Commit d9aff9ce authored by Olivier Teulière's avatar Olivier Teulière

* Added sound volume management and changed a bit the menus

 * Added audio channels selection, but it's currently disabled since
   it's quite buggy :)
parent 2d8e1a61
...@@ -319,6 +319,44 @@ void __fastcall TMainFrameDlg::EjectActionExecute( TObject *Sender ) ...@@ -319,6 +319,44 @@ void __fastcall TMainFrameDlg::EjectActionExecute( TObject *Sender )
} }
} }
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
void __fastcall TMainFrameDlg::VolumeUpActionExecute( TObject *Sender )
{
aout_instance_t *p_aout;
p_aout = (aout_instance_t *)vlc_object_find( p_intf, VLC_OBJECT_AOUT,
FIND_ANYWHERE );
if ( p_aout != NULL )
{
aout_VolumeUp( p_aout, 1, NULL );
vlc_object_release( (vlc_object_t *)p_aout );
}
}
//---------------------------------------------------------------------------
void __fastcall TMainFrameDlg::VolumeDownActionExecute( TObject *Sender )
{
aout_instance_t *p_aout;
p_aout = (aout_instance_t *)vlc_object_find( p_intf, VLC_OBJECT_AOUT,
FIND_ANYWHERE );
if ( p_aout != NULL )
{
aout_VolumeDown( p_aout, 1, NULL );
vlc_object_release( (vlc_object_t *)p_aout );
}
}
//---------------------------------------------------------------------------
void __fastcall TMainFrameDlg::MuteActionExecute( TObject *Sender )
{
aout_instance_t *p_aout;
p_aout = (aout_instance_t *)vlc_object_find( p_intf, VLC_OBJECT_AOUT,
FIND_ANYWHERE );
if ( p_aout != NULL )
{
aout_VolumeMute( p_aout, NULL );
vlc_object_release( (vlc_object_t *)p_aout );
// MenuMute->Checked = ! MenuMute->Checked;
}
}
//---------------------------------------------------------------------------
/***************************************************************************** /*****************************************************************************
...@@ -375,7 +413,7 @@ void __fastcall TMainFrameDlg::PopupCloseClick( TObject *Sender ) ...@@ -375,7 +413,7 @@ void __fastcall TMainFrameDlg::PopupCloseClick( TObject *Sender )
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void __fastcall TMainFrameDlg::PopupJumpClick( TObject *Sender ) void __fastcall TMainFrameDlg::PopupJumpClick( TObject *Sender )
{ {
// TODO /* TODO */
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
...@@ -590,10 +628,10 @@ void __fastcall TMainFrameDlg::ModeManage() ...@@ -590,10 +628,10 @@ void __fastcall TMainFrameDlg::ModeManage()
MenuProgram->Enabled = false; MenuProgram->Enabled = false;
MenuTitle->Enabled = false; MenuTitle->Enabled = false;
MenuChapter->Enabled = false; MenuChapter->Enabled = false;
MenuAudio->Enabled = false; MenuLanguage->Enabled = false;
MenuSubtitles->Enabled = false; MenuSubtitles->Enabled = false;
PopupNavigation->Enabled = false; PopupNavigation->Enabled = false;
PopupAudio->Enabled = false; PopupLanguage->Enabled = false;
PopupSubtitles->Enabled = false; PopupSubtitles->Enabled = false;
} }
......
...@@ -256,7 +256,7 @@ object MainFrameDlg: TMainFrameDlg ...@@ -256,7 +256,7 @@ object MainFrameDlg: TMainFrameDlg
end end
object StatusBar: TStatusBar object StatusBar: TStatusBar
Left = 0 Left = 0
Top = 238 Top = 241
Width = 533 Width = 533
Height = 19 Height = 19
Panels = <> Panels = <>
...@@ -464,14 +464,6 @@ object MainFrameDlg: TMainFrameDlg ...@@ -464,14 +464,6 @@ object MainFrameDlg: TMainFrameDlg
Caption = '-' Caption = '-'
Visible = False Visible = False
end end
object MenuEjectDisc: TMenuItem
Tag = 3
Action = EjectAction
Caption = '&Eject disc'
end
object N1: TMenuItem
Caption = '-'
end
object MenuExit: TMenuItem object MenuExit: TMenuItem
Tag = 3 Tag = 3
Action = ExitAction Action = ExitAction
...@@ -486,16 +478,66 @@ object MainFrameDlg: TMainFrameDlg ...@@ -486,16 +478,66 @@ object MainFrameDlg: TMainFrameDlg
Hint = 'Hide the main interface window' Hint = 'Hide the main interface window'
OnClick = MenuHideinterfaceClick OnClick = MenuHideinterfaceClick
end end
object N3: TMenuItem
Caption = '-'
end
object MenuPlaylist: TMenuItem
Tag = 3
Action = PlaylistAction
Caption = '&Playlist...'
end
object MenuMessages: TMenuItem
Tag = 3
Action = MessagesAction
end
object MenuPreferences: TMenuItem
Tag = 3
Action = PreferencesAction
end
end
object MenuControls: TMenuItem
Tag = 3
Caption = '&Controls'
object MenuADevice: TMenuItem
Tag = 3
Caption = 'Audio device'
Enabled = False
end
object MenuVolumeUp: TMenuItem
Tag = 3
Action = VolumeUpAction
end
object MenuVolumeDown: TMenuItem
Tag = 3
Action = VolumeDownAction
end
object MenuMute: TMenuItem
Action = MuteAction
end
object MenuChannel: TMenuItem
Tag = 3
Caption = 'C&hannels'
Enabled = False
Hint = 'Select audio channel'
end
object N2: TMenuItem
Caption = '-'
end
object MenuVDevice: TMenuItem
Tag = 3
Caption = 'Sc&reen'
Enabled = False
end
object MenuFullscreen: TMenuItem object MenuFullscreen: TMenuItem
Tag = 3 Tag = 3
Action = FullscreenAction Action = FullscreenAction
end end
object N2: TMenuItem object N11: TMenuItem
Caption = '-' Caption = '-'
end end
object MenuProgram: TMenuItem object MenuProgram: TMenuItem
Tag = 3 Tag = 3
Caption = 'Progr&am' Caption = '&Program'
Enabled = False Enabled = False
Hint = 'Select program' Hint = 'Select program'
end end
...@@ -513,29 +555,13 @@ object MainFrameDlg: TMainFrameDlg ...@@ -513,29 +555,13 @@ object MainFrameDlg: TMainFrameDlg
end end
object MenuAngle: TMenuItem object MenuAngle: TMenuItem
Tag = 3 Tag = 3
Caption = 'An&gle' Caption = '&Angle'
Enabled = False Enabled = False
Hint = 'Select angle' Hint = 'Select angle'
end end
object N3: TMenuItem object MenuLanguage: TMenuItem
Caption = '-'
end
object MenuPlaylist: TMenuItem
Tag = 3 Tag = 3
Action = PlaylistAction Caption = '&Language'
Caption = '&Playlist...'
end
object MenuMessages: TMenuItem
Tag = 3
Action = MessagesAction
end
end
object MenuSettings: TMenuItem
Tag = 3
Caption = '&Settings'
object MenuAudio: TMenuItem
Tag = 3
Caption = '&Audio'
Enabled = False Enabled = False
Hint = 'Select audio language' Hint = 'Select audio language'
end end
...@@ -545,13 +571,6 @@ object MainFrameDlg: TMainFrameDlg ...@@ -545,13 +571,6 @@ object MainFrameDlg: TMainFrameDlg
Enabled = False Enabled = False
Hint = 'Select subtitles language' Hint = 'Select subtitles language'
end end
object N4: TMenuItem
Caption = '-'
end
object MenuPreferences: TMenuItem
Tag = 3
Action = PreferencesAction
end
end end
object MenuHelp: TMenuItem object MenuHelp: TMenuItem
Tag = 3 Tag = 3
...@@ -2299,16 +2318,17 @@ object MainFrameDlg: TMainFrameDlg ...@@ -2299,16 +2318,17 @@ object MainFrameDlg: TMainFrameDlg
end end
object PopupMenuMain: TPopupMenu object PopupMenuMain: TPopupMenu
AutoPopup = False AutoPopup = False
TrackButton = tbLeftButton
Left = 72 Left = 72
Top = 208 Top = 208
object PopupClose: TMenuItem object PopupClose: TMenuItem
Tag = 3 Tag = 3
Caption = '&Close this popup' Caption = 'Close this popup'
OnClick = PopupCloseClick OnClick = PopupCloseClick
end end
object PopupToggleInterface: TMenuItem object PopupToggleInterface: TMenuItem
Tag = 3 Tag = 3
Caption = '&Toggle interface' Caption = 'Show interface'
OnClick = PopupToggleInterfaceClick OnClick = PopupToggleInterfaceClick
end end
object N9: TMenuItem object N9: TMenuItem
...@@ -2363,9 +2383,38 @@ object MainFrameDlg: TMainFrameDlg ...@@ -2363,9 +2383,38 @@ object MainFrameDlg: TMainFrameDlg
object PopupFullscreen: TMenuItem object PopupFullscreen: TMenuItem
Tag = 3 Tag = 3
Action = FullscreenAction Action = FullscreenAction
ShortCut = 70
end end
end end
object PopupAudioSettings: TMenuItem
Tag = 3
Caption = 'Audio settings'
object PopupADevice: TMenuItem
Tag = 3
Caption = 'Device'
end
object VolumeUp1: TMenuItem
Tag = 3
Action = VolumeUpAction
end
object VolumeDown1: TMenuItem
Tag = 3
Action = VolumeDownAction
end
object Mute1: TMenuItem
Tag = 3
Action = MuteAction
end
object PopupChannel: TMenuItem
Tag = 3
Caption = 'Channels'
end
end
object PopupVDevice: TMenuItem
Caption = 'Screen'
end
object N1: TMenuItem
Caption = '-'
end
object PopupNavigation: TMenuItem object PopupNavigation: TMenuItem
Tag = 3 Tag = 3
Caption = 'Navigation' Caption = 'Navigation'
...@@ -2374,9 +2423,9 @@ object MainFrameDlg: TMainFrameDlg ...@@ -2374,9 +2423,9 @@ object MainFrameDlg: TMainFrameDlg
Tag = 3 Tag = 3
Caption = 'Program' Caption = 'Program'
end end
object PopupAudio: TMenuItem object PopupLanguage: TMenuItem
Tag = 3 Tag = 3
Caption = 'Audio' Caption = 'Language'
end end
object PopupSubtitles: TMenuItem object PopupSubtitles: TMenuItem
Tag = 3 Tag = 3
...@@ -2553,8 +2602,9 @@ object MainFrameDlg: TMainFrameDlg ...@@ -2553,8 +2602,9 @@ object MainFrameDlg: TMainFrameDlg
object FullscreenAction: TAction object FullscreenAction: TAction
Tag = 3 Tag = 3
Category = 'Control' Category = 'Control'
Caption = 'Fullscreen' Caption = '&Fullscreen'
Hint = 'Toggle fullscreen' Hint = 'Toggle fullscreen'
ShortCut = 70
OnExecute = FullscreenActionExecute OnExecute = FullscreenActionExecute
end end
object PreferencesAction: TAction object PreferencesAction: TAction
...@@ -2607,5 +2657,28 @@ object MainFrameDlg: TMainFrameDlg ...@@ -2607,5 +2657,28 @@ object MainFrameDlg: TMainFrameDlg
Hint = 'Jump to next chapter' Hint = 'Jump to next chapter'
OnExecute = NextChapterActionExecute OnExecute = NextChapterActionExecute
end end
object VolumeUpAction: TAction
Tag = 3
Category = 'Control'
Caption = 'Volume &Up'
Hint = 'Increase the volume'
ShortCut = 16469
OnExecute = VolumeUpActionExecute
end
object VolumeDownAction: TAction
Tag = 3
Category = 'Control'
Caption = 'Volume &Down'
Hint = 'Decrease the volume'
ShortCut = 16452
OnExecute = VolumeDownActionExecute
end
object MuteAction: TAction
Tag = 3
Category = 'Control'
Caption = '&Mute'
Hint = 'Toggle mute'
OnExecute = MuteActionExecute
end
end end
end end
...@@ -70,22 +70,19 @@ __published: // IDE-managed Components ...@@ -70,22 +70,19 @@ __published: // IDE-managed Components
TMenuItem *MenuOpenFile; TMenuItem *MenuOpenFile;
TMenuItem *MenuOpenDisc; TMenuItem *MenuOpenDisc;
TMenuItem *MenuNetworkStream; TMenuItem *MenuNetworkStream;
TMenuItem *N1;
TMenuItem *MenuExit; TMenuItem *MenuExit;
TMenuItem *MenuView; TMenuItem *MenuView;
TMenuItem *MenuHideinterface; TMenuItem *MenuHideinterface;
TMenuItem *MenuFullscreen; TMenuItem *MenuFullscreen;
TMenuItem *N2;
TMenuItem *MenuTitle; TMenuItem *MenuTitle;
TMenuItem *MenuChapter; TMenuItem *MenuChapter;
TMenuItem *MenuAngle; TMenuItem *MenuAngle;
TMenuItem *N3; TMenuItem *N3;
TMenuItem *MenuPlaylist; TMenuItem *MenuPlaylist;
TMenuItem *MenuMessages; TMenuItem *MenuMessages;
TMenuItem *MenuSettings; TMenuItem *MenuControls;
TMenuItem *MenuAudio; TMenuItem *MenuLanguage;
TMenuItem *MenuSubtitles; TMenuItem *MenuSubtitles;
TMenuItem *N4;
TMenuItem *MenuPreferences; TMenuItem *MenuPreferences;
TMenuItem *MenuHelp; TMenuItem *MenuHelp;
TMenuItem *MenuAbout; TMenuItem *MenuAbout;
...@@ -105,7 +102,7 @@ __published: // IDE-managed Components ...@@ -105,7 +102,7 @@ __published: // IDE-managed Components
TMenuItem *PopupJump; TMenuItem *PopupJump;
TMenuItem *PopupNavigation; TMenuItem *PopupNavigation;
TMenuItem *PopupProgram; TMenuItem *PopupProgram;
TMenuItem *PopupAudio; TMenuItem *PopupLanguage;
TMenuItem *PopupSubtitles; TMenuItem *PopupSubtitles;
TMenuItem *PopupFile; TMenuItem *PopupFile;
TMenuItem *PopupPlaylist; TMenuItem *PopupPlaylist;
...@@ -120,7 +117,6 @@ __published: // IDE-managed Components ...@@ -120,7 +117,6 @@ __published: // IDE-managed Components
TLabel *LabelServer; TLabel *LabelServer;
TGroupBox *GroupBoxDisc; TGroupBox *GroupBoxDisc;
TMenuItem *N8; TMenuItem *N8;
TMenuItem *MenuEjectDisc;
TMenuItem *MenuProgram; TMenuItem *MenuProgram;
TLabel *LabelDisc; TLabel *LabelDisc;
TLabel *LabelTitle; TLabel *LabelTitle;
...@@ -169,6 +165,25 @@ __published: // IDE-managed Components ...@@ -169,6 +165,25 @@ __published: // IDE-managed Components
TAction *NextTitleAction; TAction *NextTitleAction;
TAction *PrevChapterAction; TAction *PrevChapterAction;
TAction *NextChapterAction; TAction *NextChapterAction;
TMenuItem *N11;
TMenuItem *MenuChannel;
TMenuItem *PopupChannel;
TMenuItem *MenuVolumeUp;
TMenuItem *MenuVolumeDown;
TMenuItem *MenuMute;
TAction *VolumeUpAction;
TAction *VolumeDownAction;
TAction *MuteAction;
TMenuItem *MenuADevice;
TMenuItem *PopupAudioSettings;
TMenuItem *PopupADevice;
TMenuItem *VolumeDown1;
TMenuItem *VolumeUp1;
TMenuItem *Mute1;
TMenuItem *MenuVDevice;
TMenuItem *N2;
TMenuItem *N1;
TMenuItem *PopupVDevice;
void __fastcall TimerManageTimer( TObject *Sender ); void __fastcall TimerManageTimer( TObject *Sender );
void __fastcall TrackBarChange( TObject *Sender ); void __fastcall TrackBarChange( TObject *Sender );
void __fastcall FormClose( TObject *Sender, TCloseAction &Action ); void __fastcall FormClose( TObject *Sender, TCloseAction &Action );
...@@ -180,21 +195,24 @@ __published: // IDE-managed Components ...@@ -180,21 +195,24 @@ __published: // IDE-managed Components
void __fastcall OpenFileActionExecute( TObject *Sender ); void __fastcall OpenFileActionExecute( TObject *Sender );
void __fastcall OpenDiscActionExecute( TObject *Sender ); void __fastcall OpenDiscActionExecute( TObject *Sender );
void __fastcall NetworkStreamActionExecute( TObject *Sender ); void __fastcall NetworkStreamActionExecute( TObject *Sender );
void __fastcall ExitActionExecute( TObject *Sender );
void __fastcall PlaylistActionExecute( TObject *Sender );
void __fastcall MessagesActionExecute( TObject *Sender );
void __fastcall AboutActionExecute( TObject *Sender );
void __fastcall BackActionExecute( TObject *Sender ); void __fastcall BackActionExecute( TObject *Sender );
void __fastcall PlayActionExecute( TObject *Sender ); void __fastcall PlayActionExecute( TObject *Sender );
void __fastcall PauseActionExecute( TObject *Sender ); void __fastcall PauseActionExecute( TObject *Sender );
void __fastcall StopActionExecute( TObject *Sender ); void __fastcall StopActionExecute( TObject *Sender );
void __fastcall SlowActionExecute( TObject *Sender ); void __fastcall SlowActionExecute( TObject *Sender );
void __fastcall FastActionExecute( TObject *Sender ); void __fastcall FastActionExecute( TObject *Sender );
void __fastcall EjectActionExecute( TObject *Sender );
void __fastcall PlaylistActionExecute( TObject *Sender );
void __fastcall PreviousActionExecute( TObject *Sender ); void __fastcall PreviousActionExecute( TObject *Sender );
void __fastcall NextActionExecute( TObject *Sender ); void __fastcall NextActionExecute( TObject *Sender );
void __fastcall EjectActionExecute( TObject *Sender );
void __fastcall VolumeUpActionExecute( TObject *Sender );
void __fastcall VolumeDownActionExecute( TObject *Sender );
void __fastcall MuteActionExecute( TObject *Sender );
void __fastcall FullscreenActionExecute( TObject *Sender ); void __fastcall FullscreenActionExecute( TObject *Sender );
void __fastcall PreferencesActionExecute( TObject *Sender ); void __fastcall PreferencesActionExecute( TObject *Sender );
void __fastcall MessagesActionExecute( TObject *Sender );
void __fastcall AboutActionExecute( TObject *Sender );
void __fastcall ExitActionExecute( TObject *Sender );
void __fastcall PrevTitleActionExecute( TObject *Sender ); void __fastcall PrevTitleActionExecute( TObject *Sender );
void __fastcall NextTitleActionExecute( TObject *Sender ); void __fastcall NextTitleActionExecute( TObject *Sender );
void __fastcall PrevChapterActionExecute( TObject *Sender ); void __fastcall PrevChapterActionExecute( TObject *Sender );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* menu.cpp: functions to handle menu items * menu.cpp: functions to handle menu items
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: menu.cpp,v 1.2 2002/12/13 03:52:58 videolan Exp $ * $Id: menu.cpp,v 1.3 2003/01/08 02:16:09 ipkiss Exp $
* *
* Authors: Olivier Teuliere <ipkiss@via.ecp.fr> * Authors: Olivier Teuliere <ipkiss@via.ecp.fr>
* *
...@@ -31,23 +31,72 @@ ...@@ -31,23 +31,72 @@
/***************************************************************************** /*****************************************************************************
* TMenusGen::*Click: callbacks for the menuitems * TMenusGen::*Click: callbacks for the menuitems
****************************************************************************
* These functions need to be in a class, or we won't be able to pass them
* as arguments (since TNotifyEvent uses __closure)
****************************************************************************/ ****************************************************************************/
/* /*
* Variables
*/
/* variables of the audio output */
void __fastcall TMenusGen::AoutVarClick( TObject *Sender )
{
TMenuItem * Item = (TMenuItem *)Sender;
vlc_object_t * p_aout;
p_aout = (vlc_object_t *)vlc_object_find( p_intf, VLC_OBJECT_AOUT,
FIND_ANYWHERE );
if( p_aout == NULL )
{
msg_Warn( p_intf, "cannot set variable (%s)", Item->Caption.c_str() );
return;
}
if( Item->Parent == MenuADevice || Item->Parent == PopupADevice )
{
VarChange( p_aout, "audio-device", MenuADevice, PopupADevice, Item );
}
else if( Item->Parent == MenuChannel || Item->Parent == PopupChannel )
{
VarChange( p_aout, "audio-channels", MenuChannel, PopupChannel, Item );
}
vlc_object_release( p_aout );
}
/* variables of the video output */
void __fastcall TMenusGen::VoutVarClick( TObject *Sender )
{
TMenuItem * Item = (TMenuItem *)Sender;
vlc_object_t * p_vout;
p_vout = (vlc_object_t *)vlc_object_find( p_intf, VLC_OBJECT_VOUT,
FIND_ANYWHERE );
if( p_vout == NULL )
{
msg_Warn( p_intf, "cannot set variable (%s)", Item->Caption.c_str() );
return;
}
if( Item->Parent == MenuVDevice || Item->Parent == PopupVDevice )
{
VarChange( p_vout, "video-device", MenuVDevice, PopupVDevice, Item );
}
vlc_object_release( p_vout );
}
/*
* Audio * Audio
*/ */
void __fastcall TMenusGen::MenuAudioClick( TObject *Sender ) void __fastcall TMenusGen::MenuLanguageClick( TObject *Sender )
{ {
LangChange( MenuAudio, (TMenuItem *)Sender, PopupAudio, AUDIO_ES ); LangChange( MenuLanguage, (TMenuItem *)Sender, PopupLanguage, AUDIO_ES );
} }
void __fastcall TMenusGen::PopupAudioClick( TObject *Sender ) void __fastcall TMenusGen::PopupLanguageClick( TObject *Sender )
{ {
LangChange( PopupAudio, (TMenuItem *)Sender, MenuAudio, AUDIO_ES ); LangChange( PopupLanguage, (TMenuItem *)Sender, MenuLanguage, AUDIO_ES );
} }
/* /*
...@@ -56,14 +105,12 @@ void __fastcall TMenusGen::PopupAudioClick( TObject *Sender ) ...@@ -56,14 +105,12 @@ void __fastcall TMenusGen::PopupAudioClick( TObject *Sender )
void __fastcall TMenusGen::MenuSubtitleClick( TObject *Sender ) void __fastcall TMenusGen::MenuSubtitleClick( TObject *Sender )
{ {
LangChange( MenuSubtitles, (TMenuItem *)Sender, LangChange( MenuSubtitles, (TMenuItem *)Sender, PopupSubtitles, SPU_ES );
PopupSubtitles, SPU_ES );
} }
void __fastcall TMenusGen::PopupSubtitleClick( TObject *Sender ) void __fastcall TMenusGen::PopupSubtitleClick( TObject *Sender )
{ {
LangChange( PopupSubtitles, (TMenuItem *)Sender, LangChange( PopupSubtitles, (TMenuItem *)Sender, MenuSubtitles, SPU_ES );
MenuSubtitles, SPU_ES );
} }
/* /*
...@@ -170,12 +217,18 @@ __fastcall TMenusGen::TMenusGen( intf_thread_t *_p_intf ) : TObject() ...@@ -170,12 +217,18 @@ __fastcall TMenusGen::TMenusGen( intf_thread_t *_p_intf ) : TObject()
TMainFrameDlg * p_window = p_intf->p_sys->p_window; TMainFrameDlg * p_window = p_intf->p_sys->p_window;
if( p_window == NULL ) if( p_window == NULL )
{ {
msg_Err( p_intf, "Main window wasn't created, expect problems..." ); msg_Warn( p_intf, "Main window wasn't created, expect problems..." );
return; return;
} }
MenuAudio = p_window->MenuAudio; MenuChannel = p_window->MenuChannel;
PopupAudio = p_window->PopupAudio; PopupChannel = p_window->PopupChannel;
MenuADevice = p_window->MenuADevice;
PopupADevice = p_window->PopupADevice;
MenuVDevice = p_window->MenuVDevice;
PopupVDevice = p_window->PopupVDevice;
MenuLanguage = p_window->MenuLanguage;
PopupLanguage = p_window->PopupLanguage;
MenuSubtitles = p_window->MenuSubtitles; MenuSubtitles = p_window->MenuSubtitles;
PopupSubtitles = p_window->PopupSubtitles; PopupSubtitles = p_window->PopupSubtitles;
MenuProgram = p_window->MenuProgram; MenuProgram = p_window->MenuProgram;
...@@ -185,18 +238,19 @@ __fastcall TMenusGen::TMenusGen( intf_thread_t *_p_intf ) : TObject() ...@@ -185,18 +238,19 @@ __fastcall TMenusGen::TMenusGen( intf_thread_t *_p_intf ) : TObject()
PopupNavigation = p_window->PopupNavigation; PopupNavigation = p_window->PopupNavigation;
} }
void __fastcall TMenusGen::SetupMenus() void __fastcall TMenusGen::SetupMenus()
{ {
TMainFrameDlg * p_window = p_intf->p_sys->p_window; TMainFrameDlg * p_window = p_intf->p_sys->p_window;
input_thread_t *p_input = p_intf->p_sys->p_input; input_thread_t * p_input = p_intf->p_sys->p_input;
es_descriptor_t * p_audio_es; es_descriptor_t * p_audio_es;
es_descriptor_t * p_spu_es; es_descriptor_t * p_spu_es;
p_intf->p_sys->b_chapter_update |= p_intf->p_sys->b_title_update; p_intf->p_sys->b_chapter_update |= p_intf->p_sys->b_title_update;
p_intf->p_sys->b_audio_update |= p_intf->p_sys->b_program_update; p_intf->p_sys->b_audio_update |= p_intf->p_sys->b_program_update |
// p_intf->p_sys->b_audio_update |= p_intf->p_sys->b_title_update; p_intf->p_sys->b_title_update;
p_intf->p_sys->b_spu_update |= p_intf->p_sys->b_program_update; p_intf->p_sys->b_spu_update |= p_intf->p_sys->b_program_update |
// p_intf->p_sys->b_spu_update |= p_intf->p_sys->b_title_update; p_intf->p_sys->b_title_update;
if( p_intf->p_sys->b_program_update ) if( p_intf->p_sys->b_program_update )
{ {
...@@ -211,8 +265,8 @@ void __fastcall TMenusGen::SetupMenus() ...@@ -211,8 +265,8 @@ void __fastcall TMenusGen::SetupMenus()
p_pgrm = p_input->stream.p_selected_program; p_pgrm = p_input->stream.p_selected_program;
} }
ProgramMenu( p_window->MenuProgram, p_pgrm, MenuProgramClick ); ProgramMenu( MenuProgram, p_pgrm, MenuProgramClick );
ProgramMenu( p_window->PopupProgram, p_pgrm, PopupProgramClick ); ProgramMenu( PopupProgram, p_pgrm, PopupProgramClick );
p_intf->p_sys->b_program_update = 0; p_intf->p_sys->b_program_update = 0;
} }
...@@ -220,7 +274,7 @@ void __fastcall TMenusGen::SetupMenus() ...@@ -220,7 +274,7 @@ void __fastcall TMenusGen::SetupMenus()
if( p_intf->p_sys->b_title_update ) if( p_intf->p_sys->b_title_update )
{ {
// why "-1" ? // why "-1" ?
RadioMenu( p_window->MenuTitle, "Title", RadioMenu( MenuTitle, "Title",
p_input->stream.i_area_nb - 1, p_input->stream.i_area_nb - 1,
p_input->stream.p_selected_area->i_id, p_input->stream.p_selected_area->i_id,
MenuTitleClick ); MenuTitleClick );
...@@ -234,13 +288,12 @@ void __fastcall TMenusGen::SetupMenus() ...@@ -234,13 +288,12 @@ void __fastcall TMenusGen::SetupMenus()
if( p_intf->p_sys->b_chapter_update ) if( p_intf->p_sys->b_chapter_update )
{ {
RadioMenu( p_window->MenuChapter, "Chapter", RadioMenu( MenuChapter, "Chapter",
p_input->stream.p_selected_area->i_part_nb, p_input->stream.p_selected_area->i_part_nb,
p_input->stream.p_selected_area->i_part, p_input->stream.p_selected_area->i_part,
MenuChapterClick ); MenuChapterClick );
NavigationMenu( p_window->PopupNavigation, NavigationMenu( PopupNavigation, PopupNavigationClick );
PopupNavigationClick );
AnsiString CurrentChapter; AnsiString CurrentChapter;
CurrentChapter.sprintf( "%d", p_input->stream.p_selected_area->i_part ); CurrentChapter.sprintf( "%d", p_input->stream.p_selected_area->i_part );
...@@ -275,10 +328,8 @@ void __fastcall TMenusGen::SetupMenus() ...@@ -275,10 +328,8 @@ void __fastcall TMenusGen::SetupMenus()
/* audio menus */ /* audio menus */
if( p_intf->p_sys->b_audio_update ) if( p_intf->p_sys->b_audio_update )
{ {
LanguageMenu( p_window->MenuAudio, p_audio_es, AUDIO_ES, LanguageMenu( MenuLanguage, p_audio_es, AUDIO_ES, MenuLanguageClick );
MenuAudioClick ); LanguageMenu( PopupLanguage, p_audio_es, AUDIO_ES, PopupLanguageClick );
LanguageMenu( p_window->PopupAudio, p_audio_es, AUDIO_ES,
PopupAudioClick );
p_intf->p_sys->b_audio_update = 0; p_intf->p_sys->b_audio_update = 0;
} }
...@@ -286,14 +337,65 @@ void __fastcall TMenusGen::SetupMenus() ...@@ -286,14 +337,65 @@ void __fastcall TMenusGen::SetupMenus()
/* sub picture menus */ /* sub picture menus */
if( p_intf->p_sys->b_spu_update ) if( p_intf->p_sys->b_spu_update )
{ {
LanguageMenu( p_window->PopupSubtitles, p_spu_es, SPU_ES, LanguageMenu( PopupSubtitles, p_spu_es, SPU_ES, PopupSubtitleClick );
PopupSubtitleClick ); LanguageMenu( MenuSubtitles, p_spu_es, SPU_ES, MenuSubtitleClick );
LanguageMenu( p_window->MenuSubtitles, p_spu_es, SPU_ES,
MenuSubtitleClick );
p_intf->p_sys->b_spu_update = 0; p_intf->p_sys->b_spu_update = 0;
} }
if( p_intf->p_sys->b_aout_update )
{
aout_instance_t * p_aout;
p_aout = (aout_instance_t *)vlc_object_find( p_intf, VLC_OBJECT_AOUT,
FIND_ANYWHERE );
if ( p_aout != NULL )
{
vlc_value_t val;
val.b_bool = 0;
var_Set( (vlc_object_t *)p_aout, "intf-change", val );
SetupVarMenu( (vlc_object_t *)p_aout, "audio-channels",
MenuChannel, AoutVarClick );
SetupVarMenu( (vlc_object_t *)p_aout, "audio-channels",
PopupChannel, AoutVarClick );
SetupVarMenu( (vlc_object_t *)p_aout, "audio-device",
MenuADevice, AoutVarClick );
SetupVarMenu( (vlc_object_t *)p_aout, "audio-device",
PopupADevice, AoutVarClick );
vlc_object_release( (vlc_object_t *)p_aout );
}
p_intf->p_sys->b_aout_update = 0;
}
if( p_intf->p_sys->b_vout_update )
{
vout_thread_t * p_vout;
p_vout = (vout_thread_t *)vlc_object_find( p_intf, VLC_OBJECT_VOUT,
FIND_ANYWHERE );
if ( p_vout != NULL )
{
vlc_value_t val;
val.b_bool = 0;
var_Set( (vlc_object_t *)p_vout, "intf-change", val );
SetupVarMenu( (vlc_object_t *)p_vout, "video-device",
MenuVDevice, VoutVarClick );
SetupVarMenu( (vlc_object_t *)p_vout, "video-device",
PopupVDevice, VoutVarClick );
vlc_object_release( (vlc_object_t *)p_vout );
}
p_intf->p_sys->b_vout_update = 0;
}
vlc_mutex_lock( &p_input->stream.stream_lock ); vlc_mutex_lock( &p_input->stream.stream_lock );
} }
...@@ -301,7 +403,8 @@ void __fastcall TMenusGen::SetupMenus() ...@@ -301,7 +403,8 @@ void __fastcall TMenusGen::SetupMenus()
/***************************************************************************** /*****************************************************************************
* Private functions * Private functions
*****************************************************************************/ *****************************************************************************/
TMenuItem * TMenusGen::Index2Item( TMenuItem *Root, int i_index, bool SingleColumn ) TMenuItem * TMenusGen::Index2Item( TMenuItem *Root, int i_index,
bool SingleColumn )
{ {
if( SingleColumn || ( i_index < 20 ) ) if( SingleColumn || ( i_index < 20 ) )
return Root->Items[i_index]; return Root->Items[i_index];
...@@ -332,6 +435,30 @@ int __fastcall TMenusGen::Pos2Data( int title, int chapter ) ...@@ -332,6 +435,30 @@ int __fastcall TMenusGen::Pos2Data( int title, int chapter )
return (int) (( title << 16 ) | ( chapter & 0xffff )); return (int) (( title << 16 ) | ( chapter & 0xffff ));
} }
/****************************************************************************
* VarChange: change a variable in a vlc_object_t
****************************************************************************
* Change the variable and update the menuitems.
****************************************************************************/
void __fastcall TMenusGen::VarChange( vlc_object_t *p_object,
const char *psz_variable, TMenuItem *RootMenu, TMenuItem *RootPopup,
TMenuItem *Item )
{
vlc_value_t val;
int i_index;
/* set the new value */
val.psz_string = Item->Name.c_str();
if( var_Set( p_object, psz_variable, val ) < 0 )
{
msg_Warn( p_object, "cannot set variable (%s)", val.psz_string );
}
i_index = Item->MenuIndex;
RootMenu->Items[i_index]->Checked = true;
RootPopup->Items[i_index]->Checked = true;
}
/**************************************************************************** /****************************************************************************
* LangChange: change audio or subtitles languages * LangChange: change audio or subtitles languages
**************************************************************************** ****************************************************************************
...@@ -411,6 +538,56 @@ void __fastcall TMenusGen::ProgramChange( TMenuItem *Item, ...@@ -411,6 +538,56 @@ void __fastcall TMenusGen::ProgramChange( TMenuItem *Item,
input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PLAY ); input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PLAY );
} }
/*****************************************************************************
* SetupVarMenu: build a menu allowing to change a variable
*****************************************************************************/
void __fastcall TMenusGen::SetupVarMenu( vlc_object_t *p_object,
const char *psz_variable, TMenuItem *Root, TNotifyEvent MenuItemClick )
{
TMenuItem * Item;
vlc_value_t val;
char * psz_value;
int i;
/* remove previous menu */
Root->Clear();
/* get the current value */
if ( var_Get( p_object, psz_variable, &val ) < 0 )
{
return;
}
psz_value = val.psz_string;
if ( var_Change( p_object, psz_variable, VLC_VAR_GETLIST, &val ) < 0 )
{
free( psz_value );
return;
}
/* append a menuitem for each option */
for ( i = 0; i < val.p_list->i_count; i++ )
{
Item = new TMenuItem( Root );
Item->Caption = val.p_list->p_values[i].psz_string;
Item->Hint = val.p_list->p_values[i].psz_string;
Item->RadioItem = true;
Item->OnClick = MenuItemClick;
if( !strcmp( psz_value, val.p_list->p_values[i].psz_string ) )
Item->Checked = true;
/* Add the item to the submenu */
Root->Add( Item );
}
/* enable the menu if there is at least 1 item */
Root->Enabled = ( val.p_list->i_count > 0 );
/* clean up everything */
var_Change( p_object, psz_variable, VLC_VAR_FREELIST, &val );
free( psz_value );
}
/***************************************************************************** /*****************************************************************************
* ProgramMenu: update the programs menu of the interface * ProgramMenu: update the programs menu of the interface
***************************************************************************** *****************************************************************************
...@@ -418,17 +595,14 @@ void __fastcall TMenusGen::ProgramChange( TMenuItem *Item, ...@@ -418,17 +595,14 @@ void __fastcall TMenusGen::ProgramChange( TMenuItem *Item,
* by the input. Useful for multi-programs streams such as DVB ones. * by the input. Useful for multi-programs streams such as DVB ones.
*****************************************************************************/ *****************************************************************************/
void __fastcall TMenusGen::ProgramMenu( TMenuItem *Root, void __fastcall TMenusGen::ProgramMenu( TMenuItem *Root,
pgrm_descriptor_t *p_pgrm, TNotifyEvent MenuItemClick) pgrm_descriptor_t *p_pgrm, TNotifyEvent MenuItemClick )
{ {
TMenuItem * Item; TMenuItem * Item;
TMenuItem * ItemActive;
/* remove previous menu */ /* remove previous menu */
Root->Clear(); Root->Clear();
Root->Enabled = false; Root->Enabled = false;
ItemActive = NULL;
/* create a set of program buttons and append them to the container */ /* create a set of program buttons and append them to the container */
for( int i = 0; i < p_intf->p_sys->p_input->stream.i_pgrm_number; i++ ) for( int i = 0; i < p_intf->p_sys->p_input->stream.i_pgrm_number; i++ )
{ {
...@@ -446,22 +620,16 @@ void __fastcall TMenusGen::ProgramMenu( TMenuItem *Root, ...@@ -446,22 +620,16 @@ void __fastcall TMenusGen::ProgramMenu( TMenuItem *Root,
* It will be used in the callback. */ * It will be used in the callback. */
Item->Tag = i + 1; Item->Tag = i + 1;
/* check the currently selected program */
if( p_pgrm == p_intf->p_sys->p_input->stream.pp_programs[i] ) if( p_pgrm == p_intf->p_sys->p_input->stream.pp_programs[i] )
{ {
/* don't lose Item when we append into menu */ Item->Checked = true;
ItemActive = Item;
} }
/* Add the item to the submenu */ /* add the item to the submenu */
Root->Add( Item ); Root->Add( Item );
} }
/* check currently selected program */
if( ItemActive != NULL )
{
ItemActive->Checked = true;
}
/* be sure that menu is enabled if more than 1 program */ /* be sure that menu is enabled if more than 1 program */
if( p_intf->p_sys->p_input->stream.i_pgrm_number > 1 ) if( p_intf->p_sys->p_input->stream.i_pgrm_number > 1 )
{ {
...@@ -481,15 +649,12 @@ void __fastcall TMenusGen::RadioMenu( TMenuItem *Root, AnsiString ItemName, ...@@ -481,15 +649,12 @@ void __fastcall TMenusGen::RadioMenu( TMenuItem *Root, AnsiString ItemName,
{ {
TMenuItem * ItemGroup; TMenuItem * ItemGroup;
TMenuItem * Item; TMenuItem * Item;
TMenuItem * ItemActive;
AnsiString Name; AnsiString Name;
/* remove previous menu */ /* remove previous menu */
Root->Enabled = false; Root->Enabled = false;
Root->Clear(); Root->Clear();
ItemActive = NULL;
for( int i_item = 0; i_item < i_nb; i_item++ ) for( int i_item = 0; i_item < i_nb; i_item++ )
{ {
/* we group titles/chapters in packets of ten for small screens */ /* we group titles/chapters in packets of ten for small screens */
...@@ -523,9 +688,10 @@ void __fastcall TMenusGen::RadioMenu( TMenuItem *Root, AnsiString ItemName, ...@@ -523,9 +688,10 @@ void __fastcall TMenusGen::RadioMenu( TMenuItem *Root, AnsiString ItemName,
* It will be used in the callback. */ * It will be used in the callback. */
Item->Tag = i_item + 1; Item->Tag = i_item + 1;
/* check the currently selected chapter */
if( i_selected == i_item + 1 ) if( i_selected == i_item + 1 )
{ {
ItemActive = Item; Item->Checked = true;
} }
/* setup signal handling */ /* setup signal handling */
...@@ -543,12 +709,6 @@ void __fastcall TMenusGen::RadioMenu( TMenuItem *Root, AnsiString ItemName, ...@@ -543,12 +709,6 @@ void __fastcall TMenusGen::RadioMenu( TMenuItem *Root, AnsiString ItemName,
Root->Add( ItemGroup ); Root->Add( ItemGroup );
} }
/* check currently selected chapter */
if( ItemActive != NULL )
{
ItemActive->Checked = true;
}
/* be sure that menu is enabled, if there are several items */ /* be sure that menu is enabled, if there are several items */
if( i_nb > 1 ) if( i_nb > 1 )
{ {
...@@ -570,7 +730,6 @@ void __fastcall TMenusGen::LanguageMenu( TMenuItem *Root, es_descriptor_t *p_es, ...@@ -570,7 +730,6 @@ void __fastcall TMenusGen::LanguageMenu( TMenuItem *Root, es_descriptor_t *p_es,
{ {
TMenuItem * Separator; TMenuItem * Separator;
TMenuItem * Item; TMenuItem * Item;
TMenuItem * ItemActive;
AnsiString Name; AnsiString Name;
/* remove previous menu */ /* remove previous menu */
...@@ -592,7 +751,6 @@ void __fastcall TMenusGen::LanguageMenu( TMenuItem *Root, es_descriptor_t *p_es, ...@@ -592,7 +751,6 @@ void __fastcall TMenusGen::LanguageMenu( TMenuItem *Root, es_descriptor_t *p_es,
Separator->Caption = "-"; Separator->Caption = "-";
Root->Add( Separator ); Root->Add( Separator );
ItemActive = NULL;
int i_item = 0; int i_item = 0;
vlc_mutex_lock( &p_intf->p_sys->p_input->stream.stream_lock ); vlc_mutex_lock( &p_intf->p_sys->p_input->stream.stream_lock );
...@@ -619,10 +777,10 @@ void __fastcall TMenusGen::LanguageMenu( TMenuItem *Root, es_descriptor_t *p_es, ...@@ -619,10 +777,10 @@ void __fastcall TMenusGen::LanguageMenu( TMenuItem *Root, es_descriptor_t *p_es,
Item->Caption = Name; Item->Caption = Name;
Item->Tag = i; Item->Tag = i;
/* check the currently selected item */
if( p_es == p_intf->p_sys->p_input->stream.pp_es[i] ) if( p_es == p_intf->p_sys->p_input->stream.pp_es[i] )
{ {
/* don't lose Item when we append into menu */ Item->Checked = true;
ItemActive = Item;
} }
/* setup signal hanling */ /* setup signal hanling */
...@@ -634,12 +792,6 @@ void __fastcall TMenusGen::LanguageMenu( TMenuItem *Root, es_descriptor_t *p_es, ...@@ -634,12 +792,6 @@ void __fastcall TMenusGen::LanguageMenu( TMenuItem *Root, es_descriptor_t *p_es,
vlc_mutex_unlock( &p_intf->p_sys->p_input->stream.stream_lock ); vlc_mutex_unlock( &p_intf->p_sys->p_input->stream.stream_lock );
/* check currently selected item */
if( ItemActive != NULL )
{
ItemActive->Checked = true;
}
/* be sure that menu is enabled if non empty */ /* be sure that menu is enabled if non empty */
if( i_item > 0 ) if( i_item > 0 )
{ {
...@@ -659,7 +811,6 @@ void __fastcall TMenusGen::NavigationMenu( TMenuItem *Root, ...@@ -659,7 +811,6 @@ void __fastcall TMenusGen::NavigationMenu( TMenuItem *Root,
{ {
TMenuItem * TitleGroup; TMenuItem * TitleGroup;
TMenuItem * TitleItem; TMenuItem * TitleItem;
TMenuItem * ItemActive;
TMenuItem * ChapterGroup; TMenuItem * ChapterGroup;
TMenuItem * ChapterItem; TMenuItem * ChapterItem;
AnsiString Name; AnsiString Name;
...@@ -671,7 +822,6 @@ void __fastcall TMenusGen::NavigationMenu( TMenuItem *Root, ...@@ -671,7 +822,6 @@ void __fastcall TMenusGen::NavigationMenu( TMenuItem *Root,
Root->Enabled = false; Root->Enabled = false;
Root->Clear(); Root->Clear();
ItemActive = NULL;
i_title_nb = p_intf->p_sys->p_input->stream.i_area_nb; i_title_nb = p_intf->p_sys->p_input->stream.i_area_nb;
/* loop on titles */ /* loop on titles */
...@@ -733,11 +883,12 @@ void __fastcall TMenusGen::NavigationMenu( TMenuItem *Root, ...@@ -733,11 +883,12 @@ void __fastcall TMenusGen::NavigationMenu( TMenuItem *Root,
ChapterItem->Tag = Pos2Data( i_title, i_chapter + 1 ); ChapterItem->Tag = Pos2Data( i_title, i_chapter + 1 );
#define p_area p_intf->p_sys->p_input->stream.pp_areas[i_title] #define p_area p_intf->p_sys->p_input->stream.pp_areas[i_title]
/* check the currently selected chapter */
if( ( p_area == if( ( p_area ==
p_intf->p_sys->p_input->stream.p_selected_area ) && p_intf->p_sys->p_input->stream.p_selected_area ) &&
( p_area->i_part == i_chapter + 1 ) ) ( p_area->i_part == i_chapter + 1 ) )
{ {
ItemActive = ChapterItem; ChapterItem->Checked = true;
} }
#undef p_area #undef p_area
...@@ -774,12 +925,6 @@ void __fastcall TMenusGen::NavigationMenu( TMenuItem *Root, ...@@ -774,12 +925,6 @@ void __fastcall TMenusGen::NavigationMenu( TMenuItem *Root,
Root->Add( TitleGroup ); Root->Add( TitleGroup );
} }
/* Default selected chapter */
if( ItemActive != NULL )
{
ItemActive->Checked = true;
}
/* be sure that menu is sensitive */ /* be sure that menu is sensitive */
Root->Enabled = true; Root->Enabled = true;
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* menu.h: prototypes for menu functions * menu.h: prototypes for menu functions
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: menu.h,v 1.2 2002/12/13 03:52:58 videolan Exp $ * $Id: menu.h,v 1.3 2003/01/08 02:16:09 ipkiss Exp $
* *
* Authors: Olivier Teuliere <ipkiss@via.ecp.fr> * Authors: Olivier Teuliere <ipkiss@via.ecp.fr>
* *
...@@ -30,8 +30,14 @@ private: ...@@ -30,8 +30,14 @@ private:
intf_thread_t *p_intf; intf_thread_t *p_intf;
/* local pointers to main window menu items */ /* local pointers to main window menu items */
TMenuItem *MenuAudio; TMenuItem *MenuChannel;
TMenuItem *PopupAudio; TMenuItem *PopupChannel;
TMenuItem *MenuADevice;
TMenuItem *PopupADevice;
TMenuItem *MenuVDevice;
TMenuItem *PopupVDevice;
TMenuItem *MenuLanguage;
TMenuItem *PopupLanguage;
TMenuItem *MenuSubtitles; TMenuItem *MenuSubtitles;
TMenuItem *PopupSubtitles; TMenuItem *PopupSubtitles;
TMenuItem *MenuProgram; TMenuItem *MenuProgram;
...@@ -51,8 +57,13 @@ private: ...@@ -51,8 +57,13 @@ private:
int __fastcall Data2Chapter( int data ); int __fastcall Data2Chapter( int data );
int __fastcall Pos2Data( int title, int chapter ); int __fastcall Pos2Data( int title, int chapter );
void __fastcall VarChange( vlc_object_t *, const char *, TMenuItem *,
TMenuItem *, TMenuItem * );
void __fastcall LangChange( TMenuItem *, TMenuItem *, TMenuItem *, int ); void __fastcall LangChange( TMenuItem *, TMenuItem *, TMenuItem *, int );
void __fastcall ProgramChange( TMenuItem *, TMenuItem * ); void __fastcall ProgramChange( TMenuItem *, TMenuItem * );
void __fastcall SetupVarMenu( vlc_object_t *, const char *, TMenuItem *,
TNotifyEvent );
void __fastcall ProgramMenu( TMenuItem *, pgrm_descriptor_t *, void __fastcall ProgramMenu( TMenuItem *, pgrm_descriptor_t *,
TNotifyEvent ); TNotifyEvent );
void __fastcall RadioMenu( TMenuItem *, AnsiString, int, int, void __fastcall RadioMenu( TMenuItem *, AnsiString, int, int,
...@@ -67,8 +78,10 @@ public: ...@@ -67,8 +78,10 @@ public:
void __fastcall SetupMenus(); void __fastcall SetupMenus();
/* callbacks for menuitems */ /* callbacks for menuitems */
void __fastcall MenuAudioClick( TObject *Sender ); void __fastcall AoutVarClick( TObject *Sender );
void __fastcall PopupAudioClick( TObject *Sender ); void __fastcall VoutVarClick( TObject *Sender );
void __fastcall MenuLanguageClick( TObject *Sender );
void __fastcall PopupLanguageClick( TObject *Sender );
void __fastcall MenuSubtitleClick( TObject *Sender ); void __fastcall MenuSubtitleClick( TObject *Sender );
void __fastcall PopupSubtitleClick( TObject *Sender ); void __fastcall PopupSubtitleClick( TObject *Sender );
void __fastcall MenuProgramClick( TObject *Sender ); void __fastcall MenuProgramClick( TObject *Sender );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* win32.cpp : Win32 interface plugin for vlc * win32.cpp : Win32 interface plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: win32.cpp,v 1.6 2002/12/13 17:05:12 babal Exp $ * $Id: win32.cpp,v 1.7 2003/01/08 02:16:09 ipkiss Exp $
* *
* Authors: Olivier Teulire <ipkiss@via.ecp.fr> * Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* *
...@@ -129,6 +129,9 @@ static void Run( intf_thread_t *p_intf ) ...@@ -129,6 +129,9 @@ static void Run( intf_thread_t *p_intf )
*****************************************************************************/ *****************************************************************************/
int Win32Manage( intf_thread_t *p_intf ) int Win32Manage( intf_thread_t *p_intf )
{ {
aout_instance_t * p_aout;
vout_thread_t * p_vout;
vlc_mutex_lock( &p_intf->change_lock ); vlc_mutex_lock( &p_intf->change_lock );
/* If the "display popup" flag has changed */ /* If the "display popup" flag has changed */
...@@ -230,6 +233,42 @@ int Win32Manage( intf_thread_t *p_intf ) ...@@ -230,6 +233,42 @@ int Win32Manage( intf_thread_t *p_intf )
p_intf->p_sys->b_playing = 0; p_intf->p_sys->b_playing = 0;
} }
/* Does the audio output require to update the menus ? */
p_aout = (aout_instance_t *)vlc_object_find( p_intf, VLC_OBJECT_AOUT,
FIND_ANYWHERE );
if( p_aout != NULL )
{
vlc_value_t val;
if( var_Get( (vlc_object_t *)p_aout, "intf-change", &val ) >= 0
&& val.b_bool )
{
#if 0
p_intf->p_sys->b_aout_update = 1;
p_intf->p_sys->p_menus->SetupMenus();
#endif
}
vlc_object_release( (vlc_object_t *)p_aout );
}
/* Does the video output require to update the menus ? */
p_vout = (vout_thread_t *)vlc_object_find( p_intf, VLC_OBJECT_VOUT,
FIND_ANYWHERE );
if( p_vout != NULL )
{
vlc_value_t val;
if( var_Get( (vlc_object_t *)p_vout, "intf-change", &val ) >= 0
&& val.b_bool )
{
#if 0
p_intf->p_sys->b_vout_update = 1;
p_intf->p_sys->p_menus->SetupMenus();
#endif
}
vlc_object_release( (vlc_object_t *)p_vout );
}
if( p_intf->b_die ) if( p_intf->b_die )
{ {
vlc_mutex_unlock( &p_intf->change_lock ); vlc_mutex_unlock( &p_intf->change_lock );
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/ *****************************************************************************/
#include "about.h"
#include "disc.h" #include "disc.h"
#include "mainframe.h" #include "mainframe.h"
#include "menu.h" #include "menu.h"
...@@ -47,7 +46,11 @@ struct intf_sys_t ...@@ -47,7 +46,11 @@ struct intf_sys_t
vlc_bool_t b_slider_free; /* slider status */ vlc_bool_t b_slider_free; /* slider status */
/* menus handlers */ /* menus handlers */
vlc_bool_t b_program_update; /* do we need to update programs vlc_bool_t b_aout_update; /* do we need to update menus
related with audio output */
vlc_bool_t b_vout_update; /* do we need to update menus
related with video output */
vlc_bool_t b_program_update; /* do we need to update programs
menu */ menu */
vlc_bool_t b_title_update; /* do we need to update title menus */ vlc_bool_t b_title_update; /* do we need to update title menus */
vlc_bool_t b_chapter_update; /* do we need to update chapter vlc_bool_t b_chapter_update; /* do we need to update chapter
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment