Skip to content

Commit

Permalink
V3.7.3 - XMAS Edition - Hot Fix III
Browse files Browse the repository at this point in the history
  • Loading branch information
quippy-git committed Dec 15, 2023
1 parent 33864d0 commit da7760b
Show file tree
Hide file tree
Showing 12 changed files with 320 additions and 562 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# JavaMod V3.7.2
# JavaMod V3.7.3
JavaMod - a java based multimedia player for Protracker, Fast Tracker,
Impulse Tracker, Scream Tracker and other mod files plus
SID, MP3, WAV, OGG, APE, FLAC, MIDI, AdLib ROL-Files (OPL), ...
Expand Down Expand Up @@ -66,6 +66,11 @@ JavaMod incorporates modified versions of the following libraries:
* Midi and AdLib/OPL with Mods
* read 7z archives

## New in Version 3.7.3
* NEW: Supporting additional Protracker type mods
* FIX: Tremolo fixed, added FT2-bug - speed and depth for XM and IT
* FIX: sample delta loading with special cases

## New in Version 3.7.2
* FIX: Sample- and instrument dialog - iterating through the instruments was
broken
Expand Down
37 changes: 36 additions & 1 deletion source/de/quippy/javamod/main/gui/MainForm.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
import java.io.IOException;
import java.net.URISyntaxException;
import java.net.URL;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
Expand Down Expand Up @@ -186,6 +188,7 @@ public class MainForm extends JFrame implements DspProcessorCallBack, PlayThread
private static final String PROPERTY_PITCHSHIFT_OVERSAMPLING = "javamod.player.pitchshift.oversampling";

private static final int PROPERTY_LASTLOADED_MAXENTRIES = 10;
private static final String PROPERTY_LAST_UPDATECHECK = "javamod.last_update_check";

private static final String WINDOW_TITLE = Helpers.FULLVERSION;
private static final String WINDOW_NAME = "JavaMod";
Expand Down Expand Up @@ -331,6 +334,10 @@ public class MainForm extends JFrame implements DspProcessorCallBack, PlayThread
private boolean useSystemTray = false;
private float currentVolume; /* 0.0 - 1.0 */
private float currentBalance; /* -1.0 - 1.0 */
private LocalDate lastUpdateCheck;
private static final DateTimeFormatter DATE_FORMATER = DateTimeFormatter.ofPattern("yyyy-MM-dd");
private static final LocalDate today = LocalDate.now();


private ArrayList<URL> lastLoaded;
private ArrayList<Window> windows;
Expand Down Expand Up @@ -478,6 +485,8 @@ private void readPropertyFile()
getSALMeterPanel().setDrawWhatTo(saMeterLeftDrawType);
getSARMeterPanel().setDrawWhatTo(saMeterRightDrawType);

lastUpdateCheck = LocalDate.from(DATE_FORMATER.parse(props.getProperty(PROPERTY_LAST_UPDATECHECK, DATE_FORMATER.format(today))));

