Skip to content

Commit

Permalink
Fix XTM first two mute buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
ho0ber committed Feb 4, 2019
1 parent c7bbe40 commit 7b66e97
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 5 deletions.
4 changes: 2 additions & 2 deletions NK2Tray/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.15.0")]
[assembly: AssemblyFileVersion("0.0.15.0")]
[assembly: AssemblyVersion("0.0.16.0")]
[assembly: AssemblyFileVersion("0.0.16.0")]
31 changes: 28 additions & 3 deletions NK2Tray/XtouchMini.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,23 @@ public class XtouchMini : MidiDevice
MidiCommandCode.ControlChange // recordCode
);

public FaderDef FirstTwoFaderDef => new FaderDef(
true, // delta
64f, // range
1, // channel
true, // selectPresent
true, // mutePresent
false, // recordPresent
16, // faderOffset
32, // selectOffset
89, // muteOffset
0, // recordOffset
MidiCommandCode.ControlChange, // faderCode
MidiCommandCode.NoteOn, // selectCode
MidiCommandCode.NoteOn, // muteCode
MidiCommandCode.ControlChange // recordCode
);

public FaderDef MasterFaderDef => new FaderDef(
false, // delta
16383f, // range
Expand Down Expand Up @@ -90,14 +107,22 @@ public override void InitFaders()
{
faders = new List<Fader>();

foreach (var i in Enumerable.Range(0, 8))
foreach (var i in Enumerable.Range(0, 9))
{
Fader fader = new Fader(this, i);
Fader fader = new Fader(this, i, SelectFaderDef(i));
fader.ResetLights();
faders.Add(fader);
}
}

faders.Add(new Fader(this, 8, MasterFaderDef));
public FaderDef SelectFaderDef(int faderNum)
{
if (faderNum < 2)
return FirstTwoFaderDef;
else if (faderNum == 8)
return MasterFaderDef;
else
return DefaultFaderDef;
}

public override void InitButtons()
Expand Down

0 comments on commit 7b66e97

Please sign in to comment.