Skip to content

Commit

Permalink
* New: Updated to JDK 21.
Browse files Browse the repository at this point in the history
* Fire
  * New: Added setting 'Color all track states (mute, solo, rec arm)' which allows to switch off the colors for the deactivated states in Mix mode.
  * New: Press Alt+Select knob to toggle the on/off state of the current device.
* Generic Flexi
  * New: Added setting for the length of a new clip.
* OXI One
  * Fixed: Extension did crash in 24.3 (regression).
git-moss committed Sep 4, 2024
1 parent 94f6000 commit 3591f16
Showing 18 changed files with 375 additions and 229 deletions.
Binary file modified DrivenByMoss-Manual.pdf
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -34,6 +34,7 @@
public class ChannelImpl extends AbstractDeviceChainImpl<Channel> implements IChannel
{
private static final int MAX_RESOLUTION = 16384;
private static final int CLIP_BORDER = 16241;

protected final IValueChanger valueChanger;

@@ -420,7 +421,15 @@ public void setColor (final ColorEx color)
@Override
public int getVu ()
{
return (this.vuLeft + this.vuRight) * this.valueChanger.getUpperBound () / MAX_RESOLUTION / 2;
return (int) Math.round ((this.vuLeft + this.vuRight) * this.valueChanger.getUpperBound () / (double) MAX_RESOLUTION / 2.0);
}


/** {@inheritDoc} */
@Override
public boolean getVuClipState ()
{
return this.getVuLeftClipState () || this.getVuRightClipState ();
}


@@ -432,6 +441,14 @@ public int getVuLeft ()
}


/** {@inheritDoc} */
@Override
public boolean getVuLeftClipState ()
{
return this.vuLeft >= CLIP_BORDER;
}


/** {@inheritDoc} */
@Override
public int getVuRight ()
@@ -440,6 +457,14 @@ public int getVuRight ()
}


/** {@inheritDoc} */
@Override
public boolean getVuRightClipState ()
{
return this.vuRight >= CLIP_BORDER;
}


/** {@inheritDoc} */
@Override
public int getVuPeakLeft ()
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
// Written by Jürgen Moßgraber - mossgrabers.de
// (c) 2017-2024
// Licensed under LGPLv3 - http://www.gnu.org/licenses/lgpl-3.0.txt

package de.mossgrabers.controller.ableton.push.controller;

/**
* The color palette of the Push 2/3.
*
* @author Jürgen Moßgraber
*/
public class ColorPalette
{
private final PushControlSurface surface;
private final ColorPaletteEntry [] entries = new ColorPaletteEntry [128];
private Object updateLock = new Object ();
private boolean entriesHasUpdate = false;


/**
* Constructor.
*
* @param surface The surface
*/
public ColorPalette (final PushControlSurface surface)
{
this.surface = surface;

for (int i = 0; i < this.entries.length; i++)
this.entries[i] = new ColorPaletteEntry (i, PushColorManager.getPaletteColorRGB (i));
}


/**
* Checks all entries in the current pad color palette of the Push 2/3. Sends updates if
* necessary.
*/
public void updatePalette ()
{
synchronized (this.updateLock)
{
final int entryIndex = this.findNextEntry ();
// All done?
if (entryIndex < 0)
{
// Re-apply the color palette, if necessary
if (this.entriesHasUpdate)
this.surface.scheduleTask ( () -> this.surface.sendSysEx ("05"), 1000);
return;
}

switch (this.entries[entryIndex].getState ())
{
case READ:
this.sendColorEntryRequest (entryIndex);
break;

case READ_REQUESTED:
// 2nd attempt after 1 second...
if (System.currentTimeMillis () - this.entries[entryIndex].getSendTimestamp () > 1000L)
this.sendColorEntryRequest (entryIndex);
break;

case WRITE:
if (this.entries[entryIndex].incWriteRetries ())
this.surface.sendSysEx (this.entries[entryIndex].createUpdateMessage ());
else
this.surface.errorln ("Failed writing color palette entry #" + entryIndex + ".");
break;

default:
return;
}
}

this.surface.scheduleTask (this::updatePalette, 10);
}


/**
* Handle a color palette system exclusive message.
*
* @param data The message data
*/
public void handleColorPaletteMessage (final int [] data)
{
if (!ColorPaletteEntry.isValid (data))
return;

synchronized (this.updateLock)
{
final int index = data[7];

// Is an update of the color palette entry necessary?
if (!this.entries[index].requiresUpdate (data))
{
this.entries[index].setDone ();
return;
}

this.entriesHasUpdate = true;
this.entries[index].setWrite ();
}
}


/**
* Get the next palette entry which needs to be updated.
*
* @return The index of the entry or -1 if no further updates are required
*/
private int findNextEntry ()
{
for (int i = 0; i < this.entries.length; i++)
{
if (this.entries[i].getState () != ColorPaletteEntry.State.DONE)
return i;
}

return -1;
}


/**
* Send a request to the Push 2/3 to send the values of an entry of the current color palette.
*
* @param entryIndex The index of the entry 0-127
*/
private void sendColorEntryRequest (final int entryIndex)
{
if (!this.entries[entryIndex].incReadRetries ())
{
this.surface.errorln ("Failed reading color palette entry #" + entryIndex + ".");
return;
}

this.surface.sendSysEx (new int []
{
0x04,
entryIndex
});
}
}
Original file line number Diff line number Diff line change
@@ -5,18 +5,18 @@
package de.mossgrabers.controller.ableton.push.controller;

