Mercurial > mplayer.hg
changeset 22308:9f5657a1dbf7
Gui compilation fixes
author | vayne |
---|---|
date | Fri, 23 Feb 2007 18:48:43 +0000 |
parents | 68125c62b6eb |
children | 50de9c8cdfd7 |
files | Gui/win32/gui.c Gui/win32/interface.c |
diffstat | 2 files changed, 21 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- 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
--- 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 <input/input.h> #include <libvo/video_out.h> #include <libao2/audio_out.h> +#include <access_mpcontext.h> #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;