Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/api-18' into thomas/controller-a…
Browse files Browse the repository at this point in the history
…pi-normalized-value-origin
  • Loading branch information
bitwig-thomas committed Jul 30, 2024
2 parents 2f0c0c6 + 8dbf1b5 commit 17aab39
Show file tree
Hide file tree
Showing 297 changed files with 23,194 additions and 7,234 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v2
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '17'
java-version: '21'
distribution: 'microsoft'
- name: Build with Gradle
run: ./gradlew check
3 changes: 0 additions & 3 deletions .settings/org.eclipse.core.resources.prefs

This file was deleted.

9 changes: 0 additions & 9 deletions .settings/org.eclipse.jdt.core.prefs

This file was deleted.

4 changes: 0 additions & 4 deletions .settings/org.eclipse.m2e.core.prefs

This file was deleted.

5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"java.configuration.updateBuildConfiguration": "automatic",
"java.format.settings.url": "code-formatting.xml",
"java.project.encoding": "warning"
}
7 changes: 4 additions & 3 deletions bitwig-extensions.iml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<module version="4">
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" version="4">
<component name="ExternalSystem" externalSystem="Maven" />
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_17">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="base-extensions-api" />
<orderEntry type="library" name="Maven: com.bitwig:extension-api:18" level="project" />
</component>
</module>
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ group = 'com.bitwig.extensions'
description = 'Bitwig Studio Extensions (Github)'