/**
* A color palette entry of the Push 2.
* A color palette entry of the Push 2/3.
*
* @author Jürgen Moßgraber
*/
public class PaletteEntry
public class ColorPaletteEntry
{
enum State
static enum State
{
INIT,
READ,
READ_REQUESTED,
WRITE,
OK
DONE
}


@@ -28,23 +28,27 @@ enum State

private static final int MESSAGE_LENGTH = 17;

private int red = -1;
private int green = -1;
private int blue = -1;
private int white = -1;
private final int index;
private final int red;
private final int green;
private final int blue;
private int white;

private State state = State.INIT;
private State state = State.READ;
private int readRetries = 0;
private int writeRetries = 0;
private long sendTimestamp;


/**
* Constructor.
*
*
* @param index The index of the entry
* @param color The default palette color consisting of three integers for red, green and blue
*/
public PaletteEntry (final int [] color)
public ColorPaletteEntry (final int index, final int [] color)
{
this.index = index;
this.red = color[0];
this.green = color[1];
this.blue = color[2];
@@ -77,57 +81,88 @@ public boolean requiresUpdate (final int [] data)


/**
* Increase the number of read attempts.
* Increases the read request for this palette entry.
*
* @return True if another attempt is allowed, false if the maximum number of retries has been
* reached
*/
public void incReadRetries ()
public boolean incReadRetries ()
{
this.readRetries++;
this.state = State.READ;
if (this.readRetries > MAX_NUMBER_OF_RETRIES)
{
this.state = State.DONE;
return false;
}

this.state = State.READ_REQUESTED;
this.sendTimestamp = System.currentTimeMillis ();
return true;
}


/**
* Increase the number of write attempts.
* Increases the write request for this palette entry.
*
* @return True if another attempt is allowed, false if the maximum number of retries has been
* reached
*/
public void incWriteRetries ()
public boolean incWriteRetries ()
{
this.writeRetries++;

if (this.writeRetries > MAX_NUMBER_OF_RETRIES)
{
this.state = State.DONE;
return false;
}

// Set to read for confirmation check
this.state = State.READ;
this.sendTimestamp = System.currentTimeMillis ();
return true;
}


/**
* Sets the state to WRITE.
*/
public void setWrite ()
{
this.state = State.WRITE;
}


/**
* Set the entry to be OK, which means identical to the device.
*/
public void setOK ()
public void setDone ()
{
this.state = State.OK;
this.state = State.DONE;
}


/**
* Check if the read request should be sent
* Get the state.
*
* @return True if it needs to be send
* @return The state
*/
public boolean requiresRead ()
public State getState ()
{
return this.state == State.INIT || this.state == State.READ;
return this.state;
}


/**
* Creates a system exclusive message which contains the current color.
*
* @param index The palette index where to store the color
* @return The created message
*/
public int [] createUpdateMessage (final int index)
public int [] createUpdateMessage ()
{
final int [] data = new int [10];

data[0] = PALETTE_MESSAGE_OUT_ID;
data[1] = index;
data[1] = this.index;
data[2] = this.red % 128;
data[3] = this.red / 128;
data[4] = this.green % 128;
@@ -136,53 +171,17 @@ public boolean requiresRead ()
data[7] = this.blue / 128;
data[8] = this.white % 128;
data[9] = this.white / 128;

return data;
}


/**
* Test if the maximum number of read retries to send the color to the device has already been
* reached.
*
* @return True if number of retries has exceeded
*/
public boolean hasMaxNumberOfReadRetriesReached ()
{
return this.readRetries > MAX_NUMBER_OF_RETRIES;
}


/**
* Test if the maximum number of write retries to send the color to the device has already been
* reached.
*
* @return True if number of retries has exceeded
*/
public boolean hasMaxNumberOfWriteRetriesReached ()
{
return this.writeRetries > MAX_NUMBER_OF_RETRIES;
}


/**
* Get the current number of attempts to read the value on the device.
*
* @return The number of retries
*/
public int getReadRetries ()
{
return this.readRetries;
}


/**
* Get the current number of attempts to update the value on the device.
*
* @return The number of retries
* Get the time in milliseconds when the read/write request was sent.
*
* @return the sendTimestamp The milliseconds
*/
public int getWriteRetries ()
public long getSendTimestamp ()
{
return this.writeRetries;
return this.sendTimestamp;
}
}
Original file line number Diff line number Diff line change
@@ -4,6 +4,8 @@

package de.mossgrabers.controller.ableton.push.controller;

import java.util.List;

import de.mossgrabers.controller.ableton.push.PushConfiguration;
import de.mossgrabers.controller.ableton.push.PushVersion;
import de.mossgrabers.framework.controller.AbstractControlSurface;
@@ -19,8 +21,6 @@
import de.mossgrabers.framework.featuregroup.IExpressionView;
import de.mossgrabers.framework.utils.StringUtils;

import java.util.List;


/**
* The Push 1, 2 and 3 control surface.
@@ -462,8 +462,7 @@ public class PushControlSurface extends AbstractControlSurface<PushConfiguration
private static final int PAD_VELOCITY_CURVE_CHUNK_SIZE = 16;
private static final int NUM_VELOCITY_CURVE_ENTRIES = 128;

private final PaletteEntry [] colorPalette = new PaletteEntry [128];
private boolean colorPaletteHasUpdate = false;
private final ColorPalette colorPalette;

private int ribbonMode = -1;
private int ribbonValue = -1;
@@ -489,13 +488,11 @@ public PushControlSurface (final IHost host, final ColorManager colorManager, fi
super (host, configuration, colorManager, output, input, configuration.getPushVersion () == PushVersion.VERSION_3 ? new PushPadGrid (colorManager, output) : new PadGridImpl (colorManager, output), 200.0, 156.0);

this.notifyViewChange = false;
this.colorPalette = new ColorPalette (this);

if (this.padGrid instanceof final PushPadGrid pushPadGrid)
pushPadGrid.setSurface (this);

for (int i = 0; i < this.colorPalette.length; i++)
this.colorPalette[i] = new PaletteEntry (PushColorManager.getPaletteColorRGB (i));

this.input.setSysexCallback (this::handleSysEx);
}

@@ -989,8 +986,8 @@ private void handleSysEx (final String data)
}

// Color palette entry message?
if (this.configuration.isPushModern () && isPush2Data (byteData) && PaletteEntry.isValid (byteData))
this.handleColorPaletteMessage (byteData);
if (this.configuration.isPushModern () && isPush2Data (byteData))
this.colorPalette.handleColorPaletteMessage (byteData);
}


@@ -1125,100 +1122,7 @@ public int getSerialNumber ()
*/
public void updateColorPalette ()
{
// Retrieve the first, all others are requested after the previous one was received
this.sendColorPaletteRequest (0);
}


/**
* Handle a color palette message.
*
* @param data The message data
*/
private void handleColorPaletteMessage (final int [] data)
{
synchronized (this.colorPalette)
{
final int index = data[7];

// Is an update necessary?
if (this.colorPalette[index].requiresUpdate (data))
{
this.colorPaletteHasUpdate = true;

if (this.colorPalette[index].hasMaxNumberOfWriteRetriesReached ())
{
// Cancel the whole process
this.host.error ("Failed writing color palette entry #" + index + ". Gave up after " + PaletteEntry.MAX_NUMBER_OF_RETRIES + " retries. Check selected MIDI in-/outputs.");
return;
}

this.colorPalette[index].incWriteRetries ();
this.sendSysEx (this.colorPalette[index].createUpdateMessage (index));
}
else
{
this.colorPalette[index].setOK ();

final int retries = this.colorPalette[index].getWriteRetries ();
if (retries > 1)
this.host.println ("Success writing color palette entry #" + index + " after " + retries + " attempts.");
}

if (index < 127)
{
this.sendColorPaletteRequest (index + 1);
return;
}
}

// Re-apply the color palette, if necessary
if (this.colorPaletteHasUpdate)
{
this.host.scheduleTask ( () -> this.output.sendSysex (SYSEX_HEADER_TEXT + "05 F7"), 1000);

// Request all values again to confirm it was written
this.sendColorPaletteRequest (0);
}
}


/**
* Send a request to the Push 2 to send the values of an entry of the current color palette.
*
* @param paletteEntry The index of the entry 0-127
*/
private void sendColorPaletteRequest (final int paletteEntry)
{
synchronized (this.colorPalette)
{
this.sendSysEx (new int []
{
0x04,
paletteEntry
});
this.colorPalette[paletteEntry].incReadRetries ();
}

// If there was no answer after 1s, retry...
this.scheduleTask ( () -> {

synchronized (this.colorPalette)
{
if (!this.colorPalette[paletteEntry].requiresRead ())
return;

if (this.colorPalette[paletteEntry].hasMaxNumberOfReadRetriesReached ())
{
this.host.error ("Failed reading color palette entry #" + paletteEntry + ". Gave up after " + PaletteEntry.MAX_NUMBER_OF_RETRIES + " retries. Check selected MIDI in-/outputs.");
return;
}

this.host.println ("Resending color palette entry #" + paletteEntry + " request.");
this.sendColorPaletteRequest (paletteEntry);
}

}, 1000);
this.colorPalette.updatePalette ();
}


Original file line number Diff line number Diff line change
@@ -119,6 +119,7 @@ public void init (final ISettingsUI globalSettings, final ISettingsUI documentSe
this.activateExcludeDeactivatedItemsSetting (globalSettings);
this.activateNewClipLengthSetting (globalSettings);
this.activateKnobSpeedSetting (globalSettings);
this.activateColorTrackStates (globalSettings);

///////////////////////////
// Hardware
Original file line number Diff line number Diff line change
@@ -58,11 +58,20 @@ public void execute (final ButtonEvent event, final int velocity)

final FireConfiguration configuration = this.surface.getConfiguration ();
final ICursorDevice cursorDevice = this.model.getCursorDevice ();
if (modeManager.isActive (Modes.DEVICE_PARAMS) && configuration.isDeleteModeActive ())
if (modeManager.isActive (Modes.DEVICE_PARAMS))
{
cursorDevice.remove ();
configuration.toggleDeleteModeActive ();
return;
if (configuration.isDeleteModeActive ())
{
cursorDevice.remove ();
configuration.toggleDeleteModeActive ();
return;
}

if (this.surface.isPressed (ButtonID.ALT))
{
cursorDevice.toggleEnabledState ();
return;
}
}

cursorDevice.toggleWindowOpen ();
Original file line number Diff line number Diff line change
@@ -42,6 +42,7 @@ public MixView (final FireControlSurface surface, final IModel model)
public void drawGrid ()
{
final IPadGrid padGrid = this.surface.getPadGrid ();
final boolean colorTrackStates = this.surface.getConfiguration ().isColorTrackStates ();
final ITrackBank tb = this.model.getCurrentTrackBank ();
for (int i = 0; i < tb.getPageSize (); i++)
{
@@ -56,11 +57,11 @@ public void drawGrid ()
padGrid.lightEx (i, 0, colorIndex);

// Mute
padGrid.lightEx (i, 1, track.isMute () ? FireColorManager.FIRE_COLOR_ORANGE : FireColorManager.FIRE_COLOR_DARKER_ORANGE);
padGrid.lightEx (i, 1, getTrackStateColor (track.isMute (), colorTrackStates, FireColorManager.FIRE_COLOR_ORANGE, FireColorManager.FIRE_COLOR_DARKER_ORANGE));
// Solo
padGrid.lightEx (i, 2, track.isSolo () ? FireColorManager.FIRE_COLOR_YELLOW : FireColorManager.FIRE_COLOR_DARKER_YELLOW);
padGrid.lightEx (i, 2, getTrackStateColor (track.isSolo (), colorTrackStates, FireColorManager.FIRE_COLOR_YELLOW, FireColorManager.FIRE_COLOR_DARKER_YELLOW));
// Record Arm
padGrid.lightEx (i, 3, track.isRecArm () ? FireColorManager.FIRE_COLOR_RED : FireColorManager.FIRE_COLOR_DARKER_RED);
padGrid.lightEx (i, 3, getTrackStateColor (track.isRecArm (), colorTrackStates, FireColorManager.FIRE_COLOR_RED, FireColorManager.FIRE_COLOR_DARKER_RED));
}
else
{
@@ -209,4 +210,12 @@ public void onSelectKnobValue (final int value)
transport.changePosition (this.model.getValueChanger ().isIncrease (value), this.surface.isPressed (ButtonID.SHIFT));
this.mvHelper.notifyPlayPosition ();
}


private static int getTrackStateColor (final boolean state, final boolean colorTrackStates, final int activeColor, final int inActiveColor)
{
if (state)
return activeColor;
return colorTrackStates ? inActiveColor : FireColorManager.FIRE_COLOR_BLACK;
}
}
Original file line number Diff line number Diff line change
@@ -531,8 +531,8 @@ else if (number >= 64)

this.activateKnobSpeedSetting (globalSettings);
this.activateExcludeDeactivatedItemsSetting (globalSettings);

this.activateNoteRepeatSetting (documentSettings);
this.activateNewClipLengthSetting (globalSettings);

this.slotSelectionSetting.addValueObserver (this::selectSlot);

Original file line number Diff line number Diff line change
@@ -862,14 +862,14 @@ private void updateVUMeters ()
if (this.vuValues[channel] != scaledVuLeft || alwaysSendVuMeters)
{
this.vuValues[channel] = scaledVuLeft;
this.sendVUValue (output, i, vuLeft, scaledVuLeft, false);
this.sendVUValue (output, i, scaledVuLeft, track.getVuLeftClipState (), false);
}
final int vuRight = track.getVuRight ();
final int scaledVuRight = this.scaleVU (vuRight);
if (this.vuValuesRight[channel] != scaledVuRight || alwaysSendVuMeters)
{
this.vuValuesRight[channel] = scaledVuRight;
this.sendVUValue (output, i, vuRight, scaledVuRight, true);
this.sendVUValue (output, i, scaledVuRight, track.getVuRightClipState (), true);
}
}
else
@@ -879,12 +879,12 @@ private void updateVUMeters ()
if (this.vuValues[channel] != scaledVu || alwaysSendVuMeters)
{
this.vuValues[channel] = scaledVu;
this.sendVUValue (output, i, vu, scaledVu, false);
this.sendVUValue (output, i, scaledVu, track.getVuClipState (), false);
}
}
}

