[MPlayer-cvslog] r37990 - in trunk: Changelog DOCS/xml/de/skin.xml DOCS/xml/en/skin.xml gui/interface.c gui/interface.h gui/ui/render.c gui/win32/widgetrender.c
ib
subversion at mplayerhq.hu
Mon Oct 9 17:56:14 EEST 2017
Author: ib
Date: Mon Oct 9 17:56:14 2017
New Revision: 37990
Log:
Add symbol character 'g' for dynamic label variable $g.
It indicates that ReplayGain is currently active and
that playback volume is adjusted.
Additionally, update the documentation.
Modified:
trunk/Changelog
trunk/gui/interface.c
trunk/gui/interface.h
trunk/gui/ui/render.c
trunk/gui/win32/widgetrender.c
Changes in other areas also in this revision:
Modified:
trunk/DOCS/xml/de/skin.xml
trunk/DOCS/xml/en/skin.xml
Modified: trunk/Changelog
==============================================================================
--- trunk/Changelog Mon Oct 9 17:46:35 2017 (r37989)
+++ trunk/Changelog Mon Oct 9 17:56:14 2017 (r37990)
@@ -31,6 +31,7 @@ MPlayer
* Dramatic speedup of scanning font description files
* Playback improvements for cue sheet playlists
* Implementation of audio playback utilizing ReplayGain data
+ * New symbol character 'g' and new dynamic label variable $g
1.3.0: "worksforme" February 16, 2016
Modified: trunk/gui/interface.c
==============================================================================
--- trunk/gui/interface.c Mon Oct 9 17:46:35 2017 (r37989)
+++ trunk/gui/interface.c Mon Oct 9 17:56:14 2017 (r37990)
@@ -917,6 +917,7 @@ int gui(int what, void *data)
if (demux_control(mpctx_get_demuxer(guiInfo.mpcontext), DEMUXER_CTRL_GET_REPLAY_GAIN, &replay_gain) == DEMUXER_CTRL_OK) {
guiInfo.LastVolume = guiInfo.Volume;
guiInfo.Volume = constrain(100.0 + (replay_gain / 10.0 + gtkReplayGainAdjustment) / 0.5);
+ guiInfo.ReplayGainVolume = -1.0f;
}
}
@@ -970,6 +971,9 @@ int gui(int what, void *data)
mixer_getvolume(mixer, &l, &r);
guiInfo.Volume = FFMAX(l, r);
+ if (guiInfo.LastVolume >= 0.0f && guiInfo.ReplayGainVolume < 0.0f)
+ guiInfo.ReplayGainVolume = guiInfo.Volume;
+
mixer_getbalance(mixer, &b);
guiInfo.Balance = (b + 1.0) * 50.0; // transform -1..1 to 0..100
Modified: trunk/gui/interface.h
==============================================================================
--- trunk/gui/interface.h Mon Oct 9 17:46:35 2017 (r37989)
+++ trunk/gui/interface.h Mon Oct 9 17:56:14 2017 (r37990)
@@ -141,6 +141,7 @@ typedef struct {
float Balance;
float LastVolume;
+ float ReplayGainVolume;
int MediumChanged; // public, read access by MPlayer
int PlaylistNext;
Modified: trunk/gui/ui/render.c
==============================================================================
--- trunk/gui/ui/render.c Mon Oct 9 17:46:35 2017 (r37989)
+++ trunk/gui/ui/render.c Mon Oct 9 17:56:14 2017 (r37990)
@@ -268,6 +268,11 @@ MMMM_SS: snprintf(trans, sizeof(t
av_strlcat(translation, trans, sizeof(translation));
break;
+ case 'g':
+ if (guiInfo.LastVolume >= 0.0f && guiInfo.Volume == guiInfo.ReplayGainVolume)
+ av_strlcat(translation, "g", sizeof(translation));
+ break;
+
case 'o':
TranslateFilename(0, trans, sizeof(trans));
av_strlcat(translation, trans, sizeof(translation));
Modified: trunk/gui/win32/widgetrender.c
==============================================================================
--- trunk/gui/win32/widgetrender.c Mon Oct 9 17:46:35 2017 (r37989)
+++ trunk/gui/win32/widgetrender.c Mon Oct 9 17:56:14 2017 (r37990)
@@ -278,6 +278,8 @@ static char *generatetextfromlabel(widge
stringreplace(text, "$f", acp(TranslateFilename(1, tmp, sizeof(tmp))));
stringreplace(text, "$F", acp(TranslateFilename(2, tmp, sizeof(tmp))));
+ stringreplace(text, "$g", "");
+
return text;
}
More information about the MPlayer-cvslog
mailing list