change: change code style to Linux style except indent.
This commit is contained in:
@@ -22,35 +22,36 @@
|
||||
|
||||
#include <QMouseEvent>
|
||||
|
||||
namespace olive {
|
||||
|
||||
DragButton::DragButton(QWidget *parent) :
|
||||
QPushButton(parent)
|
||||
namespace olive
|
||||
{
|
||||
setCursor(Qt::OpenHandCursor);
|
||||
dragging_ = false;
|
||||
|
||||
DragButton::DragButton(QWidget *parent)
|
||||
: QPushButton(parent)
|
||||
{
|
||||
setCursor(Qt::OpenHandCursor);
|
||||
dragging_ = false;
|
||||
}
|
||||
|
||||
void DragButton::mousePressEvent(QMouseEvent *event)
|
||||
{
|
||||
QPushButton::mousePressEvent(event);
|
||||
QPushButton::mousePressEvent(event);
|
||||
}
|
||||
|
||||
void DragButton::mouseMoveEvent(QMouseEvent *event)
|
||||
{
|
||||
QPushButton::mouseMoveEvent(event);
|
||||
QPushButton::mouseMoveEvent(event);
|
||||
|
||||
if (event->buttons() && !dragging_) {
|
||||
emit DragStarted();
|
||||
dragging_ = true;
|
||||
}
|
||||
if (event->buttons() && !dragging_) {
|
||||
emit DragStarted();
|
||||
dragging_ = true;
|
||||
}
|
||||
}
|
||||
|
||||
void DragButton::mouseReleaseEvent(QMouseEvent *event)
|
||||
{
|
||||
QPushButton::mouseReleaseEvent(event);
|
||||
QPushButton::mouseReleaseEvent(event);
|
||||
|
||||
dragging_ = false;
|
||||
dragging_ = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -25,27 +25,26 @@
|
||||
|
||||
#include "common/define.h"
|
||||
|
||||
namespace olive {
|
||||
|
||||
class DragButton : public QPushButton
|
||||
namespace olive
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
class DragButton : public QPushButton {
|
||||
Q_OBJECT
|
||||
public:
|
||||
DragButton(QWidget* parent = nullptr);
|
||||
DragButton(QWidget *parent = nullptr);
|
||||
|
||||
signals:
|
||||
void DragStarted();
|
||||
void DragStarted();
|
||||
|
||||
protected:
|
||||
virtual void mousePressEvent(QMouseEvent* event) override;
|
||||
virtual void mousePressEvent(QMouseEvent *event) override;
|
||||
|
||||
virtual void mouseMoveEvent(QMouseEvent* event) override;
|
||||
virtual void mouseMoveEvent(QMouseEvent *event) override;
|
||||
|
||||
virtual void mouseReleaseEvent(QMouseEvent* event) override;
|
||||
virtual void mouseReleaseEvent(QMouseEvent *event) override;
|
||||
|
||||
private:
|
||||
bool dragging_;
|
||||
|
||||
bool dragging_;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -28,227 +28,241 @@
|
||||
#include "config/config.h"
|
||||
#include "ui/icons/icons.h"
|
||||
|
||||
namespace olive {
|
||||
|
||||
PlaybackControls::PlaybackControls(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
time_base_(0)
|
||||
namespace olive
|
||||
{
|
||||
// Create lower controls
|
||||
QHBoxLayout* lower_control_layout = new QHBoxLayout(this);
|
||||
lower_control_layout->setSpacing(0);
|
||||
lower_control_layout->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
QSizePolicy lower_container_size_policy(QSizePolicy::Maximum, QSizePolicy::Expanding);
|
||||
lower_container_size_policy.setHorizontalStretch(1);
|
||||
PlaybackControls::PlaybackControls(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, time_base_(0)
|
||||
{
|
||||
// Create lower controls
|
||||
QHBoxLayout *lower_control_layout = new QHBoxLayout(this);
|
||||
lower_control_layout->setSpacing(0);
|
||||
lower_control_layout->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
// In the lower-left, we create a current timecode label wrapped in a QWidget for fixed sizing
|
||||
lower_left_container_ = new QWidget();
|
||||
lower_left_container_->setVisible(false);
|
||||
lower_left_container_->setSizePolicy(lower_container_size_policy);
|
||||
QSizePolicy lower_container_size_policy(QSizePolicy::Maximum,
|
||||
QSizePolicy::Expanding);
|
||||
lower_container_size_policy.setHorizontalStretch(1);
|
||||
|
||||
lower_control_layout->addWidget(lower_left_container_);
|
||||
// In the lower-left, we create a current timecode label wrapped in a QWidget for fixed sizing
|
||||
lower_left_container_ = new QWidget();
|
||||
lower_left_container_->setVisible(false);
|
||||
lower_left_container_->setSizePolicy(lower_container_size_policy);
|
||||
|
||||
QHBoxLayout* lower_left_layout = new QHBoxLayout(lower_left_container_);
|
||||
lower_left_layout->setSpacing(0);
|
||||
lower_left_layout->setContentsMargins(0, 0, 0, 0);
|
||||
lower_control_layout->addWidget(lower_left_container_);
|
||||
|
||||
cur_tc_lbl_ = new RationalSlider();
|
||||
cur_tc_lbl_->SetDisplayType(RationalSlider::kTime);
|
||||
cur_tc_lbl_->SetMinimum(0);
|
||||
connect(cur_tc_lbl_, &RationalSlider::ValueChanged, this, &PlaybackControls::TimeChanged);
|
||||
lower_left_layout->addWidget(cur_tc_lbl_);
|
||||
lower_left_layout->addStretch();
|
||||
QHBoxLayout *lower_left_layout = new QHBoxLayout(lower_left_container_);
|
||||
lower_left_layout->setSpacing(0);
|
||||
lower_left_layout->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
// This is only here
|
||||
QWidget* blank_widget = new QWidget();
|
||||
//new QHBoxLayout(blank_widget);
|
||||
blank_widget->setSizePolicy(lower_container_size_policy);
|
||||
lower_control_layout->addWidget(blank_widget);
|
||||
cur_tc_lbl_ = new RationalSlider();
|
||||
cur_tc_lbl_->SetDisplayType(RationalSlider::kTime);
|
||||
cur_tc_lbl_->SetMinimum(0);
|
||||
connect(cur_tc_lbl_, &RationalSlider::ValueChanged, this,
|
||||
&PlaybackControls::TimeChanged);
|
||||
lower_left_layout->addWidget(cur_tc_lbl_);
|
||||
lower_left_layout->addStretch();
|
||||
|
||||
// In the lower-middle, we create playback control buttons
|
||||
QWidget* lower_middle_container = new QWidget();
|
||||
lower_middle_container->setSizePolicy(lower_container_size_policy);
|
||||
lower_control_layout->addWidget(lower_middle_container);
|
||||
// This is only here
|
||||
QWidget *blank_widget = new QWidget();
|
||||
//new QHBoxLayout(blank_widget);
|
||||
blank_widget->setSizePolicy(lower_container_size_policy);
|
||||
lower_control_layout->addWidget(blank_widget);
|
||||
|
||||
QHBoxLayout* lower_middle_layout = new QHBoxLayout(lower_middle_container);
|
||||
lower_middle_layout->setSpacing(0);
|
||||
lower_middle_layout->setContentsMargins(0, 0, 0, 0);
|
||||
lower_middle_layout->addStretch();
|
||||
// In the lower-middle, we create playback control buttons
|
||||
QWidget *lower_middle_container = new QWidget();
|
||||
lower_middle_container->setSizePolicy(lower_container_size_policy);
|
||||
lower_control_layout->addWidget(lower_middle_container);
|
||||
|
||||
QSizePolicy btn_sz_policy(QSizePolicy::Maximum, QSizePolicy::Preferred);
|
||||
QHBoxLayout *lower_middle_layout = new QHBoxLayout(lower_middle_container);
|
||||
lower_middle_layout->setSpacing(0);
|
||||
lower_middle_layout->setContentsMargins(0, 0, 0, 0);
|
||||
lower_middle_layout->addStretch();
|
||||
|
||||
// Go To Start Button
|
||||
go_to_start_btn_ = new QPushButton();
|
||||
go_to_start_btn_->setSizePolicy(btn_sz_policy);
|
||||
lower_middle_layout->addWidget(go_to_start_btn_);
|
||||
connect(go_to_start_btn_, &QPushButton::clicked, this, &PlaybackControls::BeginClicked);
|
||||
QSizePolicy btn_sz_policy(QSizePolicy::Maximum, QSizePolicy::Preferred);
|
||||
|
||||
// Prev Frame Button
|
||||
prev_frame_btn_ = new QPushButton();
|
||||
prev_frame_btn_->setSizePolicy(btn_sz_policy);
|
||||
lower_middle_layout->addWidget(prev_frame_btn_);
|
||||
connect(prev_frame_btn_, &QPushButton::clicked, this, &PlaybackControls::PrevFrameClicked);
|
||||
// Go To Start Button
|
||||
go_to_start_btn_ = new QPushButton();
|
||||
go_to_start_btn_->setSizePolicy(btn_sz_policy);
|
||||
lower_middle_layout->addWidget(go_to_start_btn_);
|
||||
connect(go_to_start_btn_, &QPushButton::clicked, this,
|
||||
&PlaybackControls::BeginClicked);
|
||||
|
||||
// Play/Pause Button
|
||||
playpause_stack_ = new QStackedWidget();
|
||||
playpause_stack_->setSizePolicy(btn_sz_policy);
|
||||
lower_middle_layout->addWidget(playpause_stack_);
|
||||
// Prev Frame Button
|
||||
prev_frame_btn_ = new QPushButton();
|
||||
prev_frame_btn_->setSizePolicy(btn_sz_policy);
|
||||
lower_middle_layout->addWidget(prev_frame_btn_);
|
||||
connect(prev_frame_btn_, &QPushButton::clicked, this,
|
||||
&PlaybackControls::PrevFrameClicked);
|
||||
|
||||
play_btn_ = new QPushButton();
|
||||
playpause_stack_->addWidget(play_btn_);
|
||||
connect(play_btn_, &QPushButton::clicked, this, &PlaybackControls::PlayClicked);
|
||||
// Play/Pause Button
|
||||
playpause_stack_ = new QStackedWidget();
|
||||
playpause_stack_->setSizePolicy(btn_sz_policy);
|
||||
lower_middle_layout->addWidget(playpause_stack_);
|
||||
|
||||
pause_btn_ = new QPushButton();
|
||||
playpause_stack_->addWidget(pause_btn_);
|
||||
connect(pause_btn_, &QPushButton::clicked, this, &PlaybackControls::PauseClicked);
|
||||
play_btn_ = new QPushButton();
|
||||
playpause_stack_->addWidget(play_btn_);
|
||||
connect(play_btn_, &QPushButton::clicked, this,
|
||||
&PlaybackControls::PlayClicked);
|
||||
|
||||
// Default to showing play button
|
||||
playpause_stack_->setCurrentWidget(play_btn_);
|
||||
pause_btn_ = new QPushButton();
|
||||
playpause_stack_->addWidget(pause_btn_);
|
||||
connect(pause_btn_, &QPushButton::clicked, this,
|
||||
&PlaybackControls::PauseClicked);
|
||||
|
||||
// Next Frame Button
|
||||
next_frame_btn_ = new QPushButton();
|
||||
next_frame_btn_->setSizePolicy(btn_sz_policy);
|
||||
lower_middle_layout->addWidget(next_frame_btn_);
|
||||
connect(next_frame_btn_, &QPushButton::clicked, this, &PlaybackControls::NextFrameClicked);
|
||||
// Default to showing play button
|
||||
playpause_stack_->setCurrentWidget(play_btn_);
|
||||
|
||||
// Go To End Button
|
||||
go_to_end_btn_ = new QPushButton();
|
||||
go_to_end_btn_->setSizePolicy(btn_sz_policy);
|
||||
lower_middle_layout->addWidget(go_to_end_btn_);
|
||||
connect(go_to_end_btn_, &QPushButton::clicked, this, &PlaybackControls::EndClicked);
|
||||
// Next Frame Button
|
||||
next_frame_btn_ = new QPushButton();
|
||||
next_frame_btn_->setSizePolicy(btn_sz_policy);
|
||||
lower_middle_layout->addWidget(next_frame_btn_);
|
||||
connect(next_frame_btn_, &QPushButton::clicked, this,
|
||||
&PlaybackControls::NextFrameClicked);
|
||||
|
||||
lower_middle_layout->addStretch();
|
||||
// Go To End Button
|
||||
go_to_end_btn_ = new QPushButton();
|
||||
go_to_end_btn_->setSizePolicy(btn_sz_policy);
|
||||
lower_middle_layout->addWidget(go_to_end_btn_);
|
||||
connect(go_to_end_btn_, &QPushButton::clicked, this,
|
||||
&PlaybackControls::EndClicked);
|
||||
|
||||
QWidget* av_btn_widget = new QWidget();
|
||||
av_btn_widget->setSizePolicy(lower_container_size_policy);
|
||||
QHBoxLayout* av_btn_layout = new QHBoxLayout(av_btn_widget);
|
||||
av_btn_layout->setSpacing(0);
|
||||
av_btn_layout->setContentsMargins(0, 0, 0, 0);
|
||||
video_drag_btn_ = new DragButton();
|
||||
connect(video_drag_btn_, &QPushButton::clicked, this, &PlaybackControls::VideoClicked);
|
||||
connect(video_drag_btn_, &DragButton::DragStarted, this, &PlaybackControls::VideoDragged);
|
||||
av_btn_layout->addWidget(video_drag_btn_);
|
||||
audio_drag_btn_ = new DragButton();
|
||||
connect(audio_drag_btn_, &QPushButton::clicked, this, &PlaybackControls::AudioClicked);
|
||||
connect(audio_drag_btn_, &DragButton::DragStarted, this, &PlaybackControls::AudioDragged);
|
||||
av_btn_layout->addWidget(audio_drag_btn_);
|
||||
lower_control_layout->addWidget(av_btn_widget);
|
||||
lower_middle_layout->addStretch();
|
||||
|
||||
// The lower-right, we create another timecode label, this time to show the end timecode
|
||||
lower_right_container_ = new QWidget();
|
||||
lower_right_container_->setVisible(false);
|
||||
lower_right_container_->setSizePolicy(lower_container_size_policy);
|
||||
lower_control_layout->addWidget(lower_right_container_);
|
||||
QWidget *av_btn_widget = new QWidget();
|
||||
av_btn_widget->setSizePolicy(lower_container_size_policy);
|
||||
QHBoxLayout *av_btn_layout = new QHBoxLayout(av_btn_widget);
|
||||
av_btn_layout->setSpacing(0);
|
||||
av_btn_layout->setContentsMargins(0, 0, 0, 0);
|
||||
video_drag_btn_ = new DragButton();
|
||||
connect(video_drag_btn_, &QPushButton::clicked, this,
|
||||
&PlaybackControls::VideoClicked);
|
||||
connect(video_drag_btn_, &DragButton::DragStarted, this,
|
||||
&PlaybackControls::VideoDragged);
|
||||
av_btn_layout->addWidget(video_drag_btn_);
|
||||
audio_drag_btn_ = new DragButton();
|
||||
connect(audio_drag_btn_, &QPushButton::clicked, this,
|
||||
&PlaybackControls::AudioClicked);
|
||||
connect(audio_drag_btn_, &DragButton::DragStarted, this,
|
||||
&PlaybackControls::AudioDragged);
|
||||
av_btn_layout->addWidget(audio_drag_btn_);
|
||||
lower_control_layout->addWidget(av_btn_widget);
|
||||
|
||||
QHBoxLayout* lower_right_layout = new QHBoxLayout(lower_right_container_);
|
||||
lower_right_layout->setSpacing(0);
|
||||
lower_right_layout->setContentsMargins(0, 0, 0, 0);
|
||||
// The lower-right, we create another timecode label, this time to show the end timecode
|
||||
lower_right_container_ = new QWidget();
|
||||
lower_right_container_->setVisible(false);
|
||||
lower_right_container_->setSizePolicy(lower_container_size_policy);
|
||||
lower_control_layout->addWidget(lower_right_container_);
|
||||
|
||||
lower_right_layout->addStretch();
|
||||
end_tc_lbl_ = new QLabel();
|
||||
lower_right_layout->addWidget(end_tc_lbl_);
|
||||
QHBoxLayout *lower_right_layout = new QHBoxLayout(lower_right_container_);
|
||||
lower_right_layout->setSpacing(0);
|
||||
lower_right_layout->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
UpdateIcons();
|
||||
lower_right_layout->addStretch();
|
||||
end_tc_lbl_ = new QLabel();
|
||||
lower_right_layout->addWidget(end_tc_lbl_);
|
||||
|
||||
SetTimebase(0);
|
||||
UpdateIcons();
|
||||
|
||||
SetAudioVideoDragButtonsVisible(false);
|
||||
SetTimebase(0);
|
||||
|
||||
connect(Core::instance(), &Core::TimecodeDisplayChanged, this, &PlaybackControls::TimecodeChanged);
|
||||
SetAudioVideoDragButtonsVisible(false);
|
||||
|
||||
play_blink_timer_ = new QTimer(this);
|
||||
play_blink_timer_->setInterval(500);
|
||||
connect(play_blink_timer_, &QTimer::timeout, this, &PlaybackControls::PlayBlink);
|
||||
connect(Core::instance(), &Core::TimecodeDisplayChanged, this,
|
||||
&PlaybackControls::TimecodeChanged);
|
||||
|
||||
play_blink_timer_ = new QTimer(this);
|
||||
play_blink_timer_->setInterval(500);
|
||||
connect(play_blink_timer_, &QTimer::timeout, this,
|
||||
&PlaybackControls::PlayBlink);
|
||||
}
|
||||
|
||||
void PlaybackControls::SetTimecodeEnabled(bool enabled)
|
||||
{
|
||||
lower_left_container_->setVisible(enabled);
|
||||
lower_right_container_->setVisible(enabled);
|
||||
lower_left_container_->setVisible(enabled);
|
||||
lower_right_container_->setVisible(enabled);
|
||||
}
|
||||
|
||||
void PlaybackControls::SetTimebase(const rational &r)
|
||||
{
|
||||
time_base_ = r;
|
||||
cur_tc_lbl_->SetTimebase(r);
|
||||
time_base_ = r;
|
||||
cur_tc_lbl_->SetTimebase(r);
|
||||
|
||||
cur_tc_lbl_->setVisible(!r.isNull());
|
||||
end_tc_lbl_->setVisible(!r.isNull());
|
||||
cur_tc_lbl_->setVisible(!r.isNull());
|
||||
end_tc_lbl_->setVisible(!r.isNull());
|
||||
|
||||
setEnabled(!r.isNull());
|
||||
setEnabled(!r.isNull());
|
||||
}
|
||||
|
||||
void PlaybackControls::SetAudioVideoDragButtonsVisible(bool e)
|
||||
{
|
||||
video_drag_btn_->setVisible(e);
|
||||
audio_drag_btn_->setVisible(e);
|
||||
video_drag_btn_->setVisible(e);
|
||||
audio_drag_btn_->setVisible(e);
|
||||
}
|
||||
|
||||
void PlaybackControls::SetTime(const rational &r)
|
||||
{
|
||||
cur_tc_lbl_->SetValue(r);
|
||||
cur_tc_lbl_->SetValue(r);
|
||||
}
|
||||
|
||||
void PlaybackControls::SetEndTime(const rational &r)
|
||||
{
|
||||
if (time_base_.isNull()) {
|
||||
return;
|
||||
}
|
||||
if (time_base_.isNull()) {
|
||||
return;
|
||||
}
|
||||
|
||||
end_time_ = r;
|
||||
end_time_ = r;
|
||||
|
||||
end_tc_lbl_->setText(QString::fromStdString(Timecode::time_to_timecode(end_time_,
|
||||
time_base_,
|
||||
Core::instance()->GetTimecodeDisplay())));
|
||||
end_tc_lbl_->setText(QString::fromStdString(Timecode::time_to_timecode(
|
||||
end_time_, time_base_, Core::instance()->GetTimecodeDisplay())));
|
||||
}
|
||||
|
||||
void PlaybackControls::ShowPauseButton()
|
||||
{
|
||||
// Play was clicked, toggle to pause
|
||||
playpause_stack_->setCurrentWidget(pause_btn_);
|
||||
// Play was clicked, toggle to pause
|
||||
playpause_stack_->setCurrentWidget(pause_btn_);
|
||||
}
|
||||
|
||||
void PlaybackControls::ShowPlayButton()
|
||||
{
|
||||
playpause_stack_->setCurrentWidget(play_btn_);
|
||||
playpause_stack_->setCurrentWidget(play_btn_);
|
||||
}
|
||||
|
||||
void PlaybackControls::changeEvent(QEvent *e)
|
||||
{
|
||||
QWidget::changeEvent(e);
|
||||
QWidget::changeEvent(e);
|
||||
|
||||
if (e->type() == QEvent::StyleChange) {
|
||||
UpdateIcons();
|
||||
}
|
||||
if (e->type() == QEvent::StyleChange) {
|
||||
UpdateIcons();
|
||||
}
|
||||
}
|
||||
|
||||
void PlaybackControls::UpdateIcons()
|
||||
{
|
||||
go_to_start_btn_->setIcon(icon::GoToStart);
|
||||
prev_frame_btn_->setIcon(icon::PrevFrame);
|
||||
play_btn_->setIcon(icon::Play);
|
||||
pause_btn_->setIcon(icon::Pause);
|
||||
next_frame_btn_->setIcon(icon::NextFrame);
|
||||
go_to_end_btn_->setIcon(icon::GoToEnd);
|
||||
video_drag_btn_->setIcon(icon::Video);
|
||||
audio_drag_btn_->setIcon(icon::Audio);
|
||||
go_to_start_btn_->setIcon(icon::GoToStart);
|
||||
prev_frame_btn_->setIcon(icon::PrevFrame);
|
||||
play_btn_->setIcon(icon::Play);
|
||||
pause_btn_->setIcon(icon::Pause);
|
||||
next_frame_btn_->setIcon(icon::NextFrame);
|
||||
go_to_end_btn_->setIcon(icon::GoToEnd);
|
||||
video_drag_btn_->setIcon(icon::Video);
|
||||
audio_drag_btn_->setIcon(icon::Audio);
|
||||
}
|
||||
|
||||
void PlaybackControls::SetButtonRecordingState(QPushButton *btn, bool on)
|
||||
{
|
||||
btn->setStyleSheet(on ? QStringLiteral("background: red;") : QString());
|
||||
btn->setStyleSheet(on ? QStringLiteral("background: red;") : QString());
|
||||
}
|
||||
|
||||
void PlaybackControls::TimecodeChanged()
|
||||
{
|
||||
// Update end time
|
||||
SetEndTime(end_time_);
|
||||
// Update end time
|
||||
SetEndTime(end_time_);
|
||||
}
|
||||
|
||||
void PlaybackControls::PlayBlink()
|
||||
{
|
||||
SetButtonRecordingState(play_btn_, play_btn_->styleSheet().isEmpty());
|
||||
SetButtonRecordingState(play_btn_, play_btn_->styleSheet().isEmpty());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -29,131 +29,130 @@
|
||||
#include "dragbutton.h"
|
||||
#include "widget/slider/rationalslider.h"
|
||||
|
||||
namespace olive {
|
||||
namespace olive
|
||||
{
|
||||
|
||||
/**
|
||||
* @brief A playback controls widget providing buttons for navigating media
|
||||
*
|
||||
* This widget optionally features timecode displays for the current timecode and end timecode.
|
||||
*/
|
||||
class PlaybackControls : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
class PlaybackControls : public QWidget {
|
||||
Q_OBJECT
|
||||
public:
|
||||
PlaybackControls(QWidget* parent = nullptr);
|
||||
PlaybackControls(QWidget *parent = nullptr);
|
||||
|
||||
/**
|
||||
/**
|
||||
* @brief Set whether the timecodes should be shown or not
|
||||
*/
|
||||
void SetTimecodeEnabled(bool enabled);
|
||||
void SetTimecodeEnabled(bool enabled);
|
||||
|
||||
void SetTimebase(const rational& r);
|
||||
void SetTimebase(const rational &r);
|
||||
|
||||
void SetAudioVideoDragButtonsVisible(bool e);
|
||||
void SetAudioVideoDragButtonsVisible(bool e);
|
||||
|
||||
public slots:
|
||||
void SetTime(const rational &r);
|
||||
void SetTime(const rational &r);
|
||||
|
||||
void SetEndTime(const rational &r);
|
||||
void SetEndTime(const rational &r);
|
||||
|
||||
void ShowPauseButton();
|
||||
void ShowPauseButton();
|
||||
|
||||
void ShowPlayButton();
|
||||
void ShowPlayButton();
|
||||
|
||||
void StartPlayBlink()
|
||||
{
|
||||
play_blink_timer_->start();
|
||||
SetButtonRecordingState(play_btn_, true);
|
||||
}
|
||||
void StartPlayBlink()
|
||||
{
|
||||
play_blink_timer_->start();
|
||||
SetButtonRecordingState(play_btn_, true);
|
||||
}
|
||||
|
||||
void StopPlayBlink()
|
||||
{
|
||||
play_blink_timer_->stop();
|
||||
SetButtonRecordingState(play_btn_, false);
|
||||
}
|
||||
void StopPlayBlink()
|
||||
{
|
||||
play_blink_timer_->stop();
|
||||
SetButtonRecordingState(play_btn_, false);
|
||||
}
|
||||
|
||||
void SetPauseButtonRecordingState(bool on)
|
||||
{
|
||||
SetButtonRecordingState(pause_btn_, on);
|
||||
}
|
||||
void SetPauseButtonRecordingState(bool on)
|
||||
{
|
||||
SetButtonRecordingState(pause_btn_, on);
|
||||
}
|
||||
|
||||
signals:
|
||||
/**
|
||||
/**
|
||||
* @brief Signal emitted when "Go to Start" is clicked
|
||||
*/
|
||||
void BeginClicked();
|
||||
void BeginClicked();
|
||||
|
||||
/**
|
||||
/**
|
||||
* @brief Signal emitted when "Previous Frame" is clicked
|
||||
*/
|
||||
void PrevFrameClicked();
|
||||
void PrevFrameClicked();
|
||||
|
||||
/**
|
||||
/**
|
||||
* @brief Signal emitted when "Play" is clicked
|
||||
*/
|
||||
void PlayClicked();
|
||||
void PlayClicked();
|
||||
|
||||
/**
|
||||
/**
|
||||
* @brief Signal emitted when "Pause" is clicked
|
||||
*/
|
||||
void PauseClicked();
|
||||
void PauseClicked();
|
||||
|
||||
/**
|
||||
/**
|
||||
* @brief Signal emitted when "Next Frame" is clicked
|
||||
*/
|
||||
void NextFrameClicked();
|
||||
void NextFrameClicked();
|
||||
|
||||
/**
|
||||
/**
|
||||
* @brief Signal emitted when "Go to End" is clicked
|
||||
*/
|
||||
void EndClicked();
|
||||
void EndClicked();
|
||||
|
||||
void AudioClicked();
|
||||
void AudioClicked();
|
||||
|
||||
void VideoClicked();
|
||||
void VideoClicked();
|
||||
|
||||
void AudioDragged();
|
||||
void AudioDragged();
|
||||
|
||||
void VideoDragged();
|
||||
void VideoDragged();
|
||||
|
||||
void TimeChanged(const rational& t);
|
||||
void TimeChanged(const rational &t);
|
||||
|
||||
protected:
|
||||
virtual void changeEvent(QEvent *) override;
|
||||
virtual void changeEvent(QEvent *) override;
|
||||
|
||||
private:
|
||||
void UpdateIcons();
|
||||
void UpdateIcons();
|
||||
|
||||
static void SetButtonRecordingState(QPushButton *btn, bool on);
|
||||
static void SetButtonRecordingState(QPushButton *btn, bool on);
|
||||
|
||||
QWidget* lower_left_container_;
|
||||
QWidget* lower_right_container_;
|
||||
QWidget *lower_left_container_;
|
||||
QWidget *lower_right_container_;
|
||||
|
||||
RationalSlider* cur_tc_lbl_;
|
||||
QLabel* end_tc_lbl_;
|
||||
RationalSlider *cur_tc_lbl_;
|
||||
QLabel *end_tc_lbl_;
|
||||
|
||||
rational end_time_;
|
||||
rational end_time_;
|
||||
|
||||
rational time_base_;
|
||||
rational time_base_;
|
||||
|
||||
QPushButton* go_to_start_btn_;
|
||||
QPushButton* prev_frame_btn_;
|
||||
QPushButton* play_btn_;
|
||||
QPushButton* pause_btn_;
|
||||
QPushButton* next_frame_btn_;
|
||||
QPushButton* go_to_end_btn_;
|
||||
DragButton* video_drag_btn_;
|
||||
DragButton* audio_drag_btn_;
|
||||
QPushButton *go_to_start_btn_;
|
||||
QPushButton *prev_frame_btn_;
|
||||
QPushButton *play_btn_;
|
||||
QPushButton *pause_btn_;
|
||||
QPushButton *next_frame_btn_;
|
||||
QPushButton *go_to_end_btn_;
|
||||
DragButton *video_drag_btn_;
|
||||
DragButton *audio_drag_btn_;
|
||||
|
||||
QStackedWidget* playpause_stack_;
|
||||
QStackedWidget *playpause_stack_;
|
||||
|
||||
QTimer *play_blink_timer_;
|
||||
QTimer *play_blink_timer_;
|
||||
|
||||
private slots:
|
||||
void TimecodeChanged();
|
||||
|
||||
void PlayBlink();
|
||||
void TimecodeChanged();
|
||||
|
||||
void PlayBlink();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user