// Stereo VUs of master channel
// Stereo VUs of master channel, only available on iCON devices
if (vuMeterStyle == VUMeterStyle.ICON && this.configuration.getDeviceType (index) == MCUDeviceType.MAIN)
{
final IMasterTrack masterTrack = this.model.getMasterTrack ();
@@ -894,15 +894,15 @@ private void updateVUMeters ()
if (this.masterVuValues[0] != scaledVu)
{
this.masterVuValues[0] = scaledVu;
this.sendVUValue (output, 0, vu, scaledVu, true);
this.sendVUValue (output, 0, scaledVu, false, true);
}

vu = masterTrack.getVuRight ();
scaledVu = this.scaleVU (vu);
if (this.masterVuValues[1] != scaledVu)
{
this.masterVuValues[1] = scaledVu;
this.sendVUValue (output, 1, vu, scaledVu, true);
this.sendVUValue (output, 1, scaledVu, false, true);
}
}
}
@@ -915,16 +915,13 @@ private int scaleVU (final int vu)
}


private void sendVUValue (final IMidiOutput output, final int track, final int vu, final int scaledVu, final boolean isMasterOrRightChannel)
private void sendVUValue (final IMidiOutput output, final int track, final int scaledVu, final boolean vuClipState, final boolean isMasterOrRightChannel)
{
output.sendChannelAftertouch (isMasterOrRightChannel ? 1 : 0, 0x10 * track + scaledVu, 0);

// iCON devices do not support the clip state and Asparion ignores it!
if (this.configuration.getVuMeterStyle () == VUMeterStyle.MACKIE)
{
final boolean doesClip = vu > 16240;
output.sendChannelAftertouch (isMasterOrRightChannel ? 1 : 0, 0x10 * track + (doesClip ? 0x0E : 0x0F), 0);
}
// iCON devices do not support the clip state
if (this.configuration.getVuMeterStyle () != VUMeterStyle.ICON)
output.sendChannelAftertouch (isMasterOrRightChannel ? 1 : 0, 0x10 * track + (vuClipState ? 0x0E : 0x0F), 0);
}


