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
qtr( "Loop from point A to point B continuously.\nClick to set point A" ),
fromAtoB() );
timeA = timeB = 0;
i_last_input_id = 0;
/* in FS controller we skip this, because we dont want to have it double
controlled */
if( !b_fsCreation )
......@@ -354,8 +355,21 @@ AdvControlsWidget::~AdvControlsWidget()
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 );
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 )
......@@ -419,7 +433,8 @@ void AdvControlsWidget::AtoBLoop( float f_pos, int i_time, int i_length )
{
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 );
}
}
......
......@@ -157,6 +157,7 @@ private:
QPushButton *snapshotButton, *frameButton;
static mtime_t timeA, timeB;
int i_last_input_id;
private slots:
void snapshot();
......
......@@ -71,7 +71,7 @@ public:
bool hasInput() { return p_input && !p_input->b_dead && vlc_object_alive (p_input); }
bool hasAudio();
bool hasVideo();
QString getName() { return old_name; }
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