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

* ./modules/gui/win32/*: some cleaning

parent 7244736d
...@@ -34,13 +34,12 @@ ...@@ -34,13 +34,12 @@
//#pragma package(smart_init) //#pragma package(smart_init)
#pragma resource "*.dfm" #pragma resource "*.dfm"
extern intf_thread_t *p_intfGlobal;
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
__fastcall TAboutDlg::TAboutDlg( TComponent* Owner ) __fastcall TAboutDlg::TAboutDlg( TComponent* Owner, intf_thread_t *_p_intf )
: TForm( Owner ) : TForm( Owner )
{ {
Image1->Picture->Icon = p_intfGlobal->p_sys->p_window->Icon; p_intf = _p_intf;
Image1->Picture->Icon = p_intf->p_sys->p_window->Icon;
LabelVersion->Caption = "Version " VERSION; LabelVersion->Caption = "Version " VERSION;
Translate( this ); Translate( this );
} }
......
...@@ -43,8 +43,9 @@ __published: // IDE-managed Components ...@@ -43,8 +43,9 @@ __published: // IDE-managed Components
TLabel *Label5; TLabel *Label5;
TLabel *LabelVersion; TLabel *LabelVersion;
private: // User declarations private: // User declarations
intf_thread_t *p_intf;
public: // User declarations public: // User declarations
__fastcall TAboutDlg( TComponent* Owner ); __fastcall TAboutDlg( TComponent* Owner, intf_thread_t *_p_intf );
}; };
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
#endif #endif
...@@ -35,12 +35,11 @@ ...@@ -35,12 +35,11 @@
#pragma link "CSPIN" #pragma link "CSPIN"
#pragma resource "*.dfm" #pragma resource "*.dfm"
extern intf_thread_t *p_intfGlobal;
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
__fastcall TDiscDlg::TDiscDlg( TComponent* Owner ) __fastcall TDiscDlg::TDiscDlg( TComponent* Owner, intf_thread_t *_p_intf )
: TForm( Owner ) : TForm( Owner )
{ {
p_intf = _p_intf;
/* Simulate a click to get the correct device name */ /* Simulate a click to get the correct device name */
RadioGroupTypeClick( RadioGroupType ); RadioGroupTypeClick( RadioGroupType );
Translate( this ); Translate( this );
...@@ -48,12 +47,12 @@ __fastcall TDiscDlg::TDiscDlg( TComponent* Owner ) ...@@ -48,12 +47,12 @@ __fastcall TDiscDlg::TDiscDlg( TComponent* Owner )
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void __fastcall TDiscDlg::FormShow( TObject *Sender ) void __fastcall TDiscDlg::FormShow( TObject *Sender )
{ {
p_intfGlobal->p_sys->p_window->OpenDiscAction->Checked = true; p_intf->p_sys->p_window->OpenDiscAction->Checked = true;
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void __fastcall TDiscDlg::FormHide( TObject *Sender ) void __fastcall TDiscDlg::FormHide( TObject *Sender )
{ {
p_intfGlobal->p_sys->p_window->OpenDiscAction->Checked = false; p_intf->p_sys->p_window->OpenDiscAction->Checked = false;
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void __fastcall TDiscDlg::BitBtnCancelClick( TObject *Sender ) void __fastcall TDiscDlg::BitBtnCancelClick( TObject *Sender )
...@@ -67,7 +66,7 @@ void __fastcall TDiscDlg::BitBtnOkClick( TObject *Sender ) ...@@ -67,7 +66,7 @@ void __fastcall TDiscDlg::BitBtnOkClick( TObject *Sender )
playlist_t * p_playlist; playlist_t * p_playlist;
p_playlist = (playlist_t *) p_playlist = (playlist_t *)
vlc_object_find( p_intfGlobal, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE ); vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist == NULL ) if( p_playlist == NULL )
{ {
return; return;
...@@ -97,7 +96,7 @@ void __fastcall TDiscDlg::BitBtnOkClick( TObject *Sender ) ...@@ -97,7 +96,7 @@ void __fastcall TDiscDlg::BitBtnOkClick( TObject *Sender )
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END ); PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
/* update the display */ /* update the display */
p_intfGlobal->p_sys->p_playwin->UpdateGrid( p_playlist ); p_intf->p_sys->p_playwin->UpdateGrid( p_playlist );
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
} }
...@@ -109,11 +108,11 @@ void __fastcall TDiscDlg::RadioGroupTypeClick( TObject *Sender ) ...@@ -109,11 +108,11 @@ void __fastcall TDiscDlg::RadioGroupTypeClick( TObject *Sender )
if( RadioGroupType->ItemIndex == 0 ) if( RadioGroupType->ItemIndex == 0 )
{ {
psz_device = config_GetPsz( p_intfGlobal, "dvd" ); psz_device = config_GetPsz( p_intf, "dvd" );
} }
else else
{ {
psz_device = config_GetPsz( p_intfGlobal, "vcd" ); psz_device = config_GetPsz( p_intf, "vcd" );
} }
if( psz_device ) if( psz_device )
......
...@@ -45,14 +45,15 @@ __published: // IDE-managed Components ...@@ -45,14 +45,15 @@ __published: // IDE-managed Components
TEdit *EditDevice; TEdit *EditDevice;
TCSpinEdit *SpinEditTitle; TCSpinEdit *SpinEditTitle;
TCSpinEdit *SpinEditChapter; TCSpinEdit *SpinEditChapter;
void __fastcall FormShow(TObject *Sender); void __fastcall FormShow( TObject *Sender );
void __fastcall FormHide(TObject *Sender); void __fastcall FormHide( TObject *Sender );
void __fastcall BitBtnCancelClick(TObject *Sender); void __fastcall BitBtnCancelClick( TObject *Sender );
void __fastcall BitBtnOkClick(TObject *Sender); void __fastcall BitBtnOkClick( TObject *Sender);
void __fastcall RadioGroupTypeClick(TObject *Sender); void __fastcall RadioGroupTypeClick( TObject *Sender );
private: // User declarations private: // User declarations
intf_thread_t *p_intf;
public: // User declarations public: // User declarations
__fastcall TDiscDlg( TComponent* Owner ); __fastcall TDiscDlg( TComponent* Owner, intf_thread_t *_p_intf );
}; };
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
#endif #endif
This diff is collapsed.
...@@ -192,9 +192,10 @@ __published: // IDE-managed Components ...@@ -192,9 +192,10 @@ __published: // IDE-managed Components
void __fastcall PrevChapterActionExecute( TObject *Sender ); void __fastcall PrevChapterActionExecute( TObject *Sender );
void __fastcall NextChapterActionExecute( TObject *Sender ); void __fastcall NextChapterActionExecute( TObject *Sender );
private: // User declarations private: // User declarations
intf_thread_t *p_intf;
public: // User declarations public: // User declarations
TStringList *StringListPref; /* stores config dialogs */ TStringList *StringListPref; /* stores config dialogs */
__fastcall TMainFrameDlg( TComponent* Owner ); __fastcall TMainFrameDlg( TComponent* Owner, intf_thread_t *_p_intf );
virtual __fastcall ~TMainFrameDlg(); virtual __fastcall ~TMainFrameDlg();
void __fastcall DisplayHint( TObject *Sender ); void __fastcall DisplayHint( TObject *Sender );
void __fastcall ModeManage(); void __fastcall ModeManage();
......
...@@ -34,13 +34,12 @@ ...@@ -34,13 +34,12 @@
#pragma package(smart_init) #pragma package(smart_init)
#pragma resource "*.dfm" #pragma resource "*.dfm"
extern intf_thread_t *p_intfGlobal;
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
__fastcall TMessagesDlg::TMessagesDlg( TComponent* Owner ) __fastcall TMessagesDlg::TMessagesDlg(
: TForm( Owner ) TComponent* Owner, intf_thread_t *_p_intf ) : TForm( Owner )
{ {
Icon = p_intfGlobal->p_sys->p_window->Icon; p_intf = _p_intf;
Icon = p_intf->p_sys->p_window->Icon;
Translate( this ); Translate( this );
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
...@@ -51,17 +50,17 @@ void __fastcall TMessagesDlg::ButtonOKClick( TObject *Sender ) ...@@ -51,17 +50,17 @@ void __fastcall TMessagesDlg::ButtonOKClick( TObject *Sender )
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void __fastcall TMessagesDlg::FormHide( TObject *Sender ) void __fastcall TMessagesDlg::FormHide( TObject *Sender )
{ {
p_intfGlobal->p_sys->p_window->MessagesAction->Checked = false; p_intf->p_sys->p_window->MessagesAction->Checked = false;
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void __fastcall TMessagesDlg::FormShow( TObject *Sender ) void __fastcall TMessagesDlg::FormShow( TObject *Sender )
{ {
p_intfGlobal->p_sys->p_window->MessagesAction->Checked = true; p_intf->p_sys->p_window->MessagesAction->Checked = true;
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void __fastcall TMessagesDlg::UpdateLog() void __fastcall TMessagesDlg::UpdateLog()
{ {
msg_subscription_t *p_sub = p_intfGlobal->p_sys->p_sub; msg_subscription_t *p_sub = p_intf->p_sys->p_sub;
int i_start, i_stop, i_del, i_count; int i_start, i_stop, i_del, i_count;
int i_max_lines; int i_max_lines;
...@@ -91,7 +90,7 @@ void __fastcall TMessagesDlg::UpdateLog() ...@@ -91,7 +90,7 @@ void __fastcall TMessagesDlg::UpdateLog()
/* Limit log size */ /* Limit log size */
i_count = RichEditMessages->Lines->Count; i_count = RichEditMessages->Lines->Count;
i_max_lines = config_GetInt( p_intfGlobal, "intfwin-max-lines" ); i_max_lines = config_GetInt( p_intf, "intfwin-max-lines" );
if( i_max_lines > 0 ) if( i_max_lines > 0 )
{ {
for( i_del = 0; i_del <= i_count - i_max_lines; i_del++ ) for( i_del = 0; i_del <= i_count - i_max_lines; i_del++ )
......
...@@ -39,8 +39,9 @@ __published: // IDE-managed Components ...@@ -39,8 +39,9 @@ __published: // IDE-managed Components
void __fastcall FormHide( TObject *Sender ); void __fastcall FormHide( TObject *Sender );
void __fastcall FormShow( TObject *Sender ); void __fastcall FormShow( TObject *Sender );
private: // User declarations private: // User declarations
intf_thread_t *p_intf;
public: // User declarations public: // User declarations
__fastcall TMessagesDlg( TComponent* Owner ); __fastcall TMessagesDlg( TComponent* Owner, intf_thread_t *_p_intf );
void __fastcall UpdateLog(); void __fastcall UpdateLog();
}; };
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
......
...@@ -37,47 +37,46 @@ ...@@ -37,47 +37,46 @@
#pragma link "CSPIN" #pragma link "CSPIN"
#pragma resource "*.dfm" #pragma resource "*.dfm"
extern intf_thread_t *p_intfGlobal;
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
__fastcall TNetworkDlg::TNetworkDlg( TComponent* Owner ) __fastcall TNetworkDlg::TNetworkDlg( TComponent* Owner, intf_thread_t *_p_intf )
: TForm( Owner ) : TForm( Owner )
{ {
p_intf = _p_intf;
char *psz_channel_server; char *psz_channel_server;
OldRadioValue = 0; OldRadioValue = 0;
/* server port */ /* server port */
SpinEditUDPPort->Value = config_GetInt( p_intfGlobal, "server-port" ); SpinEditUDPPort->Value = config_GetInt( p_intf, "server-port" );
SpinEditMulticastPort->Value = config_GetInt( p_intfGlobal, "server-port" ); SpinEditMulticastPort->Value = config_GetInt( p_intf, "server-port" );
/* channel server */ /* channel server */
if( config_GetInt( p_intfGlobal, "network-channel" ) ) if( config_GetInt( p_intf, "network-channel" ) )
{ {
RadioButtonCS->Checked = true; RadioButtonCS->Checked = true;
RadioButtonCSEnter( RadioButtonCS ); RadioButtonCSEnter( RadioButtonCS );
} }
psz_channel_server = config_GetPsz( p_intfGlobal, "channel-server" ); psz_channel_server = config_GetPsz( p_intf, "channel-server" );
if( psz_channel_server ) if( psz_channel_server )
{ {
ComboBoxCSAddress->Text = psz_channel_server; ComboBoxCSAddress->Text = psz_channel_server;
free( psz_channel_server ); free( psz_channel_server );
} }
SpinEditCSPort->Value = config_GetInt( p_intfGlobal, "channel-port" ); SpinEditCSPort->Value = config_GetInt( p_intf, "channel-port" );
Translate( this ); Translate( this );
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void __fastcall TNetworkDlg::FormShow( TObject *Sender ) void __fastcall TNetworkDlg::FormShow( TObject *Sender )
{ {
p_intfGlobal->p_sys->p_window->NetworkStreamAction->Checked = true; p_intf->p_sys->p_window->NetworkStreamAction->Checked = true;
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void __fastcall TNetworkDlg::FormHide( TObject *Sender ) void __fastcall TNetworkDlg::FormHide( TObject *Sender )
{ {
p_intfGlobal->p_sys->p_window->NetworkStreamAction->Checked = false; p_intf->p_sys->p_window->NetworkStreamAction->Checked = false;
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void __fastcall TNetworkDlg::BitBtnCancelClick( TObject *Sender ) void __fastcall TNetworkDlg::BitBtnCancelClick( TObject *Sender )
...@@ -94,7 +93,7 @@ void __fastcall TNetworkDlg::BitBtnOkClick( TObject *Sender ) ...@@ -94,7 +93,7 @@ void __fastcall TNetworkDlg::BitBtnOkClick( TObject *Sender )
playlist_t * p_playlist; playlist_t * p_playlist;
p_playlist = (playlist_t *) p_playlist = (playlist_t *)
vlc_object_find( p_intfGlobal, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE ); vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist == NULL ) if( p_playlist == NULL )
{ {
return; return;
...@@ -107,7 +106,7 @@ void __fastcall TNetworkDlg::BitBtnOkClick( TObject *Sender ) ...@@ -107,7 +106,7 @@ void __fastcall TNetworkDlg::BitBtnOkClick( TObject *Sender )
{ {
/* UDP */ /* UDP */
case 0: case 0:
config_PutInt( p_intfGlobal, "network-channel", FALSE ); config_PutInt( p_intf, "network-channel", FALSE );
i_port = SpinEditUDPPort->Value; i_port = SpinEditUDPPort->Value;
/* Build source name */ /* Build source name */
...@@ -117,12 +116,12 @@ void __fastcall TNetworkDlg::BitBtnOkClick( TObject *Sender ) ...@@ -117,12 +116,12 @@ void __fastcall TNetworkDlg::BitBtnOkClick( TObject *Sender )
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END ); PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
/* update the display */ /* update the display */
p_intfGlobal->p_sys->p_playwin->UpdateGrid( p_playlist ); p_intf->p_sys->p_playwin->UpdateGrid( p_playlist );
break; break;
/* UDP Multicast */ /* UDP Multicast */
case 1: case 1:
config_PutInt( p_intfGlobal, "network-channel", FALSE ); config_PutInt( p_intf, "network-channel", FALSE );
Address = ComboBoxMulticastAddress->Text; Address = ComboBoxMulticastAddress->Text;
i_port = SpinEditMulticastPort->Value; i_port = SpinEditMulticastPort->Value;
...@@ -133,26 +132,26 @@ void __fastcall TNetworkDlg::BitBtnOkClick( TObject *Sender ) ...@@ -133,26 +132,26 @@ void __fastcall TNetworkDlg::BitBtnOkClick( TObject *Sender )
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END ); PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
/* update the display */ /* update the display */
p_intfGlobal->p_sys->p_playwin->UpdateGrid( p_playlist ); p_intf->p_sys->p_playwin->UpdateGrid( p_playlist );
break; break;
/* Channel server */ /* Channel server */
case 2: case 2:
config_PutInt( p_intfGlobal, "network-channel", TRUE ); config_PutInt( p_intf, "network-channel", TRUE );
config_PutPsz( p_intfGlobal, "channel-server", Channel.c_str() ); config_PutPsz( p_intf, "channel-server", Channel.c_str() );
config_PutInt( p_intfGlobal, "channel-port", i_channel_port ); config_PutInt( p_intf, "channel-port", i_channel_port );
if( p_intfGlobal->p_vlc->p_channel == NULL ) if( p_intf->p_vlc->p_channel == NULL )
{ {
network_ChannelCreate( p_intfGlobal ); network_ChannelCreate( p_intf );
} }
p_intfGlobal->p_sys->b_playing = 1; p_intf->p_sys->b_playing = 1;
break; break;
/* HTTP */ /* HTTP */
case 3: case 3:
config_PutInt( p_intfGlobal, "network-channel", FALSE ); config_PutInt( p_intf, "network-channel", FALSE );
Address = EditHTTPURL->Text; Address = EditHTTPURL->Text;
/* Build source name with a basic test */ /* Build source name with a basic test */
...@@ -169,7 +168,7 @@ void __fastcall TNetworkDlg::BitBtnOkClick( TObject *Sender ) ...@@ -169,7 +168,7 @@ void __fastcall TNetworkDlg::BitBtnOkClick( TObject *Sender )
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END ); PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
/* update the display */ /* update the display */
p_intfGlobal->p_sys->p_playwin->UpdateGrid( p_playlist ); p_intf->p_sys->p_playwin->UpdateGrid( p_playlist );
break; break;
} }
......
...@@ -68,8 +68,9 @@ __published: // IDE-managed Components ...@@ -68,8 +68,9 @@ __published: // IDE-managed Components
private: // User declarations private: // User declarations
int OldRadioValue; int OldRadioValue;
void __fastcall ChangeEnabled( int i_selected ); void __fastcall ChangeEnabled( int i_selected );
intf_thread_t *p_intf;
public: // User declarations public: // User declarations
__fastcall TNetworkDlg( TComponent* Owner ); __fastcall TNetworkDlg( TComponent* Owner, intf_thread_t *_p_intf );
}; };
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
#endif #endif
...@@ -34,13 +34,12 @@ ...@@ -34,13 +34,12 @@
//#pragma package(smart_init) //#pragma package(smart_init)
#pragma resource "*.dfm" #pragma resource "*.dfm"
extern intf_thread_t *p_intfGlobal;
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
__fastcall TPlaylistDlg::TPlaylistDlg( TComponent* Owner ) __fastcall TPlaylistDlg::TPlaylistDlg(
: TForm( Owner ) TComponent* Owner, intf_thread_t *_p_intf ) : TForm( Owner )
{ {
Icon = p_intfGlobal->p_sys->p_window->Icon; p_intf = _p_intf;
Icon = p_intf->p_sys->p_window->Icon;
Translate( this ); Translate( this );
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
...@@ -70,12 +69,12 @@ char * __fastcall TPlaylistDlg::rindex( char *s, char c ) ...@@ -70,12 +69,12 @@ char * __fastcall TPlaylistDlg::rindex( char *s, char c )
****************************************************************************/ ****************************************************************************/
void __fastcall TPlaylistDlg::FormShow( TObject *Sender ) void __fastcall TPlaylistDlg::FormShow( TObject *Sender )
{ {
p_intfGlobal->p_sys->p_window->PlaylistAction->Checked = true; p_intf->p_sys->p_window->PlaylistAction->Checked = true;
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void __fastcall TPlaylistDlg::FormHide( TObject *Sender ) void __fastcall TPlaylistDlg::FormHide( TObject *Sender )
{ {
p_intfGlobal->p_sys->p_window->PlaylistAction->Checked = false; p_intf->p_sys->p_window->PlaylistAction->Checked = false;
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void __fastcall TPlaylistDlg::BitBtnOkClick( TObject *Sender ) void __fastcall TPlaylistDlg::BitBtnOkClick( TObject *Sender )
...@@ -90,7 +89,7 @@ void __fastcall TPlaylistDlg::PlayStreamActionExecute( TObject *Sender ) ...@@ -90,7 +89,7 @@ void __fastcall TPlaylistDlg::PlayStreamActionExecute( TObject *Sender )
TItemStates Focused; TItemStates Focused;
playlist_t * p_playlist = (playlist_t *) playlist_t * p_playlist = (playlist_t *)
vlc_object_find( p_intfGlobal, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE ); vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist == NULL ) if( p_playlist == NULL )
{ {
return; return;
...@@ -140,7 +139,7 @@ void __fastcall TPlaylistDlg::ListViewPlaylistCustomDrawItem( ...@@ -140,7 +139,7 @@ void __fastcall TPlaylistDlg::ListViewPlaylistCustomDrawItem(
TRect Rect = Item->DisplayRect( drBounds ); TRect Rect = Item->DisplayRect( drBounds );
/* set the background color */ /* set the background color */
if( Item->Index == p_intfGlobal->p_sys->i_playing ) if( Item->Index == p_intf->p_sys->i_playing )
{ {
Sender->Canvas->Brush->Color = clRed; Sender->Canvas->Brush->Color = clRed;
} }
...@@ -159,17 +158,17 @@ void __fastcall TPlaylistDlg::ListViewPlaylistCustomDrawItem( ...@@ -159,17 +158,17 @@ void __fastcall TPlaylistDlg::ListViewPlaylistCustomDrawItem(
****************************************************************************/ ****************************************************************************/
void __fastcall TPlaylistDlg::MenuAddFileClick( TObject *Sender ) void __fastcall TPlaylistDlg::MenuAddFileClick( TObject *Sender )
{ {
p_intfGlobal->p_sys->p_window->OpenFileActionExecute( Sender ); p_intf->p_sys->p_window->OpenFileActionExecute( Sender );
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void __fastcall TPlaylistDlg::MenuAddDiscClick( TObject *Sender ) void __fastcall TPlaylistDlg::MenuAddDiscClick( TObject *Sender )
{ {
p_intfGlobal->p_sys->p_window->OpenDiscActionExecute( Sender ); p_intf->p_sys->p_window->OpenDiscActionExecute( Sender );
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void __fastcall TPlaylistDlg::MenuAddNetClick( TObject *Sender ) void __fastcall TPlaylistDlg::MenuAddNetClick( TObject *Sender )
{ {
p_intfGlobal->p_sys->p_window->NetworkStreamActionExecute( Sender ); p_intf->p_sys->p_window->NetworkStreamActionExecute( Sender );
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void __fastcall TPlaylistDlg::MenuAddUrlClick( TObject *Sender ) void __fastcall TPlaylistDlg::MenuAddUrlClick( TObject *Sender )
...@@ -182,10 +181,10 @@ void __fastcall TPlaylistDlg::DeleteSelectionActionExecute( TObject *Sender ) ...@@ -182,10 +181,10 @@ void __fastcall TPlaylistDlg::DeleteSelectionActionExecute( TObject *Sender )
#if 0 /* PLAYLIST TARASS */ #if 0 /* PLAYLIST TARASS */
/* user wants to delete a file in the queue */ /* user wants to delete a file in the queue */
int i_pos; int i_pos;
playlist_t *p_playlist = p_intfGlobal->p_vlc->p_playlist; playlist_t *p_playlist = p_intf->p_vlc->p_playlist;
/* lock the struct */ /* lock the struct */
vlc_mutex_lock( &p_intfGlobal->change_lock ); vlc_mutex_lock( &p_intf->change_lock );
/* delete the items from the last to the first */ /* delete the items from the last to the first */
for( i_pos = p_playlist->i_size - 1; i_pos >= 0; i_pos-- ) for( i_pos = p_playlist->i_size - 1; i_pos >= 0; i_pos-- )
...@@ -199,7 +198,7 @@ void __fastcall TPlaylistDlg::DeleteSelectionActionExecute( TObject *Sender ) ...@@ -199,7 +198,7 @@ void __fastcall TPlaylistDlg::DeleteSelectionActionExecute( TObject *Sender )
/* Rebuild the ListView */ /* Rebuild the ListView */
UpdateGrid( p_playlist ); UpdateGrid( p_playlist );
vlc_mutex_unlock( &p_intfGlobal->change_lock ); vlc_mutex_unlock( &p_intf->change_lock );
#endif #endif
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
...@@ -207,10 +206,10 @@ void __fastcall TPlaylistDlg::DeleteAllActionExecute( TObject *Sender ) ...@@ -207,10 +206,10 @@ void __fastcall TPlaylistDlg::DeleteAllActionExecute( TObject *Sender )
{ {
#if 0 /* PLAYLIST TARASS */ #if 0 /* PLAYLIST TARASS */
int i_pos; int i_pos;
playlist_t *p_playlist = p_intfGlobal->p_vlc->p_playlist; playlist_t *p_playlist = p_intf->p_vlc->p_playlist;
/* lock the struct */ /* lock the struct */
vlc_mutex_lock( &p_intfGlobal->change_lock ); vlc_mutex_lock( &p_intf->change_lock );
/* delete the items from the last to the first */ /* delete the items from the last to the first */
for( i_pos = p_playlist->i_size - 1; i_pos >= 0; i_pos-- ) for( i_pos = p_playlist->i_size - 1; i_pos >= 0; i_pos-- )
...@@ -221,7 +220,7 @@ void __fastcall TPlaylistDlg::DeleteAllActionExecute( TObject *Sender ) ...@@ -221,7 +220,7 @@ void __fastcall TPlaylistDlg::DeleteAllActionExecute( TObject *Sender )
/* Rebuild the ListView */ /* Rebuild the ListView */
UpdateGrid( p_playlist ); UpdateGrid( p_playlist );
vlc_mutex_unlock( &p_intfGlobal->change_lock ); vlc_mutex_unlock( &p_intf->change_lock );
#endif #endif
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
...@@ -230,7 +229,7 @@ void __fastcall TPlaylistDlg::InvertSelectionActionExecute( TObject *Sender ) ...@@ -230,7 +229,7 @@ void __fastcall TPlaylistDlg::InvertSelectionActionExecute( TObject *Sender )
#if 0 /* PLAYLIST TARASS */ #if 0 /* PLAYLIST TARASS */
#define NOT( var ) ( (var) ? false : true ) #define NOT( var ) ( (var) ? false : true )
int i_pos; int i_pos;
playlist_t *p_playlist = p_intfGlobal->p_vlc->p_playlist; playlist_t *p_playlist = p_intf->p_vlc->p_playlist;
TListItems *Items = ListViewPlaylist->Items; TListItems *Items = ListViewPlaylist->Items;
/* delete the items from the last to the first */ /* delete the items from the last to the first */
...@@ -293,10 +292,10 @@ void __fastcall TPlaylistDlg::UpdateGrid( playlist_t * p_playlist ) ...@@ -293,10 +292,10 @@ void __fastcall TPlaylistDlg::UpdateGrid( playlist_t * p_playlist )
ListViewPlaylist->Items->EndUpdate(); ListViewPlaylist->Items->EndUpdate();
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void __fastcall TPlaylistDlg::Manage( intf_thread_t * p_intf ) void __fastcall TPlaylistDlg::Manage()
{ {
playlist_t * p_playlist = (playlist_t *) playlist_t * p_playlist = (playlist_t *)
vlc_object_find( p_intfGlobal, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE ); vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist == NULL ) if( p_playlist == NULL )
{ {
return; return;
...@@ -319,37 +318,40 @@ void __fastcall TPlaylistDlg::Manage( intf_thread_t * p_intf ) ...@@ -319,37 +318,40 @@ void __fastcall TPlaylistDlg::Manage( intf_thread_t * p_intf )
void __fastcall TPlaylistDlg::DeleteItem( int i_pos ) void __fastcall TPlaylistDlg::DeleteItem( int i_pos )
{ {
playlist_t * p_playlist = (playlist_t *) playlist_t * p_playlist = (playlist_t *)
vlc_object_find( p_intfGlobal, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE ); vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist == NULL ) if( p_playlist == NULL )
{ {
return; return;
} }
playlist_Delete( p_playlist, i_pos ); playlist_Delete( p_playlist, i_pos );
vlc_object_release( p_playlist );
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void __fastcall TPlaylistDlg::Previous() void __fastcall TPlaylistDlg::Previous()
{ {
playlist_t * p_playlist = (playlist_t *) playlist_t * p_playlist = (playlist_t *)
vlc_object_find( p_intfGlobal, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE ); vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist == NULL ) if( p_playlist == NULL )
{ {
return; return;
} }
playlist_Prev( p_playlist ); playlist_Prev( p_playlist );
vlc_object_release( p_playlist );
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void __fastcall TPlaylistDlg::Next() void __fastcall TPlaylistDlg::Next()
{ {
playlist_t * p_playlist = (playlist_t *) playlist_t * p_playlist = (playlist_t *)
vlc_object_find( p_intfGlobal, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE ); vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist == NULL ) if( p_playlist == NULL )
{ {
return; return;
} }
playlist_Next( p_playlist ); playlist_Next( p_playlist );
vlc_object_release( p_playlist );
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
...@@ -83,10 +83,11 @@ __published: // IDE-managed Components ...@@ -83,10 +83,11 @@ __published: // IDE-managed Components
void __fastcall PlayStreamActionExecute( TObject *Sender ); void __fastcall PlayStreamActionExecute( TObject *Sender );
private: // User declarations private: // User declarations
char * __fastcall rindex( char *s, char c ); char * __fastcall rindex( char *s, char c );
intf_thread_t *p_intf;
public: // User declarations public: // User declarations
__fastcall TPlaylistDlg( TComponent* Owner ); __fastcall TPlaylistDlg( TComponent* Owner, intf_thread_t *_p_intf );
void __fastcall UpdateGrid( playlist_t * p_playlist ); void __fastcall UpdateGrid( playlist_t * p_playlist );
void __fastcall Manage( intf_thread_t * p_intf ); void __fastcall Manage();
void __fastcall DeleteItem( int i_pos ); void __fastcall DeleteItem( int i_pos );
void __fastcall Previous(); void __fastcall Previous();
void __fastcall Next(); void __fastcall Next();
......
...@@ -106,9 +106,9 @@ static void Close ( vlc_object_t *p_this ) ...@@ -106,9 +106,9 @@ static void Close ( vlc_object_t *p_this )
*****************************************************************************/ *****************************************************************************/
static void Run( intf_thread_t *p_intf ) static void Run( intf_thread_t *p_intf )
{ {
p_intf->p_sys->p_window = new TMainFrameDlg( NULL ); p_intf->p_sys->p_window = new TMainFrameDlg( NULL, p_intf );
p_intf->p_sys->p_playwin = new TPlaylistDlg( NULL ); p_intf->p_sys->p_playwin = new TPlaylistDlg( NULL, p_intf );
p_intf->p_sys->p_messages = new TMessagesDlg( NULL ); p_intf->p_sys->p_messages = new TMessagesDlg( NULL, p_intf );
/* show main window and wait until it is closed */ /* show main window and wait until it is closed */
p_intf->p_sys->p_window->ShowModal(); p_intf->p_sys->p_window->ShowModal();
...@@ -145,7 +145,7 @@ int Win32Manage( intf_thread_t *p_intf ) ...@@ -145,7 +145,7 @@ int Win32Manage( intf_thread_t *p_intf )
p_intf->p_sys->p_messages->UpdateLog(); p_intf->p_sys->p_messages->UpdateLog();
/* Update the playlist */ /* Update the playlist */
p_intf->p_sys->p_playwin->Manage( p_intf ); p_intf->p_sys->p_playwin->Manage();
/* Update the input */ /* Update the input */
if( p_intf->p_sys->p_input == NULL ) if( p_intf->p_sys->p_input == NULL )
......
...@@ -59,7 +59,6 @@ struct intf_sys_t ...@@ -59,7 +59,6 @@ struct intf_sys_t
TMainFrameDlg * p_window; /* main window */ TMainFrameDlg * p_window; /* main window */
TPlaylistDlg * p_playwin; /* playlist */ TPlaylistDlg * p_playwin; /* playlist */
TPopupMenu * p_popup; /* popup menu */ TPopupMenu * p_popup; /* popup menu */
TAboutDlg * p_about; /* about window */
TDiscDlg * p_disc; /* disc selection window */ TDiscDlg * p_disc; /* disc selection window */
TNetworkDlg * p_network; /* network stream window */ TNetworkDlg * p_network; /* network stream window */
TPreferencesDlg * p_preferences; /* preferences window */ TPreferencesDlg * p_preferences; /* preferences window */
......
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