Original file line number Diff line number Diff line change
@@ -250,21 +250,22 @@ public void onButton (final ButtonID buttonID, final ButtonEvent event, final in
@Override
public int getValue ()
{
final Optional<ITrack> track = this.model.getCurrentTrackBank ().getSelectedItem ();
if (track.isEmpty ())
final Optional<ITrack> trackOpt = this.model.getCurrentTrackBank ().getSelectedItem ();
if (trackOpt.isEmpty ())
return 0;
final ITrack track = trackOpt.get ();
switch (this.faderMode)
{
default:
case VOLUME:
return track.get ().getVolume ();
return track.getVolume ();
case PAN:
return track.get ().getPan ();
return track.getPan ();
case SEND1:
final ISend send1 = track.get ().getSendBank ().getItem (0);
final ISend send1 = track.getSendBank ().getItem (0);
return send1.doesExist () ? send1.getValue () : 0;
case SEND2:
final ISend send2 = track.get ().getSendBank ().getItem (1);
final ISend send2 = track.getSendBank ().getItem (1);
return send2.doesExist () ? send2.getValue () : 0;
}
}
Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@
import java.util.List;

import de.mossgrabers.framework.configuration.AbstractConfiguration;
import de.mossgrabers.framework.configuration.IEnumSetting;
import de.mossgrabers.framework.configuration.ISettingsUI;
import de.mossgrabers.framework.controller.valuechanger.IValueChanger;
import de.mossgrabers.framework.daw.IHost;
@@ -33,11 +32,6 @@ public class OxiOneConfiguration extends AbstractConfiguration
Views.POLY_SEQUENCER
};

