Skip to content

Commit

Permalink
* Fire
Browse files Browse the repository at this point in the history
  * Fixed: Regression introduced in 18.0, button LEDs did not update.
* Push 1
  * Fixed: Browser mode could crash if presets contained non-ASCII characters.
  • Loading branch information
git-moss committed Oct 8, 2022
1 parent 192a944 commit 2d3c1e4
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 9 deletions.
Binary file modified DrivenByMoss-Manual.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>de.mossgrabers</groupId>
<artifactId>DrivenByMoss</artifactId>
<name>DrivenByMoss</name>
<version>18.0.0</version>
<version>18.1.0</version>
<licenses>
<license>
<name>LGPL-2.1-or-later</name>
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<artifactId>DrivenByMoss</artifactId>
<packaging>jar</packaging>
<name>DrivenByMoss</name>
<version>18.0.0</version>
<version>18.1.0</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
Expand Down Expand Up @@ -65,7 +65,7 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.13.3</version>
<version>2.13.4</version>
</dependency>
<!-- Gamepad support. -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public void updateDisplay1 (final ITextDisplay display)

display.setBlock (2, 2, "Selection:");
String selectedResult = browser.getSelectedResult ();
selectedResult = selectedResult == null || selectedResult.isBlank () ? "None" : selectedResult;
selectedResult = selectedResult == null || selectedResult.isBlank () ? "None" : StringUtils.shortenAndFixASCII (selectedResult, 18);

String [] infoText = browser.getInfoText ().split (":");
infoText = new String []
Expand Down Expand Up @@ -243,7 +243,7 @@ public void updateDisplay1 (final ITextDisplay display)
for (int i = 0; i < 16; i++)
{
if (i < results.length)
display.setBlock (i % 4, i / 4, (results[i].isSelected () ? Push1Display.SELECT_ARROW : " ") + results[i].getName (16));
display.setBlock (i % 4, i / 4, (results[i].isSelected () ? Push1Display.SELECT_ARROW : " ") + StringUtils.shortenAndFixASCII (results[i].getName (), 16));
else
display.setBlock (i % 4, i / 4, "");
}
Expand All @@ -253,7 +253,7 @@ public void updateDisplay1 (final ITextDisplay display)
final IBrowserColumnItem [] items = browser.getFilterColumn (this.filterColumn).getItems ();
for (int i = 0; i < 16; i++)
{
String text = (items[i].isSelected () ? Push1Display.SELECT_ARROW : " ") + items[i].getName () + " ";
String text = (items[i].isSelected () ? Push1Display.SELECT_ARROW : " ") + StringUtils.shortenAndFixASCII (items[i].getName (), 18) + " ";
if (!items[i].getName ().isEmpty ())
{
final String hitStr = "(" + items[i].getHitCount () + ")";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,12 @@ public static boolean isPad (final ButtonID buttonID)
*/
public static boolean isInRange (final ButtonID buttonID, final ButtonID firstButtonID, final int length)
{
return buttonID != null && ButtonID.get (firstButtonID, length - 1).ordinal () - buttonID.ordinal () >= 0;
if (buttonID == null)
return false;

final int pos = buttonID.ordinal ();
final int firstPos = firstButtonID.ordinal ();
final int lastPos = firstPos + length - 1;
return pos >= firstPos && pos <= lastPos;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public void registerColor (final int colorIndex, final ColorEx color)


/**
* Get the color index which is registered with the given key.
* Get the color which is registered at the given index.
*
* @param colorIndex The color index
* @param buttonID The ID of the button in case button LEDs have a different color range
Expand Down
23 changes: 22 additions & 1 deletion src/main/java/de/mossgrabers/framework/utils/StringUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,36 @@ public static String fixASCII (final String text)
case 'ß':
str.append ("ss");
break;
case 'é':
case 'é', 'ê':
str.append ("e");
break;
case 'ī', 'ï':
str.append ("i");
break;
case 'ā':
str.append ("a");
break;
case '→':
str.append ("->");
break;
case '♯':
str.append ("#");
break;
case '\u2013':
str.append ("-");
break;
case '¼':
str.append ("1/4");
break;
case '⅕':
str.append ("1/5");
break;
case '⅙':
str.append ("1/6");
break;
case '’':
str.append ("'");
break;
default:
str.append ("?");
break;
Expand Down
Binary file modified src/main/resources/Documentation/DrivenByMoss-Manual.pdf
Binary file not shown.

0 comments on commit 2d3c1e4

Please sign in to comment.