Commit 940b39ab authored by Jean-Philippe Andre's avatar Jean-Philippe Andre

Qt: don't save A to B state when the input item changes. Also go to A if...

Qt: don't save A to B state when the input item changes. Also go to A if before current time is before A
parent f025433b
...@@ -318,6 +318,7 @@ AdvControlsWidget::AdvControlsWidget( intf_thread_t *_p_i, bool b_fsCreation = f ...@@ -318,6 +318,7 @@ AdvControlsWidget::AdvControlsWidget( intf_thread_t *_p_i, bool b_fsCreation = f
qtr( "Loop from point A to point B continuously.\nClick to set point A" ), qtr( "Loop from point A to point B continuously.\nClick to set point A" ),
fromAtoB() ); fromAtoB() );
timeA = timeB = 0; timeA = timeB = 0;
i_last_input_id = 0;
/* in FS controller we skip this, because we dont want to have it double /* in FS controller we skip this, because we dont want to have it double
controlled */ controlled */
if( !b_fsCreation ) if( !b_fsCreation )
...@@ -354,8 +355,21 @@ AdvControlsWidget::~AdvControlsWidget() ...@@ -354,8 +355,21 @@ AdvControlsWidget::~AdvControlsWidget()
void AdvControlsWidget::enableInput( bool enable ) void AdvControlsWidget::enableInput( bool enable )
{ {
int i_input_id = 0;
if( THEMIM->getInput() != NULL )
{
input_item_t *p_item = input_GetItem( THEMIM->getInput() );
i_input_id = p_item->i_id;
}
ABButton->setEnabled( enable ); ABButton->setEnabled( enable );
recordButton->setEnabled( enable ); recordButton->setEnabled( enable );
if( enable && ( i_last_input_id != i_input_id ) )
{
timeA = timeB = 0;
i_last_input_id = i_input_id;
emit timeChanged();
}
} }
void AdvControlsWidget::enableVideo( bool enable ) void AdvControlsWidget::enableVideo( bool enable )
...@@ -419,7 +433,8 @@ void AdvControlsWidget::AtoBLoop( float f_pos, int i_time, int i_length ) ...@@ -419,7 +433,8 @@ void AdvControlsWidget::AtoBLoop( float f_pos, int i_time, int i_length )
{ {
if( timeB ) if( timeB )
{ {
if( i_time >= (int)(timeB/1000000) ) if( ( i_time >= (int)( timeB/1000000 ) )
|| ( i_time < (int)( timeA/1000000 ) ) )
var_SetTime( THEMIM->getInput(), "time" , timeA ); var_SetTime( THEMIM->getInput(), "time" , timeA );
} }
} }
......
...@@ -157,6 +157,7 @@ private: ...@@ -157,6 +157,7 @@ private:
QPushButton *snapshotButton, *frameButton; QPushButton *snapshotButton, *frameButton;
static mtime_t timeA, timeB; static mtime_t timeA, timeB;
int i_last_input_id;
private slots: private slots:
void snapshot(); void snapshot();
......
...@@ -71,7 +71,7 @@ public: ...@@ -71,7 +71,7 @@ public:
bool hasInput() { return p_input && !p_input->b_dead && vlc_object_alive (p_input); } bool hasInput() { return p_input && !p_input->b_dead && vlc_object_alive (p_input); }
bool hasAudio(); bool hasAudio();
bool hasVideo(); bool hasVideo();
QString getName() { return old_name; } QString getName() { return old_name; }
private: private:
......
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