/** Should all track states be colored? */
public static final Integer COLOR_TRACK_STATES = Integer.valueOf (100);

private boolean colorTrackStates;


/**
* Constructor.
@@ -108,24 +102,6 @@ public void init (final ISettingsUI globalSettings, final ISettingsUI documentSe
this.activateExcludeDeactivatedItemsSetting (globalSettings);
this.activateNewClipLengthSetting (globalSettings);
this.activateKnobSpeedSetting (globalSettings);

// Color all track states in mixer view
final IEnumSetting excludeDeactivatedItemsSetting = globalSettings.getEnumSetting ("Color all track states (mute, solo, rec arm)", CATEGORY_WORKFLOW, ON_OFF_OPTIONS, ON_OFF_OPTIONS[1]);
excludeDeactivatedItemsSetting.addValueObserver (value -> {
this.colorTrackStates = ON_OFF_OPTIONS[1].equals (value);
this.notifyObservers (COLOR_TRACK_STATES);
});
this.isSettingActive.add (COLOR_TRACK_STATES);
}


/**
* Should all track states be colored?
*
* @return True if all color track states should be colored
*/
public boolean isColorTrackStates ()
{
return this.colorTrackStates;
this.activateColorTrackStates (globalSettings);
}
}
Original file line number Diff line number Diff line change
@@ -138,6 +138,8 @@ public abstract class AbstractConfiguration implements Configuration
public static final Integer ENABLED_MPE_ZONES = Integer.valueOf (47);
/** The MPE pitch bend sensitivity setting has changed. */
public static final Integer MPE_PITCHBEND_RANGE = Integer.valueOf (48);
/** Should all track states be colored in mix view? */
public static final Integer COLOR_TRACK_STATES = Integer.valueOf (49);

