Skip to content

Commit da7760b

Browse files
committed
V3.7.3 - XMAS Edition - Hot Fix III
1 parent 33864d0 commit da7760b

12 files changed

+320
-562
lines changed

README.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# JavaMod V3.7.2
1+
# JavaMod V3.7.3
22
JavaMod - a java based multimedia player for Protracker, Fast Tracker,
33
Impulse Tracker, Scream Tracker and other mod files plus
44
SID, MP3, WAV, OGG, APE, FLAC, MIDI, AdLib ROL-Files (OPL), ...
@@ -66,6 +66,11 @@ JavaMod incorporates modified versions of the following libraries:
6666
* Midi and AdLib/OPL with Mods
6767
* read 7z archives
6868

69+
## New in Version 3.7.3
70+
* NEW: Supporting additional Protracker type mods
71+
* FIX: Tremolo fixed, added FT2-bug - speed and depth for XM and IT
72+
* FIX: sample delta loading with special cases
73+
6974
## New in Version 3.7.2
7075
* FIX: Sample- and instrument dialog - iterating through the instruments was
7176
broken

source/de/quippy/javamod/main/gui/MainForm.java

+36-1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@
5454
import java.io.IOException;
5555
import java.net.URISyntaxException;
5656
import java.net.URL;
57+
import java.time.LocalDate;
58+
import java.time.format.DateTimeFormatter;
5759
import java.util.ArrayList;
5860
import java.util.HashMap;
5961
import java.util.Iterator;
@@ -186,6 +188,7 @@ public class MainForm extends JFrame implements DspProcessorCallBack, PlayThread
186188
private static final String PROPERTY_PITCHSHIFT_OVERSAMPLING = "javamod.player.pitchshift.oversampling";
187189

188190
private static final int PROPERTY_LASTLOADED_MAXENTRIES = 10;
191+
private static final String PROPERTY_LAST_UPDATECHECK = "javamod.last_update_check";
189192

190193
private static final String WINDOW_TITLE = Helpers.FULLVERSION;
191194
private static final String WINDOW_NAME = "JavaMod";
@@ -331,6 +334,10 @@ public class MainForm extends JFrame implements DspProcessorCallBack, PlayThread
331334
private boolean useSystemTray = false;
332335
private float currentVolume; /* 0.0 - 1.0 */
333336
private float currentBalance; /* -1.0 - 1.0 */
337+
private LocalDate lastUpdateCheck;
338+
private static final DateTimeFormatter DATE_FORMATER = DateTimeFormatter.ofPattern("yyyy-MM-dd");
339+
private static final LocalDate today = LocalDate.now();
340+
334341

335342
private ArrayList<URL> lastLoaded;
336343
private ArrayList<Window> windows;
@@ -478,6 +485,8 @@ private void readPropertyFile()
478485
getSALMeterPanel().setDrawWhatTo(saMeterLeftDrawType);
479486
getSARMeterPanel().setDrawWhatTo(saMeterRightDrawType);
480487

