Skip to content

Commit

Permalink
fixed mute and copy tracks
Browse files Browse the repository at this point in the history
  • Loading branch information
rpaezbas committed Jun 15, 2021
1 parent 2fb2f6a commit 45d8d01
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ exports.changePage = (state,scenes) => {

exports.toogleMute = (state,scenes) => {
if(state.pressedButtons.length == 2 && state.pressedButtons[0] == cons.SHIFT_BUTTON && isMuteButton(state.pressedButtons[1])){
var track = cons.MUTE_BUTTONS.indexOf(state.pressedButtons[1]);
var track = cons.MUTE_BUTTONS.indexOf(state.pressedButtons[1]) + (state.page * 8);
scenes[state.currentScene].tracks[track].muted ^= true;
}
};
Expand All @@ -107,9 +107,9 @@ exports.copyScene = (state,scenes) => {

exports.copyTrack = (state,scenes) => {
if(state.pressedButtons.length == 2 && state.pressedButtons[0] == cons.SHIFT_3_BUTTON && isMuteButton(state.pressedButtons[1])){
var trackColors = [cons.COLOR_TRACK_1,cons.COLOR_TRACK_2,cons.COLOR_TRACK_3,cons.COLOR_TRACK_4, cons.COLOR_TRACK_5,cons.COLOR_TRACK_6,cons.COLOR_TRACK_7,cons.COLOR_TRACK_8];
var trackColors = [cons.COLOR_TRACK_1,cons.COLOR_TRACK_2,cons.COLOR_TRACK_3,cons.COLOR_TRACK_4, cons.COLOR_TRACK_5,cons.COLOR_TRACK_6,cons.COLOR_TRACK_7,cons.COLOR_TRACK_8,cons.COLOR_TRACK_9,cons.COLOR_TRACK_10,cons.COLOR_TRACK_11,cons.COLOR_TRACK_12,cons.COLOR_TRACK_13,cons.COLOR_TRACK_14,cons.COLOR_TRACK_15,cons.COLOR_TRACK_16];
var bufferTrack = JSON.parse(JSON.stringify(scenes[state.currentScene].tracks[state.currentTrack]));
var targetTrack = cons.MUTE_BUTTONS.indexOf(state.pressedButtons[1]);
var targetTrack = cons.MUTE_BUTTONS.indexOf(state.pressedButtons[1]) + (state.page * 8);
bufferTrack.color = trackColors[targetTrack];
bufferTrack.channel = targetTrack;
scenes[state.currentScene].tracks[targetTrack] = bufferTrack;
Expand Down

0 comments on commit 45d8d01

Please sign in to comment.