Mercurial > mplayer.hg
comparison gui/win32/gui.c @ 37151:c63629427fde
Apply skin defaults in Win32 GUI.
The starting defaults for volume, balance and movie position are defined
in the skin used by the GUI. So far, the Win32 GUI has completely ignored
these.
Based on a patch by Stephen Sheldon, sfsheldo gmail com.
author | ib |
---|---|
date | Wed, 06 Aug 2014 16:35:38 +0000 |
parents | 84c93a60ead3 |
children |
comparison
equal
deleted
inserted
replaced
37150:67efc9d84be2 | 37151:c63629427fde |
---|---|
233 if(!gui) return -1; | 233 if(!gui) return -1; |
234 for(i=0; i<gui->window_priv_count; i++) | 234 for(i=0; i<gui->window_priv_count; i++) |
235 if(gui->window_priv[i]->hwnd == hwnd) | 235 if(gui->window_priv[i]->hwnd == hwnd) |
236 return gui->window_priv[i]->type; | 236 return gui->window_priv[i]->type; |
237 return -1; | 237 return -1; |
238 } | |
239 | |
240 static void get_widgetvalue(skin_t *skin, int event, float *value) | |
241 { | |
242 unsigned int i; | |
243 | |
244 if (!skin) return; | |
245 | |
246 for (i=0; i<skin->widgetcount; i++) | |
247 if (skin->widgets[i]->msg == event) | |
248 { | |
249 *value = skin->widgets[i]->value; | |
250 return; | |
251 } | |
238 } | 252 } |
239 | 253 |
240 static void uninit(gui_t *gui) | 254 static void uninit(gui_t *gui) |
241 { | 255 { |
242 if(gui->skin) destroy_window(gui); | 256 if(gui->skin) destroy_window(gui); |
1657 window_render(gui, gui->mainwindow, hdc, priv, desc, binfo); | 1671 window_render(gui, gui->mainwindow, hdc, priv, desc, binfo); |
1658 | 1672 |
1659 /* enable drag and drop support */ | 1673 /* enable drag and drop support */ |
1660 DragAcceptFiles(gui->mainwindow, TRUE); | 1674 DragAcceptFiles(gui->mainwindow, TRUE); |
1661 | 1675 |
1676 /* set defaults */ | |
1677 gui->default_volume = 50.0f; | |
1678 gui->default_balance = 50.0f; | |
1679 | |
1680 /* get defaults from skin */ | |
1681 get_widgetvalue(gui->skin, evSetVolume, &gui->default_volume); | |
1682 get_widgetvalue(gui->skin, evSetBalance, &gui->default_balance); | |
1683 get_widgetvalue(gui->skin, evSetMoviePosition, &guiInfo.Position); | |
1684 | |
1685 if (guiInfo.Position) gui->playercontrol(evSetMoviePosition); | |
1686 | |
1662 updatedisplay(gui, gui->mainwindow); | 1687 updatedisplay(gui, gui->mainwindow); |
1663 | 1688 |
1664 /* display */ | 1689 /* display */ |
1665 ShowWindow(gui->mainwindow, SW_SHOW); | 1690 ShowWindow(gui->mainwindow, SW_SHOW); |
1666 UpdateWindow(gui->mainwindow); | 1691 UpdateWindow(gui->mainwindow); |