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

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

parent 7244736d
......@@ -34,13 +34,12 @@
//#pragma package(smart_init)
#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 )
{
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;
Translate( this );
}
......
......@@ -43,8 +43,9 @@ __published: // IDE-managed Components
TLabel *Label5;
TLabel *LabelVersion;
private: // User declarations
intf_thread_t *p_intf;
public: // User declarations
__fastcall TAboutDlg( TComponent* Owner );
__fastcall TAboutDlg( TComponent* Owner, intf_thread_t *_p_intf );
};
//---------------------------------------------------------------------------
#endif
......@@ -35,12 +35,11 @@
#pragma link "CSPIN"
#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 )
{
p_intf = _p_intf;
/* Simulate a click to get the correct device name */
RadioGroupTypeClick( RadioGroupType );
Translate( this );
......@@ -48,12 +47,12 @@ __fastcall TDiscDlg::TDiscDlg( TComponent* Owner )
//---------------------------------------------------------------------------
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 )
{
p_intfGlobal->p_sys->p_window->OpenDiscAction->Checked = false;
p_intf->p_sys->p_window->OpenDiscAction->Checked = false;
}
//---------------------------------------------------------------------------
void __fastcall TDiscDlg::BitBtnCancelClick( TObject *Sender )
......@@ -67,7 +66,7 @@ void __fastcall TDiscDlg::BitBtnOkClick( TObject *Sender )
playlist_t * p_playlist;
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 )
{
return;
......@@ -97,7 +96,7 @@ void __fastcall TDiscDlg::BitBtnOkClick( TObject *Sender )
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
/* 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 );
}
......@@ -109,11 +108,11 @@ void __fastcall TDiscDlg::RadioGroupTypeClick( TObject *Sender )
if( RadioGroupType->ItemIndex == 0 )
{
psz_device = config_GetPsz( p_intfGlobal, "dvd" );
psz_device = config_GetPsz( p_intf, "dvd" );
}
else
{
psz_device = config_GetPsz( p_intfGlobal, "vcd" );
psz_device = config_GetPsz( p_intf, "vcd" );
}
if( psz_device )
......
......@@ -45,14 +45,15 @@ __published: // IDE-managed Components
TEdit *EditDevice;
TCSpinEdit *SpinEditTitle;
TCSpinEdit *SpinEditChapter;
void __fastcall FormShow(TObject *Sender);
void __fastcall FormHide(TObject *Sender);
void __fastcall BitBtnCancelClick(TObject *Sender);
void __fastcall BitBtnOkClick(TObject *Sender);
void __fastcall RadioGroupTypeClick(TObject *Sender);
void __fastcall FormShow( TObject *Sender );
void __fastcall FormHide( TObject *Sender );
void __fastcall BitBtnCancelClick( TObject *Sender );
void __fastcall BitBtnOkClick( TObject *Sender);
void __fastcall RadioGroupTypeClick( TObject *Sender );
private: // User declarations
intf_thread_t *p_intf;
public: // User declarations
__fastcall TDiscDlg( TComponent* Owner );
__fastcall TDiscDlg( TComponent* Owner, intf_thread_t *_p_intf );
};
//---------------------------------------------------------------------------
#endif
......@@ -46,13 +46,14 @@
#pragma link "CSPIN"
#pragma resource "*.dfm"
extern intf_thread_t *p_intfGlobal;
extern int Win32Manage( intf_thread_t *p_intf );
//---------------------------------------------------------------------------
__fastcall TMainFrameDlg::TMainFrameDlg( TComponent* Owner )
: TForm( Owner )
__fastcall TMainFrameDlg::TMainFrameDlg(
TComponent* Owner, intf_thread_t *_p_intf ) : TForm( Owner )
{
p_intf = _p_intf;
Application->ShowHint = true;
Application->OnHint = DisplayHint;
......@@ -81,7 +82,7 @@ __fastcall TMainFrameDlg::~TMainFrameDlg()
****************************************************************************/
void __fastcall TMainFrameDlg::TimerManageTimer( TObject *Sender )
{
Win32Manage( p_intfGlobal );
Win32Manage( p_intf );
}
//---------------------------------------------------------------------------
void __fastcall TMainFrameDlg::DisplayHint( TObject *Sender )
......@@ -95,28 +96,26 @@ void __fastcall TMainFrameDlg::TrackBarChange( TObject *Sender )
* the stream. It is called whenever the slider changes its value.
* 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 ];
off_t Value = TrackBar->Position;
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 );
#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,
TCloseAction &Action )
{
intf_thread_t *p_intf = p_intfGlobal;
vlc_mutex_lock( &p_intf->change_lock );
p_intf->p_vlc->b_die = VLC_TRUE;
vlc_mutex_unlock( &p_intf->change_lock );
......@@ -135,7 +134,7 @@ void __fastcall TMainFrameDlg::OpenFileActionExecute( TObject *Sender )
AnsiString FileName;
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 );
if( p_playlist == NULL )
{
......@@ -150,7 +149,7 @@ void __fastcall TMainFrameDlg::OpenFileActionExecute( TObject *Sender )
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
/* 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 );
......@@ -158,22 +157,22 @@ void __fastcall TMainFrameDlg::OpenFileActionExecute( 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 )
{
p_disc = new TDiscDlg( this );
p_intfGlobal->p_sys->p_disc = p_disc;
p_disc = new TDiscDlg( this, p_intf );
p_intf->p_sys->p_disc = p_disc;
}
p_disc->Show();
}
//---------------------------------------------------------------------------
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 )
{
p_network = new TNetworkDlg( this );
p_intfGlobal->p_sys->p_network = p_network;
p_network = new TNetworkDlg( this, p_intf );
p_intf->p_sys->p_network = p_network;
}
p_network->Show();
}
......@@ -187,7 +186,7 @@ void __fastcall TMainFrameDlg::FullscreenActionExecute( TObject *Sender )
{
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 );
if( p_vout == NULL )
{
......@@ -200,7 +199,7 @@ void __fastcall TMainFrameDlg::FullscreenActionExecute( 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 )
{
p_playwin->Hide();
......@@ -208,7 +207,7 @@ void __fastcall TMainFrameDlg::PlaylistActionExecute( TObject *Sender )
else
{
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 );
if( p_playlist == NULL )
{
......@@ -223,7 +222,7 @@ void __fastcall TMainFrameDlg::PlaylistActionExecute( 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 )
......@@ -233,9 +232,9 @@ void __fastcall TMainFrameDlg::PreferencesActionExecute( TObject *Sender )
//---------------------------------------------------------------------------
void __fastcall TMainFrameDlg::AboutActionExecute( TObject *Sender )
{
p_intfGlobal->p_sys->p_about = new TAboutDlg( this );
p_intfGlobal->p_sys->p_about->ShowModal();
delete p_intfGlobal->p_sys->p_about;
TAboutDlg *AboutDlg = new TAboutDlg( this, p_intf );
AboutDlg->ShowModal();
delete AboutDlg;
}
//---------------------------------------------------------------------------
void __fastcall TMainFrameDlg::BackActionExecute( TObject *Sender )
......@@ -270,12 +269,12 @@ void __fastcall TMainFrameDlg::FastActionExecute( 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)
{
p_intfGlobal->p_sys->p_playwin->Next();
p_intf->p_sys->p_playwin->Next();
}
//---------------------------------------------------------------------------
void __fastcall TMainFrameDlg::EjectActionExecute( TObject *Sender )
......@@ -284,7 +283,7 @@ void __fastcall TMainFrameDlg::EjectActionExecute( TObject *Sender )
char * psz_current;
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 );
if( p_playlist == NULL )
{
......@@ -321,11 +320,11 @@ void __fastcall TMainFrameDlg::EjectActionExecute( TObject *Sender )
}
/* 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 )
****************************************************************************/
void __fastcall TMainFrameDlg::PrevTitleActionExecute( TObject *Sender )
{
intf_thread_t * p_intf;
input_area_t * p_area;
int i_id;
p_intf = p_intfGlobal;
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 */
......@@ -387,11 +384,9 @@ void __fastcall TMainFrameDlg::PrevTitleActionExecute( TObject *Sender )
//---------------------------------------------------------------------------
void __fastcall TMainFrameDlg::NextTitleActionExecute( TObject *Sender )
{
intf_thread_t * p_intf;
input_area_t * p_area;
int i_id;
p_intf = p_intfGlobal;
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 )
......@@ -410,7 +405,6 @@ void __fastcall TMainFrameDlg::NextTitleActionExecute( TObject *Sender )
//---------------------------------------------------------------------------
void __fastcall TMainFrameDlg::PrevChapterActionExecute( TObject *Sender )
{
intf_thread_t * p_intf = p_intfGlobal;
input_area_t * p_area;
p_area = p_intf->p_sys->p_input->stream.p_selected_area;
......@@ -431,7 +425,6 @@ void __fastcall TMainFrameDlg::PrevChapterActionExecute( TObject *Sender )
//---------------------------------------------------------------------------
void __fastcall TMainFrameDlg::NextChapterActionExecute( TObject *Sender )
{
intf_thread_t * p_intf = p_intfGlobal;
input_area_t * p_area;
p_area = p_intf->p_sys->p_input->stream.p_selected_area;
......@@ -457,7 +450,6 @@ void __fastcall TMainFrameDlg::NextChapterActionExecute( TObject *Sender )
****************************************************************************/
void __fastcall TMainFrameDlg::ButtonGoClick( TObject *Sender )
{
intf_thread_t *p_intf = p_intfGlobal;
int i_channel;
i_channel = SpinEditChannel->Value;
......@@ -480,7 +472,6 @@ void __fastcall TMainFrameDlg::ButtonGoClick( TObject *Sender )
*****************************************************************************/
void __fastcall TMainFrameDlg::ModeManage()
{
intf_thread_t * p_intf = p_intfGlobal;
TGroupBox * ActiveGB;
int i_Height;
bool b_control;
......
......@@ -192,9 +192,10 @@ __published: // IDE-managed Components
void __fastcall PrevChapterActionExecute( TObject *Sender );
void __fastcall NextChapterActionExecute( TObject *Sender );
private: // User declarations
intf_thread_t *p_intf;
public: // User declarations
TStringList *StringListPref; /* stores config dialogs */
__fastcall TMainFrameDlg( TComponent* Owner );
__fastcall TMainFrameDlg( TComponent* Owner, intf_thread_t *_p_intf );
virtual __fastcall ~TMainFrameDlg();
void __fastcall DisplayHint( TObject *Sender );
void __fastcall ModeManage();
......
......@@ -34,13 +34,12 @@
#pragma package(smart_init)
#pragma resource "*.dfm"
extern intf_thread_t *p_intfGlobal;
//---------------------------------------------------------------------------
__fastcall TMessagesDlg::TMessagesDlg( TComponent* Owner )
: TForm( Owner )
__fastcall TMessagesDlg::TMessagesDlg(
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 );
}
//---------------------------------------------------------------------------
......@@ -51,17 +50,17 @@ void __fastcall TMessagesDlg::ButtonOKClick( 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 )
{
p_intfGlobal->p_sys->p_window->MessagesAction->Checked = true;
p_intf->p_sys->p_window->MessagesAction->Checked = true;
}
//---------------------------------------------------------------------------
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_max_lines;
......@@ -91,7 +90,7 @@ void __fastcall TMessagesDlg::UpdateLog()
/* Limit log size */
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 )
{
for( i_del = 0; i_del <= i_count - i_max_lines; i_del++ )
......
......@@ -39,8 +39,9 @@ __published: // IDE-managed Components
void __fastcall FormHide( TObject *Sender );
void __fastcall FormShow( TObject *Sender );
private: // User declarations
intf_thread_t *p_intf;
public: // User declarations
__fastcall TMessagesDlg( TComponent* Owner );
__fastcall TMessagesDlg( TComponent* Owner, intf_thread_t *_p_intf );
void __fastcall UpdateLog();
};
//---------------------------------------------------------------------------
......
......@@ -37,47 +37,46 @@
#pragma link "CSPIN"
#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 )
{
p_intf = _p_intf;
char *psz_channel_server;
OldRadioValue = 0;
/* server port */
SpinEditUDPPort->Value = config_GetInt( p_intfGlobal, "server-port" );
SpinEditMulticastPort->Value = config_GetInt( p_intfGlobal, "server-port" );
SpinEditUDPPort->Value = config_GetInt( p_intf, "server-port" );
SpinEditMulticastPort->Value = config_GetInt( p_intf, "server-port" );
/* channel server */
if( config_GetInt( p_intfGlobal, "network-channel" ) )
if( config_GetInt( p_intf, "network-channel" ) )
{
RadioButtonCS->Checked = true;
RadioButtonCSEnter( RadioButtonCS );
}
psz_channel_server = config_GetPsz( p_intfGlobal, "channel-server" );
psz_channel_server = config_GetPsz( p_intf, "channel-server" );
if( psz_channel_server )
{
ComboBoxCSAddress->Text = 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 );
}
//---------------------------------------------------------------------------
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 )
{
p_intfGlobal->p_sys->p_window->NetworkStreamAction->Checked = false;
p_intf->p_sys->p_window->NetworkStreamAction->Checked = false;
}
//---------------------------------------------------------------------------
void __fastcall TNetworkDlg::BitBtnCancelClick( TObject *Sender )
......@@ -94,7 +93,7 @@ void __fastcall TNetworkDlg::BitBtnOkClick( TObject *Sender )
playlist_t * p_playlist;
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 )
{
return;
......@@ -107,7 +106,7 @@ void __fastcall TNetworkDlg::BitBtnOkClick( TObject *Sender )
{
/* UDP */
case 0:
config_PutInt( p_intfGlobal, "network-channel", FALSE );
config_PutInt( p_intf, "network-channel", FALSE );
i_port = SpinEditUDPPort->Value;
/* Build source name */
......@@ -117,12 +116,12 @@ void __fastcall TNetworkDlg::BitBtnOkClick( TObject *Sender )
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
/* update the display */
p_intfGlobal->p_sys->p_playwin->UpdateGrid( p_playlist );
p_intf->p_sys->p_playwin->UpdateGrid( p_playlist );
break;
/* UDP Multicast */
case 1:
config_PutInt( p_intfGlobal, "network-channel", FALSE );
config_PutInt( p_intf, "network-channel", FALSE );
Address = ComboBoxMulticastAddress->Text;
i_port = SpinEditMulticastPort->Value;
......@@ -133,26 +132,26 @@ void __fastcall TNetworkDlg::BitBtnOkClick( TObject *Sender )
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
/* update the display */
p_intfGlobal->p_sys->p_playwin->UpdateGrid( p_playlist );
p_intf->p_sys->p_playwin->UpdateGrid( p_playlist );
break;
/* Channel server */
case 2:
config_PutInt( p_intfGlobal, "network-channel", TRUE );
config_PutPsz( p_intfGlobal, "channel-server", Channel.c_str() );
config_PutInt( p_intfGlobal, "channel-port", i_channel_port );
config_PutInt( p_intf, "network-channel", TRUE );
config_PutPsz( p_intf, "channel-server", Channel.c_str() );
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;
/* HTTP */
case 3:
config_PutInt( p_intfGlobal, "network-channel", FALSE );
config_PutInt( p_intf, "network-channel", FALSE );
Address = EditHTTPURL->Text;
/* Build source name with a basic test */
......@@ -169,7 +168,7 @@ void __fastcall TNetworkDlg::BitBtnOkClick( TObject *Sender )
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
/* update the display */
p_intfGlobal->p_sys->p_playwin->UpdateGrid( p_playlist );
p_intf->p_sys->p_playwin->UpdateGrid( p_playlist );
break;
}
......
......@@ -68,8 +68,9 @@ __published: // IDE-managed Components
private: // User declarations
int OldRadioValue;
void __fastcall ChangeEnabled( int i_selected );
intf_thread_t *p_intf;
public: // User declarations
__fastcall TNetworkDlg( TComponent* Owner );
__fastcall TNetworkDlg( TComponent* Owner, intf_thread_t *_p_intf );
};
//---------------------------------------------------------------------------
#endif
......@@ -34,13 +34,12 @@
//#pragma package(smart_init)
#pragma resource "*.dfm"
extern intf_thread_t *p_intfGlobal;
//---------------------------------------------------------------------------
__fastcall TPlaylistDlg::TPlaylistDlg( TComponent* Owner )
: TForm( Owner )
__fastcall TPlaylistDlg::TPlaylistDlg(
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 );
}
//---------------------------------------------------------------------------
......@@ -70,12 +69,12 @@ char * __fastcall TPlaylistDlg::rindex( char *s, char c )
****************************************************************************/
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 )
{
p_intfGlobal->p_sys->p_window->PlaylistAction->Checked = false;
p_intf->p_sys->p_window->PlaylistAction->Checked = false;
}
//---------------------------------------------------------------------------
void __fastcall TPlaylistDlg::BitBtnOkClick( TObject *Sender )
......@@ -90,7 +89,7 @@ void __fastcall TPlaylistDlg::PlayStreamActionExecute( TObject *Sender )
TItemStates Focused;
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 )
{
return;
......@@ -140,7 +139,7 @@ void __fastcall TPlaylistDlg::ListViewPlaylistCustomDrawItem(
TRect Rect = Item->DisplayRect( drBounds );
/* 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;
}
......@@ -159,17 +158,17 @@ void __fastcall TPlaylistDlg::ListViewPlaylistCustomDrawItem(
****************************************************************************/
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 )
{
p_intfGlobal->p_sys->p_window->OpenDiscActionExecute( Sender );
p_intf->p_sys->p_window->OpenDiscActionExecute( 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 )
......@@ -182,10 +181,10 @@ void __fastcall TPlaylistDlg::DeleteSelectionActionExecute( TObject *Sender )
#if 0 /* PLAYLIST TARASS */
/* user wants to delete a file in the queue */
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 */
vlc_mutex_lock( &p_intfGlobal->change_lock );
vlc_mutex_lock( &p_intf->change_lock );
/* delete the items from the last to the first */
for( i_pos = p_playlist->i_size - 1; i_pos >= 0; i_pos-- )
......@@ -199,7 +198,7 @@ void __fastcall TPlaylistDlg::DeleteSelectionActionExecute( TObject *Sender )
/* Rebuild the ListView */
UpdateGrid( p_playlist );
vlc_mutex_unlock( &p_intfGlobal->change_lock );
vlc_mutex_unlock( &p_intf->change_lock );
#endif
}
//---------------------------------------------------------------------------
......@@ -207,10 +206,10 @@ void __fastcall TPlaylistDlg::DeleteAllActionExecute( TObject *Sender )
{
#if 0 /* PLAYLIST TARASS */
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 */
vlc_mutex_lock( &p_intfGlobal->change_lock );
vlc_mutex_lock( &p_intf->change_lock );
/* delete the items from the last to the first */
for( i_pos = p_playlist->i_size - 1; i_pos >= 0; i_pos-- )
......@@ -221,7 +220,7 @@ void __fastcall TPlaylistDlg::DeleteAllActionExecute( TObject *Sender )
/* Rebuild the ListView */
UpdateGrid( p_playlist );
vlc_mutex_unlock( &p_intfGlobal->change_lock );
vlc_mutex_unlock( &p_intf->change_lock );
#endif
}
//---------------------------------------------------------------------------
......@@ -230,7 +229,7 @@ void __fastcall TPlaylistDlg::InvertSelectionActionExecute( TObject *Sender )
#if 0 /* PLAYLIST TARASS */
#define NOT( var ) ( (var) ? false : true )
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;
/* delete the items from the last to the first */
......@@ -293,10 +292,10 @@ void __fastcall TPlaylistDlg::UpdateGrid( playlist_t * p_playlist )
ListViewPlaylist->Items->EndUpdate();
}
//---------------------------------------------------------------------------
void __fastcall TPlaylistDlg::Manage( intf_thread_t * p_intf )
void __fastcall TPlaylistDlg::Manage()
{
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 )
{
return;
......@@ -319,37 +318,40 @@ void __fastcall TPlaylistDlg::Manage( intf_thread_t * p_intf )
void __fastcall TPlaylistDlg::DeleteItem( int i_pos )
{
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 )
{
return;
}
playlist_Delete( p_playlist, i_pos );
vlc_object_release( p_playlist );
}
//---------------------------------------------------------------------------
void __fastcall TPlaylistDlg::Previous()
{
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 )
{
return;
}
playlist_Prev( p_playlist );
vlc_object_release( p_playlist );
}
//---------------------------------------------------------------------------
void __fastcall TPlaylistDlg::Next()
{
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 )
{
return;
}
playlist_Next( p_playlist );
vlc_object_release( p_playlist );
}
//---------------------------------------------------------------------------
......@@ -83,10 +83,11 @@ __published: // IDE-managed Components
void __fastcall PlayStreamActionExecute( TObject *Sender );
private: // User declarations
char * __fastcall rindex( char *s, char c );
intf_thread_t *p_intf;
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 Manage( intf_thread_t * p_intf );
void __fastcall Manage();
void __fastcall DeleteItem( int i_pos );
void __fastcall Previous();
void __fastcall Next();
......
......@@ -106,9 +106,9 @@ static void Close ( vlc_object_t *p_this )
*****************************************************************************/
static void Run( intf_thread_t *p_intf )
{
p_intf->p_sys->p_window = new TMainFrameDlg( NULL );
p_intf->p_sys->p_playwin = new TPlaylistDlg( NULL );
p_intf->p_sys->p_messages = new TMessagesDlg( NULL );
p_intf->p_sys->p_window = new TMainFrameDlg( NULL, p_intf );
p_intf->p_sys->p_playwin = new TPlaylistDlg( NULL, p_intf );
p_intf->p_sys->p_messages = new TMessagesDlg( NULL, p_intf );
/* show main window and wait until it is closed */
p_intf->p_sys->p_window->ShowModal();
......@@ -145,7 +145,7 @@ int Win32Manage( intf_thread_t *p_intf )
p_intf->p_sys->p_messages->UpdateLog();
/* Update the playlist */
p_intf->p_sys->p_playwin->Manage( p_intf );
p_intf->p_sys->p_playwin->Manage();
/* Update the input */
if( p_intf->p_sys->p_input == NULL )
......
......@@ -59,7 +59,6 @@ struct intf_sys_t
TMainFrameDlg * p_window; /* main window */
TPlaylistDlg * p_playwin; /* playlist */
TPopupMenu * p_popup; /* popup menu */
TAboutDlg * p_about; /* about window */
TDiscDlg * p_disc; /* disc selection window */
TNetworkDlg * p_network; /* network stream 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