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
...@@ -46,13 +46,14 @@ ...@@ -46,13 +46,14 @@
#pragma link "CSPIN" #pragma link "CSPIN"
#pragma resource "*.dfm" #pragma resource "*.dfm"
extern intf_thread_t *p_intfGlobal;
extern int Win32Manage( intf_thread_t *p_intf ); extern int Win32Manage( intf_thread_t *p_intf );
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
__fastcall TMainFrameDlg::TMainFrameDlg( TComponent* Owner ) __fastcall TMainFrameDlg::TMainFrameDlg(
: TForm( Owner ) TComponent* Owner, intf_thread_t *_p_intf ) : TForm( Owner )
{ {
p_intf = _p_intf;
Application->ShowHint = true; Application->ShowHint = true;
Application->OnHint = DisplayHint; Application->OnHint = DisplayHint;
...@@ -81,7 +82,7 @@ __fastcall TMainFrameDlg::~TMainFrameDlg() ...@@ -81,7 +82,7 @@ __fastcall TMainFrameDlg::~TMainFrameDlg()
****************************************************************************/ ****************************************************************************/
void __fastcall TMainFrameDlg::TimerManageTimer( TObject *Sender ) void __fastcall TMainFrameDlg::TimerManageTimer( TObject *Sender )
{ {
Win32Manage( p_intfGlobal ); Win32Manage( p_intf );
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void __fastcall TMainFrameDlg::DisplayHint( TObject *Sender ) void __fastcall TMainFrameDlg::DisplayHint( TObject *Sender )
...@@ -95,28 +96,26 @@ void __fastcall TMainFrameDlg::TrackBarChange( TObject *Sender ) ...@@ -95,28 +96,26 @@ void __fastcall TMainFrameDlg::TrackBarChange( TObject *Sender )
* the stream. It is called whenever the slider changes its value. * the stream. It is called whenever the slider changes its value.
* The lock has to be taken before the function is called */ * The lock has to be taken before the function is called */
// vlc_mutex_lock( &p_intfGlobal->p_sys->p_input->stream.stream_lock ); // vlc_mutex_lock( &p_intf->p_sys->p_input->stream.stream_lock );
if( p_intfGlobal->p_sys->p_input != NULL ) if( p_intf->p_sys->p_input != NULL )
{ {
#define p_area p_intfGlobal->p_sys->p_input->stream.p_selected_area #define p_area p_intf->p_sys->p_input->stream.p_selected_area
char psz_time[ OFFSETTOTIME_MAX_SIZE ]; char psz_time[ OFFSETTOTIME_MAX_SIZE ];
off_t Value = TrackBar->Position; off_t Value = TrackBar->Position;
GroupBoxSlider->Caption = GroupBoxSlider->Caption =
input_OffsetToTime( p_intfGlobal->p_sys->p_input, psz_time, input_OffsetToTime( p_intf->p_sys->p_input, psz_time,
( p_area->i_size * Value ) / (off_t)SLIDER_MAX_VALUE ); ( p_area->i_size * Value ) / (off_t)SLIDER_MAX_VALUE );
#undef p_area #undef p_area
} }
// vlc_mutex_unlock( &p_intfGlobal->p_sys->p_input->stream.stream_lock ); // vlc_mutex_unlock( &p_intf->p_sys->p_input->stream.stream_lock );
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void __fastcall TMainFrameDlg::FormClose( TObject *Sender, void __fastcall TMainFrameDlg::FormClose( TObject *Sender,
TCloseAction &Action ) TCloseAction &Action )
{ {
intf_thread_t *p_intf = p_intfGlobal;
vlc_mutex_lock( &p_intf->change_lock ); vlc_mutex_lock( &p_intf->change_lock );
p_intf->p_vlc->b_die = VLC_TRUE; p_intf->p_vlc->b_die = VLC_TRUE;
vlc_mutex_unlock( &p_intf->change_lock ); vlc_mutex_unlock( &p_intf->change_lock );
...@@ -135,7 +134,7 @@ void __fastcall TMainFrameDlg::OpenFileActionExecute( TObject *Sender ) ...@@ -135,7 +134,7 @@ void __fastcall TMainFrameDlg::OpenFileActionExecute( TObject *Sender )
AnsiString FileName; AnsiString FileName;
playlist_t * p_playlist; playlist_t * p_playlist;
p_playlist = (playlist_t *)vlc_object_find( p_intfGlobal, p_playlist = (playlist_t *)vlc_object_find( p_intf,
VLC_OBJECT_PLAYLIST, FIND_ANYWHERE ); VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist == NULL ) if( p_playlist == NULL )
{ {
...@@ -150,7 +149,7 @@ void __fastcall TMainFrameDlg::OpenFileActionExecute( TObject *Sender ) ...@@ -150,7 +149,7 @@ void __fastcall TMainFrameDlg::OpenFileActionExecute( TObject *Sender )
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END ); PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
/* update the plugin display */ /* update the plugin 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 );
...@@ -158,22 +157,22 @@ void __fastcall TMainFrameDlg::OpenFileActionExecute( TObject *Sender ) ...@@ -158,22 +157,22 @@ void __fastcall TMainFrameDlg::OpenFileActionExecute( TObject *Sender )
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void __fastcall TMainFrameDlg::OpenDiscActionExecute( TObject *Sender ) void __fastcall TMainFrameDlg::OpenDiscActionExecute( TObject *Sender )
{ {
TDiscDlg *p_disc = p_intfGlobal->p_sys->p_disc; TDiscDlg *p_disc = p_intf->p_sys->p_disc;
if( p_disc == NULL ) if( p_disc == NULL )
{ {
p_disc = new TDiscDlg( this ); p_disc = new TDiscDlg( this, p_intf );
p_intfGlobal->p_sys->p_disc = p_disc; p_intf->p_sys->p_disc = p_disc;
} }
p_disc->Show(); p_disc->Show();
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void __fastcall TMainFrameDlg::NetworkStreamActionExecute( TObject *Sender ) void __fastcall TMainFrameDlg::NetworkStreamActionExecute( TObject *Sender )
{ {
TNetworkDlg *p_network = p_intfGlobal->p_sys->p_network; TNetworkDlg *p_network = p_intf->p_sys->p_network;
if( p_network == NULL ) if( p_network == NULL )
{ {
p_network = new TNetworkDlg( this ); p_network = new TNetworkDlg( this, p_intf );
p_intfGlobal->p_sys->p_network = p_network; p_intf->p_sys->p_network = p_network;
} }
p_network->Show(); p_network->Show();
} }
...@@ -187,7 +186,7 @@ void __fastcall TMainFrameDlg::FullscreenActionExecute( TObject *Sender ) ...@@ -187,7 +186,7 @@ void __fastcall TMainFrameDlg::FullscreenActionExecute( TObject *Sender )
{ {
vout_thread_t *p_vout; vout_thread_t *p_vout;
p_vout = (vout_thread_t *)vlc_object_find( p_intfGlobal->p_sys->p_input, p_vout = (vout_thread_t *)vlc_object_find( p_intf->p_sys->p_input,
VLC_OBJECT_VOUT, FIND_CHILD ); VLC_OBJECT_VOUT, FIND_CHILD );
if( p_vout == NULL ) if( p_vout == NULL )
{ {
...@@ -200,7 +199,7 @@ void __fastcall TMainFrameDlg::FullscreenActionExecute( TObject *Sender ) ...@@ -200,7 +199,7 @@ void __fastcall TMainFrameDlg::FullscreenActionExecute( TObject *Sender )
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void __fastcall TMainFrameDlg::PlaylistActionExecute( TObject *Sender ) void __fastcall TMainFrameDlg::PlaylistActionExecute( TObject *Sender )
{ {
TPlaylistDlg *p_playwin = p_intfGlobal->p_sys->p_playwin; TPlaylistDlg *p_playwin = p_intf->p_sys->p_playwin;
if( p_playwin->Visible ) if( p_playwin->Visible )
{ {
p_playwin->Hide(); p_playwin->Hide();
...@@ -208,7 +207,7 @@ void __fastcall TMainFrameDlg::PlaylistActionExecute( TObject *Sender ) ...@@ -208,7 +207,7 @@ void __fastcall TMainFrameDlg::PlaylistActionExecute( TObject *Sender )
else else
{ {
playlist_t * p_playlist; playlist_t * p_playlist;
p_playlist = (playlist_t *)vlc_object_find( p_intfGlobal, p_playlist = (playlist_t *)vlc_object_find( p_intf,
VLC_OBJECT_PLAYLIST, FIND_ANYWHERE ); VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist == NULL ) if( p_playlist == NULL )
{ {
...@@ -223,7 +222,7 @@ void __fastcall TMainFrameDlg::PlaylistActionExecute( TObject *Sender ) ...@@ -223,7 +222,7 @@ void __fastcall TMainFrameDlg::PlaylistActionExecute( TObject *Sender )
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void __fastcall TMainFrameDlg::MessagesActionExecute( TObject *Sender ) void __fastcall TMainFrameDlg::MessagesActionExecute( TObject *Sender )
{ {
p_intfGlobal->p_sys->p_messages->Show(); p_intf->p_sys->p_messages->Show();
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void __fastcall TMainFrameDlg::PreferencesActionExecute( TObject *Sender ) void __fastcall TMainFrameDlg::PreferencesActionExecute( TObject *Sender )
...@@ -233,9 +232,9 @@ void __fastcall TMainFrameDlg::PreferencesActionExecute( TObject *Sender ) ...@@ -233,9 +232,9 @@ void __fastcall TMainFrameDlg::PreferencesActionExecute( TObject *Sender )
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void __fastcall TMainFrameDlg::AboutActionExecute( TObject *Sender ) void __fastcall TMainFrameDlg::AboutActionExecute( TObject *Sender )
{ {
p_intfGlobal->p_sys->p_about = new TAboutDlg( this ); TAboutDlg *AboutDlg = new TAboutDlg( this, p_intf );
p_intfGlobal->p_sys->p_about->ShowModal(); AboutDlg->ShowModal();
delete p_intfGlobal->p_sys->p_about; delete AboutDlg;
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void __fastcall TMainFrameDlg::BackActionExecute( TObject *Sender ) void __fastcall TMainFrameDlg::BackActionExecute( TObject *Sender )
...@@ -270,12 +269,12 @@ void __fastcall TMainFrameDlg::FastActionExecute( TObject *Sender ) ...@@ -270,12 +269,12 @@ void __fastcall TMainFrameDlg::FastActionExecute( TObject *Sender )
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void __fastcall TMainFrameDlg::PreviousActionExecute(TObject *Sender) void __fastcall TMainFrameDlg::PreviousActionExecute(TObject *Sender)
{ {
p_intfGlobal->p_sys->p_playwin->Previous(); p_intf->p_sys->p_playwin->Previous();
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void __fastcall TMainFrameDlg::NextActionExecute(TObject *Sender) void __fastcall TMainFrameDlg::NextActionExecute(TObject *Sender)
{ {
p_intfGlobal->p_sys->p_playwin->Next(); p_intf->p_sys->p_playwin->Next();
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void __fastcall TMainFrameDlg::EjectActionExecute( TObject *Sender ) void __fastcall TMainFrameDlg::EjectActionExecute( TObject *Sender )
...@@ -284,7 +283,7 @@ void __fastcall TMainFrameDlg::EjectActionExecute( TObject *Sender ) ...@@ -284,7 +283,7 @@ void __fastcall TMainFrameDlg::EjectActionExecute( TObject *Sender )
char * psz_current; char * psz_current;
playlist_t * p_playlist; playlist_t * p_playlist;
p_playlist = (playlist_t *)vlc_object_find( p_intfGlobal, p_playlist = (playlist_t *)vlc_object_find( p_intf,
VLC_OBJECT_PLAYLIST, FIND_ANYWHERE ); VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist == NULL ) if( p_playlist == NULL )
{ {
...@@ -321,11 +320,11 @@ void __fastcall TMainFrameDlg::EjectActionExecute( TObject *Sender ) ...@@ -321,11 +320,11 @@ void __fastcall TMainFrameDlg::EjectActionExecute( TObject *Sender )
} }
/* If there's a stream playing, we aren't allowed to eject ! */ /* If there's a stream playing, we aren't allowed to eject ! */
if( p_intfGlobal->p_sys->p_input == NULL ) if( p_intf->p_sys->p_input == NULL )
{ {
msg_Dbg( p_intfGlobal, "ejecting %s", Device.c_str() ); msg_Dbg( p_intf, "ejecting %s", Device.c_str() );
intf_Eject( p_intfGlobal, Device.c_str() ); intf_Eject( p_intf, Device.c_str() );
} }
} }
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
...@@ -363,11 +362,9 @@ void __fastcall TMainFrameDlg::PopupJumpClick( TObject *Sender ) ...@@ -363,11 +362,9 @@ void __fastcall TMainFrameDlg::PopupJumpClick( TObject *Sender )
****************************************************************************/ ****************************************************************************/
void __fastcall TMainFrameDlg::PrevTitleActionExecute( TObject *Sender ) void __fastcall TMainFrameDlg::PrevTitleActionExecute( TObject *Sender )
{ {
intf_thread_t * p_intf;
input_area_t * p_area; input_area_t * p_area;
int i_id; int i_id;
p_intf = p_intfGlobal;
i_id = p_intf->p_sys->p_input->stream.p_selected_area->i_id - 1; i_id = p_intf->p_sys->p_input->stream.p_selected_area->i_id - 1;
/* Disallow area 0 since it is used for video_ts.vob */ /* Disallow area 0 since it is used for video_ts.vob */
...@@ -387,11 +384,9 @@ void __fastcall TMainFrameDlg::PrevTitleActionExecute( TObject *Sender ) ...@@ -387,11 +384,9 @@ void __fastcall TMainFrameDlg::PrevTitleActionExecute( TObject *Sender )
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void __fastcall TMainFrameDlg::NextTitleActionExecute( TObject *Sender ) void __fastcall TMainFrameDlg::NextTitleActionExecute( TObject *Sender )
{ {
intf_thread_t * p_intf;
input_area_t * p_area; input_area_t * p_area;
int i_id; int i_id;
p_intf = p_intfGlobal;
i_id = p_intf->p_sys->p_input->stream.p_selected_area->i_id + 1; i_id = p_intf->p_sys->p_input->stream.p_selected_area->i_id + 1;
if( i_id < p_intf->p_sys->p_input->stream.i_area_nb ) if( i_id < p_intf->p_sys->p_input->stream.i_area_nb )
...@@ -410,7 +405,6 @@ void __fastcall TMainFrameDlg::NextTitleActionExecute( TObject *Sender ) ...@@ -410,7 +405,6 @@ void __fastcall TMainFrameDlg::NextTitleActionExecute( TObject *Sender )
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void __fastcall TMainFrameDlg::PrevChapterActionExecute( TObject *Sender ) void __fastcall TMainFrameDlg::PrevChapterActionExecute( TObject *Sender )
{ {
intf_thread_t * p_intf = p_intfGlobal;
input_area_t * p_area; input_area_t * p_area;
p_area = p_intf->p_sys->p_input->stream.p_selected_area; p_area = p_intf->p_sys->p_input->stream.p_selected_area;
...@@ -431,7 +425,6 @@ void __fastcall TMainFrameDlg::PrevChapterActionExecute( TObject *Sender ) ...@@ -431,7 +425,6 @@ void __fastcall TMainFrameDlg::PrevChapterActionExecute( TObject *Sender )
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void __fastcall TMainFrameDlg::NextChapterActionExecute( TObject *Sender ) void __fastcall TMainFrameDlg::NextChapterActionExecute( TObject *Sender )
{ {
intf_thread_t * p_intf = p_intfGlobal;
input_area_t * p_area; input_area_t * p_area;
p_area = p_intf->p_sys->p_input->stream.p_selected_area; p_area = p_intf->p_sys->p_input->stream.p_selected_area;
...@@ -457,7 +450,6 @@ void __fastcall TMainFrameDlg::NextChapterActionExecute( TObject *Sender ) ...@@ -457,7 +450,6 @@ void __fastcall TMainFrameDlg::NextChapterActionExecute( TObject *Sender )
****************************************************************************/ ****************************************************************************/
void __fastcall TMainFrameDlg::ButtonGoClick( TObject *Sender ) void __fastcall TMainFrameDlg::ButtonGoClick( TObject *Sender )
{ {
intf_thread_t *p_intf = p_intfGlobal;
int i_channel; int i_channel;
i_channel = SpinEditChannel->Value; i_channel = SpinEditChannel->Value;
...@@ -480,7 +472,6 @@ void __fastcall TMainFrameDlg::ButtonGoClick( TObject *Sender ) ...@@ -480,7 +472,6 @@ void __fastcall TMainFrameDlg::ButtonGoClick( TObject *Sender )
*****************************************************************************/ *****************************************************************************/
void __fastcall TMainFrameDlg::ModeManage() void __fastcall TMainFrameDlg::ModeManage()
{ {
intf_thread_t * p_intf = p_intfGlobal;
TGroupBox * ActiveGB; TGroupBox * ActiveGB;
int i_Height; int i_Height;
bool b_control; bool b_control;
......
...@@ -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