-
-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#196 Move common IFF (EA-IFF 85) to definition to shared 'iff' library.
- Loading branch information
Showing
6 changed files
with
77 additions
and
77 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
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,35 @@ | ||
import * as Token from "token-types"; | ||
import * as assert from "assert"; | ||
import {FourCcToken} from "../common/FourCC"; | ||
|
||
/** | ||
* "EA IFF 85" Standard for Interchange Format Files | ||
* Ref: http://www.martinreddy.net/gfx/2d/IFF.txt | ||
*/ | ||
export interface IChunkHeader { | ||
|
||
/** | ||
* A chunk ID (ie, 4 ASCII bytes) | ||
*/ | ||
chunkID: string, | ||
/** | ||
* Number of data bytes following this data header | ||
*/ | ||
chunkSize: number | ||
} | ||
|
||
/** | ||
* Common AIFF chunk header | ||
*/ | ||
export const Header: Token.IGetToken<IChunkHeader> = { | ||
len: 8, | ||
|
||
get: (buf, off): IChunkHeader => { | ||
return { | ||
// Chunk type ID | ||
chunkID: FourCcToken.get(buf, off), | ||
// Chunk size | ||
chunkSize: buf.readUInt32BE(off + 4) | ||
}; | ||
} | ||
}; |
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
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