Skip to content

Commit

Permalink
Update image properties panel when out point changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
ddennedy committed Jan 15, 2015
1 parent 885a6e3 commit 70b6550
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
7 changes: 5 additions & 2 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1708,8 +1708,11 @@ QWidget *MainWindow::loadProducerWidget(Mlt::Producer* producer)
w = new X11grabWidget(this);
else if (service.startsWith("avformat"))
w = new AvformatProducerWidget(this);
else if (service == "pixbuf" || service == "qimage")
w = new ImageProducerWidget(this);
else if (service == "pixbuf" || service == "qimage") {
ImageProducerWidget* ipw = new ImageProducerWidget(this);
connect(m_player, SIGNAL(outChanged(int)), ipw, SLOT(setOutPoint(int)));
w = ipw;
}
else if (service == "decklink" || resource.contains("decklink"))
w = new DecklinkProducerWidget(this);
else if (service == "color")
Expand Down
12 changes: 2 additions & 10 deletions src/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,17 +228,9 @@ Player::Player(QWidget *parent)
void Player::connectTransport(const TransportControllable* receiver)
{
if (receiver == m_currentTransport) return;
if (m_currentTransport)
disconnect(m_currentTransport);
m_currentTransport = receiver;
disconnect(SIGNAL(played(double)));
disconnect(SIGNAL(paused()));
disconnect(SIGNAL(stopped()));
disconnect(SIGNAL(seeked(int)));
disconnect(SIGNAL(rewound()));
disconnect(SIGNAL(fastForwarded()));
disconnect(SIGNAL(previousSought(int)));
disconnect(SIGNAL(nextSought(int)));
disconnect(SIGNAL(inChanged(int)));
disconnect(SIGNAL(outChanged(int)));
connect(this, SIGNAL(played(double)), receiver, SLOT(play(double)));
connect(this, SIGNAL(paused()), receiver, SLOT(pause()));
connect(this, SIGNAL(stopped()), receiver, SLOT(stop()));
Expand Down
5 changes: 5 additions & 0 deletions src/widgets/imageproducerwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ void ImageProducerWidget::setProducer(Mlt::Producer* p)
ui->repeatSpinBox->setEnabled(m_producer->get_int("shotcut_sequence"));
}

void ImageProducerWidget::setOutPoint(int duration)
{
ui->durationSpinBox->setValue(duration + 1);
}

void ImageProducerWidget::reopen(Mlt::Producer* p)
{
int out = ui->durationSpinBox->value() - 1;
Expand Down
3 changes: 3 additions & 0 deletions src/widgets/imageproducerwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ class ImageProducerWidget : public QWidget, public AbstractProducerWidget
void producerChanged();
void producerReopened();

public slots:
void setOutPoint(int duration);

private slots:
void on_resetButton_clicked();

Expand Down

0 comments on commit 70b6550

Please sign in to comment.