Skip to content

Commit

Permalink
V3.7.1 X-Mas Release - Tray Icon HOT FIX
Browse files Browse the repository at this point in the history
  • Loading branch information
quippy-git committed Dec 14, 2023
1 parent 62085ad commit e3f1c8d
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 40 deletions.
44 changes: 24 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# JavaMod V3.7
# JavaMod V3.7.1
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,10 @@ JavaMod incorporates modified versions of the following libraries:
* Midi and AdLib/OPL with Mods
* read 7z archives

## New in Version 3.7.1
* FIX: Error if window manager does not support tray icon. So really check for
tray icon support. Would end up in a hard error, JavaMod will not start!

## New in Version 3.7
* NEW XMAS SPECIAL:
Enjoy some light bulbs on your desktop. You can enable it in the view
Expand All @@ -76,27 +80,27 @@ JavaMod incorporates modified versions of the following libraries:
flawlessly, but on KDE it is either flickery or with opengl it inherits
the dim color of a window decoration under it.
* NEW: Follow song in pattern dialog is now fun to watch:
- The arrangement is now scrolling to the activated pattern.
- In the pattern dialog horizontal scrolling by user is not reset by
* The arrangement is now scrolling to the activated pattern.
* In the pattern dialog horizontal scrolling by user is not reset by
caret anymore.
- no editing the caret (mark text) via mouse by user
- Rows and channels are fixed for scrolling - and added some color (yes,
* no editing the caret (mark text) via mouse by user
* Rows and channels are fixed for scrolling - and added some color (yes,
a bit more gray)
- channel markers are buttons for muting and have a context menu to
* channel markers are buttons for muting and have a context menu to
select solo, mute and un-mute per channel
- resetting to normal mute will regard muted channels with ITs (if the
* resetting to normal mute will regard muted channels with ITs (if the
author wanted them to be muted)
- Added sample / panning representation in channel buttons based on
* Added sample / panning representation in channel buttons based on
samples / volumes and panning in channel
- Coding of colored version was deleted... It is too slow anyways.
- Follow song can be switched off - however, this will only stop
* Coding of colored version was deleted... It is too slow anyways.
* Follow song can be switched off - however, this will only stop
automatic scrolling and pattern display. If the currently watched
pattern is played, the caret will fly by (though being of lightest
gray)
- display of current volume column effect and effect column effect
- No FollowSong while exporting - except for when doing play back while
* display of current volume column effect and effect column effect
* No FollowSong while exporting - except for when doing play back while
exporting
- upper left corner shows pattern number
* upper left corner shows pattern number
* NEW: Pattern/Sample/Instrument dialogs will disappear when a file other than
a mod (e.g. mp3) is played - and reappear when a mod is played again
* NEW: To make pattern sample/instrument data (hex values) fit to sample and
Expand All @@ -109,12 +113,12 @@ JavaMod incorporates modified versions of the following libraries:
set. (BTW: The behavior of FT2, IT2.14, Schism and ModPlug is totally
different here, which values for volume and panning reset to use.)
Three things are now done:
- if the current instrument is a long player (i.e. has loops), we will
* if the current instrument is a long player (i.e. has loops), we will
continue using that. If no instrument is playing, we will use the new
given instrument and switch to it
- but also safe the instrument set. Following notes (without instrument)
* but also safe the instrument set. Following notes (without instrument)
will use exactly that new one.
- reset panning and volume to the instrument chosen from above
* reset panning and volume to the instrument chosen from above
Check with Airborn.xm and Anthem.mod
* FIX: PatternBreak at end of Song: do a loop and start at given row, do a
fade-out if wished. Do not do so, if infinite loops are to be ignored.
Expand Down Expand Up @@ -218,7 +222,7 @@ JavaMod incorporates modified versions of the following libraries:
volume and preamp. New ModPlug-Songs were played fare to silent then
* FIX: End of envelopes now correctly identified, count of active NNAs, that
are not active anymore, does not explode anymore
* FIX: volume column effects for IT and XM refactored, many fixes on
* FIX: volume column effects for IT and XM re-factored, many fixes on
ImpulseTracker
* FIX: s3m load volume column as panning, if above 128
* FIX: also stm and s3m (with IT Compatmode OFF) share Porta memories now (like
Expand Down Expand Up @@ -263,9 +267,9 @@ JavaMod incorporates modified versions of the following libraries:
* FIX: MP3 info panel: Label "Duration" is "Bit Rate"
* FIX: Detailed progress bar while export did not restart properly
* FIX: Exported MP3, FLAC, WAV,... in chunks
-> did not stop exactly at end position but at end of chunk
-> MP3: counting samples now, recalculating milliseconds from that
(previously added milliseconds send to buffer, which is not accurate)
* did not stop exactly at end position but at end of chunk
* MP3: counting samples now, recalculating milliseconds from that
(previously added milliseconds send to buffer, which is not accurate)
* FIX: Export file name generation allowed illegal characters
* UNFIX FIX: pattern break with row index stays in last pattern now, but only if
"ignore loop" is not checked
Expand Down
49 changes: 33 additions & 16 deletions source/de/quippy/javamod/main/gui/MainForm.java
Original file line number Diff line number Diff line change
Expand Up @@ -694,8 +694,8 @@ public void error(String message, Throwable ex)

setName(WINDOW_NAME);
setTitle(WINDOW_TITLE);
getTrayIcon().setToolTip(WINDOW_TITLE);

setTrayIconToolTip(WINDOW_TITLE);
setIconImages(getWindowIconImages(DEFAULTWINDOWICONPATH));

setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
Expand Down Expand Up @@ -1559,9 +1559,13 @@ private void doDeIconify()
}
}
}
/**
*
* @since 07.02.2012
*/
private TrayIcon getTrayIcon()
{
if (javaModTrayIcon==null)
if (javaModTrayIcon==null && SystemTray.isSupported())
{
final java.net.URL iconURL = MainForm.class.getResource(DEFAULTTRAYICONPATH);
if (iconURL!=null)
Expand Down Expand Up @@ -1597,28 +1601,41 @@ public void mouseClicked(MouseEvent e)
}
return javaModTrayIcon;
}
/**
* @since 12.12.2023
* @param newToolTip
*/
private void setTrayIconToolTip(final String newToolTip)
{
if (SystemTray.isSupported())
{
final TrayIcon trayIcon = getTrayIcon();
if (trayIcon!=null) trayIcon.setToolTip(newToolTip);
}
}
/**
*
* @since 07.02.2012
*/
private void setSystemTray()
{
// Check the SystemTray is supported
if (SystemTray.isSupported())
try
{
final SystemTray tray = SystemTray.getSystemTray();
try
// Check the SystemTray is supported
if (SystemTray.isSupported())
{
tray.remove(getTrayIcon());
if (useSystemTray)
final SystemTray tray = SystemTray.getSystemTray();
final TrayIcon trayIcon = getTrayIcon();
if (tray!=null && trayIcon!=null)
{
tray.add(getTrayIcon());
tray.remove(trayIcon);
if (useSystemTray) tray.add(trayIcon);
}
}
catch (AWTException e)
{
Log.error("TrayIcon could not be added.", e);
}
}
catch (AWTException e)
{
Log.error("TrayIcon could not be added.", e);
}
}
/**
Expand Down Expand Up @@ -2327,7 +2344,7 @@ public void multimediaContainerEventOccured(MultimediaContainerEvent event)
else
if (event.getType() == MultimediaContainerEvent.SONG_NAME_CHANGED_OLD_INVALID)
getLEDScrollPanel().setScrollTextTo(event.getEvent().toString() + Helpers.SCROLLY_BLANKS);
getTrayIcon().setToolTip(event.getEvent().toString());
setTrayIconToolTip(event.getEvent().toString());
}
/**
* @param thread
Expand Down Expand Up @@ -3033,7 +3050,7 @@ private boolean loadMultimediaFile(PlayListEntry playListEntry)
{
currentContainer = newContainer;
getLEDScrollPanel().setScrollTextTo(currentContainer.getSongName() + Helpers.SCROLLY_BLANKS);
getTrayIcon().setToolTip(currentContainer.getSongName());
setTrayIconToolTip(currentContainer.getSongName());
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions source/de/quippy/javamod/main/gui/XmasScreenConfigPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public void itemStateChanged(ItemEvent e)
if (e.getStateChange()==ItemEvent.SELECTED || e.getStateChange()==ItemEvent.DESELECTED)
{
final boolean isEnabled = getXmasEnabledCheckBox().isSelected();
getTransparentJFrame().setVisible(isEnabled);
getTransparentJWindow().setVisible(isEnabled);
if (isEnabled) startThread(); // else: do not stop the thread - that cannot be undone
}
}
Expand Down Expand Up @@ -224,7 +224,7 @@ public void stateChanged(ChangeEvent e)
}
return updateFPSSelector;
}
private JWindow getTransparentJFrame()
private JWindow getTransparentJWindow()
{
// Examples use always a java.awt.Window for this. That basically does work.
// But whatever the difference of a JWindow to a Window is, a Window
Expand Down Expand Up @@ -256,7 +256,7 @@ private XmasDecorationPanel getXmasDecorationPanel()
xmasDecorationPanel.setBorder(BorderFactory.createEmptyBorder());
xmasDecorationPanel.setOpaque(false);
xmasDecorationPanel.setBackground(new Color(0, true));
final Dimension d = getTransparentJFrame().getSize();
final Dimension d = getTransparentJWindow().getSize();
xmasDecorationPanel.setSize(d);
}
return xmasDecorationPanel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ protected synchronized Image getDoubleBuffer(final int myWidth, final int myHeig
g2d.setColor(new Color(0, true));
g2d.setComposite(AlphaComposite.Clear);
g2d.fillRect(0, 0, myWidth, myHeight);
//g2d.clearRect(0, 0, myWidth, myHeight);
}
}
return imageBuffer;
Expand Down
2 changes: 1 addition & 1 deletion source/de/quippy/javamod/system/Helpers.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ private Helpers()
}

/** Version Information */
public static final String VERSION = "V3.7";
public static final String VERSION = "V3.7.1";
public static final String PROGRAM = "Java Mod Player";
public static final String FULLVERSION = PROGRAM+' '+VERSION;
public static final String COPYRIGHT = "© by Daniel Becker since 2006";
Expand Down

0 comments on commit e3f1c8d

Please sign in to comment.