Skip to content

Commit

Permalink
V3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
quippy-git committed Nov 16, 2023
1 parent 8010e6f commit 5d5a39f
Show file tree
Hide file tree
Showing 47 changed files with 1,254 additions and 380 deletions.
78 changes: 61 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
Code Compliance Level: JDK 17
Build with openJDK 17.0.2

# JavaMod V3.6
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), ...
See the supported file types for a complete list.

This is the original JavaMod project from Daniel "Quippy" Becker.

Download the JAR or the source code and compile for yourself. A double click
on the jar-file should start it. If not, to manually start the player in GUI
mode open a command line (CMD or Shell) and enter:
java -jar ./javamod.jar
To start the command line version enter:
java -cp ./javamod.jar de.quippy.javamod.main.CommandLine MODFILE
Without any parameters you will receive a help screen.

## Download of compiled version and source code
* https://javamod.de/javamod.php
* https://quippy.de/mod.php
* https://sourceforge.net/projects/javamod/
* https://github.com/quippy-git/javamod

## Supported file types:
* Mods (FAR, NST, MOD, MTM, STK, WOW, XM, STM, S3M, IT, PowerPacker)
* SID
Expand All @@ -13,16 +32,20 @@ Build with openJDK 17.0.2
* OPL2/3 (ROL, LAA, CMF, DRO, SCI)
* Playlists PLS, M3U, M3U8, ZIP, CUE

## Technical info:
Code Compliance Level: JDK 17
Build with openJDK 17.0.2

## Third-party libraries
JavaMod incorporates modified versions of the following libraries.
JavaMod incorporates modified versions of the following libraries:

