1 /*****************************************************************************
\r
2 * disc.cpp: "Open disc" dialog box.
\r
3 *****************************************************************************
\r
4 * Copyright (C) 2002 VideoLAN
\r
6 * Authors: Olivier Teuliere <ipkiss@via.ecp.fr>
\r
8 * This program is free software; you can redistribute it and/or modify
\r
9 * it under the terms of the GNU General Public License as published by
\r
10 * the Free Software Foundation; either version 2 of the License, or
\r
11 * (at your option) any later version.
\r
13 * This program is distributed in the hope that it will be useful,
\r
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
16 * GNU General Public License for more details.
\r
18 * You should have received a copy of the GNU General Public License
\r
19 * along with this program; if not, write to the Free Software
\r
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
\r
21 *****************************************************************************/
\r
26 #include <vlc/vlc.h>
\r
27 #include <vlc/intf.h>
\r
31 #include "win32_common.h"
\r
33 //---------------------------------------------------------------------------
\r
34 //#pragma package(smart_init)
\r
35 #pragma link "CSPIN"
\r
36 #pragma resource "*.dfm"
\r
38 //---------------------------------------------------------------------------
\r
39 __fastcall TDiscDlg::TDiscDlg( TComponent* Owner, intf_thread_t *_p_intf )
\r
43 /* Simulate a click to get the correct device name */
\r
44 RadioGroupTypeClick( RadioGroupType );
\r
47 //---------------------------------------------------------------------------
\r
48 void __fastcall TDiscDlg::FormShow( TObject *Sender )
\r
50 p_intf->p_sys->p_window->OpenDiscAction->Checked = true;
\r
52 //---------------------------------------------------------------------------
\r
53 void __fastcall TDiscDlg::FormHide( TObject *Sender )
\r
55 p_intf->p_sys->p_window->OpenDiscAction->Checked = false;
\r
57 //---------------------------------------------------------------------------
\r
58 void __fastcall TDiscDlg::BitBtnCancelClick( TObject *Sender )
\r
62 //---------------------------------------------------------------------------
\r
63 void __fastcall TDiscDlg::BitBtnOkClick( TObject *Sender )
\r
65 AnsiString Device, Source, Method, Title, Chapter;
\r
69 Device = EditDevice->Text;
\r
71 /* Check which method was activated */
\r
72 if( RadioGroupType->ItemIndex == 0 )
\r
77 /* Select title and chapter */
\r
78 Title.sprintf( "%d", SpinEditTitle->Value );
\r
79 Chapter.sprintf( "%d", SpinEditChapter->Value );
\r
81 /* Build source name and add it to playlist */
\r
82 Source = Method + ":" + Device + "@" + Title + "," + Chapter;
\r
84 p_intf->p_sys->p_playwin->Add( Source, PLAYLIST_APPEND | PLAYLIST_GO,
\r
87 //---------------------------------------------------------------------------
\r
88 void __fastcall TDiscDlg::RadioGroupTypeClick( TObject *Sender )
\r
90 TRadioGroup *RadioGroupType = (TRadioGroup *)Sender;
\r
93 if( RadioGroupType->ItemIndex == 0 )
\r
95 psz_device = config_GetPsz( p_intf, "dvd" );
\r
99 psz_device = config_GetPsz( p_intf, "vcd" );
\r
104 EditDevice->Text = psz_device;
\r
105 free( psz_device );
\r
108 //---------------------------------------------------------------------------
\r