[MPlayer-dev-eng] [patch] gui ignores mplayer volume option
Stephen Sheldon
sfsheldo at gmail.com
Tue Jul 22 21:44:19 CEST 2014
On 7/19/2014 3:51 PM, Ingo Brückl wrote:
> The Windows GUI doesn't regard the skin defaults for volume, balance
> and movie position. Please file a trac bug report.
> Ingo
Here is a patch for the windows GUI to use the skin defaults for volume
and balance. I am still thinking about movie position.
-------------- next part --------------
Index: gui/win32/gui.c
===================================================================
--- gui/win32/gui.c (revision 37241)
+++ gui/win32/gui.c (working copy)
@@ -204,6 +204,21 @@
MessageBox(hWnd, about_msg, acp(MSGTR_GUI_AboutMPlayer), MB_OK);
}
+static float getWidgetValue(gui_t *mygui, int event)
+{
+ unsigned int i;
+ if (mygui == NULL || mygui->skin == NULL || mygui->skin->widgets == NULL)
+ return 0.0F;
+
+ for (i=0; i<mygui->skin->widgetcount; i++)
+ {
+ if (mygui->skin->widgets[i]->msg == event)
+ return (mygui->skin->widgets[i]->value);
+ }
+ return 0.0F;
+
+}
+
static image *get_drawground(HWND hwnd)
{
gui_t * gui = (gui_t *) GetWindowLongPtr(hwnd, GWLP_USERDATA);
@@ -1653,6 +1668,10 @@
/* register the systray icon */
Shell_NotifyIcon(NIM_ADD, &nid);
+ /* get some info from the skin */
+ guiInfo.Volume = getWidgetValue(gui, evSetVolume);
+ guiInfo.Balance = getWidgetValue(gui, evSetBalance);
+
/* load all the window images */
window_render(gui, gui->mainwindow, hdc, priv, desc, binfo);
Index: gui/win32/interface.c
===================================================================
--- gui/win32/interface.c (revision 37241)
+++ gui/win32/interface.c (working copy)
@@ -636,6 +636,8 @@
guiInfo.AudioChannels = 0;
guiInfo.AudioPassthrough = FALSE;
}
+ guiSetEvent(evSetVolume);
+ guiSetEvent(evSetBalance);
if(IsWindowVisible(mygui->videowindow) && !guiInfo.VideoWindow)
ShowWindow(mygui->videowindow, SW_HIDE);
break;
More information about the MPlayer-dev-eng
mailing list