Fix sound editor export (missing music address), fix type texts and missing date

This commit is contained in:
Peter Dell 2022-09-10 16:45:35 +02:00
parent 0a20519ab4
commit 12ae9048dc
7 changed files with 55 additions and 13 deletions

View File

@ -7,4 +7,23 @@ com.wudsn.ide.snd.player.c64.C64SoundFile.name=C64 Sound File
com.wudsn.ide.snd.editor.SoundEditor.name=Sound Editor com.wudsn.ide.snd.editor.SoundEditor.name=Sound Editor
com.wudsn.ide.snd.editor.SoundEditorToolbar.label=Sound com.wudsn.ide.snd.editor.SoundEditorToolbar.label=Sound
com.wudsn.ide.snd.editor.SoundEditorActionSet.label=Sound com.wudsn.ide.snd.editor.SoundEditorActionSet.label=Sound
com.wudsn.ide.snd.editor.SoundEditorPlayCommand.name=Play com.wudsn.ide.snd.editor.SoundEditorPlayCommand.name=Play
com.wudsn.ide.snd.player.FileType.CM3=Chaos Music Composer File (3/4)
com.wudsn.ide.snd.player.FileType.CMC=Chaos Music Composer File
com.wudsn.ide.snd.player.FileType.CMR=Chaos Music Composer File (Rzog)
com.wudsn.ide.snd.player.FileType.CMS=Chaos Music Composer File (Stereo)
com.wudsn.ide.snd.player.FileType.DLT=Delta Music Composer File
com.wudsn.ide.snd.player.FileType.DMC=Chaos Music Composer File (DoublePlay)
com.wudsn.ide.snd.player.FileType.FC=Future Composer File
com.wudsn.ide.snd.player.FileType.MPD=Music Pro-Tracker File (DoublePlay)
com.wudsn.ide.snd.player.FileType.MPT=Music Pro-Tracker File
com.wudsn.ide.snd.player.FileType.RMT=Raster Music Tracker File
com.wudsn.ide.snd.player.FileType.SAP=Slight Atari Player File
com.wudsn.ide.snd.player.FileType.TM2=Theta Music Composer 1.x File
com.wudsn.ide.snd.player.FileType.TM8=Theta Music Composer 1.x File (Stereo)
com.wudsn.ide.snd.player.FileType.TMC=Theta Music Composer 2.x File
com.wudsn.ide.snd.player.FileType.XEX=Atari Executable
com.wudsn.ide.snd.player.FileType.PRG=C64 Program
com.wudsn.ide.snd.player.FileType.SID=SID File

View File

@ -7,4 +7,23 @@ com.wudsn.ide.snd.player.c64.C64SoundFile.name=C64 Musik-Datei
com.wudsn.ide.snd.editor.SoundEditor.name=Musik Editor com.wudsn.ide.snd.editor.SoundEditor.name=Musik Editor
com.wudsn.ide.snd.editor.SoundEditorToolbar.label=Musik com.wudsn.ide.snd.editor.SoundEditorToolbar.label=Musik
com.wudsn.ide.snd.editor.SoundEditorActionSet.label=Musik com.wudsn.ide.snd.editor.SoundEditorActionSet.label=Musik
com.wudsn.ide.snd.editor.SoundEditorPlayCommand.name=Wiedergabe com.wudsn.ide.snd.editor.SoundEditorPlayCommand.name=Wiedergabe
com.wudsn.ide.snd.player.FileType.CM3=Chaos Music Composer Datei (3/4)
com.wudsn.ide.snd.player.FileType.CMC=Chaos Music Composer Datei
com.wudsn.ide.snd.player.FileType.CMR=Chaos Music Composer Datei (Rzog)
com.wudsn.ide.snd.player.FileType.CMS=Chaos Music Composer Datei (Stereo)
com.wudsn.ide.snd.player.FileType.DLT=Delta Music Composer Datei
com.wudsn.ide.snd.player.FileType.DMC=Chaos Music Composer Datei (DoublePlay)
com.wudsn.ide.snd.player.FileType.FC=Future Composer Datei
com.wudsn.ide.snd.player.FileType.MPD=Music Pro-Tracker Datei (DoublePlay)
com.wudsn.ide.snd.player.FileType.MPT=Music Pro-Tracker Datei
com.wudsn.ide.snd.player.FileType.RMT=Raster Music Tracker Datei
com.wudsn.ide.snd.player.FileType.SAP=Slight Atari Player Datei
com.wudsn.ide.snd.player.FileType.TM2=Theta Music Composer 1.x Datei
com.wudsn.ide.snd.player.FileType.TM8=Theta Music Composer 1.x Datei (Stereo)
com.wudsn.ide.snd.player.FileType.TMC=Theta Music Composer 2.x Datei
com.wudsn.ide.snd.player.FileType.XEX=Atari Programm
com.wudsn.ide.snd.player.FileType.PRG=C64 Programm
com.wudsn.ide.snd.player.FileType.SID=SID Datei

View File

@ -6,7 +6,7 @@ bin.includes = META-INF/,\
lib/atari8bit/asap.jar,\ lib/atari8bit/asap.jar,\
lib/c64/jsidplay2.jar,\ lib/c64/jsidplay2.jar,\
plugin.properties,\ plugin.properties,\
plugin_de_DE.properties,\ plugin_de.properties,\
lib/atari8bit/asap.txt,\ lib/atari8bit/asap.txt,\
lib/c64/jsidplay2.txt,\ lib/c64/jsidplay2.txt,\
OSGI-INF/ OSGI-INF/

View File

