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

* The stream output can't use PS with UDP

 * Added tooltips for the subtitles dialog box
 * Added a missing "delete"
 * Added a menu entry to spawn new interfaces (but it's currently
   disabled, due to a problem with the vlc_list_t struct)
parent ba0ff50c
......@@ -206,11 +206,11 @@ object MainFrameDlg: TMainFrameDlg
Top = 0
Action = EjectAction
end
object ToolButton1: TToolButton
object ToolButtonSep2: TToolButton
Left = 320
Top = 0
Width = 8
Caption = 'ToolButton1'
Caption = 'ToolButtonSep2'
ImageIndex = 13
Style = tbsSeparator
end
......@@ -226,11 +226,11 @@ object MainFrameDlg: TMainFrameDlg
Top = 0
Action = FastAction
end
object ToolButtonSep2: TToolButton
object ToolButtonSep3: TToolButton
Left = 406
Top = 0
Width = 8
Caption = 'ToolButtonSep2'
Caption = 'ToolButtonSep3'
ImageIndex = 9
Style = tbsSeparator
end
......@@ -502,6 +502,15 @@ object MainFrameDlg: TMainFrameDlg
Tag = 3
Action = PreferencesAction
end
object N4: TMenuItem
Caption = '-'
end
object MenuAddInterface: TMenuItem
Tag = 3
Caption = '&Add interface'
Enabled = False
Hint = 'Spawn a new interface'
end
end
object MenuControls: TMenuItem
Tag = 3
......
......@@ -59,9 +59,10 @@ __published: // IDE-managed Components
TToolButton *ToolButtonEject;
TToolButton *ToolButtonPlay;
TToolButton *ToolButtonPause;
TToolButton *ToolButtonSep2;
TToolButton *ToolButtonSlow;
TToolButton *ToolButtonFast;
TToolButton *ToolButtonSep2;
TToolButton *ToolButtonSep3;
TToolButton *ToolButtonPlaylist;
TToolButton *ToolButtonPrev;
TToolButton *ToolButtonNext;
......@@ -137,7 +138,6 @@ __published: // IDE-managed Components
TMenuItem *PopupClose;
TMenuItem *N9;
TCSpinEdit *SpinEditChannel;
TToolButton *ToolButton1;
TActionList *ActionList1;
TAction *OpenFileAction;
TAction *OpenDiscAction;
......@@ -157,23 +157,25 @@ __published: // IDE-managed Components
TAction *PreferencesAction;
TAction *MessagesAction;
TAction *AboutAction;
TMenuItem *Control1;
TMenuItem *N5;
TMenuItem *N6;
TMenuItem *N10;
TAction *PrevTitleAction;
TAction *NextTitleAction;
TAction *PrevChapterAction;
TAction *NextChapterAction;
TAction *VolumeUpAction;
TAction *VolumeDownAction;
TAction *MuteAction;
TAction *StreamOutputAction;
TAction *AddSubtitlesAction;
TMenuItem *Control1;
TMenuItem *N5;
TMenuItem *N6;
TMenuItem *N10;
TMenuItem *N11;
TMenuItem *MenuChannel;
TMenuItem *PopupChannel;
TMenuItem *MenuVolumeUp;
TMenuItem *MenuVolumeDown;
TMenuItem *MenuMute;
TAction *VolumeUpAction;
TAction *VolumeDownAction;
TAction *MuteAction;
TMenuItem *MenuADevice;
TMenuItem *PopupAudioSettings;
TMenuItem *PopupADevice;
......@@ -185,9 +187,9 @@ __published: // IDE-managed Components
TMenuItem *N1;
TMenuItem *PopupVDevice;
TMenuItem *MenuStreamOuput;
TAction *StreamOutputAction;
TMenuItem *MenuAddSubtitles;
TAction *AddSubtitlesAction;
TMenuItem *N4;
TMenuItem *MenuAddInterface;
void __fastcall TimerManageTimer( TObject *Sender );
void __fastcall TrackBarChange( TObject *Sender );
void __fastcall FormClose( TObject *Sender, TCloseAction &Action );
......@@ -222,7 +224,7 @@ __published: // IDE-managed Components
void __fastcall NextTitleActionExecute( TObject *Sender );
void __fastcall PrevChapterActionExecute( TObject *Sender );
void __fastcall NextChapterActionExecute( TObject *Sender );
void __fastcall AddSubtitlesActionsExecute(TObject *Sender);
void __fastcall AddSubtitlesActionsExecute( TObject *Sender );
private: // User declarations
intf_thread_t *p_intf;
/* drag and drop handling */
......
......@@ -2,7 +2,7 @@
* menu.cpp: functions to handle menu items
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
* $Id: menu.cpp,v 1.7 2003/01/19 17:55:18 ipkiss Exp $
* $Id: menu.cpp,v 1.8 2003/01/23 03:33:34 ipkiss Exp $
*
* Authors: Olivier Teuliere <ipkiss@via.ecp.fr>
*
......@@ -85,6 +85,40 @@ void __fastcall TMenusGen::VoutVarClick( TObject *Sender )
vlc_object_release( p_vout );
}
/*
* Modules
*/
/* Interface modules: we spawn a new interface */
void __fastcall TMenusGen::InterfaceModuleClick( TObject *Sender )
{
TMenuItem * Item = (TMenuItem *)Sender;
AnsiString IntfName = CleanCaption( Item->Caption );
intf_thread_t *p_newintf;
char *psz_oldmodule = config_GetPsz( p_intf->p_vlc, "intf" );
config_PutPsz( p_intf->p_vlc, "intf", IntfName.c_str() );
p_newintf = intf_Create( p_intf->p_vlc );
config_PutPsz( p_intf->p_vlc, "intf", psz_oldmodule );
if( psz_oldmodule )
{
free( psz_oldmodule );
}
if( p_newintf )
{
p_newintf->b_block = VLC_FALSE;
if( intf_RunThread( p_newintf ) )
{
vlc_object_detach( p_newintf );
intf_Destroy( p_newintf );
}
}
}
/*
* Audio
*/
......@@ -258,6 +292,12 @@ __fastcall TMenusGen::TMenusGen( intf_thread_t *_p_intf ) : TObject()
MenuTitle = p_window->MenuTitle;
MenuChapter = p_window->MenuChapter;
PopupNavigation = p_window->PopupNavigation;
MenuAddInterface = p_window->MenuAddInterface;
/* Create the "Add interface" menu */
#if 0
SetupModuleMenu( "inerface", MenuAddInterface, InterfaceModuleClick );
#endif
}
......@@ -463,6 +503,19 @@ int __fastcall TMenusGen::Pos2Data( int title, int chapter )
return (int) (( title << 16 ) | ( chapter & 0xffff ));
}
/* This function deletes all the '&' characters in the caption string,
* because Borland automatically adds one when (and only when!) you click on
* the menuitem. Grrrrr... */
AnsiString __fastcall TMenusGen::CleanCaption( AnsiString Caption )
{
while( Caption.LastDelimiter( "&" ) != 0 )
{
Caption.Delete( Caption.LastDelimiter( "&" ), 1 );
}
return Caption;
}
/****************************************************************************
* VarChange: change a variable in a vlc_object_t
****************************************************************************
......@@ -475,14 +528,7 @@ void __fastcall TMenusGen::VarChange( vlc_object_t *p_object,
vlc_value_t val;
int i_index;
/* We must delete all the '&' characters in the caption string, because
* Borland automatically adds one when (and only when!) you click on
* the menuitem. Grrrrr... */
AnsiString Caption = Item->Caption;
while( Caption.LastDelimiter( "&" ) != 0 )
{
Caption.Delete( Caption.LastDelimiter( "&" ), 1 );
}
AnsiString Caption = CleanCaption( Item->Caption );
val.psz_string = Caption.c_str();
/* set the new value */
......@@ -625,6 +671,43 @@ void __fastcall TMenusGen::SetupVarMenu( vlc_object_t *p_object,
// free( psz_value );
}
/*****************************************************************************
* SetupModuleMenu: build a menu listing all the modules of a given
capability
*****************************************************************************/
void __fastcall TMenusGen::SetupModuleMenu( const char *psz_capability,
TMenuItem *Root, TNotifyEvent MenuItemClick )
{
module_t * p_parser;
vlc_list_t list;
int i_index;
/* remove previous menu */
Root->Clear();
Root->Enabled = false;
list = vlc_list_find( p_intf, VLC_OBJECT_MODULE, FIND_ANYWHERE );
for( i_index = 0; i_index < list.i_count; i_index++ )
{
p_parser = (module_t *)list.p_values[i_index].p_object ;
if( !strcmp( p_parser->psz_capability, psz_capability ) )
{
TMenuItem *Item = new TMenuItem( Root );
Item->Caption = p_parser->psz_object_name;
Item->Hint = Item->Caption;
Item->OnClick = MenuItemClick;
Root->Add( Item );
}
}
vlc_list_release( &list );
/* be sure that menu is enabled, if there is at least one item */
if( i_index > 0 )
Root->Enabled = true;
}
/*****************************************************************************
* ProgramMenu: update the programs menu of the interface
*****************************************************************************
......@@ -660,9 +743,7 @@ void __fastcall TMenusGen::ProgramMenu( TMenuItem *Root,
/* check the currently selected program */
if( p_pgrm == p_intf->p_sys->p_input->stream.pp_programs[i] )
{
Item->Checked = true;
}
/* add the item to the submenu */
Root->Add( Item );
......@@ -670,9 +751,7 @@ void __fastcall TMenusGen::ProgramMenu( TMenuItem *Root,
/* be sure that menu is enabled if more than 1 program */
if( p_intf->p_sys->p_input->stream.i_pgrm_number > 1 )
{
Root->Enabled = true;
}
}
/*****************************************************************************
......@@ -699,9 +778,7 @@ void __fastcall TMenusGen::RadioMenu( TMenuItem *Root, AnsiString ItemName,
if( ( i_item % 10 == 1 ) && ( i_nb > 20 ) )
{
if( i_item != 1 )
{
Root->Add( ItemGroup );
}
Name.sprintf( "%ss %d to %d", ItemName, i_item, i_item + 9 );
ItemGroup = new TMenuItem( Root );
......@@ -728,9 +805,7 @@ void __fastcall TMenusGen::RadioMenu( TMenuItem *Root, AnsiString ItemName,
/* check the currently selected chapter */
if( i_selected == i_item )
{
Item->Checked = true;
}
/* setup signal handling */
Item->OnClick = MenuItemClick;
......@@ -743,15 +818,11 @@ void __fastcall TMenusGen::RadioMenu( TMenuItem *Root, AnsiString ItemName,
// if( ( i_nb > 20 ) && ( i_item % 10 ) ) ?
if( i_nb > 20 )
{
Root->Add( ItemGroup );
}
/* be sure that menu is enabled, if there are several items */
if( i_nb > 1 )
{
Root->Enabled = true;
}
}
/*****************************************************************************
......@@ -806,9 +877,7 @@ void __fastcall TMenusGen::LanguageMenu( TMenuItem *Root, es_descriptor_t *p_es,
i_item++;
Name = p_intf->p_sys->p_input->stream.pp_es[i]->psz_desc;
if( Name.IsEmpty() )
{
Name.sprintf( "Language %d", i_item );
}
Item = new TMenuItem( Root );
Item->RadioItem = true;
......@@ -818,9 +887,7 @@ void __fastcall TMenusGen::LanguageMenu( TMenuItem *Root, es_descriptor_t *p_es,
/* check the currently selected item */
if( p_es == p_intf->p_sys->p_input->stream.pp_es[i] )
{
Item->Checked = true;
}
/* setup signal hanling */
Item->OnClick = MenuItemClick;
......@@ -833,9 +900,7 @@ void __fastcall TMenusGen::LanguageMenu( TMenuItem *Root, es_descriptor_t *p_es,
/* be sure that menu is enabled if non empty */
if( i_item > 0 )
{
Root->Enabled = true;
}
}
/*****************************************************************************
......@@ -870,9 +935,7 @@ void __fastcall TMenusGen::NavigationMenu( TMenuItem *Root,
if( ( i_title % 10 == 1 ) && ( i_title_nb > 20 ) )
{
if( i_title != 1 )
{
Root->Add( TitleGroup );
}
Name.sprintf( "%d - %d", i_title, i_title + 9 );
TitleGroup = new TMenuItem( Root );
......@@ -900,9 +963,7 @@ void __fastcall TMenusGen::NavigationMenu( TMenuItem *Root,
if( ( i_chapter % 10 == 1 ) && ( i_chapter_nb > 20 ) )
{
if( i_chapter != 1 )
{
TitleItem->Add( ChapterGroup );
}
Name.sprintf( "%d - %d", i_chapter, i_chapter + 9 );
ChapterGroup = new TMenuItem( TitleItem );
......@@ -961,12 +1022,9 @@ void __fastcall TMenusGen::NavigationMenu( TMenuItem *Root,
}
if( i_title_nb > 20 )
{
Root->Add( TitleGroup );
}
/* be sure that menu is sensitive */
Root->Enabled = true;
}
......@@ -2,7 +2,7 @@
* menu.h: prototypes for menu functions
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: menu.h,v 1.3 2003/01/08 02:16:09 ipkiss Exp $
* $Id: menu.h,v 1.4 2003/01/23 03:33:34 ipkiss Exp $
*
* Authors: Olivier Teuliere <ipkiss@via.ecp.fr>
*
......@@ -45,6 +45,7 @@ private:
TMenuItem *MenuTitle;
TMenuItem *MenuChapter;
TMenuItem *PopupNavigation;
TMenuItem *MenuAddInterface;
/* Language information */
es_descriptor_t * p_audio_es_old;
......@@ -56,6 +57,7 @@ private:
int __fastcall Data2Title( int data );
int __fastcall Data2Chapter( int data );
int __fastcall Pos2Data( int title, int chapter );
AnsiString __fastcall TMenusGen::CleanCaption( AnsiString Caption );
void __fastcall VarChange( vlc_object_t *, const char *, TMenuItem *,
TMenuItem *, TMenuItem * );
......@@ -64,6 +66,7 @@ private:
void __fastcall SetupVarMenu( vlc_object_t *, const char *, TMenuItem *,
TNotifyEvent );
void __fastcall SetupModuleMenu( const char *, TMenuItem *, TNotifyEvent );
void __fastcall ProgramMenu( TMenuItem *, pgrm_descriptor_t *,
TNotifyEvent );
void __fastcall RadioMenu( TMenuItem *, AnsiString, int, int,
......@@ -80,6 +83,7 @@ public:
/* callbacks for menuitems */
void __fastcall AoutVarClick( TObject *Sender );
void __fastcall VoutVarClick( TObject *Sender );
void __fastcall InterfaceModuleClick( TObject *Sender );
void __fastcall MenuLanguageClick( TObject *Sender );
void __fastcall PopupLanguageClick( TObject *Sender );
void __fastcall MenuSubtitleClick( TObject *Sender );
......
......@@ -2,7 +2,7 @@
* sout.cpp: the stream ouput dialog box
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
* $Id: sout.cpp,v 1.2 2003/01/22 21:42:51 ipkiss Exp $
* $Id: sout.cpp,v 1.3 2003/01/23 03:33:34 ipkiss Exp $
*
* Authors: Olivier Teuliere <ipkiss@via.ecp.fr>
*
......@@ -79,7 +79,7 @@ void __fastcall TSoutDlg::RadioButtonAccessClick( TObject *Sender )
SpinEditPort->Enabled = b_udp | b_rtp;
RadioButtonPS->Enabled = !b_rtp;
if( b_rtp )
if( b_udp || b_rtp )
RadioButtonTS->Checked = true;
RebuildMrl();
......
......@@ -42,6 +42,8 @@ object SubtitlesDlg: TSubtitlesDlg
Width = 57
Height = 21
Hint = 'Set the delay (in seconds)'
ParentShowHint = False
ShowHint = True
TabOrder = 0
Text = '0.0'
end
......@@ -52,6 +54,8 @@ object SubtitlesDlg: TSubtitlesDlg
Height = 21
Hint = 'Set the number of Frames Per Second'
Anchors = [akTop, akRight]
ParentShowHint = False
ShowHint = True
TabOrder = 1
Text = '0.0'
end
......
......@@ -2,7 +2,7 @@
* win32.cpp : Win32 interface plugin for vlc
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
* $Id: win32.cpp,v 1.10 2003/01/22 21:42:51 ipkiss Exp $
* $Id: win32.cpp,v 1.11 2003/01/23 03:33:34 ipkiss Exp $
*
* Authors: Olivier Teulire <ipkiss@via.ecp.fr>
*
......@@ -128,6 +128,7 @@ static void Run( intf_thread_t *p_intf )
delete p_intf->p_sys->p_menus;
delete p_intf->p_sys->p_messages;
delete p_intf->p_sys->p_playwin;
delete p_intf->p_sys->p_window;
}
/*****************************************************************************
......@@ -242,7 +243,7 @@ int Win32Manage( intf_thread_t *p_intf )
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 );
......@@ -259,8 +260,8 @@ int Win32Manage( intf_thread_t *p_intf )
vlc_object_release( (vlc_object_t *)p_vout );
}
if( b_need_menus )
p_intf->p_sys->p_menus->SetupMenus();
// if( b_need_menus )
// p_intf->p_sys->p_menus->SetupMenus();
vlc_mutex_unlock( &p_input->stream.stream_lock );
}
......
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