* jflac (http://jflac.sourceforge.net/)
* jlayer (https://github.com/wkpark/JLayer (was http://www.javazoom.net/javalayer/javalayer.html))
* jmac (http://jmac.sourceforge.net/)
* jorbis (http://www.jcraft.com/jorbis/)
* sidplay2 (http://sidplay2.sourceforge.net/)
* OPL3 (https://opl3.cozendey.com/)
* FMOPL (https://github.com/mamedev/mame - was removed 03/2021)
* FMOPL (https://github.com/mamedev/mame - was removed from mame 03/2021)

## Known issues:
* reading midi devices in MidiContainer can take a long time on Linux
Expand All @@ -39,24 +62,45 @@ JavaMod incorporates modified versions of the following libraries.
## Planned:
* WavPack and MusePack support
* MO3 support
* Midi, AdLib with Mods
* Midi and AdLib/OPL with Mods
* read 7z archives
* maybe: follow song with mod files (pattern display)

## Download of compiled version and source code
* https://javamod.de/javamod.php
* https://quippy.de/mod.php
* https://sourceforge.net/projects/javamod/
* https://github.com/quippy-git/javamod

## New in Version 3.6
* NEW: Shuffle play list moved from context menu to a separate button, so that
the function is found.
* NEW: Save play list moved from context menu to a separate button, so that
the function is found.
* NEW: Repeat play list is now a button with small icon, not a JCheckBox
* NEW: Upgrade to Java 20 compatibility (new URL(..) is deprecated)
* NEW: Follow a tracker song in pattern view. I also implemented a colored
version. Did work and looked good, but is way too slow!
* FIX: The SourceLine now has the same amount of bytes like the rendering
buffer, which is set with mod play back config.
Previously the SourceLine had a default amount of bytes that did not fit
the rendering buffer. Made the mixer block and wait.
However, you now might need to increase your milliseconds set!
* FIX: Envelope::sanitize also needs to limit the nPoints and endPoint values to
maximum possible index of the arrays of positions and values. Plus moved
fix of XM positions MSB set into sanitize function.
* FIX: fixing the FIX of 3.4 (SongName) - getSongInfosFor(URL) should NEVER
alter the container singleton. Changed that in 3.4 for MIDIs using
"getSongName". Result: after adding a piece to the play list, this would
not play when double clicked.
* FIX: Samples are now displayed without gap to the left (only visible with
small samples), color of loop was adjusted, is not swallowed by border
* FIX: BasicModMixer::fitIntoLoops ping pong loops were calculated a bit off as
XMs need that differently to ITs...
(AGAiN - FairStars MP3 Recorderkg.XM vs. TIMEAGO.IT)
* FIX: IT Compatibility: Ensure that there is no pan swing, panbrello, panning
envelopes, etc. applied on surround channels.

## New in Version 3.5
* FIX: PortaToNote: if an instrument is set, that was ignored, as FT2.09 does it.
Fix for the fix: (re-)set a NEW instrument, but do nothing when instrument
does not change.
* FIX: Powerpacked MODs were not correctly read at all circumstances
* FIX: CommandLine: missing break statement. Setting volume fell through to
default, which through an exception
default, which throws an exception
* FIX: CommandLine stayed in an endless loop even after piece finished
* FIX: CommandLine did not end in case of a RuntimeException
* FIX: CommandLine: supports 32 Bit now, as GUI does
Expand All @@ -75,7 +119,7 @@ JavaMod incorporates modified versions of the following libraries.
not? They are mapped to ProTracker / XM Modules
* FIX: added NULL-Pointer checks and clearing sample/instrument/pattern-dialogs,
because Farandole in S3M leaves patterns and samples empty
* FIX: All multimediafiles relying on MultimediaContainer::getSongNameFromURL
* FIX: All multimedia files relying on MultimediaContainer::getSongNameFromURL
need the URL updated in the BaseContainer - is now done.
Flaw was probably only visible with MIDIs
* FIX: SIDMixer must not implemented setMillisecondposition. Wav-Export of File
Expand Down Expand Up @@ -348,7 +392,7 @@ JavaMod incorporates modified versions of the following libraries.
* Saving radio / Internet stream playlists works now
* "All Playable files" is on top of selection now
* TextAreaFont and DialogFont are not set as statics any more to prevent errors
when UI is not used and needed in server like environments
when UI is not used and needed in server like environments (headless)
* Optimized load of URLs from playlists - no "re-location" for http-files - these
are always absolute
* introducing HttpResource for web-Radio - this supports also 302, moved
Expand Down Expand Up @@ -384,7 +428,7 @@ JavaMod incorporates modified versions of the following libraries.
--> Eclipse uses its own compiler and will not create that error
--> JavaC and NetBeans nevertheless will
--> arrays are now loaded as a resource from files
* SampleOffset now playes only with a note given
* SampleOffset now plays only with a note given

## New in Version 2.0
* Needs Java 6 now!!!
Expand Down
13 changes: 3 additions & 10 deletions source/de/quippy/javamod/io/FileOrPackedInputStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,9 @@ private InputStream tryForZippedFile(URL fromUrl) throws IOException
if (slashIndex<0) break;
fileNamePortion = Helpers.createStringFromURLString(path.substring(slashIndex)) + fileNamePortion;
path = path.substring(0, slashIndex);
URL newUrl = new URL(path);
ZipInputStream input = null;
try
{
input = new ZipInputStream(newUrl.openStream());
}
catch (Throwable e)
{
continue;
}
URL newUrl = Helpers.createURLfromString(path);
if (newUrl == null) continue;
ZipInputStream input = new ZipInputStream(newUrl.openStream());
String zipEntryName = fileNamePortion.substring(1);
ZipEntry entry;
while ((entry = input.getNextEntry())!=null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public RandomAccessInputStreamImpl(String fileName) throws IOException, FileNotF
public RandomAccessInputStreamImpl(URL fromUrl) throws IOException, FileNotFoundException
{
super();
if (fromUrl.getProtocol().equalsIgnoreCase("file"))
if (Helpers.isFile(fromUrl))
{
try
{
Expand Down
2 changes: 2 additions & 0 deletions source/de/quippy/javamod/io/SoundOutputStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public interface SoundOutputStream
public void stopLine(final boolean flushOrDrain);
public void flushLine();
public void drainLine();
public int getLineBufferSize();
public void writeSampleData(final byte[] samples, final int start, final int length);
public void setInternalFramePosition(final long newPosition);
public long getFramePosition();
Expand All @@ -55,6 +56,7 @@ public interface SoundOutputStream
public void setPlayDuringExport(final boolean playDuringExport);
public void setKeepSilent(final boolean keepSilent);
public void changeAudioFormatTo(final AudioFormat newFormat);
public void changeAudioFormatTo(final AudioFormat newFormat, final int newSourceLineBufferSize);
public AudioFormat getAudioFormat();
public boolean matches(final SoundOutputStream otherStream);
}
36 changes: 35 additions & 1 deletion source/de/quippy/javamod/io/SoundOutputStreamImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public class SoundOutputStreamImpl implements SoundOutputStream
protected WaveFile waveExportFile;
protected boolean playDuringExport;
protected boolean keepSilent;
protected int sourceLineBufferSize;

public SoundOutputStreamImpl()
{
Expand All @@ -74,6 +75,12 @@ public SoundOutputStreamImpl(final AudioFormat audioFormat, final AudioProcessor
this.exportFile = exportFile;
this.playDuringExport = playDuringExport;
this.keepSilent = keepSilent;
this.sourceLineBufferSize = -1;
}
public SoundOutputStreamImpl(final AudioFormat audioFormat, final AudioProcessor audioProcessor, final File exportFile, final boolean playDuringExport, final boolean keepSilent, final int sourceLineBufferSize)
{
this(audioFormat, audioProcessor, exportFile, playDuringExport, keepSilent);
this.sourceLineBufferSize = sourceLineBufferSize;
}
/**
* @since 30.12.2007
Expand All @@ -91,7 +98,11 @@ protected synchronized void openSourceLine()
{
//sourceLineInfo.getFormats();
sourceLine = (SourceDataLine) AudioSystem.getLine(sourceLineInfo);
sourceLine.open();
if (sourceLineBufferSize>0)
sourceLine.open(audioFormat, sourceLineBufferSize);
else
sourceLine.open(audioFormat);
sourceLineBufferSize = sourceLine.getBufferSize();
sourceLine.start();
setVolume(currentVolume);
setBalance(currentBalance);
Expand Down Expand Up @@ -126,6 +137,9 @@ protected synchronized void openAudioProcessor()
}
}
}
/**
* @since 30.12.2007
*/
protected synchronized void openExportFile()
{
if (exportFile!=null)
Expand Down Expand Up @@ -271,6 +285,18 @@ public void drainLine()
//try { Thread.sleep(150L); } catch (InterruptedException ex) { /*NOOP*/ }
}
}
/**
* @since 11.11.2023
* @return the buffer size in bytes of the audio source line
* or -1 if no sourceline is present
*/
public int getLineBufferSize()
{
if (sourceLine!=null)
return sourceLine.getBufferSize();
else
return -1;
}
/**
* @since 27.12.2011
* @param samples
Expand Down Expand Up @@ -421,4 +447,12 @@ public synchronized void changeAudioFormatTo(final AudioFormat newAudioFormat)
audioFormat = newAudioFormat;
if (reOpen) open();
}
/**
* @see de.quippy.javamod.io.SoundOutputStream#changeAudioFormatTo(javax.sound.sampled.AudioFormat, int)
*/
public synchronized void changeAudioFormatTo(final AudioFormat newAudioFormat, final int newSourceLineBufferSize)
{
sourceLineBufferSize = newSourceLineBufferSize;
changeAudioFormatTo(newAudioFormat);
}
}
23 changes: 8 additions & 15 deletions source/de/quippy/javamod/main/CommandLine.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
package de.quippy.javamod.main;

import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Properties;

Expand Down Expand Up @@ -163,21 +162,11 @@ private void parseParameters(String[] args)
else
{
String fileName = args[i];
try
modFileName = Helpers.createURLfromString(fileName);
if (modFileName == null)
{
modFileName = new URL(fileName);
}
catch (MalformedURLException ex) // This is evil, but I don't want to test on local files myself...
{
try
{
modFileName = (new File(fileName)).toURI().toURL();
}
catch (MalformedURLException exe) // This is even more evil...
{
Log.error("This is not parsable: " + fileName, ex);
System.exit(-1);
}
Log.error("This is not parsable: " + fileName);
System.exit(-1);
}
}
}
Expand Down Expand Up @@ -325,5 +314,9 @@ public static void main(String[] args)
showHelp();
System.exit(-1);
}
finally
{
MultimediaContainerManager.cleanUpAllContainers();
}
}
}
3 changes: 2 additions & 1 deletion source/de/quippy/javamod/main/JavaMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
*/
package de.quippy.javamod.main;

import java.awt.EventQueue;
import java.io.File;

import de.quippy.javamod.main.gui.MainForm;
Expand Down Expand Up @@ -66,7 +67,7 @@ private static String getFileName(String[] args)
*/
public static void main(final String[] args)
{
java.awt.EventQueue.invokeLater(new Runnable()
EventQueue.invokeLater(new Runnable()
{
public void run()
{
Expand Down
Loading

0 comments on commit 5d5a39f

Please sign in to comment.