java {
sourceCompatibility = JavaVersion.VERSION_16
sourceCompatibility = JavaVersion.VERSION_21

jar {
archiveFileName = 'BitwigControllers.bwextension'
Expand Down
2 changes: 2 additions & 0 deletions doc-source/MIDIPLUS/XPro Keyboards.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
* Pads are working and will be mapped to the first 8 pads of the Bitwig Studio drum machine
* Keys, Pitch-Bend and Mod-Wheel are working
* Transport buttons are working

Make sure your controller has the latest firmware update.
2 changes: 2 additions & 0 deletions doc-source/MIDIPLUS/Xmini Keyboards.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
* The four knobs controls the first four remote controls of the selected device
* Keys, Pitch-Bend and Mod-Wheel are working
* Transport buttons are working

Make sure your controller has the latest firmware update.
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
29 changes: 17 additions & 12 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,8 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -133,26 +131,29 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -197,11 +198,15 @@ if "$cygwin" || "$msys" ; then
done
fi

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down
20 changes: 10 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand All @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
<configuration>
<optimize>true</optimize>
<fork>true</fork>
<source>16</source>
<target>16</target>
<source>21</source>
<target>21</target>
<encoding>UTF-8</encoding>
<maxmem>1024m</maxmem>
</configuration>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
package com.bitwig.extensions.controllers.akai.apc.common;

import com.bitwig.extension.controller.api.ClipLauncherSlot;
import com.bitwig.extension.controller.api.SettableBooleanValue;
import com.bitwig.extension.controller.api.Track;
import com.bitwig.extension.controller.api.TrackBank;
import com.bitwig.extensions.controllers.akai.apc.common.led.LedBehavior;
import com.bitwig.extensions.controllers.akai.apc.common.led.RgbLightState;
import com.bitwig.extensions.controllers.novation.commonsmk3.ColorLookup;
import com.bitwig.extensions.framework.Layer;
import com.bitwig.extensions.framework.Layers;

public abstract class AbstractSessionLayer extends Layer {
protected final int[][] colorIndex = new int[8][8];
protected SettableBooleanValue clipLauncherOverdub;

public AbstractSessionLayer(final Layers layers) {
super(layers, "SESSION_LAYER");
}

protected abstract boolean isPlaying();

protected abstract boolean isShiftHeld();

protected RgbLightState getState(final Track track, final ClipLauncherSlot slot, final int trackIndex,
final int sceneIndex) {
if (slot.hasContent().get()) {
final int color = colorIndex[sceneIndex][trackIndex];
if (slot.isSelected().get() && isShiftHeld()) {
return RgbLightState.WHITE_BRIGHT;
}
if (slot.isRecordingQueued().get()) {
return RgbLightState.RED.behavior(LedBehavior.BLINK_4);
} else if (slot.isRecording().get()) {
return RgbLightState.RED.behavior(LedBehavior.PULSE_2);
} else if (slot.isPlaybackQueued().get()) {
return RgbLightState.of(color, LedBehavior.BLINK_4);
} else if (slot.isStopQueued().get()) {
return RgbLightState.GREEN_PLAY.behavior(LedBehavior.BLINK_8);
} else if (slot.isPlaying().get() && track.isQueuedForStop().get()) {
return RgbLightState.GREEN.behavior(LedBehavior.BLINK_8);
} else if (slot.isPlaying().get()) {
if (clipLauncherOverdub.get() && track.arm().get()) {
return RgbLightState.RED.behavior(LedBehavior.PULSE_2);
} else {
if (isPlaying()) {
return RgbLightState.GREEN_PLAY;
}
return RgbLightState.GREEN;
}
}
return RgbLightState.of(color);
}
if (slot.isSelected().get() && isShiftHeld()) {
return RgbLightState.WHITE_DIM;
}
if (slot.isRecordingQueued().get()) {
return RgbLightState.RED.behavior(LedBehavior.BLINK_8); // Possibly Track Color
} else if (track.arm().get()) {
return RgbLightState.RED.behavior(LedBehavior.LIGHT_25);
}
return RgbLightState.OFF;
} // V ultra_X_39--

protected void markTrackBank(TrackBank bank) {
bank.canScrollBackwards().markInterested();
bank.canScrollForwards().markInterested();
bank.sceneBank().canScrollBackwards().markInterested();
bank.sceneBank().canScrollForwards().markInterested();
}

protected void markTrack(final Track track) {
track.isStopped().markInterested();
track.mute().markInterested();
track.solo().markInterested();
track.isQueuedForStop().markInterested();
track.arm().markInterested();
}

protected void prepareSlot(final ClipLauncherSlot slot, final int sceneIndex, final int trackIndex) {
slot.hasContent().markInterested();
slot.isPlaying().markInterested();
slot.isStopQueued().markInterested();
slot.isRecordingQueued().markInterested();
slot.isRecording().markInterested();
slot.isPlaybackQueued().markInterested();
slot.isSelected().markInterested();
slot.color().addValueObserver((r, g, b) -> colorIndex[sceneIndex][trackIndex] = ColorLookup.toColor(r, g, b));
}

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.bitwig.extensions.controllers.akai.apcmk2.midi;
package com.bitwig.extensions.controllers.akai.apc.common;

import com.bitwig.extension.controller.api.MidiIn;
import com.bitwig.extension.controller.api.NoteInput;
Expand All @@ -19,4 +19,5 @@ public interface MidiProcessor {
void setModeChangeListener(final IntConsumer modeChangeListener);

MidiIn getMidiIn();

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.bitwig.extensions.controllers.akai.apc.common;

import java.util.Arrays;

public enum OrientationFollowType {
AUTOMATIC("Automatic", "Auto"), //
FIXED_VERTICAL("Mix Panel Layout", "Mixer"), //
FIXED_HORIZONTAL("Arrange Panel Layout", "Arrange");

private final String label;
private final String shortLabel;

OrientationFollowType(final String label, final String shortLabel) {
this.label = label;
this.shortLabel = shortLabel;
}

public String getLabel() {
return label;
}

public String getShortLabel() {
return shortLabel;
}

public static OrientationFollowType toType(final String value) {
return Arrays.stream(OrientationFollowType.values())
.filter(type -> type.label.equals(value))
.findFirst()
.orElse(OrientationFollowType.FIXED_VERTICAL);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.bitwig.extensions.controllers.akai.apc.common;

public enum PanelLayout {
VERTICAL,
HORIZONTAL
}
Loading

0 comments on commit 17aab39

Please sign in to comment.