@ -616,8 +616,11 @@ public final class SoundEditor extends EditorPart implements Application, SoundP
} }
int musicAddress = info.getMusicAddress(); int musicAddress = info.getMusicAddress();
if (musicAddress >= 0 && selectedFileType.isMusicAddressChangeable()) { if (selectedFileType.isMusicAddressChangeable()) {
String initialValue = HexUtility.getLongValueHexString(musicAddress, 4); String initialValue = "";
if (musicAddress >= 0) {
initialValue = HexUtility.getLongValueHexString(musicAddress, 4);
}
InputDialog inputDialog = new InputDialog(mainComposite.getShell(), InputDialog inputDialog = new InputDialog(mainComposite.getShell(),
TextUtility.format(Texts.MESSAGE_I507, selectedFileType.getDescription()), Texts.MESSAGE_I508, TextUtility.format(Texts.MESSAGE_I507, selectedFileType.getDescription()), Texts.MESSAGE_I508,
initialValue, new IInputValidator() { initialValue, new IInputValidator() {

View File

@ -26,14 +26,14 @@ import com.wudsn.ide.base.common.EnumUtility;
*/ */
public enum FileType { public enum FileType {
// ATARI file Types, alphabethical order: // ATARI file Types, alphabetical order:
// cm3, cmc, cmr, cms, dlt, dmc, fc, mpd, mpt, rmt, tmc, tm2, tm8, sap // cm3, cmc, cmr, cms, dlt, dmc, fc, mpd, mpt, rmt, tmc, tm2, tm8, sap
// XEX is an export only format, not registered in the content type. // XEX is an export only format, not registered in the content type.
CM3(".cm3"), CMC(".cmc"), CMR(".cmr"), CMS(".cms"), DLT(".dlt"), DMC(".dmc"), FC(".fc"), MPD(".mpd"), MPT(".mpt"), CM3(".cm3"), CMC(".cmc"), CMR(".cmr"), CMS(".cms"), DLT(".dlt"), DMC(".dmc"), FC(".fc"), MPD(".mpd"), MPT(".mpt"),
RMT(".rmt"), SAP(".sap"), TM2(".tm2"), TM8(".tm8"), TMC(".tmc"), XEX(".xex"), RMT(".rmt"), SAP(".sap"), TM2(".tm2"), TM8(".tm8"), TMC(".tmc"), XEX(".xex"),
// C64 File Types, alphabethical order: // C64 File Types, alphabetical order:
// prg, sid // prg, sid
// PRG is an export only format, not registered in the content type. // PRG is an export only format, not registered in the content type.

View File

@ -128,7 +128,8 @@ public interface SoundInfo {
* Gets the music address or <code>-1</code> if the module type does not have * Gets the music address or <code>-1</code> if the module type does not have
* one. * one.
* *
* @return TODO * @return The music address or <code>-1</code> if the module type does not have
* one.
*/ */
public int getMusicAddress(); public int getMusicAddress();

View File

@ -136,6 +136,7 @@ public final class ASAPPlayer extends SoundPlayer {
ASAPInfo asapInfo = asap.getInfo(); ASAPInfo asapInfo = asap.getInfo();
info.title = asapInfo.getTitleOrFilename(); info.title = asapInfo.getTitleOrFilename();
info.author = asapInfo.getAuthor(); info.author = asapInfo.getAuthor();
info.date = asapInfo.getDate();
// Determine the original file type in the container. // Determine the original file type in the container.
// Only if it cannot be determined, the file extension is used. // Only if it cannot be determined, the file extension is used.
@ -185,6 +186,9 @@ public final class ASAPPlayer extends SoundPlayer {
info.initFulltime = asapMusicRoutine.isFulltime(); info.initFulltime = asapMusicRoutine.isFulltime();
info.playerAddress = asapMusicRoutine.getPlayerAddress(); info.playerAddress = asapMusicRoutine.getPlayerAddress();
info.musicAddress = asapInfo.getMusicAddress(); info.musicAddress = asapInfo.getMusicAddress();
if (info.musicAddress == 0) {
info.musicAddress = -1;
}
setLoaded(true); setLoaded(true);
@ -202,7 +206,6 @@ public final class ASAPPlayer extends SoundPlayer {
// The file name must have a least one character before the dot. // The file name must have a least one character before the dot.
String asapFile = "DUMMY" + fileType.getExtension().toUpperCase(); String asapFile = "DUMMY" + fileType.getExtension().toUpperCase();
ASAPInfo asapInfo = asap.getInfo(); ASAPInfo asapInfo = asap.getInfo();
int oldMusicAddress = asapInfo.getMusicAddress();
byte[] output = new byte[MAX_EXPORT_SIZE]; byte[] output = new byte[MAX_EXPORT_SIZE];
ASAPWriter asapWriter = new ASAPWriter(); ASAPWriter asapWriter = new ASAPWriter();
int outputOffset = 0; int outputOffset = 0;
@ -223,10 +226,7 @@ public final class ASAPPlayer extends SoundPlayer {
*/ */
outputOffset = asapWriter.write(asapFile, asapInfo, module, moduleLen, false); outputOffset = asapWriter.write(asapFile, asapInfo, module, moduleLen, false);
// Change the music address back in case it was changed.
if (fileType.isMusicAddressChangeable()) {
asapInfo.setMusicAddress(oldMusicAddress);
}
byte[] result = new byte[outputOffset]; byte[] result = new byte[outputOffset];
System.arraycopy(output, 0, result, 0, outputOffset); System.arraycopy(output, 0, result, 0, outputOffset);
return result; return result;