Skip to content

Commit

Permalink
feat: Remote Midi Control - working on datastructure
Browse files Browse the repository at this point in the history
  • Loading branch information
olzzon committed May 31, 2019
1 parent 5ed8364 commit b15542f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 20 deletions.
20 changes: 4 additions & 16 deletions src/constants/RemoteFaderPresets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,19 @@ export interface IRemoteProtocol {
fromRemote: {
CHANNEL_PGM_ON_OFF: string,
CHANNEL_PST_ON_OFF: string,
CHANNEL_PFL_ON_OFF: string,
CHANNEL_FADER_LEVEL: string,
CHANNEL_VISIBLE: string,
GRP_FADER_PGM_ON_OFF: string,
GRP_FADER_PST_ON_OFF: string,
GRP_FADER_LEVEL: string,
GRP_FADER_VISIBLE: string,
X_MIX: string,
FADE_TO_BLACK: string,
SNAP_RECALL: string,
STATE_CHANNEL_PGM: string,
STATE_CHANNEL_PST: string,
STATE_CHANNEL_FADER_LEVEL: string,
STATE_GRP_FADER_PGM: string,
STATE_GRP_FADER_PST: string,
STATE_GRP_FADER_LEVEL: string,
},
toRemote: {
STATE_CHANNEL_PGM: string,
STATE_CHANNEL_PST: string,
STATE_CHANNEL_PFL: string,
STATE_CHANNEL_FADER_LEVEL: string,
STATE_GRP_FADER_PGM: string,
STATE_GRP_FADER_PST: string,
Expand Down Expand Up @@ -74,25 +68,19 @@ export const RemoteFaderPresets: { [key: string]: IRemoteProtocol } = {
fromRemote: {
CHANNEL_PGM_ON_OFF: '/ch/{value1}/mix/pgm',
CHANNEL_PST_ON_OFF: '/ch/{value1}/mix/pst',
CHANNEL_PFL_ON_OFF: '/ch/{value1}/solo',
CHANNEL_FADER_LEVEL: '/ch/{value1}/mix/faderlevel',
CHANNEL_VISIBLE: '/ch/{value1}/visible',
GRP_FADER_PGM_ON_OFF: '/grp/{value1}/pgm',
GRP_FADER_PST_ON_OFF: '/grp/{value1}/pst',
GRP_FADER_LEVEL: '/grp/{value1}/faderlevel',
GRP_FADER_VISIBLE: '/grp/{value1}/visible',
X_MIX: '/take',
FADE_TO_BLACK: '/fadetoblack',
SNAP_RECALL: '/snap/{value1}',
STATE_CHANNEL_PGM: '/state/ch/{value1}/mix/pgm',
STATE_CHANNEL_PST: '/state/ch/{value1}/mix/pst',
STATE_CHANNEL_FADER_LEVEL: '/state/ch/{value1}/mix/faderlevel',
STATE_GRP_FADER_PGM: '/state/grp/{value1}/pgm',
STATE_GRP_FADER_PST: '/state/grp/{value1}/pst',
STATE_GRP_FADER_LEVEL: '/state/grp/{value1}/faderlevel',
},
toRemote: {
STATE_CHANNEL_PGM: '/state/ch/{value1}/mix/pgm',
STATE_CHANNEL_PST: '/state/ch/{value1}/mix/pst',
STATE_CHANNEL_PFL: '/state/ch/{value1}/solo',
STATE_CHANNEL_FADER_LEVEL: '/state/ch/{value1}/mix/faderlevel',
STATE_GRP_FADER_PGM: '/state/grp/{value1}/pgm',
STATE_GRP_FADER_PST: '/state/grp/{value1}/pst',
Expand Down
8 changes: 4 additions & 4 deletions src/utils/MidiRemoteConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,15 @@ export class MidiRemoteConnection {

if (this.store.channels[0].channel[channelIndex].pflOn = true) {
this.sendOutMessage(
this.remoteProtocol.toRemote.PFL_ON.oscMessage,
this.remoteProtocol.toRemote.STATE_CHANNEL_PFL.oscMessage,
channelIndex+1,
this.remoteProtocol.toRemote.PFL_ON.value
this.remoteProtocol.toRemote.STATE_CHANNEL_PFL.value
);
} else {
this.sendOutMessage(
this.remoteProtocol.toRemote.PFL_OFF.oscMessage,
this.remoteProtocol.toRemote.STATE_CHANNEL_PFL.oscMessage,
channelIndex+1,
this.remoteProtocol.toRemote.PFL_OFF.value
this.remoteProtocol.toRemote.STATE_CHANNEL_PFL.value
);
}
}
Expand Down

0 comments on commit b15542f

Please sign in to comment.