-
-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
288 additions
and
228 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import type { IParserLoader, ITokenParser } from '../ParserFactory.js'; | ||
import type { INativeMetadataCollector } from '../common/MetadataCollector.js'; | ||
import type { ITokenizer } from 'strtok3'; | ||
import type { IOptions } from '../type.js'; | ||
|
||
export const aiffParserLoader: IParserLoader = { | ||
parserType: 'aiff', | ||
extensions: ['.aif', 'aiff', 'aifc'], | ||
async load(metadata: INativeMetadataCollector, tokenizer: ITokenizer, options: IOptions): Promise<ITokenParser> { | ||
return new (await import('./AiffParser.js')).AIFFParser(metadata, tokenizer, options); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import type { IParserLoader, ITokenParser } from '../ParserFactory.js'; | ||
import type { INativeMetadataCollector } from '../common/MetadataCollector.js'; | ||
import type { ITokenizer } from 'strtok3'; | ||
import type { IOptions } from '../type.js'; | ||
|
||
export const apeParserLoader: IParserLoader = { | ||
parserType: 'apev2', | ||
extensions: ['.ape'], | ||
async load(metadata: INativeMetadataCollector, tokenizer: ITokenizer, options: IOptions): Promise<ITokenParser> { | ||
return new (await import('./APEv2Parser.js')).APEv2Parser(metadata, tokenizer, options); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import type { IParserLoader, ITokenParser } from '../ParserFactory.js'; | ||
import type { INativeMetadataCollector } from '../common/MetadataCollector.js'; | ||
import type { ITokenizer } from 'strtok3'; | ||
import type { IOptions } from '../type.js'; | ||
|
||
export const asfParserLoader: IParserLoader = { | ||
parserType: 'asf', | ||
extensions: ['.asf'], | ||
async load(metadata: INativeMetadataCollector, tokenizer: ITokenizer, options: IOptions): Promise<ITokenParser> { | ||
return new (await import('./AsfParser.js')).AsfParser(metadata, tokenizer, options); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,23 @@ | ||
import type { ITokenizer } from 'strtok3'; | ||
|
||
import type { ITokenParser } from '../ParserFactory.js'; | ||
import type { IOptions, IPrivateOptions } from '../type.js'; | ||
import type { IOptions, } from '../type.js'; | ||
import type { INativeMetadataCollector } from './MetadataCollector.js'; | ||
|
||
export abstract class BasicParser implements ITokenParser { | ||
|
||
protected metadata: INativeMetadataCollector = undefined as unknown as INativeMetadataCollector; | ||
protected tokenizer: ITokenizer = undefined as unknown as ITokenizer; | ||
protected options: IPrivateOptions = undefined as unknown as IPrivateOptions; | ||
|
||
/** | ||
* Initialize parser with output (metadata), input (tokenizer) & parsing options (options). | ||
* @param {INativeMetadataCollector} metadata Output | ||
* @param {ITokenizer} tokenizer Input | ||
* @param {IOptions} options Parsing options | ||
*/ | ||
public init(metadata: INativeMetadataCollector, tokenizer: ITokenizer, options: IOptions): ITokenParser { | ||
|
||
this.metadata = metadata; | ||
this.tokenizer = tokenizer; | ||
this.options = options; | ||
|
||
return this; | ||
constructor( | ||
protected readonly metadata: INativeMetadataCollector, | ||
protected readonly tokenizer: ITokenizer, | ||
protected readonly options: IOptions | ||
) { | ||
} | ||
|
||
public abstract parse(): Promise<void>; | ||
|
||
} |
Empty file.
Oops, something went wrong.