// Implementation IDs start at 50

@@ -446,6 +448,7 @@ public enum RecordFunction
private boolean isMPEEnabled = false;
private int mpePitchBendRange = 48;
private boolean showPlayedChords = true;
private boolean colorTrackStates = true;


/**
@@ -1683,6 +1686,23 @@ protected void activateShowPlayedChordsSetting (final ISettingsUI settingsUI)
}


/**
* Should all track states be colored in mix view?
*
* @param settingsUI The settings
*/
protected void activateColorTrackStates (final ISettingsUI settingsUI)
{
// Color all track states in mixer view
final IEnumSetting excludeDeactivatedItemsSetting = settingsUI.getEnumSetting ("Color all track states (mute, solo, rec arm)", CATEGORY_WORKFLOW, ON_OFF_OPTIONS, ON_OFF_OPTIONS[1]);
excludeDeactivatedItemsSetting.addValueObserver (value -> {
this.colorTrackStates = ON_OFF_OPTIONS[1].equals (value);
this.notifyObservers (COLOR_TRACK_STATES);
});
this.isSettingActive.add (COLOR_TRACK_STATES);
}


/** {@inheritDoc} */
@Override
public void notifyAllObservers ()
@@ -2072,6 +2092,17 @@ public Optional<IDeviceMetadata> getDeviceFavorite (final int index)
}


