Skip to content

Commit 13eeccf

Browse files
committed
Workaround for action categories with 1 entry which leads to an exception with enumeration lists.
1 parent a39fda8 commit 13eeccf

File tree

6 files changed

+13
-6
lines changed

6 files changed

+13
-6
lines changed

DrivenByMoss-Manual.pdf

233 Bytes
Binary file not shown.

src/main/java/de/mossgrabers/bitwig/framework/configuration/SettingsUIImpl.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ public IActionSetting getActionSetting (final String label, final String categor
128128
for (final String categoryName: this.categoryNames)
129129
{
130130
final String [] actionNames = this.categoriesActionIDs.get (categoryName);
131-
categoryActionsSettings.put (categoryName, this.preferences.getEnumSetting (label + ": " + categoryName + " Actions", cat, actionNames, actionNames[0]));
131+
if (actionNames.length > 1)
132+
categoryActionsSettings.put (categoryName, this.preferences.getEnumSetting (label + ": " + categoryName + " Actions", cat, actionNames, actionNames[0]));
132133
}
133134

134135
return new ActionSettingImpl (categorySetting, categoryActionsSettings, this.actionIDsNames, this.actionCategories);
@@ -155,8 +156,9 @@ private synchronized void prepareActions ()
155156
for (int j = 0; j < actions.length; j++)
156157
{
157158
actionNames[j] = actions[j].getName ();
158-
this.actionIDsNames.put (actions[j].getId (), actionNames[j]);
159-
this.actionCategories.put (actions[j].getId (), categoryName);
159+
final String id = actions[j].getId ();
160+
this.actionIDsNames.put (id, actionNames[j]);
161+
this.actionCategories.put (id, categoryName);
160162
}
161163

162164
this.categoriesActionIDs.put (categoryName, actionNames);

src/main/java/de/mossgrabers/controller/generic/GenericFlexiControllerSetup.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,8 @@ protected void createObservers ()
262262

263263
final INoteInput input = surface.getMidiInput ().getDefaultNoteInput ();
264264
final IMidiOutput output = surface.getMidiOutput ();
265-
265+
if (input == null || output == null)
266+
return;
266267
final boolean mpeEnabled = this.configuration.isMPEEndabled ();
267268
input.enableMPE (mpeEnabled);
268269
// Enable MPE zone 1 with all 15 channels
@@ -273,11 +274,15 @@ protected void createObservers ()
273274
}, 2000));
274275

275276
this.configuration.addSettingObserver (GenericFlexiConfiguration.MPE_PITCHBEND_RANGE, () -> surface.scheduleTask ( () -> {
277+
276278
final INoteInput input = surface.getMidiInput ().getDefaultNoteInput ();
277279
final IMidiOutput output = surface.getMidiOutput ();
280+
if (input == null || output == null)
281+
return;
278282
final int mpePitchBendRange = this.configuration.getMPEPitchBendRange ();
279283
input.setMPEPitchBendSensitivity (mpePitchBendRange);
280284
output.sendMPEPitchbendRange (AbstractMidiOutput.ZONE_1, mpePitchBendRange);
285+
281286
}, 2000));
282287

283288
this.activateBrowserObserver (Modes.BROWSER);

src/main/java/de/mossgrabers/controller/generic/flexihandler/ActionHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public void handle (final FlexiCommand command, final KnobMode knobMode, final M
7070
return;
7171

7272
final String assignableActionID = this.configuration.getAssignableAction (command.ordinal () - FlexiCommand.ACTION_1.ordinal ());
73-
if (assignableActionID != null)
73+
if (assignableActionID != null && !assignableActionID.isBlank ())
7474
this.model.getApplication ().invokeAction (assignableActionID);
7575
}
7676
}
233 Bytes
Binary file not shown.

src/main/resources/META-INF/services/com.bitwig.extension.ExtensionDefinition

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
de.mossgrabers.bitwig.controller.ableton.push.Push1ControllerExtensionDefinition
22
de.mossgrabers.bitwig.controller.ableton.push.Push2ControllerExtensionDefinition
3-
de.mossgrabers.bitwig.controller.ableton.push.Push3ControllerExtensionDefinition
3+
#de.mossgrabers.bitwig.controller.ableton.push.Push3ControllerExtensionDefinition
44
de.mossgrabers.bitwig.controller.akai.apc.APCmkIControllerExtensionDefinition
55
de.mossgrabers.bitwig.controller.akai.apc.APCmkIIControllerExtensionDefinition
66
de.mossgrabers.bitwig.controller.akai.apcmini.APCminiControllerExtensionDefinition

0 commit comments

Comments
 (0)