-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Media Pool): clear / set commands
- Loading branch information
Balte de Wit
authored and
Alex Van Camp
committed
Oct 4, 2018
1 parent
bca847f
commit a2ecc82
Showing
3 changed files
with
51 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import AbstractCommand from '../AbstractCommand' | ||
|
||
export class MediaPoolClearClipCommand extends AbstractCommand { | ||
rawName = 'CMPC' | ||
|
||
properties: { | ||
index: number | ||
} | ||
|
||
serialize () { | ||
const rawCommand = 'CMPC' | ||
return new Buffer([ | ||
...Buffer.from(rawCommand), | ||
this.properties.index, | ||
0x00, | ||
0x00, | ||
0x00 | ||
]) | ||
} | ||
|
||
updateProps (props: { index: number }) { | ||
this._updateProps(props) | ||
} | ||
} |
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,25 @@ | ||
import AbstractCommand from '../AbstractCommand' | ||
|
||
export class MediaPoolSetClipCommand extends AbstractCommand { | ||
rawName = 'SMPC' | ||
|
||
properties: { | ||
index: number, | ||
name: string, | ||
frames: number | ||
} | ||
|
||
serialize () { | ||
const buffer = new Buffer(68) | ||
buffer[0] = 3 | ||
buffer[1] = this.properties.index | ||
buffer.write(this.properties.name, 2, 44) | ||
buffer.writeUInt16BE(this.properties.frames, 66) | ||
|
||
return Buffer.concat([ Buffer.from('SMPC', 'ascii'), buffer ]) | ||
} | ||
|
||
updateProps (props: { index: number, name: string, frames: number }) { | ||
this._updateProps(props) | ||
} | ||
} |
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 +1,3 @@ | ||
export * from './MediaPlayerStatusCommand' | ||
export * from './MediaPoolClearClipCommand' | ||
export * from './MediaPoolSetClipCommand' |