/**
* Should all track states be colored?
*
* @return True if all color track states should be colored
*/
public boolean isColorTrackStates ()
{
return this.colorTrackStates;
}


private static String [] getDeviceNames (final List<IDeviceMetadata> deviceMetadata)
{
final String [] deviceNames = new String [deviceMetadata.size ()];
6 changes: 3 additions & 3 deletions src/main/java/de/mossgrabers/framework/daw/IHost.java
Original file line number Diff line number Diff line change
@@ -4,6 +4,8 @@

package de.mossgrabers.framework.daw;

import java.util.List;

import de.mossgrabers.framework.controller.hardware.IHwSurfaceFactory;
import de.mossgrabers.framework.daw.constants.Capability;
import de.mossgrabers.framework.daw.data.IDeviceMetadata;
@@ -17,8 +19,6 @@
import de.mossgrabers.framework.usb.IUsbDevice;
import de.mossgrabers.framework.usb.UsbException;

import java.util.List;


/**
* Interface to the Host.
@@ -158,7 +158,7 @@ public interface IHost


/**
* Creates an offscreen bitmap that the extension can use to render into. The memory used by
* Creates an off-screen bitmap that the extension can use to render into. The memory used by
* this bitmap is guaranteed to be freed once this extension exits.
*
* @param width The width of the bitmap
26 changes: 25 additions & 1 deletion src/main/java/de/mossgrabers/framework/daw/data/IChannel.java
Original file line number Diff line number Diff line change
@@ -291,13 +291,21 @@ public interface IChannel extends IItem


/**
* Get the Mono VU value.
* Get the mono VU value.
*
* @return The VU value
*/
int getVu ();


/**
* Get the clip state of the mono VU meter.
*
* @return True if clipped
*/
boolean getVuClipState ();


/**
* Get the left VU value.
*
@@ -306,6 +314,14 @@ public interface IChannel extends IItem
int getVuLeft ();


/**
* Get the clip state of the left VU meter.
*
* @return True if clipped
*/
boolean getVuLeftClipState ();


/**
* Get the right VU value.
*
@@ -314,6 +330,14 @@ public interface IChannel extends IItem
int getVuRight ();


/**
* Get the clip state of the right VU meter.
*
* @return True if clipped
*/
boolean getVuRightClipState ();


/**
* Get the maximum peak of the left VU value. This takes the maximum of the left VU value since
* the first call. If a volume change happened since the last call the value is reset.
Original file line number Diff line number Diff line change
@@ -186,6 +186,14 @@ public int getVu ()
}


/** {@inheritDoc} */
@Override
public boolean getVuClipState ()
{
return false;
}


/** {@inheritDoc} */
@Override
public int getVuLeft ()
@@ -194,6 +202,14 @@ public int getVuLeft ()
}


