Commit 5b914302 authored by Rocky Bernstein's avatar Rocky Bernstein

Add audio track entry field for VCD and DVD.

Correct ranges for # of tracks and subtitles allowed in VCD and DVD.
parent 44534710
......@@ -64,6 +64,7 @@ enum
DiscTitle_Event,
DiscChapter_Event,
DiscSub_Event,
DiscAudio_Event,
NetType_Event,
NetRadio1_Event, NetRadio2_Event, NetRadio3_Event, NetRadio4_Event,
......@@ -105,6 +106,7 @@ BEGIN_EVENT_TABLE(OpenDialog, wxDialog)
EVT_TEXT(DiscChapter_Event, OpenDialog::OnDiscPanelChange)
EVT_SPINCTRL(DiscChapter_Event, OpenDialog::OnDiscPanelChangeSpin)
EVT_TEXT(DiscSub_Event, OpenDialog::OnDiscPanelChange)
EVT_TEXT(DiscAudio_Event, OpenDialog::OnDiscPanelChange)
EVT_SPINCTRL(DiscSub_Event, OpenDialog::OnDiscPanelChangeSpin)
/* Events generated by the net panel */
......@@ -680,6 +682,14 @@ wxPanel *OpenDialog::DiscPanel( wxWindow* parent )
i_disc_sub = config_GetInt( p_intf, "sub-track" );
disc_sub->SetValue( i_disc_sub );
disc_audio_label = new wxStaticText( panel, -1, wxU(_("Audio track")) );
disc_audio = new wxSpinCtrl( panel, DiscAudio_Event );
sizer->Add( disc_audio_label, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL );
sizer->Add( disc_audio, 1, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL );
disc_audio->SetRange( -1, 255 );
i_disc_audio = config_GetInt( p_intf, "audio-track" );
disc_audio->SetValue( i_disc_audio );
sizer_row->Add( sizer, 0, wxEXPAND | wxALL, 5 );
panel->SetSizerAndFit( sizer_row );
......@@ -842,6 +852,9 @@ void OpenDialog::UpdateMRL( int i_access_method )
if( i_disc_sub >= 0 )
mrltemp += wxString::Format( wxT(" :sub-track=%d"),
i_disc_sub );
if( i_disc_audio >= 0 )
mrltemp += wxString::Format( wxT(" :audio-track=%d"),
i_disc_audio );
break;
case 2: /* VCD of some sort */
......@@ -861,6 +874,9 @@ void OpenDialog::UpdateMRL( int i_access_method )
mrltemp += wxString::Format( wxT(" :sub-track=%d"),
i_disc_sub );
if( i_disc_audio >= 0 )
mrltemp += wxString::Format( wxT(" :audio-track=%d"),
i_disc_audio );
caching_name = wxT("vcd-caching");
break;
......@@ -1164,6 +1180,7 @@ void OpenDialog::OnDiscPanelChange( wxCommandEvent& event )
if( event.GetId() == DiscTitle_Event ) i_disc_title = event.GetInt();
if( event.GetId() == DiscChapter_Event ) i_disc_chapter = event.GetInt();
if( event.GetId() == DiscSub_Event ) i_disc_sub = event.GetInt();
if( event.GetId() == DiscAudio_Event ) i_disc_audio = event.GetInt();
UpdateMRL( DISC_ACCESS );
}
......@@ -1207,6 +1224,7 @@ void OpenDialog::OnDiscTypeChange( wxCommandEvent& WXUNUSED(event) )
case 0: /* DVD with menus */
case 1: /* DVD without menus */
disc_sub->Enable(); disc_sub_label->Enable();
disc_audio->Enable(); disc_audio_label->Enable();
disc_chapter->Enable(); disc_chapter_label->Enable();
disc_title_label->SetLabel ( wxU(_("Title")) );
psz_device = config_GetPsz( p_intf, "dvd" );
......@@ -1216,11 +1234,14 @@ void OpenDialog::OnDiscTypeChange( wxCommandEvent& WXUNUSED(event) )
else disc_device->SetValue( wxT("") );
}
disc_title->SetRange( 0, 255 );
disc_sub->SetRange( -1, 31 ); // up to 32 subtitles -1: no subtitle
disc_audio->SetRange( 0, 7 ); // up to 8 audio channels
disc_chapter->SetRange( 0, 255 );
break;
case 2: /* VCD of some sort */
disc_sub->Enable(); disc_sub_label->Enable();
disc_audio->Enable(); disc_audio_label->Enable();
disc_chapter->Disable(); disc_chapter_label->Disable();
psz_device = config_GetPsz( p_intf, "vcd" );
if( !b_disc_device_changed )
......@@ -1235,12 +1256,15 @@ void OpenDialog::OnDiscTypeChange( wxCommandEvent& WXUNUSED(event) )
#else
disc_title_label->SetLabel ( wxU(_("Track")) );
#endif
disc_title->SetRange( 0, 999 );
disc_title->SetRange( 0, 99 ); // only 100 tracks allowed on VCDs
disc_sub->SetRange( -1, 3 ); // up to 4 subtitles -1 = no subtitle
disc_audio->SetRange( 0, 1 ); // up to 2 audio tracks
break;
case 3: /* CD-DA */
disc_sub->Disable(); disc_sub_label->Disable();
disc_chapter->Disable(); disc_chapter_label->Disable();
disc_audio->Disable(); disc_audio_label->Disable();
disc_title_label->SetLabel ( wxU(_("Track")) );
psz_device = config_GetPsz( p_intf, "cd-audio" );
if( !b_disc_device_changed )
......
......@@ -523,12 +523,14 @@ private:
wxSpinCtrl *disc_title; int i_disc_title;
wxSpinCtrl *disc_chapter; int i_disc_chapter;
wxSpinCtrl *disc_sub; int i_disc_sub;
wxSpinCtrl *disc_audio; int i_disc_audio;
/* The media equivalent name for a DVD names. For example,
* "Title", is "Track" for a CD-DA */
wxStaticText *disc_title_label;
wxStaticText *disc_chapter_label;
wxStaticText *disc_sub_label;
wxStaticText *disc_audio_label;
/* Indicates if the disc device control was modified */
bool b_disc_device_changed;
......
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