Commit e77471fb authored by Clément Stenac's avatar Clément Stenac

Timeshift checkbox in open dialog

parent de30e639
......@@ -69,7 +69,7 @@ enum
NetRadio1_Event, NetRadio2_Event, NetRadio3_Event, NetRadio4_Event,
NetPort1_Event, NetPort2_Event, NetPort3_Event,
NetAddr1_Event, NetAddr2_Event, NetAddr3_Event, NetAddr4_Event,
NetForceIPv6_Event,
NetForceIPv6_Event, NetTimeshift_Event,
SubsFileEnable_Event,
SubsFileSettings_Event,
......@@ -122,6 +122,7 @@ BEGIN_EVENT_TABLE(OpenDialog, wxDialog)
EVT_TEXT(NetAddr3_Event, OpenDialog::OnNetPanelChange)
EVT_TEXT(NetAddr4_Event, OpenDialog::OnNetPanelChange)
EVT_CHECKBOX(NetForceIPv6_Event, OpenDialog::OnNetPanelChange)
EVT_CHECKBOX(NetTimeshift_Event, OpenDialog::OnNetPanelChange)
/* Events generated by the subtitle file buttons */
EVT_CHECKBOX(SubsFileEnable_Event, OpenDialog::OnSubsFileEnable)
......@@ -770,6 +771,17 @@ wxPanel *OpenDialog::NetPanel( wxWindow* parent )
net_subpanels[i]->SetSizerAndFit( subpanel_sizer );
}
/* Timeshift */
wxPanel *timeshift_panel = new wxPanel( panel, -1 );
subpanel_sizer = new wxFlexGridSizer( 1,1,20 );
net_timeshift = new wxCheckBox( timeshift_panel, NetTimeshift_Event,
wxU(_("Allow timeshifting")) );
subpanel_sizer->Add( net_timeshift, 0, wxALIGN_RIGHT
| wxALIGN_CENTER_VERTICAL);
timeshift_panel->SetSizerAndFit( subpanel_sizer );
net_timeshift->Enable();
/* Stuff everything into the main panel */
for( i=0; i<4; i++ )
{
......@@ -778,6 +790,7 @@ wxPanel *OpenDialog::NetPanel( wxWindow* parent )
sizer->Add( net_subpanels[i], 1, wxEXPAND | wxALIGN_LEFT |
wxALIGN_CENTER_VERTICAL | wxALL, 5 );
}
sizer->Add( timeshift_panel );
sizer_row->Add( sizer, 0, wxEXPAND | wxALL, 5 );
......@@ -935,6 +948,8 @@ void OpenDialog::UpdateMRL( int i_access_method )
caching_name = wxT("rtsp-caching");
break;
}
if( net_timeshift->IsEnabled() && net_timeshift->IsChecked() )
mrltemp += wxT(" :access-filter=timeshift");
break;
default:
......@@ -1061,8 +1076,8 @@ void OpenDialog::OnOk( wxCommandEvent& WXUNUSED(event) )
}
}
int i_id = playlist_AddItem( p_playlist, p_item,
PLAYLIST_APPEND, PLAYLIST_END );
playlist_AddItem( p_playlist, p_item,
PLAYLIST_APPEND, PLAYLIST_END );
if( b_start )
{
......@@ -1265,6 +1280,11 @@ void OpenDialog::OnNetTypeChange( wxCommandEvent& event )
net_radios[i]->SetValue( event.GetId() == (NetRadio1_Event+i) );
net_subpanels[i]->Enable( event.GetId() == (NetRadio1_Event+i) );
}
/* UDP Unicast or multicast -> timeshift */
if( i_net_type == 0 || i_net_type == 1 )
net_timeshift->Enable();
else
net_timeshift->Disable();
UpdateMRL( NET_ACCESS );
}
......
......@@ -513,6 +513,7 @@ private:
wxSpinCtrl *net_ports[4];
int i_net_ports[4];
wxTextCtrl *net_addrs[4];
wxCheckBox *net_timeshift;
wxCheckBox *net_ipv6;
/* Controls for the subtitles file */
......
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