if (currentEqualizer!=null)
{
boolean isActive = Boolean.parseBoolean(props.getProperty(PROPERTY_EQUALIZER_ISACTIVE, "FALSE"));
Expand Down Expand Up @@ -558,6 +567,7 @@ private void writePropertyFile()
props.setProperty(PROPERTY_XMASCONFIG_VISABLE, Boolean.toString(getXmasConfigDialog().isVisible()));
props.setProperty(PROPERTY_SAMETER_LEFT_DRAWTYPE, Integer.toString(getSALMeterPanel().getDrawWhat()));
props.setProperty(PROPERTY_SAMETER_RIGHT_DRAWTYPE, Integer.toString(getSARMeterPanel().getDrawWhat()));
props.setProperty(PROPERTY_LAST_UPDATECHECK, DATE_FORMATER.format(lastUpdateCheck));

if (currentEqualizer!=null)
{
Expand Down Expand Up @@ -759,8 +769,33 @@ public void windowDeiconified(WindowEvent e)
createFileFilter();

currentContainer = null; //set Back to null!
showMessage("Ready...");
//if (today.minusDays(30).isAfter(lastUpdateCheck)) checkForUpdate();

showMessage("Ready...");
}
//TODO: We might want to enable this once...
// private void checkForUpdate()
// {
// new Thread( new Runnable()
// {
// public void run()
// {
// try
// {
// lastUpdateCheck = LocalDate.now();
// String serverVersion = Helpers.getCurrentServerVersion();
// if (Helpers.compareVersions(Helpers.VERSION, serverVersion)<0)
// {
// getLEDScrollPanel().addScrollText("Version ("+serverVersion+") available" + Helpers.SCROLLY_BLANKS);
// }
// }
// catch (Throwable ex)
// {
// /* NOOP */
// }
// }
// }).run();
// }
private void createAllWindows()
{
windows = new ArrayList<Window>();
Expand Down
19 changes: 15 additions & 4 deletions source/de/quippy/javamod/multimedia/mod/ModConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -531,15 +531,26 @@ public static enum PanBits { Pan4Bit, Pan6Bit, Pan8Bit }
-255, -253, -250, -244, -235, -224, -212, -197, -180, -161, -141, -120, -97, -74, -49, -24
};

// /**
// * Triangle wave table (ramp down)
// */
// public static final int [] ModRampDownTable = new int[]
// {
// 0, -8, -16, -24, -32, -40, -48, -56, -64, -72, -80, -88, -96, -104, -112, -120,
// -128, -136, -144, -152, -160, -168, -176, -184, -192, -200, -208, -216, -224, -232, -240, -248,
// 255, 247, 239, 231, 223, 215, 207, 199, 191, 183, 175, 167, 159, 151, 143, 135,
// 127, 119, 113, 103, 95, 87, 79, 71, 63, 55, 47, 39, 31, 23, 15, 7,
// };

/**
* Triangle wave table (ramp down)
*/
public static final int [] ModRampDownTable = new int[]
{
0, -8, -16, -24, -32, -40, -48, -56, -64, -72, -80, -88, -96, -104, -112, -120,
-128, -136, -144, -152, -160, -168, -176, -184, -192, -200, -208, -216, -224, -232, -240, -248,
255, 247, 239, 231, 223, 215, 207, 199, 191, 183, 175, 167, 159, 151, 143, 135,
127, 119, 113, 103, 95, 87, 79, 71, 63, 55, 47, 39, 31, 23, 15, 7,
255, 247, 239, 231, 223, 215, 207, 199, 191, 183, 175, 167, 159, 151, 143, 135,
127, 119, 111, 103, 95, 87, 79, 71, 63, 55, 47, 39, 31, 23, 15, 7,
-1, -9, -17, -25, -33, -41, -49, -57, -65, -73, -81, -89, -97, -105, -113, -121,
-129, -137, -145, -153, -161, -169, -177, -185, -193, -201, -209, -217, -225, -233, -241, -249
};

/**
Expand Down
34 changes: 11 additions & 23 deletions source/de/quippy/javamod/multimedia/mod/loader/Module.java
Original file line number Diff line number Diff line change
Expand Up @@ -568,43 +568,27 @@ protected void readSampleData(final Sample current, final ModfileInputStream inp
else
if ((flags&ModConstants.SM_PCM16D)==ModConstants.SM_PCM16D)
{
int delta = 0;
short delta = 0;
for (int s=0; s<current.length; s++)
{
delta += (int)inputStream.readIntelWord();
if (delta>32767) delta = 32767; else if (delta<-32768) delta = -32768;
current.sampleL[s] = ModConstants.promoteSigned16BitToSigned32Bit((long)delta);
}
current.sampleL[s] = ModConstants.promoteSigned16BitToSigned32Bit((long)(delta += inputStream.readIntelWord()));
if (isStereo)
{
delta = 0;
for (int s=0; s<current.length; s++)
{
delta += (int)inputStream.readIntelWord();
if (delta>32767) delta = 32767; else if (delta<-32768) delta = -32768;
current.sampleR[s] = ModConstants.promoteSigned16BitToSigned32Bit((long)delta);
}
current.sampleR[s] = ModConstants.promoteSigned16BitToSigned32Bit((long)(delta += inputStream.readIntelWord()));
}
}
else
if ((flags&ModConstants.SM_PCMD)==ModConstants.SM_PCMD)
{
int delta = 0;
byte delta = 0;
for (int s=0; s<current.length; s++)
{
delta += (int)inputStream.readByte();
if (delta>127) delta = 127; else if (delta<-128) delta = -128;
current.sampleL[s] = ModConstants.promoteSigned8BitToSigned32Bit((long)delta);
}
current.sampleL[s] = ModConstants.promoteSigned8BitToSigned32Bit((long)(delta += inputStream.readByte()));
if (isStereo)
{
delta = 0;
for (int s=0; s<current.length; s++)
{
delta += (int)inputStream.readByte();
if (delta>127) delta = 127; else if (delta<-128) delta = -128;
current.sampleR[s] = ModConstants.promoteSigned8BitToSigned32Bit((long)delta);
}
current.sampleR[s] = ModConstants.promoteSigned8BitToSigned32Bit((long)(delta += inputStream.readByte()));
}
}
else
Expand Down Expand Up @@ -721,7 +705,11 @@ protected void readSampleData(final Sample current, final ModfileInputStream inp
* @since 15.06.2020
*/
public abstract MidiMacros getMidiConfig();

/**
* @since 15.12.2023
* @return
*/
public abstract boolean getFT2Tremolo();
/**
* @since 25.06.2006
* @param length
Expand Down
Loading

0 comments on commit da7760b

Please sign in to comment.