# HG changeset patch # User vayne # Date 1172256523 0 # Node ID 9f5657a1dbf702691420c780a1d311baaeeb27aa # Parent 68125c62b6eb1663de372abc7af5f3eecd21c0d7 Gui compilation fixes diff -r 68125c62b6eb -r 9f5657a1dbf7 Gui/win32/gui.c --- a/Gui/win32/gui.c Fri Feb 23 16:30:10 2007 +0000 +++ b/Gui/win32/gui.c Fri Feb 23 18:48:43 2007 +0000 @@ -61,6 +61,8 @@ DWORD oldtime; NOTIFYICONDATA nid; int console_state = 0; +play_tree_t *playtree = NULL; +m_config_t* mconfig = NULL; static HBRUSH colorbrush = NULL; //Handle to colorkey brush static COLORREF windowcolor = RGB(255,0,255); //Windowcolor == colorkey diff -r 68125c62b6eb -r 9f5657a1dbf7 Gui/win32/interface.c --- a/Gui/win32/interface.c Fri Feb 23 16:30:10 2007 +0000 +++ b/Gui/win32/interface.c Fri Feb 23 18:48:43 2007 +0000 @@ -35,6 +35,7 @@ #include #include #include +#include #include "gui.h" #include "dialogs.h" #include "wincfg.h" @@ -43,13 +44,10 @@ #endif extern m_obj_settings_t *vf_settings; -extern vo_functions_t *video_out; -extern ao_functions_t *audio_out; extern void exit_player(const char *how); extern char *filename; extern int abs_seek_pos; extern float rel_seek_secs; -extern mixer_t mixer; extern int audio_id; extern int video_id; extern int dvdsub_id; @@ -69,6 +67,9 @@ static int update_subwindow(void); static RECT old_rect; static DWORD style; +ao_functions_t *audio_out = NULL; +vo_functions_t *video_out = NULL; +mixer_t *mixer = NULL; /* test for playlist files, no need to specify -playlist on the commandline. * add any conceivable playlist extensions here. @@ -144,6 +145,9 @@ /* this function gets called by the gui to update mplayer */ static void guiSetEvent(int event) { + if(guiIntfStruct.mpcontext) + mixer = mpctx_get_mixer(guiIntfStruct.mpcontext); + switch(event) { case evPlay: @@ -245,22 +249,22 @@ break; if (guiIntfStruct.Balance == 50.0f) - mixer_setvolume(&mixer, guiIntfStruct.Volume, guiIntfStruct.Volume); + mixer_setvolume(mixer, guiIntfStruct.Volume, guiIntfStruct.Volume); l = guiIntfStruct.Volume * ((100.0f - guiIntfStruct.Balance) / 50.0f); r = guiIntfStruct.Volume * ((guiIntfStruct.Balance) / 50.0f); if (l > guiIntfStruct.Volume) l=guiIntfStruct.Volume; if (r > guiIntfStruct.Volume) r=guiIntfStruct.Volume; - mixer_setvolume(&mixer, l, r); + mixer_setvolume(mixer, l, r); /* Check for balance support on mixer - there is a better way ?? */ if (r != l) { - mixer_getvolume(&mixer, &l, &r); + mixer_getvolume(mixer, &l, &r); if (r == l) { mp_msg(MSGT_GPLAYER, MSGL_V, "[GUI] Mixer doesn't support balanced audio\n"); - mixer_setvolume(&mixer, guiIntfStruct.Volume, guiIntfStruct.Volume); + mixer_setvolume(mixer, guiIntfStruct.Volume, guiIntfStruct.Volume); guiIntfStruct.Balance = 50.0f; } } @@ -490,6 +494,13 @@ #endif if(!mygui || !mygui->skin) return 0; + if(guiIntfStruct.mpcontext) + { + audio_out = mpctx_get_audio_out(guiIntfStruct.mpcontext); + video_out = mpctx_get_video_out(guiIntfStruct.mpcontext); + mixer = mpctx_get_mixer(guiIntfStruct.mpcontext); + } + switch (type) { case guiSetFileFormat: @@ -730,7 +741,7 @@ /* Some audio_out drivers do not support balance e.g. dsound */ /* FIXME this algo is not correct */ float l, r; - mixer_getvolume(&mixer, &l, &r); + mixer_getvolume(mixer, &l, &r); guiIntfStruct.Volume = (r > l ? r : l); /* max(r,l) */ if (r != l) guiIntfStruct.Balance = ((r-l) + 100.0f) * 0.5f;