488+
lastUpdateCheck = LocalDate.from(DATE_FORMATER.parse(props.getProperty(PROPERTY_LAST_UPDATECHECK, DATE_FORMATER.format(today))));
489+
481490
if (currentEqualizer!=null)
482491
{
483492
boolean isActive = Boolean.parseBoolean(props.getProperty(PROPERTY_EQUALIZER_ISACTIVE, "FALSE"));
@@ -558,6 +567,7 @@ private void writePropertyFile()
558567
props.setProperty(PROPERTY_XMASCONFIG_VISABLE, Boolean.toString(getXmasConfigDialog().isVisible()));
559568
props.setProperty(PROPERTY_SAMETER_LEFT_DRAWTYPE, Integer.toString(getSALMeterPanel().getDrawWhat()));
560569
props.setProperty(PROPERTY_SAMETER_RIGHT_DRAWTYPE, Integer.toString(getSARMeterPanel().getDrawWhat()));
570+
props.setProperty(PROPERTY_LAST_UPDATECHECK, DATE_FORMATER.format(lastUpdateCheck));
561571

562572
if (currentEqualizer!=null)
563573
{
@@ -759,8 +769,33 @@ public void windowDeiconified(WindowEvent e)
759769
createFileFilter();
760770

761771
currentContainer = null; //set Back to null!
762-
showMessage("Ready...");
772+
//if (today.minusDays(30).isAfter(lastUpdateCheck)) checkForUpdate();
773+
774+
showMessage("Ready...");
763775
}
776+
//TODO: We might want to enable this once...
777+
// private void checkForUpdate()
778+
// {
779+
// new Thread( new Runnable()
780+
// {
781+
// public void run()
782+
// {
783+
// try
784+
// {
785+
// lastUpdateCheck = LocalDate.now();
786+
// String serverVersion = Helpers.getCurrentServerVersion();
787+
// if (Helpers.compareVersions(Helpers.VERSION, serverVersion)<0)
788+
// {
789+
// getLEDScrollPanel().addScrollText("Version ("+serverVersion+") available" + Helpers.SCROLLY_BLANKS);
790+
// }
791+
// }
792+
// catch (Throwable ex)
793+
// {
794+
// /* NOOP */
795+
// }
796+
// }
797+
// }).run();
798+
// }
764799
private void createAllWindows()
765800
{
766801
windows = new ArrayList<Window>();

source/de/quippy/javamod/multimedia/mod/ModConstants.java

+15-4
Original file line numberDiff line numberDiff line change
@@ -531,15 +531,26 @@ public static enum PanBits { Pan4Bit, Pan6Bit, Pan8Bit }
531531
-255, -253, -250, -244, -235, -224, -212, -197, -180, -161, -141, -120, -97, -74, -49, -24
532532
};
533533

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

545556
/**

source/de/quippy/javamod/multimedia/mod/loader/Module.java

+11-23
Original file line numberDiff line numberDiff line change
@@ -568,43 +568,27 @@ protected void readSampleData(final Sample current, final ModfileInputStream inp
568568
else
569569
if ((flags&ModConstants.SM_PCM16D)==ModConstants.SM_PCM16D)
570570
{
571-
int delta = 0;
571+
short delta = 0;
572572
for (int s=0; s<current.length; s++)
573-
{
574-
delta += (int)inputStream.readIntelWord();
575-
if (delta>32767) delta = 32767; else if (delta<-32768) delta = -32768;
576-
current.sampleL[s] = ModConstants.promoteSigned16BitToSigned32Bit((long)delta);
577-
}
573+
current.sampleL[s] = ModConstants.promoteSigned16BitToSigned32Bit((long)(delta += inputStream.readIntelWord()));
578574
if (isStereo)
579575
{
580576
delta = 0;
581577
for (int s=0; s<current.length; s++)
582-
{
583-
delta += (int)inputStream.readIntelWord();
584-
if (delta>32767) delta = 32767; else if (delta<-32768) delta = -32768;
585-
current.sampleR[s] = ModConstants.promoteSigned16BitToSigned32Bit((long)delta);
586-
}
578+
current.sampleR[s] = ModConstants.promoteSigned16BitToSigned32Bit((long)(delta += inputStream.readIntelWord()));
587579
}
588580
}
589581
else
590582
if ((flags&ModConstants.SM_PCMD)==ModConstants.SM_PCMD)
591583
{
592-
int delta = 0;
584+
byte delta = 0;
593585
for (int s=0; s<current.length; s++)
594-
{
595-
delta += (int)inputStream.readByte();
596-
if (delta>127) delta = 127; else if (delta<-128) delta = -128;
597-
current.sampleL[s] = ModConstants.promoteSigned8BitToSigned32Bit((long)delta);
598-
}
586+
current.sampleL[s] = ModConstants.promoteSigned8BitToSigned32Bit((long)(delta += inputStream.readByte()));
599587
if (isStereo)
600588
{
601589
delta = 0;
602590
for (int s=0; s<current.length; s++)
603-
{
604-
delta += (int)inputStream.readByte();
605-
if (delta>127) delta = 127; else if (delta<-128) delta = -128;
606-
current.sampleR[s] = ModConstants.promoteSigned8BitToSigned32Bit((long)delta);
607-
}
591+
current.sampleR[s] = ModConstants.promoteSigned8BitToSigned32Bit((long)(delta += inputStream.readByte()));
608592
}
609593
}
610594
else
@@ -721,7 +705,11 @@ protected void readSampleData(final Sample current, final ModfileInputStream inp
721705
* @since 15.06.2020
722706
*/
723707
public abstract MidiMacros getMidiConfig();
724-
708+
/**
709+
* @since 15.12.2023
710+
* @return
711+
*/
712+
public abstract boolean getFT2Tremolo();
725713
/**
726714
* @since 25.06.2006
727715
* @param length

0 commit comments

Comments
 (0)