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

* Interaction between bookmarks and streaming wizard

* Edit bookmarks if possible
parent 57724052
......@@ -593,6 +593,7 @@ enum input_query_e
INPUT_GET_BOOKMARKS, /* arg1= seekpoint_t *** arg2= int * res=can fail */
INPUT_CLEAR_BOOKMARKS, /* res=can fail */
INPUT_ADD_BOOKMARK, /* arg1= seekpoint_t * res=can fail */
INPUT_CHANGE_BOOKMARK, /* arg1= seekpoint_t * arg2= int * res=can fail */
INPUT_DEL_BOOKMARK, /* arg1= seekpoint_t * res=can fail */
INPUT_SET_BOOKMARK, /* arg1= int res=can fail */
......
This diff is collapsed.
......@@ -269,14 +269,14 @@ void DialogsProvider::OnStreamWizardDialog( wxCommandEvent& WXUNUSED(event) )
void DialogsProvider::OnWizardDialog( wxCommandEvent& WXUNUSED(event) )
{
p_wizard_dialog = new WizardDialog( p_intf, this );
p_wizard_dialog = new WizardDialog( p_intf, this, NULL, 0, 0 );
if( p_wizard_dialog )
{
p_wizard_dialog->Run();
delete p_wizard_dialog;
}
delete p_wizard_dialog;
p_wizard_dialog = NULL;
}
......
......@@ -217,6 +217,8 @@ class wizInputPage : public wxWizardPage
void SetTranscodePage( wxWizardPage *page);
void SetAction( int i_action );
void SetPintf( intf_thread_t *p_intf );
void SetUri( char *psz_uri );
void SetPartial( int i_from, int i_to );
protected:
bool b_chosen;
intf_thread_t *p_intf;
......@@ -755,6 +757,23 @@ void wizInputPage::SetPintf( intf_thread_t *p_intf )
this->p_intf = p_intf;
}
void wizInputPage::SetUri( char *psz_uri )
{
mrl_text->SetValue( wxU( psz_uri ) );
}
void wizInputPage::SetPartial( int i_from, int i_to )
{
wxString msg;
msg.Printf( wxString( wxT( "%i") ), i_from );
from_text->Enable( TRUE );
from_text->SetValue( msg );
msg.Printf( wxString( wxT( "%i") ), i_to );
to_text->Enable( TRUE );
to_text->SetValue( msg );
enable_checkbox->SetValue( TRUE );
}
/***************************************************
* First transcode page: choose codecs *
***************************************************/
......@@ -1344,7 +1363,8 @@ wizTranscodeExtraPage *tr_page2 ;
wizStreamingExtraPage *st_page2;
wizEncapPage *encap_page;
WizardDialog::WizardDialog(intf_thread_t *_p_intf, wxWindow *_p_parent ) :
WizardDialog::WizardDialog(intf_thread_t *_p_intf, wxWindow *_p_parent,
char *psz_uri, int _i_from, int _i_to ) :
wxWizard( _p_parent, -1, wxU(_("Streaming/Transcoding Wizard")), wxNullBitmap, wxDefaultPosition)
{
/* Initializations */
......@@ -1353,8 +1373,8 @@ wxWizard( _p_parent, -1, wxU(_("Streaming/Transcoding Wizard")), wxNullBitmap, w
/* Initialize structure */
i_action = 0;
i_from = 0;
i_to = 0;
i_from = _i_from;
i_to = _i_to;
i_ttl = 1;
vb = 0;
ab = 0;
......@@ -1363,6 +1383,16 @@ wxWizard( _p_parent, -1, wxU(_("Streaming/Transcoding Wizard")), wxNullBitmap, w
page1 = new wizHelloPage(this);
page2 = new wizInputPage(this, page1, p_intf);
if( psz_uri )
{
page2->SetUri( psz_uri );
}
if( i_from != 0 || i_to != 0 )
{
page2->SetPartial( i_from, i_to );
}
encap_page = new wizEncapPage(this );
tr_page1 = new wizTranscodeCodecPage(this, encap_page );
st_page1 = new wizStreamingMethodPage(this, encap_page);
......@@ -1474,6 +1504,7 @@ int WizardDialog::GetAction()
void WizardDialog::Run()
{
fprintf(stderr, "p_intf %p %p", p_intf, this->p_intf);
msg_Dbg( p_intf,"starting wizard");
if( RunWizard(page1) )
{
......
......@@ -574,7 +574,7 @@ class WizardDialog : public wxWizard
{
public:
/* Constructor */
WizardDialog( intf_thread_t *p_intf, wxWindow *p_parent );
WizardDialog( intf_thread_t *p_intf, wxWindow *p_parent,char *, int, int );
virtual ~WizardDialog();
void SetTranscode( char *vcodec, int vb, char *acodec,int ab);
void SetMrl( const char *mrl );
......
......@@ -66,7 +66,8 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
{
int i_ret;
seekpoint_t *p_bkmk, ***ppp_bkmk;
int i_bkmk, *pi_bkmk;
int i_bkmk = 0;
int *pi_bkmk;
int i, *pi;
vlc_value_t val, text;
char *psz_option, *psz_value;
......@@ -284,6 +285,29 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
i_ret = VLC_SUCCESS;
break;
case INPUT_CHANGE_BOOKMARK:
p_bkmk = (seekpoint_t *)va_arg( args, seekpoint_t * );
i_bkmk = (int)va_arg( args, int );
if( i_bkmk < p_input->i_bookmarks )
{
p_input->pp_bookmarks[i_bkmk] = p_bkmk;
/* Reflect the changes on the object var */
var_Change( p_input, "bookmark", VLC_VAR_CLEARCHOICES, 0, 0 );
for( i = 0; i < p_input->i_bookmarks; i++ )
{
val.i_int = i;
text.psz_string = p_input->pp_bookmarks[i]->psz_name;
var_Change( p_input, "bookmark", VLC_VAR_ADDCHOICE,
&val, &text );
}
}
UpdateBookmarksOption( p_input );
i_ret = VLC_SUCCESS;
break;
case INPUT_DEL_BOOKMARK:
i_bkmk = (int)va_arg( args, int );
if( i_bkmk < p_input->i_bookmarks )
......
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