Skip to content

Commit

Permalink
feat: List mixer presets in storage prepared
Browse files Browse the repository at this point in the history
  • Loading branch information
olzzon authored and olzzon committed Jun 4, 2020
1 parent 5bedab5 commit 67b6435
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
10 changes: 9 additions & 1 deletion client/components/RoutingStorage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class Storage extends React.PureComponent<IStorageProps & Store> {
//Bindings:
this.ListSnapshotFiles = this.ListSnapshotFiles.bind(this)
this.ListCcgFiles = this.ListCcgFiles.bind(this)
this.ListPresetFiles = this.ListPresetFiles.bind(this)
this.loadFile = this.loadFile.bind(this)
this.saveFile = this.saveFile.bind(this)
}
Expand Down Expand Up @@ -122,7 +123,7 @@ class Storage extends React.PureComponent<IStorageProps & Store> {
const listItems = window.mixerPresetList.map(
(file: string, index: number) => {
return (
<li key={index} onClick={this.loadCcgFile} className="item">
<li key={index} onClick={this.loadMixerPreset} className="item">
{file}
</li>
)
Expand All @@ -146,6 +147,13 @@ class Storage extends React.PureComponent<IStorageProps & Store> {
<hr />
<h3>LOAD ROUTING :</h3>
<this.ListSnapshotFiles />
{window.mixerPresetList.length > 0 ? (
<div>
<hr />
<h3>LOAD MIXER PRESET :</h3>
<this.ListPresetFiles />
</div>
) : null}
{window.ccgFileList.length > 0 ? (
<div>
<hr />
Expand Down
4 changes: 3 additions & 1 deletion server/MainThreadHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,9 @@ export class MainThreadHandlers {
logger.info('Get Preset list', {})
socketServer.emit(
SOCKET_RETURN_MIXER_PRESET_LIST,
getMixerPresetList()
getMixerPresetList(
mixerGenericConnection.getPresetFileExtention()
)
)
})
.on(SOCKET_SAVE_CCG_FILE, (payload: any) => {
Expand Down
5 changes: 5 additions & 0 deletions server/utils/MixerConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ export class MixerGenericConnection {
this.fadeActiveTimer = new Array(state.channels[0].channel.length)
}

getPresetFileExtention(): string {
console.log('TODO: File extension should be handled pr. mixer type')
return 'x32'
}

loadMixerPreset(presetName: string) {
logger.info('Loading Preset :' + presetName)
}
Expand Down

0 comments on commit 67b6435

Please sign in to comment.