/** {@inheritDoc} */
@Override
public boolean getVuLeftClipState ()
{
return false;
}


/** {@inheritDoc} */
@Override
public int getVuRight ()
@@ -202,6 +218,14 @@ public int getVuRight ()
}


/** {@inheritDoc} */
@Override
public boolean getVuRightClipState ()
{
return false;
}


/** {@inheritDoc} */
@Override
public int getVuPeakLeft ()
5 changes: 4 additions & 1 deletion src/main/java/de/mossgrabers/framework/view/Views.java
Original file line number Diff line number Diff line change
@@ -127,10 +127,12 @@ public enum Views
public static final String NAME_SEQUENCER = "Sequencer";
/** The name of the raindrops view. */
public static final String NAME_RAINDROPS = "Raindrop";
/** The name of the poly sequencer view. */
/** The name of the poly-sequencer view. */
public static final String NAME_POLY_SEQUENCER = "Poly Seq.";
/** The name of the browser view. */
public static final String NAME_BROWSER = "Browser";
/** The name of the mix view. */
public static final String NAME_MIX = "Mix";
/** The name of the clip length view. */
public static final String NAME_CLIP_LENGTH = "Clip Length";

@@ -169,6 +171,7 @@ public static void init ()
VIEW_NAMES.put (NAME_PIANO, PIANO);
VIEW_NAMES.put (NAME_DRUM64, DRUM64);

VIEW_NAMES.put (NAME_MIX, MIX);
VIEW_NAMES.put (NAME_CLIP_LENGTH, CLIP_LENGTH);

NOTE_VIEWS.add (DRUM);
Binary file modified src/main/resources/Documentation/DrivenByMoss-Manual.pdf
Binary file not shown.

0 comments on commit 3591f16

Please sign in to comment.