change: change code style to Linux style except indent.
This commit is contained in:
@@ -22,23 +22,24 @@
|
||||
|
||||
#include "panel/panelmanager.h"
|
||||
|
||||
namespace olive {
|
||||
namespace olive
|
||||
{
|
||||
|
||||
#define super PanelWidget
|
||||
|
||||
AudioMonitorPanel::AudioMonitorPanel() :
|
||||
super(QStringLiteral("AudioMonitor"))
|
||||
AudioMonitorPanel::AudioMonitorPanel()
|
||||
: super(QStringLiteral("AudioMonitor"))
|
||||
{
|
||||
audio_monitor_ = new AudioMonitor(this);
|
||||
audio_monitor_ = new AudioMonitor(this);
|
||||
|
||||
SetWidgetWithPadding(audio_monitor_);
|
||||
SetWidgetWithPadding(audio_monitor_);
|
||||
|
||||
Retranslate();
|
||||
Retranslate();
|
||||
}
|
||||
|
||||
void AudioMonitorPanel::Retranslate()
|
||||
{
|
||||
SetTitle(tr("Audio Monitor"));
|
||||
SetTitle(tr("Audio Monitor"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -24,32 +24,31 @@
|
||||
#include "panel/panel.h"
|
||||
#include "widget/audiomonitor/audiomonitor.h"
|
||||
|
||||
namespace olive {
|
||||
namespace olive
|
||||
{
|
||||
|
||||
/**
|
||||
* @brief PanelWidget wrapper around an AudioMonitor
|
||||
*/
|
||||
class AudioMonitorPanel : public PanelWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
class AudioMonitorPanel : public PanelWidget {
|
||||
Q_OBJECT
|
||||
public:
|
||||
AudioMonitorPanel();
|
||||
AudioMonitorPanel();
|
||||
|
||||
bool IsPlaying() const
|
||||
{
|
||||
return audio_monitor_->IsPlaying();
|
||||
}
|
||||
bool IsPlaying() const
|
||||
{
|
||||
return audio_monitor_->IsPlaying();
|
||||
}
|
||||
|
||||
void SetParams(const AudioParams& params)
|
||||
{
|
||||
audio_monitor_->SetParams(params);
|
||||
}
|
||||
void SetParams(const AudioParams ¶ms)
|
||||
{
|
||||
audio_monitor_->SetParams(params);
|
||||
}
|
||||
|
||||
private:
|
||||
virtual void Retranslate() override;
|
||||
|
||||
AudioMonitor* audio_monitor_;
|
||||
virtual void Retranslate() override;
|
||||
|
||||
AudioMonitor *audio_monitor_;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
+19
-18
@@ -20,55 +20,56 @@
|
||||
|
||||
#include "curve.h"
|
||||
|
||||
namespace olive {
|
||||
|
||||
CurvePanel::CurvePanel() :
|
||||
TimeBasedPanel(QStringLiteral("CurvePanel"))
|
||||
namespace olive
|
||||
{
|
||||
// Create main widget and set it
|
||||
SetTimeBasedWidget(new CurveWidget(this));
|
||||
|
||||
// Set strings
|
||||
Retranslate();
|
||||
CurvePanel::CurvePanel()
|
||||
: TimeBasedPanel(QStringLiteral("CurvePanel"))
|
||||
{
|
||||
// Create main widget and set it
|
||||
SetTimeBasedWidget(new CurveWidget(this));
|
||||
|
||||
// Set strings
|
||||
Retranslate();
|
||||
}
|
||||
|
||||
void CurvePanel::DeleteSelected()
|
||||
{
|
||||
static_cast<CurveWidget*>(GetTimeBasedWidget())->DeleteSelected();
|
||||
static_cast<CurveWidget *>(GetTimeBasedWidget())->DeleteSelected();
|
||||
}
|
||||
|
||||
void CurvePanel::SelectAll()
|
||||
{
|
||||
static_cast<CurveWidget*>(GetTimeBasedWidget())->SelectAll();
|
||||
static_cast<CurveWidget *>(GetTimeBasedWidget())->SelectAll();
|
||||
}
|
||||
|
||||
void CurvePanel::DeselectAll()
|
||||
{
|
||||
static_cast<CurveWidget*>(GetTimeBasedWidget())->DeselectAll();
|
||||
static_cast<CurveWidget *>(GetTimeBasedWidget())->DeselectAll();
|
||||
}
|
||||
|
||||
void CurvePanel::SetNodes(const QVector<Node *> &nodes)
|
||||
{
|
||||
static_cast<CurveWidget*>(GetTimeBasedWidget())->SetNodes(nodes);
|
||||
static_cast<CurveWidget *>(GetTimeBasedWidget())->SetNodes(nodes);
|
||||
}
|
||||
|
||||
void CurvePanel::IncreaseTrackHeight()
|
||||
{
|
||||
CurveWidget* c = static_cast<CurveWidget*>(GetTimeBasedWidget());
|
||||
c->SetVerticalScale(c->GetVerticalScale() * 2);
|
||||
CurveWidget *c = static_cast<CurveWidget *>(GetTimeBasedWidget());
|
||||
c->SetVerticalScale(c->GetVerticalScale() * 2);
|
||||
}
|
||||
|
||||
void CurvePanel::DecreaseTrackHeight()
|
||||
{
|
||||
CurveWidget* c = static_cast<CurveWidget*>(GetTimeBasedWidget());
|
||||
c->SetVerticalScale(c->GetVerticalScale() * 0.5);
|
||||
CurveWidget *c = static_cast<CurveWidget *>(GetTimeBasedWidget());
|
||||
c->SetVerticalScale(c->GetVerticalScale() * 0.5);
|
||||
}
|
||||
|
||||
void CurvePanel::Retranslate()
|
||||
{
|
||||
TimeBasedPanel::Retranslate();
|
||||
TimeBasedPanel::Retranslate();
|
||||
|
||||
SetTitle(tr("Curve Editor"));
|
||||
SetTitle(tr("Curve Editor"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+21
-22
@@ -24,42 +24,41 @@
|
||||
#include "panel/timebased/timebased.h"
|
||||
#include "widget/curvewidget/curvewidget.h"
|
||||
|
||||
namespace olive {
|
||||
|
||||
class CurvePanel : public TimeBasedPanel
|
||||
namespace olive
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
class CurvePanel : public TimeBasedPanel {
|
||||
Q_OBJECT
|
||||
public:
|
||||
CurvePanel();
|
||||
CurvePanel();
|
||||
|
||||
virtual void DeleteSelected() override;
|
||||
virtual void DeleteSelected() override;
|
||||
|
||||
virtual void SelectAll() override;
|
||||
virtual void SelectAll() override;
|
||||
|
||||
virtual void DeselectAll() override;
|
||||
virtual void DeselectAll() override;
|
||||
|
||||
public slots:
|
||||
void SetNode(Node *node)
|
||||
{
|
||||
// Convert single pointer to either an empty vector or a vector of one
|
||||
QVector<Node *> nodes;
|
||||
void SetNode(Node *node)
|
||||
{
|
||||
// Convert single pointer to either an empty vector or a vector of one
|
||||
QVector<Node *> nodes;
|
||||
|
||||
if (node) {
|
||||
nodes.append(node);
|
||||
}
|
||||
if (node) {
|
||||
nodes.append(node);
|
||||
}
|
||||
|
||||
SetNodes(nodes);
|
||||
}
|
||||
SetNodes(nodes);
|
||||
}
|
||||
|
||||
void SetNodes(const QVector<Node *> &nodes);
|
||||
void SetNodes(const QVector<Node *> &nodes);
|
||||
|
||||
virtual void IncreaseTrackHeight() override;
|
||||
virtual void IncreaseTrackHeight() override;
|
||||
|
||||
virtual void DecreaseTrackHeight() override;
|
||||
virtual void DecreaseTrackHeight() override;
|
||||
|
||||
protected:
|
||||
virtual void Retranslate() override;
|
||||
|
||||
virtual void Retranslate() override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -20,45 +20,46 @@
|
||||
|
||||
#include "footageviewer.h"
|
||||
|
||||
namespace olive {
|
||||
namespace olive
|
||||
{
|
||||
|
||||
#define super ViewerPanelBase
|
||||
|
||||
FootageViewerPanel::FootageViewerPanel() :
|
||||
super(QStringLiteral("FootageViewerPanel"))
|
||||
FootageViewerPanel::FootageViewerPanel()
|
||||
: super(QStringLiteral("FootageViewerPanel"))
|
||||
{
|
||||
// Set ViewerWidget as the central widget
|
||||
FootageViewerWidget* fvw = new FootageViewerWidget(this);
|
||||
SetViewerWidget(fvw);
|
||||
// Set ViewerWidget as the central widget
|
||||
FootageViewerWidget *fvw = new FootageViewerWidget(this);
|
||||
SetViewerWidget(fvw);
|
||||
|
||||
// Set strings
|
||||
Retranslate();
|
||||
// Set strings
|
||||
Retranslate();
|
||||
|
||||
// Show and raise on connect
|
||||
SetShowAndRaiseOnConnect();
|
||||
// Show and raise on connect
|
||||
SetShowAndRaiseOnConnect();
|
||||
}
|
||||
|
||||
void FootageViewerPanel::OverrideWorkArea(const TimeRange &r)
|
||||
{
|
||||
GetFootageViewerWidget()->OverrideWorkArea(r);
|
||||
GetFootageViewerWidget()->OverrideWorkArea(r);
|
||||
}
|
||||
|
||||
QVector<ViewerOutput *> FootageViewerPanel::GetSelectedFootage() const
|
||||
{
|
||||
QVector<ViewerOutput *> list;
|
||||
QVector<ViewerOutput *> list;
|
||||
|
||||
if (GetConnectedViewer()) {
|
||||
list.append(GetConnectedViewer());
|
||||
}
|
||||
if (GetConnectedViewer()) {
|
||||
list.append(GetConnectedViewer());
|
||||
}
|
||||
|
||||
return list;
|
||||
return list;
|
||||
}
|
||||
|
||||
void FootageViewerPanel::Retranslate()
|
||||
{
|
||||
super::Retranslate();
|
||||
super::Retranslate();
|
||||
|
||||
SetTitle(tr("Footage Viewer"));
|
||||
SetTitle(tr("Footage Viewer"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -27,28 +27,29 @@
|
||||
#include "panel/project/footagemanagementpanel.h"
|
||||
#include "widget/viewer/footageviewer.h"
|
||||
|
||||
namespace olive {
|
||||
namespace olive
|
||||
{
|
||||
|
||||
/**
|
||||
* @brief Dockable wrapper around a ViewerWidget
|
||||
*/
|
||||
class FootageViewerPanel : public ViewerPanelBase, public FootageManagementPanel {
|
||||
Q_OBJECT
|
||||
class FootageViewerPanel : public ViewerPanelBase,
|
||||
public FootageManagementPanel {
|
||||
Q_OBJECT
|
||||
public:
|
||||
FootageViewerPanel();
|
||||
FootageViewerPanel();
|
||||
|
||||
void OverrideWorkArea(const TimeRange &r);
|
||||
void OverrideWorkArea(const TimeRange &r);
|
||||
|
||||
FootageViewerWidget *GetFootageViewerWidget() const
|
||||
{
|
||||
return static_cast<FootageViewerWidget*>(GetTimeBasedWidget());
|
||||
}
|
||||
FootageViewerWidget *GetFootageViewerWidget() const
|
||||
{
|
||||
return static_cast<FootageViewerWidget *>(GetTimeBasedWidget());
|
||||
}
|
||||
|
||||
virtual QVector<ViewerOutput *> GetSelectedFootage() const override;
|
||||
virtual QVector<ViewerOutput *> GetSelectedFootage() const override;
|
||||
|
||||
protected:
|
||||
virtual void Retranslate() override;
|
||||
|
||||
virtual void Retranslate() override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -22,19 +22,20 @@
|
||||
|
||||
#include "widget/history/historywidget.h"
|
||||
|
||||
namespace olive {
|
||||
|
||||
HistoryPanel::HistoryPanel() :
|
||||
PanelWidget(QStringLiteral("HistoryPanel"))
|
||||
namespace olive
|
||||
{
|
||||
SetWidgetWithPadding(new HistoryWidget(this));
|
||||
|
||||
Retranslate();
|
||||
HistoryPanel::HistoryPanel()
|
||||
: PanelWidget(QStringLiteral("HistoryPanel"))
|
||||
{
|
||||
SetWidgetWithPadding(new HistoryWidget(this));
|
||||
|
||||
Retranslate();
|
||||
}
|
||||
|
||||
void HistoryPanel::Retranslate()
|
||||
{
|
||||
SetTitle(tr("History"));
|
||||
SetTitle(tr("History"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -23,17 +23,16 @@
|
||||
|
||||
#include "panel/panel.h"
|
||||
|
||||
namespace olive {
|
||||
|
||||
class HistoryPanel : public PanelWidget
|
||||
namespace olive
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
class HistoryPanel : public PanelWidget {
|
||||
Q_OBJECT
|
||||
public:
|
||||
HistoryPanel();
|
||||
HistoryPanel();
|
||||
|
||||
protected:
|
||||
virtual void Retranslate() override;
|
||||
|
||||
virtual void Retranslate() override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,22 +1,23 @@
|
||||
#include "multicampanel.h"
|
||||
|
||||
namespace olive {
|
||||
namespace olive
|
||||
{
|
||||
|
||||
#define super TimeBasedPanel
|
||||
|
||||
MulticamPanel::MulticamPanel() :
|
||||
super(QStringLiteral("MultiCamPanel"))
|
||||
MulticamPanel::MulticamPanel()
|
||||
: super(QStringLiteral("MultiCamPanel"))
|
||||
{
|
||||
SetTimeBasedWidget(new MulticamWidget(this));
|
||||
SetTimeBasedWidget(new MulticamWidget(this));
|
||||
|
||||
Retranslate();
|
||||
Retranslate();
|
||||
}
|
||||
|
||||
void MulticamPanel::Retranslate()
|
||||
{
|
||||
super::Retranslate();
|
||||
super::Retranslate();
|
||||
|
||||
SetTitle(tr("Multi-Cam"));
|
||||
SetTitle(tr("Multi-Cam"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,19 +4,21 @@
|
||||
#include "panel/viewer/viewerbase.h"
|
||||
#include "widget/multicam/multicamwidget.h"
|
||||
|
||||
namespace olive {
|
||||
|
||||
class MulticamPanel : public TimeBasedPanel
|
||||
namespace olive
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
MulticamPanel();
|
||||
|
||||
MulticamWidget *GetMulticamWidget() const { return static_cast<MulticamWidget *>(GetTimeBasedWidget()); }
|
||||
class MulticamPanel : public TimeBasedPanel {
|
||||
Q_OBJECT
|
||||
public:
|
||||
MulticamPanel();
|
||||
|
||||
MulticamWidget *GetMulticamWidget() const
|
||||
{
|
||||
return static_cast<MulticamWidget *>(GetTimeBasedWidget());
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual void Retranslate() override;
|
||||
|
||||
virtual void Retranslate() override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
+24
-16
@@ -20,26 +20,34 @@
|
||||
|
||||
#include "node.h"
|
||||
|
||||
namespace olive {
|
||||
|
||||
NodePanel::NodePanel() :
|
||||
PanelWidget(QStringLiteral("NodePanel"))
|
||||
namespace olive
|
||||
{
|
||||
node_widget_ = new NodeWidget(this);
|
||||
connect(this, &NodePanel::shown, node_widget_->view(), &NodeView::CenterOnItemsBoundingRect);
|
||||
|
||||
connect(node_widget_->view(), &NodeView::NodesSelected, this, &NodePanel::NodesSelected);
|
||||
connect(node_widget_->view(), &NodeView::NodesDeselected, this, &NodePanel::NodesDeselected);
|
||||
connect(node_widget_->view(), &NodeView::NodeSelectionChanged, this, &NodePanel::NodeSelectionChanged);
|
||||
connect(node_widget_->view(), &NodeView::NodeSelectionChangedWithContexts, this, &NodePanel::NodeSelectionChangedWithContexts);
|
||||
connect(node_widget_->view(), &NodeView::NodeGroupOpened, this, &NodePanel::NodeGroupOpened);
|
||||
connect(node_widget_->view(), &NodeView::NodeGroupClosed, this, &NodePanel::NodeGroupClosed);
|
||||
NodePanel::NodePanel()
|
||||
: PanelWidget(QStringLiteral("NodePanel"))
|
||||
{
|
||||
node_widget_ = new NodeWidget(this);
|
||||
connect(this, &NodePanel::shown, node_widget_->view(),
|
||||
&NodeView::CenterOnItemsBoundingRect);
|
||||
|
||||
// Set it as the main widget of this panel
|
||||
SetWidgetWithPadding(node_widget_);
|
||||
connect(node_widget_->view(), &NodeView::NodesSelected, this,
|
||||
&NodePanel::NodesSelected);
|
||||
connect(node_widget_->view(), &NodeView::NodesDeselected, this,
|
||||
&NodePanel::NodesDeselected);
|
||||
connect(node_widget_->view(), &NodeView::NodeSelectionChanged, this,
|
||||
&NodePanel::NodeSelectionChanged);
|
||||
connect(node_widget_->view(), &NodeView::NodeSelectionChangedWithContexts,
|
||||
this, &NodePanel::NodeSelectionChangedWithContexts);
|
||||
connect(node_widget_->view(), &NodeView::NodeGroupOpened, this,
|
||||
&NodePanel::NodeGroupOpened);
|
||||
connect(node_widget_->view(), &NodeView::NodeGroupClosed, this,
|
||||
&NodePanel::NodeGroupClosed);
|
||||
|
||||
// Set strings
|
||||
Retranslate();
|
||||
// Set it as the main widget of this panel
|
||||
SetWidgetWithPadding(node_widget_);
|
||||
|
||||
// Set strings
|
||||
Retranslate();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+85
-79
@@ -24,117 +24,123 @@
|
||||
#include "panel/panel.h"
|
||||
#include "widget/nodeview/nodewidget.h"
|
||||
|
||||
namespace olive {
|
||||
namespace olive
|
||||
{
|
||||
|
||||
/**
|
||||
* @brief A PanelWidget wrapper around a NodeView
|
||||
*/
|
||||
class NodePanel : public PanelWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
class NodePanel : public PanelWidget {
|
||||
Q_OBJECT
|
||||
public:
|
||||
NodePanel();
|
||||
NodePanel();
|
||||
|
||||
NodeWidget *GetNodeWidget() const
|
||||
{
|
||||
return node_widget_;
|
||||
}
|
||||
NodeWidget *GetNodeWidget() const
|
||||
{
|
||||
return node_widget_;
|
||||
}
|
||||
|
||||
const QVector<Node*> &GetContexts() const { return node_widget_->view()->GetContexts(); }
|
||||
const QVector<Node *> &GetContexts() const
|
||||
{
|
||||
return node_widget_->view()->GetContexts();
|
||||
}
|
||||
|
||||
bool IsGroupOverlay() const { return node_widget_->view()->IsGroupOverlay(); }
|
||||
bool IsGroupOverlay() const
|
||||
{
|
||||
return node_widget_->view()->IsGroupOverlay();
|
||||
}
|
||||
|
||||
void SetContexts(const QVector<Node*> &nodes)
|
||||
{
|
||||
node_widget_->SetContexts(nodes);
|
||||
}
|
||||
void SetContexts(const QVector<Node *> &nodes)
|
||||
{
|
||||
node_widget_->SetContexts(nodes);
|
||||
}
|
||||
|
||||
void CloseContextsBelongingToProject(Project *project)
|
||||
{
|
||||
node_widget_->view()->CloseContextsBelongingToProject(project);
|
||||
}
|
||||
void CloseContextsBelongingToProject(Project *project)
|
||||
{
|
||||
node_widget_->view()->CloseContextsBelongingToProject(project);
|
||||
}
|
||||
|
||||
virtual void SelectAll() override
|
||||
{
|
||||
node_widget_->view()->SelectAll();
|
||||
}
|
||||
virtual void SelectAll() override
|
||||
{
|
||||
node_widget_->view()->SelectAll();
|
||||
}
|
||||
|
||||
virtual void DeselectAll() override
|
||||
{
|
||||
node_widget_->view()->DeselectAll();
|
||||
}
|
||||
virtual void DeselectAll() override
|
||||
{
|
||||
node_widget_->view()->DeselectAll();
|
||||
}
|
||||
|
||||
virtual void DeleteSelected() override
|
||||
{
|
||||
node_widget_->view()->DeleteSelected();
|
||||
}
|
||||
virtual void DeleteSelected() override
|
||||
{
|
||||
node_widget_->view()->DeleteSelected();
|
||||
}
|
||||
|
||||
virtual void CutSelected() override
|
||||
{
|
||||
node_widget_->view()->CopySelected(true);
|
||||
}
|
||||
virtual void CutSelected() override
|
||||
{
|
||||
node_widget_->view()->CopySelected(true);
|
||||
}
|
||||
|
||||
virtual void CopySelected() override
|
||||
{
|
||||
node_widget_->view()->CopySelected(false);
|
||||
}
|
||||
virtual void CopySelected() override
|
||||
{
|
||||
node_widget_->view()->CopySelected(false);
|
||||
}
|
||||
|
||||
virtual void Paste() override
|
||||
{
|
||||
node_widget_->view()->Paste();
|
||||
}
|
||||
virtual void Paste() override
|
||||
{
|
||||
node_widget_->view()->Paste();
|
||||
}
|
||||
|
||||
virtual void Duplicate() override
|
||||
{
|
||||
node_widget_->view()->Duplicate();
|
||||
}
|
||||
virtual void Duplicate() override
|
||||
{
|
||||
node_widget_->view()->Duplicate();
|
||||
}
|
||||
|
||||
virtual void SetColorLabel(int index) override
|
||||
{
|
||||
node_widget_->view()->SetColorLabel(index);
|
||||
}
|
||||
virtual void SetColorLabel(int index) override
|
||||
{
|
||||
node_widget_->view()->SetColorLabel(index);
|
||||
}
|
||||
|
||||
virtual void ZoomIn() override
|
||||
{
|
||||
node_widget_->view()->ZoomIn();
|
||||
}
|
||||
virtual void ZoomIn() override
|
||||
{
|
||||
node_widget_->view()->ZoomIn();
|
||||
}
|
||||
|
||||
virtual void ZoomOut() override
|
||||
{
|
||||
node_widget_->view()->ZoomOut();
|
||||
}
|
||||
virtual void ZoomOut() override
|
||||
{
|
||||
node_widget_->view()->ZoomOut();
|
||||
}
|
||||
|
||||
virtual void RenameSelected() override
|
||||
{
|
||||
node_widget_->view()->LabelSelectedNodes();
|
||||
}
|
||||
virtual void RenameSelected() override
|
||||
{
|
||||
node_widget_->view()->LabelSelectedNodes();
|
||||
}
|
||||
|
||||
public slots:
|
||||
void Select(const QVector<Node::ContextPair> &p)
|
||||
{
|
||||
node_widget_->view()->Select(p, true);
|
||||
}
|
||||
void Select(const QVector<Node::ContextPair> &p)
|
||||
{
|
||||
node_widget_->view()->Select(p, true);
|
||||
}
|
||||
|
||||
signals:
|
||||
void NodesSelected(const QVector<Node*>& nodes);
|
||||
void NodesSelected(const QVector<Node *> &nodes);
|
||||
|
||||
void NodesDeselected(const QVector<Node*>& nodes);
|
||||
void NodesDeselected(const QVector<Node *> &nodes);
|
||||
|
||||
void NodeSelectionChanged(const QVector<Node*>& nodes);
|
||||
void NodeSelectionChangedWithContexts(const QVector<Node::ContextPair>& nodes);
|
||||
void NodeSelectionChanged(const QVector<Node *> &nodes);
|
||||
void
|
||||
NodeSelectionChangedWithContexts(const QVector<Node::ContextPair> &nodes);
|
||||
|
||||
void NodeGroupOpened(NodeGroup *group);
|
||||
void NodeGroupOpened(NodeGroup *group);
|
||||
|
||||
void NodeGroupClosed();
|
||||
void NodeGroupClosed();
|
||||
|
||||
private:
|
||||
virtual void Retranslate() override
|
||||
{
|
||||
SetTitle(tr("Node Editor"));
|
||||
}
|
||||
|
||||
NodeWidget *node_widget_;
|
||||
virtual void Retranslate() override
|
||||
{
|
||||
SetTitle(tr("Node Editor"));
|
||||
}
|
||||
|
||||
NodeWidget *node_widget_;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
+54
-53
@@ -30,101 +30,102 @@
|
||||
|
||||
#include "panel/panelmanager.h"
|
||||
|
||||
namespace olive {
|
||||
namespace olive
|
||||
{
|
||||
|
||||
#define super KDDockWidgets::DockWidget
|
||||
|
||||
PanelWidget::PanelWidget(const QString &object_name) :
|
||||
super(object_name),
|
||||
border_visible_(false),
|
||||
signal_instead_of_close_(false)
|
||||
PanelWidget::PanelWidget(const QString &object_name)
|
||||
: super(object_name)
|
||||
, border_visible_(false)
|
||||
, signal_instead_of_close_(false)
|
||||
{
|
||||
setFocusPolicy(Qt::ClickFocus);
|
||||
setFocusPolicy(Qt::ClickFocus);
|
||||
|
||||
connect(this, &PanelWidget::shown, this, static_cast<void(PanelWidget::*)()>(&PanelWidget::setFocus));
|
||||
connect(this, &PanelWidget::shown, this,
|
||||
static_cast<void (PanelWidget::*)()>(&PanelWidget::setFocus));
|
||||
|
||||
PanelManager::instance()->RegisterPanel(this);
|
||||
PanelManager::instance()->RegisterPanel(this);
|
||||
}
|
||||
|
||||
PanelWidget::~PanelWidget()
|
||||
{
|
||||
PanelManager::instance()->UnregisterPanel(this);
|
||||
PanelManager::instance()->UnregisterPanel(this);
|
||||
}
|
||||
|
||||
void PanelWidget::SetBorderVisible(bool enabled)
|
||||
{
|
||||
border_visible_ = enabled;
|
||||
border_visible_ = enabled;
|
||||
|
||||
update();
|
||||
update();
|
||||
}
|
||||
|
||||
void PanelWidget::SetTitle(const QString &t)
|
||||
{
|
||||
title_ = t;
|
||||
UpdateTitle();
|
||||
title_ = t;
|
||||
UpdateTitle();
|
||||
}
|
||||
|
||||
void PanelWidget::SetSubtitle(const QString &t)
|
||||
{
|
||||
subtitle_ = t;
|
||||
UpdateTitle();
|
||||
subtitle_ = t;
|
||||
UpdateTitle();
|
||||
}
|
||||
|
||||
void PanelWidget::paintEvent(QPaintEvent *event)
|
||||
{
|
||||
// Perform default behavior
|
||||
super::paintEvent(event);
|
||||
// Perform default behavior
|
||||
super::paintEvent(event);
|
||||
|
||||
// Check if this panel (or a child of it) has focus using PanelFocusManager
|
||||
if (border_visible_) {
|
||||
// Check if this panel (or a child of it) has focus using PanelFocusManager
|
||||
if (border_visible_) {
|
||||
// Draw a highlight border if so
|
||||
QPainter p(this);
|
||||
|
||||
// Draw a highlight border if so
|
||||
QPainter p(this);
|
||||
// We need to adjust the rect by 1 pixel since the bottom and right are "offscreen"
|
||||
QRect highlight_border = rect();
|
||||
highlight_border.adjust(0, 0, -1, -1);
|
||||
|
||||
// We need to adjust the rect by 1 pixel since the bottom and right are "offscreen"
|
||||
QRect highlight_border = rect();
|
||||
highlight_border.adjust(0, 0, -1, -1);
|
||||
// Set the color to the palette's highlight color
|
||||
p.setPen(palette().highlight().color());
|
||||
|
||||
// Set the color to the palette's highlight color
|
||||
p.setPen(palette().highlight().color());
|
||||
|
||||
// Draw the highlight border
|
||||
p.drawRect(highlight_border);
|
||||
}
|
||||
// Draw the highlight border
|
||||
p.drawRect(highlight_border);
|
||||
}
|
||||
}
|
||||
|
||||
void PanelWidget::UpdateTitle()
|
||||
{
|
||||
// If there's no subtitle, just use the title. Otherwise, we set a formatted combination of the two that can
|
||||
// differ based on translation
|
||||
if (subtitle_.isEmpty()) {
|
||||
this->setTitle(title_);
|
||||
} else {
|
||||
this->setTitle(tr("%1: %2").arg(title_, subtitle_));
|
||||
}
|
||||
// If there's no subtitle, just use the title. Otherwise, we set a formatted combination of the two that can
|
||||
// differ based on translation
|
||||
if (subtitle_.isEmpty()) {
|
||||
this->setTitle(title_);
|
||||
} else {
|
||||
this->setTitle(tr("%1: %2").arg(title_, subtitle_));
|
||||
}
|
||||
}
|
||||
|
||||
void PanelWidget::SetSignalInsteadOfClose(bool e)
|
||||
{
|
||||
signal_instead_of_close_ = e;
|
||||
signal_instead_of_close_ = e;
|
||||
}
|
||||
|
||||
void PanelWidget::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
if (signal_instead_of_close_) {
|
||||
event->ignore();
|
||||
emit CloseRequested();
|
||||
} else {
|
||||
super::closeEvent(event);
|
||||
}
|
||||
if (signal_instead_of_close_) {
|
||||
event->ignore();
|
||||
emit CloseRequested();
|
||||
} else {
|
||||
super::closeEvent(event);
|
||||
}
|
||||
}
|
||||
|
||||
void PanelWidget::changeEvent(QEvent *e)
|
||||
{
|
||||
if (e->type() == QEvent::LanguageChange) {
|
||||
Retranslate();
|
||||
}
|
||||
super::changeEvent(e);
|
||||
if (e->type() == QEvent::LanguageChange) {
|
||||
Retranslate();
|
||||
}
|
||||
super::changeEvent(e);
|
||||
}
|
||||
|
||||
void PanelWidget::Retranslate()
|
||||
@@ -133,11 +134,11 @@ void PanelWidget::Retranslate()
|
||||
|
||||
void PanelWidget::SetWidgetWithPadding(QWidget *widget)
|
||||
{
|
||||
QWidget* wrapper = new QWidget();
|
||||
QHBoxLayout* layout = new QHBoxLayout(wrapper);
|
||||
layout->setContentsMargins(layout->contentsMargins() / 2);
|
||||
layout->addWidget(widget);
|
||||
setWidget(wrapper);
|
||||
QWidget *wrapper = new QWidget();
|
||||
QHBoxLayout *layout = new QHBoxLayout(wrapper);
|
||||
layout->setContentsMargins(layout->contentsMargins() / 2);
|
||||
layout->addWidget(widget);
|
||||
setWidget(wrapper);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+180
-82
@@ -26,16 +26,16 @@
|
||||
|
||||
#include "common/define.h"
|
||||
|
||||
namespace olive {
|
||||
namespace olive
|
||||
{
|
||||
|
||||
/**
|
||||
* @brief A widget that is always dockable within the MainWindow.
|
||||
*/
|
||||
class PanelWidget : public KDDockWidgets::DockWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
class PanelWidget : public KDDockWidgets::DockWidget {
|
||||
Q_OBJECT
|
||||
public:
|
||||
/**
|
||||
/**
|
||||
* @brief PanelWidget Constructor
|
||||
*
|
||||
* @param parent
|
||||
@@ -43,161 +43,260 @@ public:
|
||||
* The PanelWidget's parent, enforced to help with memory handling. Most of the time this will be an instance of
|
||||
* MainWindow.
|
||||
*/
|
||||
PanelWidget(const QString& object_name);
|
||||
PanelWidget(const QString &object_name);
|
||||
|
||||
virtual ~PanelWidget() override;
|
||||
virtual ~PanelWidget() override;
|
||||
|
||||
/**
|
||||
/**
|
||||
* @brief Set visibility of panel's highlighted border, mostly used for showing panel focus
|
||||
*
|
||||
* @param enabled
|
||||
*/
|
||||
void SetBorderVisible(bool enabled);
|
||||
void SetBorderVisible(bool enabled);
|
||||
|
||||
/**
|
||||
/**
|
||||
* @brief If enabled, sends signal CloseRequested() when the user closes instead of closing
|
||||
*
|
||||
* Defaults to FALSE. Use this to override default panel closing functionality.
|
||||
*/
|
||||
void SetSignalInsteadOfClose(bool e);
|
||||
void SetSignalInsteadOfClose(bool e);
|
||||
|
||||
using Info = std::map<QString, QString>;
|
||||
using Info = std::map<QString, QString>;
|
||||
|
||||
virtual void LoadData(const Info &info){}
|
||||
virtual Info SaveData() const {return Info();}
|
||||
virtual void LoadData(const Info &info)
|
||||
{
|
||||
}
|
||||
virtual Info SaveData() const
|
||||
{
|
||||
return Info();
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* @brief Called whenever this panel is focused and user uses "Zoom In" (either in menus or as a keyboard shortcut)
|
||||
*
|
||||
* This function is up to the Panel's interpretation of what the user intends to zoom into. Default behavior is a
|
||||
* no-op.
|
||||
*/
|
||||
virtual void ZoomIn(){}
|
||||
virtual void ZoomIn()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* @brief Called whenever this panel is focused and user uses "Zoom Out" (either in menus or as a keyboard shortcut)
|
||||
*
|
||||
* This function is up to the Panel's interpretation of what the user intends to zoom out of. Default behavior is a
|
||||
* no-op.
|
||||
*/
|
||||
virtual void ZoomOut(){}
|
||||
virtual void ZoomOut()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void GoToStart(){}
|
||||
virtual void GoToStart()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void PrevFrame(){}
|
||||
virtual void PrevFrame()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* @brief Called whenever this panel is focused and user uses "Play/Pause" (either in menus or as a keyboard shortcut)
|
||||
*
|
||||
* This function is up to the Panel's interpretation of what the user intends to zoom out of. Default behavior is a
|
||||
* no-op.
|
||||
*/
|
||||
virtual void PlayPause(){}
|
||||
virtual void PlayPause()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void PlayInToOut(){}
|
||||
virtual void PlayInToOut()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void NextFrame(){}
|
||||
virtual void NextFrame()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void GoToEnd(){}
|
||||
virtual void GoToEnd()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void SelectAll(){}
|
||||
virtual void SelectAll()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void DeselectAll(){}
|
||||
virtual void DeselectAll()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void RippleToIn(){}
|
||||
virtual void RippleToIn()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void RippleToOut(){}
|
||||
virtual void RippleToOut()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void EditToIn(){}
|
||||
virtual void EditToIn()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void EditToOut(){}
|
||||
virtual void EditToOut()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void ShuttleLeft(){}
|
||||
virtual void ShuttleLeft()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void ShuttleStop(){}
|
||||
virtual void ShuttleStop()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void ShuttleRight(){}
|
||||
virtual void ShuttleRight()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void GoToPrevCut(){}
|
||||
virtual void GoToPrevCut()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void GoToNextCut(){}
|
||||
virtual void GoToNextCut()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void RenameSelected(){}
|
||||
virtual void RenameSelected()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void DeleteSelected(){}
|
||||
virtual void DeleteSelected()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void RippleDelete(){}
|
||||
virtual void RippleDelete()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void IncreaseTrackHeight(){}
|
||||
virtual void IncreaseTrackHeight()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void DecreaseTrackHeight(){}
|
||||
virtual void DecreaseTrackHeight()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void SetIn(){}
|
||||
virtual void SetIn()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void SetOut(){}
|
||||
virtual void SetOut()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void ResetIn(){}
|
||||
virtual void ResetIn()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void ResetOut(){}
|
||||
virtual void ResetOut()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void ClearInOut(){}
|
||||
virtual void ClearInOut()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void SetMarker(){}
|
||||
virtual void SetMarker()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void ToggleLinks(){}
|
||||
virtual void ToggleLinks()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void CutSelected(){}
|
||||
virtual void CutSelected()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void CopySelected(){}
|
||||
virtual void CopySelected()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void Paste(){}
|
||||
virtual void Paste()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void PasteInsert(){}
|
||||
virtual void PasteInsert()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void ToggleShowAll(){}
|
||||
virtual void ToggleShowAll()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void GoToIn(){}
|
||||
virtual void GoToIn()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void GoToOut(){}
|
||||
virtual void GoToOut()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void DeleteInToOut(){}
|
||||
virtual void DeleteInToOut()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void RippleDeleteInToOut(){}
|
||||
virtual void RippleDeleteInToOut()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void ToggleSelectedEnabled(){}
|
||||
virtual void ToggleSelectedEnabled()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void Duplicate(){}
|
||||
virtual void Duplicate()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void SetColorLabel(int){}
|
||||
virtual void SetColorLabel(int)
|
||||
{
|
||||
}
|
||||
|
||||
virtual void NudgeLeft(){}
|
||||
virtual void NudgeLeft()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void NudgeRight(){}
|
||||
virtual void NudgeRight()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void MoveInToPlayhead(){}
|
||||
virtual void MoveInToPlayhead()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void MoveOutToPlayhead(){}
|
||||
virtual void MoveOutToPlayhead()
|
||||
{
|
||||
}
|
||||
|
||||
signals:
|
||||
void CloseRequested();
|
||||
void CloseRequested();
|
||||
|
||||
protected:
|
||||
/**
|
||||
/**
|
||||
* @brief paintEvent
|
||||
* @param event
|
||||
*/
|
||||
void paintEvent(QPaintEvent *event) override;
|
||||
void paintEvent(QPaintEvent *event) override;
|
||||
|
||||
virtual void changeEvent(QEvent* e) override;
|
||||
virtual void changeEvent(QEvent *e) override;
|
||||
|
||||
virtual void closeEvent(QCloseEvent* event) override;
|
||||
virtual void closeEvent(QCloseEvent *event) override;
|
||||
|
||||
virtual void Retranslate();
|
||||
virtual void Retranslate();
|
||||
|
||||
void SetWidgetWithPadding(QWidget* widget);
|
||||
void SetWidgetWithPadding(QWidget *widget);
|
||||
|
||||
protected slots:
|
||||
/**
|
||||
/**
|
||||
* @brief Set panel's title
|
||||
*
|
||||
* Use this function to set the title of the panel.
|
||||
@@ -209,9 +308,9 @@ protected slots:
|
||||
*
|
||||
* String to set the title to
|
||||
*/
|
||||
void SetTitle(const QString& t);
|
||||
void SetTitle(const QString &t);
|
||||
|
||||
/**
|
||||
/**
|
||||
* @brief Set panel's subtitle
|
||||
*
|
||||
* Use this function to set the subtitle of the panel.
|
||||
@@ -223,24 +322,23 @@ protected slots:
|
||||
*
|
||||
* String to set the subtitle to
|
||||
*/
|
||||
void SetSubtitle(const QString& t);
|
||||
void SetSubtitle(const QString &t);
|
||||
|
||||
private:
|
||||
/**
|
||||
/**
|
||||
* @brief Internal function that sets the QDockWidget's window title whenever the title/subtitle change.
|
||||
*
|
||||
* Should be called any time a change is made to title_ or subtitle_
|
||||
*/
|
||||
void UpdateTitle();
|
||||
void UpdateTitle();
|
||||
|
||||
QString title_;
|
||||
QString title_;
|
||||
|
||||
QString subtitle_;
|
||||
QString subtitle_;
|
||||
|
||||
bool border_visible_;
|
||||
|
||||
bool signal_instead_of_close_;
|
||||
bool border_visible_;
|
||||
|
||||
bool signal_instead_of_close_;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
+83
-84
@@ -22,154 +22,153 @@
|
||||
|
||||
#include "config/config.h"
|
||||
|
||||
namespace olive {
|
||||
namespace olive
|
||||
{
|
||||
|
||||
PanelManager* PanelManager::instance_ = nullptr;
|
||||
PanelManager *PanelManager::instance_ = nullptr;
|
||||
|
||||
PanelManager::PanelManager(QObject *parent) :
|
||||
QObject(parent),
|
||||
suppress_changed_signal_(false)
|
||||
PanelManager::PanelManager(QObject *parent)
|
||||
: QObject(parent)
|
||||
, suppress_changed_signal_(false)
|
||||
{
|
||||
}
|
||||
|
||||
void PanelManager::DeleteAllPanels()
|
||||
{
|
||||
// Prevent any confusion regarding focus history by clearing it first
|
||||
QList<PanelWidget*> copy = focus_history_;
|
||||
focus_history_.clear();
|
||||
qDeleteAll(copy);
|
||||
// Prevent any confusion regarding focus history by clearing it first
|
||||
QList<PanelWidget *> copy = focus_history_;
|
||||
focus_history_.clear();
|
||||
qDeleteAll(copy);
|
||||
}
|
||||
|
||||
const QList<PanelWidget *> &PanelManager::panels()
|
||||
{
|
||||
return focus_history_;
|
||||
return focus_history_;
|
||||
}
|
||||
|
||||
PanelWidget *PanelManager::CurrentlyFocused(bool enable_hover) const
|
||||
{
|
||||
// If hover focus is enabled, find the currently hovered panel and return it (if no panel is hovered, resort to
|
||||
// default behavior)
|
||||
if (enable_hover && OLIVE_CONFIG("HoverFocus").toBool()) {
|
||||
PanelWidget* hovered = CurrentlyHovered();
|
||||
// If hover focus is enabled, find the currently hovered panel and return it (if no panel is hovered, resort to
|
||||
// default behavior)
|
||||
if (enable_hover && OLIVE_CONFIG("HoverFocus").toBool()) {
|
||||
PanelWidget *hovered = CurrentlyHovered();
|
||||
|
||||
if (hovered != nullptr) {
|
||||
return hovered;
|
||||
}
|
||||
}
|
||||
if (hovered != nullptr) {
|
||||
return hovered;
|
||||
}
|
||||
}
|
||||
|
||||
if (focus_history_.isEmpty()) {
|
||||
return nullptr;
|
||||
}
|
||||
if (focus_history_.isEmpty()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return focus_history_.first();
|
||||
return focus_history_.first();
|
||||
}
|
||||
|
||||
PanelWidget *PanelManager::CurrentlyHovered() const
|
||||
{
|
||||
QPoint global_mouse = QCursor::pos();
|
||||
QPoint global_mouse = QCursor::pos();
|
||||
|
||||
foreach (PanelWidget* panel, focus_history_) {
|
||||
if (panel->rect().contains(panel->mapFromGlobal(global_mouse))) {
|
||||
return panel;
|
||||
}
|
||||
}
|
||||
foreach (PanelWidget *panel, focus_history_) {
|
||||
if (panel->rect().contains(panel->mapFromGlobal(global_mouse))) {
|
||||
return panel;
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PanelWidget *PanelManager::GetPanelWithName(const QString &name) const
|
||||
{
|
||||
foreach (PanelWidget* panel, focus_history_) {
|
||||
if (panel->objectName() == name) {
|
||||
return panel;
|
||||
}
|
||||
}
|
||||
foreach (PanelWidget *panel, focus_history_) {
|
||||
if (panel->objectName() == name) {
|
||||
return panel;
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void PanelManager::CreateInstance()
|
||||
{
|
||||
instance_ = new PanelManager();
|
||||
instance_ = new PanelManager();
|
||||
}
|
||||
|
||||
void PanelManager::DestroyInstance()
|
||||
{
|
||||
delete instance_;
|
||||
delete instance_;
|
||||
}
|
||||
|
||||
PanelManager *PanelManager::instance()
|
||||
{
|
||||
return instance_;
|
||||
return instance_;
|
||||
}
|
||||
|
||||
void PanelManager::RegisterPanel(PanelWidget *panel)
|
||||
{
|
||||
// Add panel to the bottom of the focus history
|
||||
focus_history_.append(panel);
|
||||
// Add panel to the bottom of the focus history
|
||||
focus_history_.append(panel);
|
||||
|
||||
// We're about to center the panel relative to the parent (usually the main window), but for some
|
||||
// reason this requires the panel to be shown first.
|
||||
panel->show();
|
||||
// We're about to center the panel relative to the parent (usually the main window), but for some
|
||||
// reason this requires the panel to be shown first.
|
||||
panel->show();
|
||||
|
||||
if (focus_history_.size() == 1) {
|
||||
// This is the first panel, focus it
|
||||
panel->SetBorderVisible(true);
|
||||
emit FocusedPanelChanged(panel);
|
||||
}
|
||||
if (focus_history_.size() == 1) {
|
||||
// This is the first panel, focus it
|
||||
panel->SetBorderVisible(true);
|
||||
emit FocusedPanelChanged(panel);
|
||||
}
|
||||
}
|
||||
|
||||
void PanelManager::UnregisterPanel(PanelWidget *panel)
|
||||
{
|
||||
focus_history_.removeOne(panel);
|
||||
focus_history_.removeOne(panel);
|
||||
}
|
||||
|
||||
void PanelManager::FocusChanged(QWidget *old, QWidget *now)
|
||||
{
|
||||
Q_UNUSED(old)
|
||||
Q_UNUSED(old)
|
||||
|
||||
QObject* parent = now;
|
||||
PanelWidget* panel_cast_test;
|
||||
QObject *parent = now;
|
||||
PanelWidget *panel_cast_test;
|
||||
|
||||
// Loop through widget's parent hierarchy
|
||||
if (!focus_history_.empty()) {
|
||||
while (parent != nullptr) {
|
||||
// Loop through widget's parent hierarchy
|
||||
if (!focus_history_.empty()) {
|
||||
while (parent != nullptr) {
|
||||
// Use dynamic_cast to test if this object is a PanelWidget
|
||||
panel_cast_test = dynamic_cast<PanelWidget *>(parent);
|
||||
|
||||
// Use dynamic_cast to test if this object is a PanelWidget
|
||||
panel_cast_test = dynamic_cast<PanelWidget*>(parent);
|
||||
if (panel_cast_test) {
|
||||
if (focus_history_.first() != panel_cast_test) {
|
||||
// If so, bump this to the top of the focus history
|
||||
int panel_index = focus_history_.indexOf(panel_cast_test);
|
||||
|
||||
if (panel_cast_test) {
|
||||
// Disable highlight border on old panel
|
||||
if (!focus_history_.isEmpty()) {
|
||||
focus_history_.first()->SetBorderVisible(false);
|
||||
}
|
||||
|
||||
if (focus_history_.first() != panel_cast_test) {
|
||||
// If so, bump this to the top of the focus history
|
||||
int panel_index = focus_history_.indexOf(panel_cast_test);
|
||||
// Enable new border's highlight
|
||||
panel_cast_test->SetBorderVisible(true);
|
||||
|
||||
// Disable highlight border on old panel
|
||||
if (!focus_history_.isEmpty()) {
|
||||
focus_history_.first()->SetBorderVisible(false);
|
||||
}
|
||||
// If it's not in the focus history, prepend it, otherwise move it
|
||||
if (panel_index == -1) {
|
||||
focus_history_.prepend(panel_cast_test);
|
||||
} else {
|
||||
focus_history_.move(panel_index, 0);
|
||||
}
|
||||
|
||||
// Enable new border's highlight
|
||||
panel_cast_test->SetBorderVisible(true);
|
||||
if (!suppress_changed_signal_) {
|
||||
emit FocusedPanelChanged(panel_cast_test);
|
||||
}
|
||||
}
|
||||
|
||||
// If it's not in the focus history, prepend it, otherwise move it
|
||||
if (panel_index == -1) {
|
||||
focus_history_.prepend(panel_cast_test);
|
||||
} else {
|
||||
focus_history_.move(panel_index, 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (!suppress_changed_signal_) {
|
||||
emit FocusedPanelChanged(panel_cast_test);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
parent = parent->parent();
|
||||
}
|
||||
}
|
||||
parent = parent->parent();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+62
-65
@@ -26,7 +26,8 @@
|
||||
|
||||
#include "panel/panel.h"
|
||||
|
||||
namespace olive {
|
||||
namespace olive
|
||||
{
|
||||
|
||||
/**
|
||||
* @brief The PanelFocusManager class
|
||||
@@ -42,149 +43,145 @@ namespace olive {
|
||||
* PanelFocusManager's SLOT(FocusChanged()) connects to the QApplication instance's SIGNAL(focusChanged()) so that
|
||||
* it always knows when focus has changed within the application.
|
||||
*/
|
||||
class PanelManager : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
class PanelManager : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
PanelManager(QObject* parent = nullptr);
|
||||
PanelManager(QObject *parent = nullptr);
|
||||
|
||||
/**
|
||||
/**
|
||||
* @brief Destroy all panels
|
||||
*
|
||||
* Should only be used on application exit to cleanly free all panels.
|
||||
*/
|
||||
void DeleteAllPanels();
|
||||
void DeleteAllPanels();
|
||||
|
||||
/**
|
||||
/**
|
||||
* @brief Get a list of all existing panels
|
||||
*
|
||||
* Panels are ordered from most recently focused to least recently focused.
|
||||
*/
|
||||
const QList<PanelWidget*>& panels();
|
||||
const QList<PanelWidget *> &panels();
|
||||
|
||||
/**
|
||||
/**
|
||||
* @brief Return the currently focused widget, or nullptr if nothing is focused
|
||||
*
|
||||
* This result == CurrentlyFocused() if HoverFocus is true and panel is hovered
|
||||
*/
|
||||
PanelWidget* CurrentlyFocused(bool enable_hover = true) const;
|
||||
PanelWidget *CurrentlyFocused(bool enable_hover = true) const;
|
||||
|
||||
/**
|
||||
/**
|
||||
* @brief Return the widget that the mouse is currently hovering over, or nullptr if nothing is hovered over
|
||||
*/
|
||||
PanelWidget* CurrentlyHovered() const;
|
||||
PanelWidget *CurrentlyHovered() const;
|
||||
|
||||
PanelWidget *GetPanelWithName(const QString &name) const;
|
||||
PanelWidget *GetPanelWithName(const QString &name) const;
|
||||
|
||||
template<class T>
|
||||
/**
|
||||
template <class T>
|
||||
/**
|
||||
* @brief Get most recently focused panel of a certain type
|
||||
*
|
||||
* @return
|
||||
*
|
||||
* The most recently focused panel of the specified type, or nullptr if none exists
|
||||
*/
|
||||
T* MostRecentlyFocused();
|
||||
T *MostRecentlyFocused();
|
||||
|
||||
/**
|
||||
/**
|
||||
* @brief Create PanelManager singleton instance
|
||||
*/
|
||||
static void CreateInstance();
|
||||
static void CreateInstance();
|
||||
|
||||
/**
|
||||
/**
|
||||
* @brief Destroy PanelManager singleton instance
|
||||
*
|
||||
* If no PanelManager was created, this is a no-op.
|
||||
*/
|
||||
static void DestroyInstance();
|
||||
static void DestroyInstance();
|
||||
|
||||
/**
|
||||
/**
|
||||
* @brief Access to PanelManager singleton instance
|
||||
*/
|
||||
static PanelManager* instance();
|
||||
static PanelManager *instance();
|
||||
|
||||
template<class T>
|
||||
/**
|
||||
template <class T>
|
||||
/**
|
||||
* @brief Get a list of panels of a certain type
|
||||
*/
|
||||
QList<T*> GetPanelsOfType();
|
||||
QList<T *> GetPanelsOfType();
|
||||
|
||||
/**
|
||||
/**
|
||||
* @brief Panel should call this upon construction so it can be kept track of
|
||||
*/
|
||||
void RegisterPanel(PanelWidget *panel);
|
||||
void RegisterPanel(PanelWidget *panel);
|
||||
|
||||
/**
|
||||
/**
|
||||
* @brief Panel should call this upon destruction so no invalid pointers will be kept for it
|
||||
*/
|
||||
void UnregisterPanel(PanelWidget *panel);
|
||||
void UnregisterPanel(PanelWidget *panel);
|
||||
|
||||
void SetSuppressChangedSignal(bool e)
|
||||
{
|
||||
suppress_changed_signal_ = e;
|
||||
}
|
||||
void SetSuppressChangedSignal(bool e)
|
||||
{
|
||||
suppress_changed_signal_ = e;
|
||||
}
|
||||
|
||||
public slots:
|
||||
/**
|
||||
/**
|
||||
* @brief Connect this to a QApplication's SIGNAL(focusChanged())
|
||||
*
|
||||
* Interprets focus information to determine the currently focused panel
|
||||
*/
|
||||
void FocusChanged(QWidget* old, QWidget* now);
|
||||
void FocusChanged(QWidget *old, QWidget *now);
|
||||
|
||||
signals:
|
||||
/**
|
||||
/**
|
||||
* @brief Signal emitted when the currently focused panel changes
|
||||
*/
|
||||
void FocusedPanelChanged(PanelWidget* panel);
|
||||
void FocusedPanelChanged(PanelWidget *panel);
|
||||
|
||||
private:
|
||||
/**
|
||||
/**
|
||||
* @brief History array for traversing through (see MostRecentlyFocused())
|
||||
*/
|
||||
QList<PanelWidget*> focus_history_;
|
||||
QList<PanelWidget *> focus_history_;
|
||||
|
||||
/**
|
||||
/**
|
||||
* @brief PanelManager singleton instance
|
||||
*/
|
||||
static PanelManager* instance_;
|
||||
|
||||
bool suppress_changed_signal_;
|
||||
static PanelManager *instance_;
|
||||
|
||||
bool suppress_changed_signal_;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
T* PanelManager::MostRecentlyFocused()
|
||||
template <class T> T *PanelManager::MostRecentlyFocused()
|
||||
{
|
||||
T* cast_test;
|
||||
T *cast_test;
|
||||
|
||||
for (int i=0;i<focus_history_.size();i++) {
|
||||
cast_test = dynamic_cast<T*>(focus_history_.at(i));
|
||||
for (int i = 0; i < focus_history_.size(); i++) {
|
||||
cast_test = dynamic_cast<T *>(focus_history_.at(i));
|
||||
|
||||
if (cast_test != nullptr) {
|
||||
return cast_test;
|
||||
}
|
||||
}
|
||||
if (cast_test != nullptr) {
|
||||
return cast_test;
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
QList<T*> PanelManager::GetPanelsOfType()
|
||||
template <class T> QList<T *> PanelManager::GetPanelsOfType()
|
||||
{
|
||||
QList<T*> panels;
|
||||
QList<T *> panels;
|
||||
|
||||
T* cast_test;
|
||||
T *cast_test;
|
||||
|
||||
foreach (PanelWidget* panel, focus_history_) {
|
||||
cast_test = dynamic_cast<T*>(panel);
|
||||
foreach (PanelWidget *panel, focus_history_) {
|
||||
cast_test = dynamic_cast<T *>(panel);
|
||||
|
||||
if (cast_test) {
|
||||
panels.append(cast_test);
|
||||
}
|
||||
}
|
||||
if (cast_test) {
|
||||
panels.append(cast_test);
|
||||
}
|
||||
}
|
||||
|
||||
return panels;
|
||||
return panels;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+20
-16
@@ -22,44 +22,48 @@
|
||||
|
||||
#include "window/mainwindow/mainwindow.h"
|
||||
|
||||
namespace olive {
|
||||
|
||||
ParamPanel::ParamPanel() :
|
||||
TimeBasedPanel(QStringLiteral("ParamPanel"))
|
||||
namespace olive
|
||||
{
|
||||
NodeParamView* view = new NodeParamView(this);
|
||||
connect(view, &NodeParamView::FocusedNodeChanged, this, &ParamPanel::FocusedNodeChanged);
|
||||
connect(view, &NodeParamView::SelectedNodesChanged, this, &ParamPanel::SelectedNodesChanged);
|
||||
connect(view, &NodeParamView::RequestViewerToStartEditingText, this, &ParamPanel::RequestViewerToStartEditingText);
|
||||
connect(this, &ParamPanel::shown, view, &NodeParamView::UpdateElementY);
|
||||
SetTimeBasedWidget(view);
|
||||
|
||||
Retranslate();
|
||||
ParamPanel::ParamPanel()
|
||||
: TimeBasedPanel(QStringLiteral("ParamPanel"))
|
||||
{
|
||||
NodeParamView *view = new NodeParamView(this);
|
||||
connect(view, &NodeParamView::FocusedNodeChanged, this,
|
||||
&ParamPanel::FocusedNodeChanged);
|
||||
connect(view, &NodeParamView::SelectedNodesChanged, this,
|
||||
&ParamPanel::SelectedNodesChanged);
|
||||
connect(view, &NodeParamView::RequestViewerToStartEditingText, this,
|
||||
&ParamPanel::RequestViewerToStartEditingText);
|
||||
connect(this, &ParamPanel::shown, view, &NodeParamView::UpdateElementY);
|
||||
SetTimeBasedWidget(view);
|
||||
|
||||
Retranslate();
|
||||
}
|
||||
|
||||
void ParamPanel::DeleteSelected()
|
||||
{
|
||||
static_cast<NodeParamView*>(GetTimeBasedWidget())->DeleteSelected();
|
||||
static_cast<NodeParamView *>(GetTimeBasedWidget())->DeleteSelected();
|
||||
}
|
||||
|
||||
void ParamPanel::SelectAll()
|
||||
{
|
||||
static_cast<NodeParamView*>(GetTimeBasedWidget())->SelectAll();
|
||||
static_cast<NodeParamView *>(GetTimeBasedWidget())->SelectAll();
|
||||
}
|
||||
|
||||
void ParamPanel::DeselectAll()
|
||||
{
|
||||
static_cast<NodeParamView*>(GetTimeBasedWidget())->DeselectAll();
|
||||
static_cast<NodeParamView *>(GetTimeBasedWidget())->DeselectAll();
|
||||
}
|
||||
|
||||
void ParamPanel::SetContexts(const QVector<Node *> &contexts)
|
||||
{
|
||||
static_cast<NodeParamView*>(GetTimeBasedWidget())->SetContexts(contexts);
|
||||
static_cast<NodeParamView *>(GetTimeBasedWidget())->SetContexts(contexts);
|
||||
}
|
||||
|
||||
void ParamPanel::Retranslate()
|
||||
{
|
||||
SetTitle(tr("Parameter Editor"));
|
||||
SetTitle(tr("Parameter Editor"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+29
-30
@@ -25,53 +25,52 @@
|
||||
#include "panel/timebased/timebased.h"
|
||||
#include "widget/nodeparamview/nodeparamview.h"
|
||||
|
||||
namespace olive {
|
||||
|
||||
class ParamPanel : public TimeBasedPanel
|
||||
namespace olive
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
class ParamPanel : public TimeBasedPanel {
|
||||
Q_OBJECT
|
||||
public:
|
||||
ParamPanel();
|
||||
ParamPanel();
|
||||
|
||||
NodeParamView *GetParamView() const
|
||||
{
|
||||
return static_cast<NodeParamView *>(GetTimeBasedWidget());
|
||||
}
|
||||
NodeParamView *GetParamView() const
|
||||
{
|
||||
return static_cast<NodeParamView *>(GetTimeBasedWidget());
|
||||
}
|
||||
|
||||
const QVector<Node*> &GetContexts() const
|
||||
{
|
||||
return GetParamView()->GetContexts();
|
||||
}
|
||||
const QVector<Node *> &GetContexts() const
|
||||
{
|
||||
return GetParamView()->GetContexts();
|
||||
}
|
||||
|
||||
void CloseContextsBelongingToProject(Project *p)
|
||||
{
|
||||
GetParamView()->CloseContextsBelongingToProject(p);
|
||||
}
|
||||
void CloseContextsBelongingToProject(Project *p)
|
||||
{
|
||||
GetParamView()->CloseContextsBelongingToProject(p);
|
||||
}
|
||||
|
||||
public slots:
|
||||
void SetSelectedNodes(const QVector<Node::ContextPair> &nodes)
|
||||
{
|
||||
GetParamView()->SetSelectedNodes(nodes, false);
|
||||
}
|
||||
void SetSelectedNodes(const QVector<Node::ContextPair> &nodes)
|
||||
{
|
||||
GetParamView()->SetSelectedNodes(nodes, false);
|
||||
}
|
||||
|
||||
virtual void DeleteSelected() override;
|
||||
virtual void DeleteSelected() override;
|
||||
|
||||
virtual void SelectAll() override;
|
||||
virtual void SelectAll() override;
|
||||
|
||||
virtual void DeselectAll() override;
|
||||
virtual void DeselectAll() override;
|
||||
|
||||
void SetContexts(const QVector<Node*> &contexts);
|
||||
void SetContexts(const QVector<Node *> &contexts);
|
||||
|
||||
signals:
|
||||
void FocusedNodeChanged(Node* n);
|
||||
void FocusedNodeChanged(Node *n);
|
||||
|
||||
void SelectedNodesChanged(const QVector<Node::ContextPair> &nodes);
|
||||
void SelectedNodesChanged(const QVector<Node::ContextPair> &nodes);
|
||||
|
||||
void RequestViewerToStartEditingText();
|
||||
void RequestViewerToStartEditingText();
|
||||
|
||||
protected:
|
||||
virtual void Retranslate() override;
|
||||
|
||||
virtual void Retranslate() override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -22,29 +22,33 @@
|
||||
|
||||
#include "core.h"
|
||||
|
||||
namespace olive {
|
||||
|
||||
PixelSamplerPanel::PixelSamplerPanel() :
|
||||
PanelWidget(QStringLiteral("PixelSamplerPanel"))
|
||||
namespace olive
|
||||
{
|
||||
sampler_widget_ = new ManagedPixelSamplerWidget(this);
|
||||
SetWidgetWithPadding(sampler_widget_);
|
||||
|
||||
connect(this, &PixelSamplerPanel::shown, Core::instance(), []{Core::instance()->RequestPixelSamplingInViewers(true);});
|
||||
connect(this, &PixelSamplerPanel::hidden, Core::instance(), []{Core::instance()->RequestPixelSamplingInViewers(false);});
|
||||
connect(Core::instance(), &Core::ColorPickerColorEmitted, this, &PixelSamplerPanel::SetValues);
|
||||
PixelSamplerPanel::PixelSamplerPanel()
|
||||
: PanelWidget(QStringLiteral("PixelSamplerPanel"))
|
||||
{
|
||||
sampler_widget_ = new ManagedPixelSamplerWidget(this);
|
||||
SetWidgetWithPadding(sampler_widget_);
|
||||
|
||||
Retranslate();
|
||||
connect(this, &PixelSamplerPanel::shown, Core::instance(),
|
||||
[] { Core::instance()->RequestPixelSamplingInViewers(true); });
|
||||
connect(this, &PixelSamplerPanel::hidden, Core::instance(),
|
||||
[] { Core::instance()->RequestPixelSamplingInViewers(false); });
|
||||
connect(Core::instance(), &Core::ColorPickerColorEmitted, this,
|
||||
&PixelSamplerPanel::SetValues);
|
||||
|
||||
Retranslate();
|
||||
}
|
||||
|
||||
void PixelSamplerPanel::SetValues(const Color &reference, const Color &display)
|
||||
{
|
||||
sampler_widget_->SetValues(reference, display);
|
||||
sampler_widget_->SetValues(reference, display);
|
||||
}
|
||||
|
||||
void PixelSamplerPanel::Retranslate()
|
||||
{
|
||||
SetTitle(tr("Pixel Sampler"));
|
||||
SetTitle(tr("Pixel Sampler"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -24,22 +24,21 @@
|
||||
#include "panel/panel.h"
|
||||
#include "widget/pixelsampler/pixelsampler.h"
|
||||
|
||||
namespace olive {
|
||||
|
||||
class PixelSamplerPanel : public PanelWidget
|
||||
namespace olive
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
class PixelSamplerPanel : public PanelWidget {
|
||||
Q_OBJECT
|
||||
public:
|
||||
PixelSamplerPanel();
|
||||
PixelSamplerPanel();
|
||||
|
||||
public slots:
|
||||
void SetValues(const Color& reference, const Color& display);
|
||||
void SetValues(const Color &reference, const Color &display);
|
||||
|
||||
private:
|
||||
virtual void Retranslate() override;
|
||||
|
||||
ManagedPixelSamplerWidget* sampler_widget_;
|
||||
virtual void Retranslate() override;
|
||||
|
||||
ManagedPixelSamplerWidget *sampler_widget_;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -25,11 +25,12 @@
|
||||
|
||||
#include "node/project/footage/footage.h"
|
||||
|
||||
namespace olive {
|
||||
namespace olive
|
||||
{
|
||||
|
||||
class FootageManagementPanel {
|
||||
public:
|
||||
virtual QVector<ViewerOutput *> GetSelectedFootage() const = 0;
|
||||
virtual QVector<ViewerOutput *> GetSelectedFootage() const = 0;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
+115
-103
@@ -32,202 +32,214 @@
|
||||
#include "widget/projecttoolbar/projecttoolbar.h"
|
||||
#include "window/mainwindow/mainwindow.h"
|
||||
|
||||
namespace olive {
|
||||
|
||||
ProjectPanel::ProjectPanel(const QString &unique_name) :
|
||||
PanelWidget(unique_name)
|
||||
namespace olive
|
||||
{
|
||||
// Create main widget and its layout
|
||||
QWidget* central_widget = new QWidget(this);
|
||||
QVBoxLayout* layout = new QVBoxLayout(central_widget);
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
SetWidgetWithPadding(central_widget);
|
||||
ProjectPanel::ProjectPanel(const QString &unique_name)
|
||||
: PanelWidget(unique_name)
|
||||
{
|
||||
// Create main widget and its layout
|
||||
QWidget *central_widget = new QWidget(this);
|
||||
QVBoxLayout *layout = new QVBoxLayout(central_widget);
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
// Set up project toolbar
|
||||
ProjectToolbar* toolbar = new ProjectToolbar(this);
|
||||
layout->addWidget(toolbar);
|
||||
SetWidgetWithPadding(central_widget);
|
||||
|
||||
// Make toolbar connections
|
||||
connect(toolbar, &ProjectToolbar::NewClicked, this, &ProjectPanel::ShowNewMenu);
|
||||
connect(toolbar, &ProjectToolbar::OpenClicked, Core::instance(), &Core::OpenProject);
|
||||
connect(toolbar, &ProjectToolbar::SaveClicked, this, &ProjectPanel::SaveConnectedProject);
|
||||
// Set up project toolbar
|
||||
ProjectToolbar *toolbar = new ProjectToolbar(this);
|
||||
layout->addWidget(toolbar);
|
||||
|
||||
// Set up main explorer object
|
||||
explorer_ = new ProjectExplorer(this);
|
||||
layout->addWidget(explorer_);
|
||||
connect(explorer_, &ProjectExplorer::DoubleClickedItem, this, &ProjectPanel::ItemDoubleClickSlot);
|
||||
connect(explorer_, &ProjectExplorer::SelectionChanged, this, &ProjectPanel::SelectionChanged);
|
||||
connect(toolbar, &ProjectToolbar::SearchChanged, explorer_, &ProjectExplorer::SetSearchFilter);
|
||||
// Make toolbar connections
|
||||
connect(toolbar, &ProjectToolbar::NewClicked, this,
|
||||
&ProjectPanel::ShowNewMenu);
|
||||
connect(toolbar, &ProjectToolbar::OpenClicked, Core::instance(),
|
||||
&Core::OpenProject);
|
||||
connect(toolbar, &ProjectToolbar::SaveClicked, this,
|
||||
&ProjectPanel::SaveConnectedProject);
|
||||
|
||||
// Set toolbar's view to the explorer's view
|
||||
toolbar->SetView(explorer_->view_type());
|
||||
// Set up main explorer object
|
||||
explorer_ = new ProjectExplorer(this);
|
||||
layout->addWidget(explorer_);
|
||||
connect(explorer_, &ProjectExplorer::DoubleClickedItem, this,
|
||||
&ProjectPanel::ItemDoubleClickSlot);
|
||||
connect(explorer_, &ProjectExplorer::SelectionChanged, this,
|
||||
&ProjectPanel::SelectionChanged);
|
||||
connect(toolbar, &ProjectToolbar::SearchChanged, explorer_,
|
||||
&ProjectExplorer::SetSearchFilter);
|
||||
|
||||
// Connect toolbar's view change signal to the explorer's view change slot
|
||||
connect(toolbar,
|
||||
&ProjectToolbar::ViewChanged,
|
||||
explorer_,
|
||||
&ProjectExplorer::set_view_type);
|
||||
// Set toolbar's view to the explorer's view
|
||||
toolbar->SetView(explorer_->view_type());
|
||||
|
||||
// Set strings
|
||||
Retranslate();
|
||||
// Connect toolbar's view change signal to the explorer's view change slot
|
||||
connect(toolbar, &ProjectToolbar::ViewChanged, explorer_,
|
||||
&ProjectExplorer::set_view_type);
|
||||
|
||||
// Set strings
|
||||
Retranslate();
|
||||
}
|
||||
|
||||
Project* ProjectPanel::project() const
|
||||
Project *ProjectPanel::project() const
|
||||
{
|
||||
return explorer_->project();
|
||||
return explorer_->project();
|
||||
}
|
||||
|
||||
void ProjectPanel::set_project(Project* p)
|
||||
void ProjectPanel::set_project(Project *p)
|
||||
{
|
||||
if (project()) {
|
||||
disconnect(project(), &Project::NameChanged, this, &ProjectPanel::UpdateSubtitle);
|
||||
disconnect(project(), &Project::NameChanged, this, &ProjectPanel::ProjectNameChanged);
|
||||
}
|
||||
if (project()) {
|
||||
disconnect(project(), &Project::NameChanged, this,
|
||||
&ProjectPanel::UpdateSubtitle);
|
||||
disconnect(project(), &Project::NameChanged, this,
|
||||
&ProjectPanel::ProjectNameChanged);
|
||||
}
|
||||
|
||||
explorer_->set_project(p);
|
||||
explorer_->set_project(p);
|
||||
|
||||
if (project()) {
|
||||
connect(project(), &Project::NameChanged, this, &ProjectPanel::UpdateSubtitle);
|
||||
connect(project(), &Project::NameChanged, this, &ProjectPanel::ProjectNameChanged);
|
||||
}
|
||||
if (project()) {
|
||||
connect(project(), &Project::NameChanged, this,
|
||||
&ProjectPanel::UpdateSubtitle);
|
||||
connect(project(), &Project::NameChanged, this,
|
||||
&ProjectPanel::ProjectNameChanged);
|
||||
}
|
||||
|
||||
UpdateSubtitle();
|
||||
UpdateSubtitle();
|
||||
|
||||
emit ProjectNameChanged();
|
||||
emit ProjectNameChanged();
|
||||
}
|
||||
|
||||
Folder *ProjectPanel::get_root() const
|
||||
{
|
||||
return explorer_->get_root();
|
||||
return explorer_->get_root();
|
||||
}
|
||||
|
||||
void ProjectPanel::set_root(Folder *item)
|
||||
{
|
||||
explorer_->set_root(item);
|
||||
explorer_->set_root(item);
|
||||
|
||||
Retranslate();
|
||||
Retranslate();
|
||||
}
|
||||
|
||||
QVector<Node *> ProjectPanel::SelectedItems() const
|
||||
{
|
||||
return explorer_->SelectedItems();
|
||||
return explorer_->SelectedItems();
|
||||
}
|
||||
|
||||
Folder *ProjectPanel::GetSelectedFolder() const
|
||||
{
|
||||
return explorer_->GetSelectedFolder();
|
||||
return explorer_->GetSelectedFolder();
|
||||
}
|
||||
|
||||
ProjectViewModel *ProjectPanel::model() const
|
||||
{
|
||||
return explorer_->model();
|
||||
return explorer_->model();
|
||||
}
|
||||
|
||||
void ProjectPanel::SelectAll()
|
||||
{
|
||||
explorer_->SelectAll();
|
||||
explorer_->SelectAll();
|
||||
}
|
||||
|
||||
void ProjectPanel::DeselectAll()
|
||||
{
|
||||
explorer_->DeselectAll();
|
||||
explorer_->DeselectAll();
|
||||
}
|
||||
|
||||
void ProjectPanel::DeleteSelected()
|
||||
{
|
||||
explorer_->DeleteSelected();
|
||||
explorer_->DeleteSelected();
|
||||
}
|
||||
|
||||
void ProjectPanel::RenameSelected()
|
||||
{
|
||||
explorer_->RenameSelectedItem();
|
||||
explorer_->RenameSelectedItem();
|
||||
}
|
||||
|
||||
void ProjectPanel::Edit(Node* item)
|
||||
void ProjectPanel::Edit(Node *item)
|
||||
{
|
||||
explorer_->Edit(item);
|
||||
explorer_->Edit(item);
|
||||
}
|
||||
|
||||
void ProjectPanel::Retranslate()
|
||||
{
|
||||
if (project() && explorer_->get_root() != project()->root()) {
|
||||
SetTitle(tr("Folder"));
|
||||
} else {
|
||||
SetTitle(tr("Project"));
|
||||
}
|
||||
if (project() && explorer_->get_root() != project()->root()) {
|
||||
SetTitle(tr("Folder"));
|
||||
} else {
|
||||
SetTitle(tr("Project"));
|
||||
}
|
||||
|
||||
UpdateSubtitle();
|
||||
UpdateSubtitle();
|
||||
}
|
||||
|
||||
void ProjectPanel::ItemDoubleClickSlot(Node *item)
|
||||
{
|
||||
if (item == nullptr) {
|
||||
// If the user double clicks on empty space, show the import dialog
|
||||
Core::instance()->DialogImportShow();
|
||||
} else if (dynamic_cast<Footage*>(item)) {
|
||||
// Open this footage in a FootageViewer
|
||||
auto panel = PanelManager::instance()->MostRecentlyFocused<FootageViewerPanel>();
|
||||
panel->ConnectViewerNode(static_cast<Footage*>(item));
|
||||
panel->raise();
|
||||
panel->setFocus();
|
||||
} else if (dynamic_cast<Sequence*>(item)) {
|
||||
// Open this sequence in the Timeline
|
||||
Core::instance()->main_window()->OpenSequence(static_cast<Sequence*>(item));
|
||||
}
|
||||
if (item == nullptr) {
|
||||
// If the user double clicks on empty space, show the import dialog
|
||||
Core::instance()->DialogImportShow();
|
||||
} else if (dynamic_cast<Footage *>(item)) {
|
||||
// Open this footage in a FootageViewer
|
||||
auto panel =
|
||||
PanelManager::instance()->MostRecentlyFocused<FootageViewerPanel>();
|
||||
panel->ConnectViewerNode(static_cast<Footage *>(item));
|
||||
panel->raise();
|
||||
panel->setFocus();
|
||||
} else if (dynamic_cast<Sequence *>(item)) {
|
||||
// Open this sequence in the Timeline
|
||||
Core::instance()->main_window()->OpenSequence(
|
||||
static_cast<Sequence *>(item));
|
||||
}
|
||||
}
|
||||
|
||||
void ProjectPanel::ShowNewMenu()
|
||||
{
|
||||
Menu new_menu(this);
|
||||
Menu new_menu(this);
|
||||
|
||||
MenuShared::instance()->AddItemsForNewMenu(&new_menu);
|
||||
MenuShared::instance()->AddItemsForNewMenu(&new_menu);
|
||||
|
||||
new_menu.exec(QCursor::pos());
|
||||
new_menu.exec(QCursor::pos());
|
||||
}
|
||||
|
||||
void ProjectPanel::UpdateSubtitle()
|
||||
{
|
||||
if (project()) {
|
||||
QString project_title = QStringLiteral("%1").arg(project()->name());
|
||||
if (project()) {
|
||||
QString project_title = QStringLiteral("%1").arg(project()->name());
|
||||
|
||||
if (explorer_->get_root() != project()->root()) {
|
||||
QString folder_path;
|
||||
if (explorer_->get_root() != project()->root()) {
|
||||
QString folder_path;
|
||||
|
||||
Folder* item = explorer_->get_root();
|
||||
Folder *item = explorer_->get_root();
|
||||
|
||||
do {
|
||||
folder_path.prepend(QStringLiteral("/%1").arg(item->GetLabel()));
|
||||
do {
|
||||
folder_path.prepend(
|
||||
QStringLiteral("/%1").arg(item->GetLabel()));
|
||||
|
||||
item = item->folder();
|
||||
} while (item != project()->root());
|
||||
item = item->folder();
|
||||
} while (item != project()->root());
|
||||
|
||||
project_title.append(folder_path);
|
||||
}
|
||||
project_title.append(folder_path);
|
||||
}
|
||||
|
||||
SetSubtitle(project_title);
|
||||
} else {
|
||||
SetSubtitle(tr("(none)"));
|
||||
}
|
||||
SetSubtitle(project_title);
|
||||
} else {
|
||||
SetSubtitle(tr("(none)"));
|
||||
}
|
||||
}
|
||||
|
||||
void ProjectPanel::SaveConnectedProject()
|
||||
{
|
||||
Core::instance()->SaveProject();
|
||||
Core::instance()->SaveProject();
|
||||
}
|
||||
|
||||
QVector<ViewerOutput *> ProjectPanel::GetSelectedFootage() const
|
||||
{
|
||||
QVector<Node*> items = SelectedItems();
|
||||
QVector<ViewerOutput*> footage;
|
||||
QVector<Node *> items = SelectedItems();
|
||||
QVector<ViewerOutput *> footage;
|
||||
|
||||
foreach (Node* i, items) {
|
||||
if (dynamic_cast<ViewerOutput*>(i)) {
|
||||
footage.append(static_cast<ViewerOutput*>(i));
|
||||
}
|
||||
}
|
||||
foreach (Node *i, items) {
|
||||
if (dynamic_cast<ViewerOutput *>(i)) {
|
||||
footage.append(static_cast<ViewerOutput *>(i));
|
||||
}
|
||||
}
|
||||
|
||||
return footage;
|
||||
return footage;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+30
-31
@@ -26,66 +26,65 @@
|
||||
#include "panel/panel.h"
|
||||
#include "widget/projectexplorer/projectexplorer.h"
|
||||
|
||||
namespace olive {
|
||||
namespace olive
|
||||
{
|
||||
|
||||
/**
|
||||
* @brief A PanelWidget wrapper around a ProjectExplorer and a ProjectToolbar
|
||||
*/
|
||||
class ProjectPanel : public PanelWidget, public FootageManagementPanel
|
||||
{
|
||||
Q_OBJECT
|
||||
class ProjectPanel : public PanelWidget, public FootageManagementPanel {
|
||||
Q_OBJECT
|
||||
public:
|
||||
ProjectPanel(const QString &unique_name);
|
||||
ProjectPanel(const QString &unique_name);
|
||||
|
||||
Project* project() const;
|
||||
void set_project(Project* p);
|
||||
Project *project() const;
|
||||
void set_project(Project *p);
|
||||
|
||||
Folder *get_root() const;
|
||||
Folder *get_root() const;
|
||||
|
||||
void set_root(Folder* item);
|
||||
void set_root(Folder *item);
|
||||
|
||||
QVector<Node *> SelectedItems() const;
|
||||
QVector<Node *> SelectedItems() const;
|
||||
|
||||
Folder* GetSelectedFolder() const;
|
||||
Folder *GetSelectedFolder() const;
|
||||
|
||||
virtual QVector<ViewerOutput *> GetSelectedFootage() const override;
|
||||
virtual QVector<ViewerOutput *> GetSelectedFootage() const override;
|
||||
|
||||
ProjectViewModel* model() const;
|
||||
ProjectViewModel *model() const;
|
||||
|
||||
bool SelectItem(Node *n, bool deselect_all_first = true)
|
||||
{
|
||||
return explorer_->SelectItem(n, deselect_all_first);
|
||||
}
|
||||
bool SelectItem(Node *n, bool deselect_all_first = true)
|
||||
{
|
||||
return explorer_->SelectItem(n, deselect_all_first);
|
||||
}
|
||||
|
||||
virtual void SelectAll() override;
|
||||
virtual void DeselectAll() override;
|
||||
virtual void SelectAll() override;
|
||||
virtual void DeselectAll() override;
|
||||
|
||||
virtual void DeleteSelected() override;
|
||||
virtual void DeleteSelected() override;
|
||||
|
||||
virtual void RenameSelected() override;
|
||||
virtual void RenameSelected() override;
|
||||
|
||||
public slots:
|
||||
void Edit(Node *item);
|
||||
void Edit(Node *item);
|
||||
|
||||
signals:
|
||||
void ProjectNameChanged();
|
||||
void ProjectNameChanged();
|
||||
|
||||
void SelectionChanged(const QVector<Node *> &selected);
|
||||
void SelectionChanged(const QVector<Node *> &selected);
|
||||
|
||||
private:
|
||||
virtual void Retranslate() override;
|
||||
virtual void Retranslate() override;
|
||||
|
||||
ProjectExplorer* explorer_;
|
||||
ProjectExplorer *explorer_;
|
||||
|
||||
private slots:
|
||||
void ItemDoubleClickSlot(Node *item);
|
||||
void ItemDoubleClickSlot(Node *item);
|
||||
|
||||
void ShowNewMenu();
|
||||
void ShowNewMenu();
|
||||
|
||||
void UpdateSubtitle();
|
||||
|
||||
void SaveConnectedProject();
|
||||
void UpdateSubtitle();
|
||||
|
||||
void SaveConnectedProject();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
+72
-64
@@ -24,113 +24,121 @@
|
||||
|
||||
#include "panel/viewer/viewer.h"
|
||||
|
||||
namespace olive {
|
||||
|
||||
ScopePanel::ScopePanel() :
|
||||
PanelWidget(QStringLiteral("ScopePanel")),
|
||||
viewer_(nullptr)
|
||||
namespace olive
|
||||
{
|
||||
QWidget* central = new QWidget(this);
|
||||
setWidget(central);
|
||||
|
||||
QVBoxLayout* layout = new QVBoxLayout(central);
|
||||
ScopePanel::ScopePanel()
|
||||
: PanelWidget(QStringLiteral("ScopePanel"))
|
||||
, viewer_(nullptr)
|
||||
{
|
||||
QWidget *central = new QWidget(this);
|
||||
setWidget(central);
|
||||
|
||||
QHBoxLayout* toolbar_layout = new QHBoxLayout();
|
||||
toolbar_layout->setContentsMargins(0, 0, 0, 0);
|
||||
QVBoxLayout *layout = new QVBoxLayout(central);
|
||||
|
||||
scope_type_combobox_ = new QComboBox();
|
||||
QHBoxLayout *toolbar_layout = new QHBoxLayout();
|
||||
toolbar_layout->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
for (int i=0;i<ScopePanel::kTypeCount;i++) {
|
||||
// These strings get filled in later in Retranslate()
|
||||
scope_type_combobox_->addItem(QString());
|
||||
}
|
||||
scope_type_combobox_ = new QComboBox();
|
||||
|
||||
toolbar_layout->addWidget(scope_type_combobox_);
|
||||
toolbar_layout->addStretch();
|
||||
for (int i = 0; i < ScopePanel::kTypeCount; i++) {
|
||||
// These strings get filled in later in Retranslate()
|
||||
scope_type_combobox_->addItem(QString());
|
||||
}
|
||||
|
||||
layout->addLayout(toolbar_layout);
|
||||
toolbar_layout->addWidget(scope_type_combobox_);
|
||||
toolbar_layout->addStretch();
|
||||
|
||||
stack_ = new QStackedWidget();
|
||||
layout->addWidget(stack_);
|
||||
layout->addLayout(toolbar_layout);
|
||||
|
||||
// Create waveform view
|
||||
waveform_view_ = new WaveformScope();
|
||||
stack_->addWidget(waveform_view_);
|
||||
stack_ = new QStackedWidget();
|
||||
layout->addWidget(stack_);
|
||||
|
||||
// Create histogram
|
||||
histogram_ = new HistogramScope();
|
||||
stack_->addWidget(histogram_);
|
||||
// Create waveform view
|
||||
waveform_view_ = new WaveformScope();
|
||||
stack_->addWidget(waveform_view_);
|
||||
|
||||
connect(scope_type_combobox_, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), stack_, &QStackedWidget::setCurrentIndex);
|
||||
// Create histogram
|
||||
histogram_ = new HistogramScope();
|
||||
stack_->addWidget(histogram_);
|
||||
|
||||
Retranslate();
|
||||
connect(
|
||||
scope_type_combobox_,
|
||||
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
||||
stack_, &QStackedWidget::setCurrentIndex);
|
||||
|
||||
Retranslate();
|
||||
}
|
||||
|
||||
void ScopePanel::SetType(ScopePanel::Type t)
|
||||
{
|
||||
scope_type_combobox_->setCurrentIndex(t);
|
||||
scope_type_combobox_->setCurrentIndex(t);
|
||||
}
|
||||
|
||||
QString ScopePanel::TypeToName(ScopePanel::Type t)
|
||||
{
|
||||
switch (t) {
|
||||
case kTypeWaveform:
|
||||
return tr("Waveform");
|
||||
case kTypeHistogram:
|
||||
return tr("Histogram");
|
||||
case kTypeCount:
|
||||
break;
|
||||
}
|
||||
switch (t) {
|
||||
case kTypeWaveform:
|
||||
return tr("Waveform");
|
||||
case kTypeHistogram:
|
||||
return tr("Histogram");
|
||||
case kTypeCount:
|
||||
break;
|
||||
}
|
||||
|
||||
return QString();
|
||||
return QString();
|
||||
}
|
||||
|
||||
void ScopePanel::SetViewerPanel(ViewerPanelBase *vp)
|
||||
{
|
||||
if (viewer_ == vp) {
|
||||
return;
|
||||
}
|
||||
if (viewer_ == vp) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (viewer_) {
|
||||
disconnect(viewer_, &ViewerPanelBase::TextureChanged, this, &ScopePanel::SetReferenceBuffer);
|
||||
disconnect(viewer_, &ViewerPanelBase::ColorManagerChanged, this, &ScopePanel::SetColorManager);
|
||||
}
|
||||
if (viewer_) {
|
||||
disconnect(viewer_, &ViewerPanelBase::TextureChanged, this,
|
||||
&ScopePanel::SetReferenceBuffer);
|
||||
disconnect(viewer_, &ViewerPanelBase::ColorManagerChanged, this,
|
||||
&ScopePanel::SetColorManager);
|
||||
}
|
||||
|
||||
viewer_ = vp;
|
||||
viewer_ = vp;
|
||||
|
||||
if (viewer_) {
|
||||
// Connect viewer widget texture drawing to scope panel
|
||||
connect(viewer_, &ViewerPanelBase::TextureChanged, this, &ScopePanel::SetReferenceBuffer);
|
||||
connect(viewer_, &ViewerPanelBase::ColorManagerChanged, this, &ScopePanel::SetColorManager);
|
||||
if (viewer_) {
|
||||
// Connect viewer widget texture drawing to scope panel
|
||||
connect(viewer_, &ViewerPanelBase::TextureChanged, this,
|
||||
&ScopePanel::SetReferenceBuffer);
|
||||
connect(viewer_, &ViewerPanelBase::ColorManagerChanged, this,
|
||||
&ScopePanel::SetColorManager);
|
||||
|
||||
SetColorManager(viewer_->GetColorManager());
|
||||
SetColorManager(viewer_->GetColorManager());
|
||||
|
||||
viewer_->UpdateTextureFromNode();
|
||||
} else {
|
||||
SetReferenceBuffer(nullptr);
|
||||
SetColorManager(nullptr);
|
||||
}
|
||||
viewer_->UpdateTextureFromNode();
|
||||
} else {
|
||||
SetReferenceBuffer(nullptr);
|
||||
SetColorManager(nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
void ScopePanel::SetReferenceBuffer(TexturePtr frame)
|
||||
{
|
||||
histogram_->SetBuffer(frame);
|
||||
waveform_view_->SetBuffer(frame);
|
||||
histogram_->SetBuffer(frame);
|
||||
waveform_view_->SetBuffer(frame);
|
||||
}
|
||||
|
||||
void ScopePanel::SetColorManager(ColorManager *manager)
|
||||
{
|
||||
histogram_->ConnectColorManager(manager);
|
||||
waveform_view_->ConnectColorManager(manager);
|
||||
histogram_->ConnectColorManager(manager);
|
||||
waveform_view_->ConnectColorManager(manager);
|
||||
}
|
||||
|
||||
void ScopePanel::Retranslate()
|
||||
{
|
||||
SetTitle(tr("Scopes"));
|
||||
SetTitle(tr("Scopes"));
|
||||
|
||||
for (int i=0;i<ScopePanel::kTypeCount;i++) {
|
||||
scope_type_combobox_->setItemText(i, TypeToName(static_cast<Type>(i)));
|
||||
}
|
||||
for (int i = 0; i < ScopePanel::kTypeCount; i++) {
|
||||
scope_type_combobox_->setItemText(i, TypeToName(static_cast<Type>(i)));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+26
-27
@@ -29,53 +29,52 @@
|
||||
#include "widget/scope/histogram/histogram.h"
|
||||
#include "widget/scope/waveform/waveform.h"
|
||||
|
||||
namespace olive {
|
||||
|
||||
class ScopePanel : public PanelWidget
|
||||
namespace olive
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
class ScopePanel : public PanelWidget {
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum Type {
|
||||
kTypeWaveform,
|
||||
kTypeHistogram,
|
||||
enum Type {
|
||||
kTypeWaveform,
|
||||
kTypeHistogram,
|
||||
|
||||
kTypeCount
|
||||
};
|
||||
kTypeCount
|
||||
};
|
||||
|
||||
ScopePanel();
|
||||
ScopePanel();
|
||||
|
||||
void SetType(Type t);
|
||||
void SetType(Type t);
|
||||
|
||||
static QString TypeToName(Type t);
|
||||
static QString TypeToName(Type t);
|
||||
|
||||
void SetViewerPanel(ViewerPanelBase *vp);
|
||||
void SetViewerPanel(ViewerPanelBase *vp);
|
||||
|
||||
ViewerPanelBase *GetConnectedViewerPanel() const
|
||||
{
|
||||
return viewer_;
|
||||
}
|
||||
ViewerPanelBase *GetConnectedViewerPanel() const
|
||||
{
|
||||
return viewer_;
|
||||
}
|
||||
|
||||
public slots:
|
||||
void SetReferenceBuffer(TexturePtr frame);
|
||||
void SetReferenceBuffer(TexturePtr frame);
|
||||
|
||||
void SetColorManager(ColorManager* manager);
|
||||
void SetColorManager(ColorManager *manager);
|
||||
|
||||
protected:
|
||||
virtual void Retranslate() override;
|
||||
virtual void Retranslate() override;
|
||||
|
||||
private:
|
||||
Type type_;
|
||||
Type type_;
|
||||
|
||||
QStackedWidget* stack_;
|
||||
QStackedWidget *stack_;
|
||||
|
||||
QComboBox* scope_type_combobox_;
|
||||
QComboBox *scope_type_combobox_;
|
||||
|
||||
WaveformScope* waveform_view_;
|
||||
WaveformScope *waveform_view_;
|
||||
|
||||
HistogramScope* histogram_;
|
||||
|
||||
ViewerPanelBase *viewer_;
|
||||
HistogramScope *histogram_;
|
||||
|
||||
ViewerPanelBase *viewer_;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -21,26 +21,29 @@
|
||||
#include "sequenceviewer.h"
|
||||
#include "panel/timeline/timeline.h"
|
||||
|
||||
namespace olive {
|
||||
|
||||
SequenceViewerPanel::SequenceViewerPanel() :
|
||||
ViewerPanel(QStringLiteral("SequenceViewerPanel"))
|
||||
namespace olive
|
||||
{
|
||||
// Set strings
|
||||
Retranslate();
|
||||
|
||||
SequenceViewerPanel::SequenceViewerPanel()
|
||||
: ViewerPanel(QStringLiteral("SequenceViewerPanel"))
|
||||
{
|
||||
// Set strings
|
||||
Retranslate();
|
||||
}
|
||||
|
||||
void SequenceViewerPanel::StartCapture(const TimeRange &time, const Track::Reference &track)
|
||||
void SequenceViewerPanel::StartCapture(const TimeRange &time,
|
||||
const Track::Reference &track)
|
||||
{
|
||||
TimelinePanel *tp = static_cast<TimelinePanel *>(sender());
|
||||
static_cast<ViewerWidget*>(GetTimeBasedWidget())->StartCapture(tp->timeline_widget(), time, track);
|
||||
TimelinePanel *tp = static_cast<TimelinePanel *>(sender());
|
||||
static_cast<ViewerWidget *>(GetTimeBasedWidget())
|
||||
->StartCapture(tp->timeline_widget(), time, track);
|
||||
}
|
||||
|
||||
void SequenceViewerPanel::Retranslate()
|
||||
{
|
||||
ViewerPanel::Retranslate();
|
||||
ViewerPanel::Retranslate();
|
||||
|
||||
SetTitle(tr("Sequence Viewer"));
|
||||
SetTitle(tr("Sequence Viewer"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -23,20 +23,19 @@
|
||||
|
||||
#include "panel/viewer/viewer.h"
|
||||
|
||||
namespace olive {
|
||||
|
||||
class SequenceViewerPanel : public ViewerPanel
|
||||
namespace olive
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
class SequenceViewerPanel : public ViewerPanel {
|
||||
Q_OBJECT
|
||||
public:
|
||||
SequenceViewerPanel();
|
||||
SequenceViewerPanel();
|
||||
|
||||
public slots:
|
||||
void StartCapture(const TimeRange &time, const Track::Reference &track);
|
||||
void StartCapture(const TimeRange &time, const Track::Reference &track);
|
||||
|
||||
protected:
|
||||
virtual void Retranslate() override;
|
||||
|
||||
virtual void Retranslate() override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -20,19 +20,20 @@
|
||||
|
||||
#include "table.h"
|
||||
|
||||
namespace olive {
|
||||
|
||||
NodeTablePanel::NodeTablePanel() :
|
||||
TimeBasedPanel(QStringLiteral("NodeTablePanel"))
|
||||
namespace olive
|
||||
{
|
||||
SetTimeBasedWidget(new NodeTableWidget(this));
|
||||
|
||||
Retranslate();
|
||||
NodeTablePanel::NodeTablePanel()
|
||||
: TimeBasedPanel(QStringLiteral("NodeTablePanel"))
|
||||
{
|
||||
SetTimeBasedWidget(new NodeTableWidget(this));
|
||||
|
||||
Retranslate();
|
||||
}
|
||||
|
||||
void NodeTablePanel::Retranslate()
|
||||
{
|
||||
SetTitle(tr("Table View"));
|
||||
SetTitle(tr("Table View"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+15
-15
@@ -24,28 +24,28 @@
|
||||
#include "panel/timebased/timebased.h"
|
||||
#include "widget/nodetableview/nodetablewidget.h"
|
||||
|
||||
namespace olive {
|
||||
|
||||
class NodeTablePanel : public TimeBasedPanel
|
||||
namespace olive
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
class NodeTablePanel : public TimeBasedPanel {
|
||||
Q_OBJECT
|
||||
public:
|
||||
NodeTablePanel();
|
||||
NodeTablePanel();
|
||||
|
||||
public slots:
|
||||
void SelectNodes(const QVector<Node*>& nodes)
|
||||
{
|
||||
static_cast<NodeTableWidget*>(GetTimeBasedWidget())->SelectNodes(nodes);
|
||||
}
|
||||
void SelectNodes(const QVector<Node *> &nodes)
|
||||
{
|
||||
static_cast<NodeTableWidget *>(GetTimeBasedWidget())->SelectNodes(nodes);
|
||||
}
|
||||
|
||||
void DeselectNodes(const QVector<Node*>& nodes)
|
||||
{
|
||||
static_cast<NodeTableWidget*>(GetTimeBasedWidget())->DeselectNodes(nodes);
|
||||
}
|
||||
void DeselectNodes(const QVector<Node *> &nodes)
|
||||
{
|
||||
static_cast<NodeTableWidget *>(GetTimeBasedWidget())
|
||||
->DeselectNodes(nodes);
|
||||
}
|
||||
|
||||
private:
|
||||
virtual void Retranslate() override;
|
||||
|
||||
virtual void Retranslate() override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -22,30 +22,35 @@
|
||||
|
||||
#include "task/taskmanager.h"
|
||||
|
||||
namespace olive {
|
||||
|
||||
TaskManagerPanel::TaskManagerPanel() :
|
||||
PanelWidget(QStringLiteral("TaskManagerPanel"))
|
||||
namespace olive
|
||||
{
|
||||
// Create task view
|
||||
view_ = new TaskView(this);
|
||||
|
||||
// Set it as the main widget
|
||||
setWidget(view_);
|
||||
TaskManagerPanel::TaskManagerPanel()
|
||||
: PanelWidget(QStringLiteral("TaskManagerPanel"))
|
||||
{
|
||||
// Create task view
|
||||
view_ = new TaskView(this);
|
||||
|
||||
// Connect task view to the task manager
|
||||
connect(TaskManager::instance(), &TaskManager::TaskAdded, view_, &TaskView::AddTask);
|
||||
connect(TaskManager::instance(), &TaskManager::TaskRemoved, view_, &TaskView::RemoveTask);
|
||||
connect(TaskManager::instance(), &TaskManager::TaskFailed, view_, &TaskView::TaskFailed);
|
||||
connect(view_, &TaskView::TaskCancelled, TaskManager::instance(), &TaskManager::CancelTask);
|
||||
// Set it as the main widget
|
||||
setWidget(view_);
|
||||
|
||||
// Set strings
|
||||
Retranslate();
|
||||
// Connect task view to the task manager
|
||||
connect(TaskManager::instance(), &TaskManager::TaskAdded, view_,
|
||||
&TaskView::AddTask);
|
||||
connect(TaskManager::instance(), &TaskManager::TaskRemoved, view_,
|
||||
&TaskView::RemoveTask);
|
||||
connect(TaskManager::instance(), &TaskManager::TaskFailed, view_,
|
||||
&TaskView::TaskFailed);
|
||||
connect(view_, &TaskView::TaskCancelled, TaskManager::instance(),
|
||||
&TaskManager::CancelTask);
|
||||
|
||||
// Set strings
|
||||
Retranslate();
|
||||
}
|
||||
|
||||
void TaskManagerPanel::Retranslate()
|
||||
{
|
||||
SetTitle(tr("Task Manager"));
|
||||
SetTitle(tr("Task Manager"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -24,21 +24,21 @@
|
||||
#include "panel/panel.h"
|
||||
#include "widget/taskview/taskview.h"
|
||||
|
||||
namespace olive {
|
||||
namespace olive
|
||||
{
|
||||
|
||||
/**
|
||||
* @brief A PanelWidget wrapper around a TaskView widget
|
||||
*/
|
||||
class TaskManagerPanel : public PanelWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
class TaskManagerPanel : public PanelWidget {
|
||||
Q_OBJECT
|
||||
public:
|
||||
TaskManagerPanel();
|
||||
TaskManagerPanel();
|
||||
|
||||
private:
|
||||
virtual void Retranslate() override;
|
||||
virtual void Retranslate() override;
|
||||
|
||||
TaskView* view_;
|
||||
TaskView *view_;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -20,206 +20,211 @@
|
||||
|
||||
#include "timebased.h"
|
||||
|
||||
namespace olive {
|
||||
namespace olive
|
||||
{
|
||||
|
||||
TimeBasedPanel::TimeBasedPanel(const QString &object_name) :
|
||||
PanelWidget(object_name),
|
||||
widget_(nullptr),
|
||||
show_and_raise_on_connect_(false)
|
||||
TimeBasedPanel::TimeBasedPanel(const QString &object_name)
|
||||
: PanelWidget(object_name)
|
||||
, widget_(nullptr)
|
||||
, show_and_raise_on_connect_(false)
|
||||
{
|
||||
}
|
||||
|
||||
TimeBasedPanel::~TimeBasedPanel()
|
||||
{
|
||||
delete widget_;
|
||||
delete widget_;
|
||||
}
|
||||
|
||||
const rational& TimeBasedPanel::timebase()
|
||||
const rational &TimeBasedPanel::timebase()
|
||||
{
|
||||
return widget_->timebase();
|
||||
return widget_->timebase();
|
||||
}
|
||||
|
||||
void TimeBasedPanel::GoToStart()
|
||||
{
|
||||
widget_->GoToStart();
|
||||
widget_->GoToStart();
|
||||
}
|
||||
|
||||
void TimeBasedPanel::PrevFrame()
|
||||
{
|
||||
widget_->PrevFrame();
|
||||
widget_->PrevFrame();
|
||||
}
|
||||
|
||||
void TimeBasedPanel::NextFrame()
|
||||
{
|
||||
widget_->NextFrame();
|
||||
widget_->NextFrame();
|
||||
}
|
||||
|
||||
void TimeBasedPanel::GoToEnd()
|
||||
{
|
||||
widget_->GoToEnd();
|
||||
widget_->GoToEnd();
|
||||
}
|
||||
|
||||
void TimeBasedPanel::ZoomIn()
|
||||
{
|
||||
widget_->ZoomIn();
|
||||
widget_->ZoomIn();
|
||||
}
|
||||
|
||||
void TimeBasedPanel::ZoomOut()
|
||||
{
|
||||
widget_->ZoomOut();
|
||||
widget_->ZoomOut();
|
||||
}
|
||||
|
||||
void TimeBasedPanel::SetTimebase(const rational &timebase)
|
||||
{
|
||||
widget_->SetTimebase(timebase);
|
||||
widget_->SetTimebase(timebase);
|
||||
}
|
||||
|
||||
void TimeBasedPanel::GoToPrevCut()
|
||||
{
|
||||
widget_->GoToPrevCut();
|
||||
widget_->GoToPrevCut();
|
||||
}
|
||||
|
||||
void TimeBasedPanel::GoToNextCut()
|
||||
{
|
||||
widget_->GoToNextCut();
|
||||
widget_->GoToNextCut();
|
||||
}
|
||||
|
||||
void TimeBasedPanel::PlayPause()
|
||||
{
|
||||
emit PlayPauseRequested();
|
||||
emit PlayPauseRequested();
|
||||
}
|
||||
|
||||
void TimeBasedPanel::PlayInToOut()
|
||||
{
|
||||
emit PlayInToOutRequested();
|
||||
emit PlayInToOutRequested();
|
||||
}
|
||||
|
||||
void TimeBasedPanel::ShuttleLeft()
|
||||
{
|
||||
emit ShuttleLeftRequested();
|
||||
emit ShuttleLeftRequested();
|
||||
}
|
||||
|
||||
void TimeBasedPanel::ShuttleStop()
|
||||
{
|
||||
emit ShuttleStopRequested();
|
||||
emit ShuttleStopRequested();
|
||||
}
|
||||
|
||||
void TimeBasedPanel::ShuttleRight()
|
||||
{
|
||||
emit ShuttleRightRequested();
|
||||
emit ShuttleRightRequested();
|
||||
}
|
||||
|
||||
void TimeBasedPanel::ConnectViewerNode(ViewerOutput *node)
|
||||
{
|
||||
widget_->ConnectViewerNode(node);
|
||||
widget_->ConnectViewerNode(node);
|
||||
}
|
||||
|
||||
void TimeBasedPanel::SetTimeBasedWidget(TimeBasedWidget *widget)
|
||||
{
|
||||
if (widget_) {
|
||||
disconnect(widget_, &TimeBasedWidget::ConnectedNodeChanged, this, &TimeBasedPanel::ConnectedNodeChanged);
|
||||
}
|
||||
if (widget_) {
|
||||
disconnect(widget_, &TimeBasedWidget::ConnectedNodeChanged, this,
|
||||
&TimeBasedPanel::ConnectedNodeChanged);
|
||||
}
|
||||
|
||||
widget_ = widget;
|
||||
widget_ = widget;
|
||||
|
||||
if (widget_) {
|
||||
connect(widget_, &TimeBasedWidget::ConnectedNodeChanged, this, &TimeBasedPanel::ConnectedNodeChanged);
|
||||
}
|
||||
if (widget_) {
|
||||
connect(widget_, &TimeBasedWidget::ConnectedNodeChanged, this,
|
||||
&TimeBasedPanel::ConnectedNodeChanged);
|
||||
}
|
||||
|
||||
SetWidgetWithPadding(widget_);
|
||||
SetWidgetWithPadding(widget_);
|
||||
}
|
||||
|
||||
void TimeBasedPanel::Retranslate()
|
||||
{
|
||||
if (GetTimeBasedWidget()->GetConnectedNode()) {
|
||||
SetSubtitle(GetTimeBasedWidget()->GetConnectedNode()->GetLabel());
|
||||
} else {
|
||||
SetSubtitle(tr("(none)"));
|
||||
}
|
||||
if (GetTimeBasedWidget()->GetConnectedNode()) {
|
||||
SetSubtitle(GetTimeBasedWidget()->GetConnectedNode()->GetLabel());
|
||||
} else {
|
||||
SetSubtitle(tr("(none)"));
|
||||
}
|
||||
}
|
||||
|
||||
void TimeBasedPanel::ConnectedNodeChanged(ViewerOutput *old, ViewerOutput *now)
|
||||
{
|
||||
if (old) {
|
||||
disconnect(old, &ViewerOutput::LabelChanged, this, &TimeBasedPanel::SetSubtitle);
|
||||
}
|
||||
if (old) {
|
||||
disconnect(old, &ViewerOutput::LabelChanged, this,
|
||||
&TimeBasedPanel::SetSubtitle);
|
||||
}
|
||||
|
||||
if (now) {
|
||||
connect(now, &ViewerOutput::LabelChanged, this, &TimeBasedPanel::SetSubtitle);
|
||||
if (now) {
|
||||
connect(now, &ViewerOutput::LabelChanged, this,
|
||||
&TimeBasedPanel::SetSubtitle);
|
||||
|
||||
if (show_and_raise_on_connect_) {
|
||||
this->show();
|
||||
this->raise();
|
||||
}
|
||||
}
|
||||
if (show_and_raise_on_connect_) {
|
||||
this->show();
|
||||
this->raise();
|
||||
}
|
||||
}
|
||||
|
||||
// Update strings
|
||||
Retranslate();
|
||||
// Update strings
|
||||
Retranslate();
|
||||
}
|
||||
|
||||
void TimeBasedPanel::SetIn()
|
||||
{
|
||||
GetTimeBasedWidget()->SetInAtPlayhead();
|
||||
GetTimeBasedWidget()->SetInAtPlayhead();
|
||||
}
|
||||
|
||||
void TimeBasedPanel::SetOut()
|
||||
{
|
||||
GetTimeBasedWidget()->SetOutAtPlayhead();
|
||||
GetTimeBasedWidget()->SetOutAtPlayhead();
|
||||
}
|
||||
|
||||
void TimeBasedPanel::ResetIn()
|
||||
{
|
||||
GetTimeBasedWidget()->ResetIn();
|
||||
GetTimeBasedWidget()->ResetIn();
|
||||
}
|
||||
|
||||
void TimeBasedPanel::ResetOut()
|
||||
{
|
||||
GetTimeBasedWidget()->ResetOut();
|
||||
GetTimeBasedWidget()->ResetOut();
|
||||
}
|
||||
|
||||
void TimeBasedPanel::ClearInOut()
|
||||
{
|
||||
GetTimeBasedWidget()->ClearInOutPoints();
|
||||
GetTimeBasedWidget()->ClearInOutPoints();
|
||||
}
|
||||
|
||||
void TimeBasedPanel::SetMarker()
|
||||
{
|
||||
GetTimeBasedWidget()->SetMarker();
|
||||
GetTimeBasedWidget()->SetMarker();
|
||||
}
|
||||
|
||||
void TimeBasedPanel::ToggleShowAll()
|
||||
{
|
||||
GetTimeBasedWidget()->ToggleShowAll();
|
||||
GetTimeBasedWidget()->ToggleShowAll();
|
||||
}
|
||||
|
||||
void TimeBasedPanel::GoToIn()
|
||||
{
|
||||
GetTimeBasedWidget()->GoToIn();
|
||||
GetTimeBasedWidget()->GoToIn();
|
||||
}
|
||||
|
||||
void TimeBasedPanel::GoToOut()
|
||||
{
|
||||
GetTimeBasedWidget()->GoToOut();
|
||||
GetTimeBasedWidget()->GoToOut();
|
||||
}
|
||||
|
||||
void TimeBasedPanel::DeleteSelected()
|
||||
{
|
||||
GetTimeBasedWidget()->DeleteSelected();
|
||||
GetTimeBasedWidget()->DeleteSelected();
|
||||
}
|
||||
|
||||
void TimeBasedPanel::CutSelected()
|
||||
{
|
||||
GetTimeBasedWidget()->CopySelected(true);
|
||||
GetTimeBasedWidget()->CopySelected(true);
|
||||
}
|
||||
|
||||
void TimeBasedPanel::CopySelected()
|
||||
{
|
||||
GetTimeBasedWidget()->CopySelected(false);
|
||||
GetTimeBasedWidget()->CopySelected(false);
|
||||
}
|
||||
|
||||
void TimeBasedPanel::Paste()
|
||||
{
|
||||
GetTimeBasedWidget()->Paste();
|
||||
GetTimeBasedWidget()->Paste();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -24,122 +24,124 @@
|
||||
#include "panel/panel.h"
|
||||
#include "widget/timebased/timebasedwidget.h"
|
||||
|
||||
namespace olive {
|
||||
|
||||
class TimeBasedPanel : public PanelWidget
|
||||
namespace olive
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
class TimeBasedPanel : public PanelWidget {
|
||||
Q_OBJECT
|
||||
public:
|
||||
TimeBasedPanel(const QString& object_name);
|
||||
TimeBasedPanel(const QString &object_name);
|
||||
|
||||
virtual ~TimeBasedPanel() override;
|
||||
virtual ~TimeBasedPanel() override;
|
||||
|
||||
void ConnectViewerNode(ViewerOutput *node);
|
||||
void ConnectViewerNode(ViewerOutput *node);
|
||||
|
||||
void DisconnectViewerNode()
|
||||
{
|
||||
ConnectViewerNode(nullptr);
|
||||
}
|
||||
void DisconnectViewerNode()
|
||||
{
|
||||
ConnectViewerNode(nullptr);
|
||||
}
|
||||
|
||||
// Get the timebase of this panels widget
|
||||
const rational& timebase();
|
||||
// Get the timebase of this panels widget
|
||||
const rational &timebase();
|
||||
|
||||
ViewerOutput *GetConnectedViewer() const
|
||||
{
|
||||
return widget_->GetConnectedNode();
|
||||
}
|
||||
ViewerOutput *GetConnectedViewer() const
|
||||
{
|
||||
return widget_->GetConnectedNode();
|
||||
}
|
||||
|
||||
TimeRuler* ruler() const
|
||||
{
|
||||
return widget_->ruler();
|
||||
}
|
||||
TimeRuler *ruler() const
|
||||
{
|
||||
return widget_->ruler();
|
||||
}
|
||||
|
||||
virtual void ZoomIn() override;
|
||||
virtual void ZoomIn() override;
|
||||
|
||||
virtual void ZoomOut() override;
|
||||
virtual void ZoomOut() override;
|
||||
|
||||
virtual void GoToStart() override;
|
||||
virtual void GoToStart() override;
|
||||
|
||||
virtual void PrevFrame() override;
|
||||
virtual void PrevFrame() override;
|
||||
|
||||
virtual void NextFrame() override;
|
||||
virtual void NextFrame() override;
|
||||
|
||||
virtual void GoToEnd() override;
|
||||
virtual void GoToEnd() override;
|
||||
|
||||
virtual void GoToPrevCut() override;
|
||||
virtual void GoToPrevCut() override;
|
||||
|
||||
virtual void GoToNextCut() override;
|
||||
virtual void GoToNextCut() override;
|
||||
|
||||
virtual void PlayPause() override;
|
||||
virtual void PlayPause() override;
|
||||
|
||||
virtual void PlayInToOut() override;
|
||||
virtual void PlayInToOut() override;
|
||||
|
||||
virtual void ShuttleLeft() override;
|
||||
virtual void ShuttleLeft() override;
|
||||
|
||||
virtual void ShuttleStop() override;
|
||||
virtual void ShuttleStop() override;
|
||||
|
||||
virtual void ShuttleRight() override;
|
||||
virtual void ShuttleRight() override;
|
||||
|
||||
virtual void SetIn() override;
|
||||
virtual void SetIn() override;
|
||||
|
||||
virtual void SetOut() override;
|
||||
virtual void SetOut() override;
|
||||
|
||||
virtual void ResetIn() override;
|
||||
virtual void ResetIn() override;
|
||||
|
||||
virtual void ResetOut() override;
|
||||
virtual void ResetOut() override;
|
||||
|
||||
virtual void ClearInOut() override;
|
||||
virtual void ClearInOut() override;
|
||||
|
||||
virtual void SetMarker() override;
|
||||
virtual void SetMarker() override;
|
||||
|
||||
virtual void ToggleShowAll() override;
|
||||
virtual void ToggleShowAll() override;
|
||||
|
||||
virtual void GoToIn() override;
|
||||
virtual void GoToIn() override;
|
||||
|
||||
virtual void GoToOut() override;
|
||||
virtual void GoToOut() override;
|
||||
|
||||
virtual void DeleteSelected() override;
|
||||
virtual void DeleteSelected() override;
|
||||
|
||||
virtual void CutSelected() override;
|
||||
virtual void CutSelected() override;
|
||||
|
||||
virtual void CopySelected() override;
|
||||
virtual void CopySelected() override;
|
||||
|
||||
virtual void Paste() override;
|
||||
virtual void Paste() override;
|
||||
|
||||
TimeBasedWidget* GetTimeBasedWidget() const { return widget_; }
|
||||
TimeBasedWidget *GetTimeBasedWidget() const
|
||||
{
|
||||
return widget_;
|
||||
}
|
||||
|
||||
public slots:
|
||||
void SetTimebase(const rational& timebase);
|
||||
void SetTimebase(const rational &timebase);
|
||||
|
||||
signals:
|
||||
void PlayPauseRequested();
|
||||
void PlayPauseRequested();
|
||||
|
||||
void PlayInToOutRequested();
|
||||
void PlayInToOutRequested();
|
||||
|
||||
void ShuttleLeftRequested();
|
||||
void ShuttleLeftRequested();
|
||||
|
||||
void ShuttleStopRequested();
|
||||
void ShuttleStopRequested();
|
||||
|
||||
void ShuttleRightRequested();
|
||||
void ShuttleRightRequested();
|
||||
|
||||
protected:
|
||||
void SetTimeBasedWidget(TimeBasedWidget* widget);
|
||||
void SetTimeBasedWidget(TimeBasedWidget *widget);
|
||||
|
||||
virtual void Retranslate() override;
|
||||
virtual void Retranslate() override;
|
||||
|
||||
void SetShowAndRaiseOnConnect()
|
||||
{
|
||||
show_and_raise_on_connect_ = true;
|
||||
}
|
||||
void SetShowAndRaiseOnConnect()
|
||||
{
|
||||
show_and_raise_on_connect_ = true;
|
||||
}
|
||||
|
||||
private:
|
||||
TimeBasedWidget* widget_;
|
||||
TimeBasedWidget *widget_;
|
||||
|
||||
bool show_and_raise_on_connect_;
|
||||
bool show_and_raise_on_connect_;
|
||||
|
||||
private slots:
|
||||
void ConnectedNodeChanged(ViewerOutput* old, ViewerOutput* now);
|
||||
|
||||
void ConnectedNodeChanged(ViewerOutput *old, ViewerOutput *now);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -23,161 +23,169 @@
|
||||
#include "panel/panelmanager.h"
|
||||
#include "panel/project/footagemanagementpanel.h"
|
||||
|
||||
namespace olive {
|
||||
|
||||
TimelinePanel::TimelinePanel(const QString &name) :
|
||||
TimeBasedPanel(name)
|
||||
namespace olive
|
||||
{
|
||||
TimelineWidget* tw = new TimelineWidget(this);
|
||||
SetTimeBasedWidget(tw);
|
||||
|
||||
Retranslate();
|
||||
TimelinePanel::TimelinePanel(const QString &name)
|
||||
: TimeBasedPanel(name)
|
||||
{
|
||||
TimelineWidget *tw = new TimelineWidget(this);
|
||||
SetTimeBasedWidget(tw);
|
||||
|
||||
connect(tw, &TimelineWidget::BlockSelectionChanged, this, &TimelinePanel::BlockSelectionChanged);
|
||||
connect(tw, &TimelineWidget::RequestCaptureStart, this, &TimelinePanel::RequestCaptureStart);
|
||||
connect(tw, &TimelineWidget::RevealViewerInProject, this, &TimelinePanel::RevealViewerInProject);
|
||||
connect(tw, &TimelineWidget::RevealViewerInFootageViewer, this, &TimelinePanel::RevealViewerInFootageViewer);
|
||||
Retranslate();
|
||||
|
||||
connect(tw, &TimelineWidget::BlockSelectionChanged, this,
|
||||
&TimelinePanel::BlockSelectionChanged);
|
||||
connect(tw, &TimelineWidget::RequestCaptureStart, this,
|
||||
&TimelinePanel::RequestCaptureStart);
|
||||
connect(tw, &TimelineWidget::RevealViewerInProject, this,
|
||||
&TimelinePanel::RevealViewerInProject);
|
||||
connect(tw, &TimelineWidget::RevealViewerInFootageViewer, this,
|
||||
&TimelinePanel::RevealViewerInFootageViewer);
|
||||
}
|
||||
|
||||
void TimelinePanel::SplitAtPlayhead()
|
||||
{
|
||||
timeline_widget()->SplitAtPlayhead();
|
||||
timeline_widget()->SplitAtPlayhead();
|
||||
}
|
||||
|
||||
void TimelinePanel::LoadData(const Info &info)
|
||||
{
|
||||
timeline_widget()->RestoreSplitterState(QByteArray::fromBase64(info.at("splitter").toUtf8()));
|
||||
timeline_widget()->RestoreSplitterState(
|
||||
QByteArray::fromBase64(info.at("splitter").toUtf8()));
|
||||
}
|
||||
|
||||
PanelWidget::Info TimelinePanel::SaveData() const
|
||||
{
|
||||
Info i;
|
||||
Info i;
|
||||
|
||||
i["splitter"] = timeline_widget()->SaveSplitterState().toBase64();
|
||||
i["splitter"] = timeline_widget()->SaveSplitterState().toBase64();
|
||||
|
||||
return i;
|
||||
return i;
|
||||
}
|
||||
|
||||
void TimelinePanel::SelectAll()
|
||||
{
|
||||
timeline_widget()->SelectAll();
|
||||
timeline_widget()->SelectAll();
|
||||
}
|
||||
|
||||
void TimelinePanel::DeselectAll()
|
||||
{
|
||||
timeline_widget()->DeselectAll();
|
||||
timeline_widget()->DeselectAll();
|
||||
}
|
||||
|
||||
void TimelinePanel::RippleToIn()
|
||||
{
|
||||
timeline_widget()->RippleToIn();
|
||||
timeline_widget()->RippleToIn();
|
||||
}
|
||||
|
||||
void TimelinePanel::RippleToOut()
|
||||
{
|
||||
timeline_widget()->RippleToOut();
|
||||
timeline_widget()->RippleToOut();
|
||||
}
|
||||
|
||||
void TimelinePanel::EditToIn()
|
||||
{
|
||||
timeline_widget()->EditToIn();
|
||||
timeline_widget()->EditToIn();
|
||||
}
|
||||
|
||||
void TimelinePanel::EditToOut()
|
||||
{
|
||||
timeline_widget()->EditToOut();
|
||||
timeline_widget()->EditToOut();
|
||||
}
|
||||
|
||||
void TimelinePanel::DeleteSelected()
|
||||
{
|
||||
timeline_widget()->DeleteSelected(false);
|
||||
timeline_widget()->DeleteSelected(false);
|
||||
}
|
||||
|
||||
void TimelinePanel::RippleDelete()
|
||||
{
|
||||
timeline_widget()->DeleteSelected(true);
|
||||
timeline_widget()->DeleteSelected(true);
|
||||
}
|
||||
|
||||
void TimelinePanel::IncreaseTrackHeight()
|
||||
{
|
||||
timeline_widget()->IncreaseTrackHeight();
|
||||
timeline_widget()->IncreaseTrackHeight();
|
||||
}
|
||||
|
||||
void TimelinePanel::DecreaseTrackHeight()
|
||||
{
|
||||
timeline_widget()->DecreaseTrackHeight();
|
||||
timeline_widget()->DecreaseTrackHeight();
|
||||
}
|
||||
|
||||
void TimelinePanel::ToggleLinks()
|
||||
{
|
||||
timeline_widget()->ToggleLinksOnSelected();
|
||||
timeline_widget()->ToggleLinksOnSelected();
|
||||
}
|
||||
|
||||
void TimelinePanel::PasteInsert()
|
||||
{
|
||||
timeline_widget()->PasteInsert();
|
||||
timeline_widget()->PasteInsert();
|
||||
}
|
||||
|
||||
void TimelinePanel::DeleteInToOut()
|
||||
{
|
||||
timeline_widget()->DeleteInToOut(false);
|
||||
timeline_widget()->DeleteInToOut(false);
|
||||
}
|
||||
|
||||
void TimelinePanel::RippleDeleteInToOut()
|
||||
{
|
||||
timeline_widget()->DeleteInToOut(true);
|
||||
timeline_widget()->DeleteInToOut(true);
|
||||
}
|
||||
|
||||
void TimelinePanel::ToggleSelectedEnabled()
|
||||
{
|
||||
timeline_widget()->ToggleSelectedEnabled();
|
||||
timeline_widget()->ToggleSelectedEnabled();
|
||||
}
|
||||
|
||||
void TimelinePanel::SetColorLabel(int index)
|
||||
{
|
||||
timeline_widget()->SetColorLabel(index);
|
||||
timeline_widget()->SetColorLabel(index);
|
||||
}
|
||||
|
||||
void TimelinePanel::NudgeLeft()
|
||||
{
|
||||
timeline_widget()->NudgeLeft();
|
||||
timeline_widget()->NudgeLeft();
|
||||
}
|
||||
|
||||
void TimelinePanel::NudgeRight()
|
||||
{
|
||||
timeline_widget()->NudgeRight();
|
||||
timeline_widget()->NudgeRight();
|
||||
}
|
||||
|
||||
void TimelinePanel::MoveInToPlayhead()
|
||||
{
|
||||
timeline_widget()->MoveInToPlayhead();
|
||||
timeline_widget()->MoveInToPlayhead();
|
||||
}
|
||||
|
||||
void TimelinePanel::MoveOutToPlayhead()
|
||||
{
|
||||
timeline_widget()->MoveOutToPlayhead();
|
||||
timeline_widget()->MoveOutToPlayhead();
|
||||
}
|
||||
|
||||
void TimelinePanel::RenameSelected()
|
||||
{
|
||||
timeline_widget()->RenameSelectedBlocks();
|
||||
timeline_widget()->RenameSelectedBlocks();
|
||||
}
|
||||
|
||||
void TimelinePanel::InsertFootageAtPlayhead(const QVector<ViewerOutput *> &footage)
|
||||
void TimelinePanel::InsertFootageAtPlayhead(
|
||||
const QVector<ViewerOutput *> &footage)
|
||||
{
|
||||
timeline_widget()->InsertFootageAtPlayhead(footage);
|
||||
timeline_widget()->InsertFootageAtPlayhead(footage);
|
||||
}
|
||||
|
||||
void TimelinePanel::OverwriteFootageAtPlayhead(const QVector<ViewerOutput *> &footage)
|
||||
void TimelinePanel::OverwriteFootageAtPlayhead(
|
||||
const QVector<ViewerOutput *> &footage)
|
||||
{
|
||||
timeline_widget()->OverwriteFootageAtPlayhead(footage);
|
||||
timeline_widget()->OverwriteFootageAtPlayhead(footage);
|
||||
}
|
||||
|
||||
void TimelinePanel::Retranslate()
|
||||
{
|
||||
TimeBasedPanel::Retranslate();
|
||||
TimeBasedPanel::Retranslate();
|
||||
|
||||
SetTitle(tr("Timeline"));
|
||||
SetTitle(tr("Timeline"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -24,109 +24,109 @@
|
||||
#include "panel/timebased/timebased.h"
|
||||
#include "widget/timelinewidget/timelinewidget.h"
|
||||
|
||||
namespace olive {
|
||||
namespace olive
|
||||
{
|
||||
|
||||
/**
|
||||
* @brief Panel container for a TimelineWidget
|
||||
*/
|
||||
class TimelinePanel : public TimeBasedPanel
|
||||
{
|
||||
Q_OBJECT
|
||||
class TimelinePanel : public TimeBasedPanel {
|
||||
Q_OBJECT
|
||||
public:
|
||||
TimelinePanel(const QString &name);
|
||||
TimelinePanel(const QString &name);
|
||||
|
||||
inline TimelineWidget *timeline_widget() const
|
||||
{
|
||||
return static_cast<TimelineWidget*>(GetTimeBasedWidget());
|
||||
}
|
||||
inline TimelineWidget *timeline_widget() const
|
||||
{
|
||||
return static_cast<TimelineWidget *>(GetTimeBasedWidget());
|
||||
}
|
||||
|
||||
void SplitAtPlayhead();
|
||||
void SplitAtPlayhead();
|
||||
|
||||
virtual void LoadData(const Info &info) override;
|
||||
virtual Info SaveData() const override;
|
||||
virtual void LoadData(const Info &info) override;
|
||||
virtual Info SaveData() const override;
|
||||
|
||||
virtual void SelectAll() override;
|
||||
virtual void SelectAll() override;
|
||||
|
||||
virtual void DeselectAll() override;
|
||||
virtual void DeselectAll() override;
|
||||
|
||||
virtual void RippleToIn() override;
|
||||
virtual void RippleToIn() override;
|
||||
|
||||
virtual void RippleToOut() override;
|
||||
virtual void RippleToOut() override;
|
||||
|
||||
virtual void EditToIn() override;
|
||||
virtual void EditToIn() override;
|
||||
|
||||
virtual void EditToOut() override;
|
||||
virtual void EditToOut() override;
|
||||
|
||||
virtual void DeleteSelected() override;
|
||||
virtual void DeleteSelected() override;
|
||||
|
||||
virtual void RippleDelete() override;
|
||||
virtual void RippleDelete() override;
|
||||
|
||||
virtual void IncreaseTrackHeight() override;
|
||||
virtual void IncreaseTrackHeight() override;
|
||||
|
||||
virtual void DecreaseTrackHeight() override;
|
||||
virtual void DecreaseTrackHeight() override;
|
||||
|
||||
virtual void ToggleLinks() override;
|
||||
virtual void ToggleLinks() override;
|
||||
|
||||
virtual void PasteInsert() override;
|
||||
virtual void PasteInsert() override;
|
||||
|
||||
virtual void DeleteInToOut() override;
|
||||
virtual void DeleteInToOut() override;
|
||||
|
||||
virtual void RippleDeleteInToOut() override;
|
||||
virtual void RippleDeleteInToOut() override;
|
||||
|
||||
virtual void ToggleSelectedEnabled() override;
|
||||
virtual void ToggleSelectedEnabled() override;
|
||||
|
||||
virtual void SetColorLabel(int index) override;
|
||||
virtual void SetColorLabel(int index) override;
|
||||
|
||||
virtual void NudgeLeft() override;
|
||||
virtual void NudgeLeft() override;
|
||||
|
||||
virtual void NudgeRight() override;
|
||||
virtual void NudgeRight() override;
|
||||
|
||||
virtual void MoveInToPlayhead() override;
|
||||
virtual void MoveInToPlayhead() override;
|
||||
|
||||
virtual void MoveOutToPlayhead() override;
|
||||
virtual void MoveOutToPlayhead() override;
|
||||
|
||||
virtual void RenameSelected() override;
|
||||
virtual void RenameSelected() override;
|
||||
|
||||
void AddDefaultTransitionsToSelected()
|
||||
{
|
||||
timeline_widget()->AddDefaultTransitionsToSelected();
|
||||
}
|
||||
void AddDefaultTransitionsToSelected()
|
||||
{
|
||||
timeline_widget()->AddDefaultTransitionsToSelected();
|
||||
}
|
||||
|
||||
void ShowSpeedDurationDialogForSelectedClips()
|
||||
{
|
||||
timeline_widget()->ShowSpeedDurationDialogForSelectedClips();
|
||||
}
|
||||
void ShowSpeedDurationDialogForSelectedClips()
|
||||
{
|
||||
timeline_widget()->ShowSpeedDurationDialogForSelectedClips();
|
||||
}
|
||||
|
||||
void NestSelectedClips()
|
||||
{
|
||||
timeline_widget()->NestSelectedClips();
|
||||
}
|
||||
void NestSelectedClips()
|
||||
{
|
||||
timeline_widget()->NestSelectedClips();
|
||||
}
|
||||
|
||||
void InsertFootageAtPlayhead(const QVector<ViewerOutput *> &footage);
|
||||
void InsertFootageAtPlayhead(const QVector<ViewerOutput *> &footage);
|
||||
|
||||
void OverwriteFootageAtPlayhead(const QVector<ViewerOutput *> &footage);
|
||||
void OverwriteFootageAtPlayhead(const QVector<ViewerOutput *> &footage);
|
||||
|
||||
const QVector<Block*>& GetSelectedBlocks() const
|
||||
{
|
||||
return timeline_widget()->GetSelectedBlocks();
|
||||
}
|
||||
const QVector<Block *> &GetSelectedBlocks() const
|
||||
{
|
||||
return timeline_widget()->GetSelectedBlocks();
|
||||
}
|
||||
|
||||
Sequence *GetSequence() const
|
||||
{
|
||||
return dynamic_cast<Sequence*>(GetConnectedViewer());
|
||||
}
|
||||
Sequence *GetSequence() const
|
||||
{
|
||||
return dynamic_cast<Sequence *>(GetConnectedViewer());
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual void Retranslate() override;
|
||||
virtual void Retranslate() override;
|
||||
|
||||
signals:
|
||||
void BlockSelectionChanged(const QVector<Block*>& selected_blocks);
|
||||
void BlockSelectionChanged(const QVector<Block *> &selected_blocks);
|
||||
|
||||
void RequestCaptureStart(const TimeRange &time, const Track::Reference &track);
|
||||
|
||||
void RevealViewerInProject(ViewerOutput *r);
|
||||
void RevealViewerInFootageViewer(ViewerOutput *r, const TimeRange &range);
|
||||
void RequestCaptureStart(const TimeRange &time,
|
||||
const Track::Reference &track);
|
||||
|
||||
void RevealViewerInProject(ViewerOutput *r);
|
||||
void RevealViewerInFootageViewer(ViewerOutput *r, const TimeRange &range);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
+17
-15
@@ -23,32 +23,34 @@
|
||||
#include "core.h"
|
||||
#include "widget/toolbar/toolbar.h"
|
||||
|
||||
namespace olive {
|
||||
|
||||
ToolPanel::ToolPanel() :
|
||||
PanelWidget(QStringLiteral("ToolPanel"))
|
||||
namespace olive
|
||||
{
|
||||
Toolbar* t = new Toolbar(this);
|
||||
|
||||
t->SetTool(Core::instance()->tool());
|
||||
t->SetSnapping(Core::instance()->snapping());
|
||||
ToolPanel::ToolPanel()
|
||||
: PanelWidget(QStringLiteral("ToolPanel"))
|
||||
{
|
||||
Toolbar *t = new Toolbar(this);
|
||||
|
||||
SetWidgetWithPadding(t);
|
||||
t->SetTool(Core::instance()->tool());
|
||||
t->SetSnapping(Core::instance()->snapping());
|
||||
|
||||
connect(t, &Toolbar::ToolChanged, Core::instance(), &Core::SetTool);
|
||||
connect(Core::instance(), &Core::ToolChanged, t, &Toolbar::SetTool);
|
||||
SetWidgetWithPadding(t);
|
||||
|
||||
connect(t, &Toolbar::SnappingChanged, Core::instance(), &Core::SetSnapping);
|
||||
connect(Core::instance(), &Core::SnappingChanged, t, &Toolbar::SetSnapping);
|
||||
connect(t, &Toolbar::ToolChanged, Core::instance(), &Core::SetTool);
|
||||
connect(Core::instance(), &Core::ToolChanged, t, &Toolbar::SetTool);
|
||||
|
||||
connect(t, &Toolbar::SelectedTransitionChanged, Core::instance(), &Core::SetSelectedTransitionObject);
|
||||
connect(t, &Toolbar::SnappingChanged, Core::instance(), &Core::SetSnapping);
|
||||
connect(Core::instance(), &Core::SnappingChanged, t, &Toolbar::SetSnapping);
|
||||
|
||||
Retranslate();
|
||||
connect(t, &Toolbar::SelectedTransitionChanged, Core::instance(),
|
||||
&Core::SetSelectedTransitionObject);
|
||||
|
||||
Retranslate();
|
||||
}
|
||||
|
||||
void ToolPanel::Retranslate()
|
||||
{
|
||||
SetTitle(tr("Tools"));
|
||||
SetTitle(tr("Tools"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -23,20 +23,19 @@
|
||||
|
||||
#include "panel/panel.h"
|
||||
|
||||
namespace olive {
|
||||
namespace olive
|
||||
{
|
||||
|
||||
/**
|
||||
* @brief A PanelWidget wrapper around a Toolbar
|
||||
*/
|
||||
class ToolPanel : public PanelWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
class ToolPanel : public PanelWidget {
|
||||
Q_OBJECT
|
||||
public:
|
||||
ToolPanel();
|
||||
ToolPanel();
|
||||
|
||||
private:
|
||||
virtual void Retranslate() override;
|
||||
|
||||
virtual void Retranslate() override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
+12
-11
@@ -20,24 +20,25 @@
|
||||
|
||||
#include "viewer.h"
|
||||
|
||||
namespace olive {
|
||||
|
||||
ViewerPanel::ViewerPanel(const QString &object_name) :
|
||||
ViewerPanelBase(object_name)
|
||||
namespace olive
|
||||
{
|
||||
// Set ViewerWidget as the central widget
|
||||
ViewerWidget* vw = new ViewerWidget(this);
|
||||
SetViewerWidget(vw);
|
||||
|
||||
// Set strings
|
||||
Retranslate();
|
||||
ViewerPanel::ViewerPanel(const QString &object_name)
|
||||
: ViewerPanelBase(object_name)
|
||||
{
|
||||
// Set ViewerWidget as the central widget
|
||||
ViewerWidget *vw = new ViewerWidget(this);
|
||||
SetViewerWidget(vw);
|
||||
|
||||
// Set strings
|
||||
Retranslate();
|
||||
}
|
||||
|
||||
void ViewerPanel::Retranslate()
|
||||
{
|
||||
ViewerPanelBase::Retranslate();
|
||||
ViewerPanelBase::Retranslate();
|
||||
|
||||
SetTitle(tr("Viewer"));
|
||||
SetTitle(tr("Viewer"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -25,19 +25,19 @@
|
||||
|
||||
#include "viewerbase.h"
|
||||
|
||||
namespace olive {
|
||||
namespace olive
|
||||
{
|
||||
|
||||
/**
|
||||
* @brief Dockable wrapper around a ViewerWidget
|
||||
*/
|
||||
class ViewerPanel : public ViewerPanelBase {
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
public:
|
||||
ViewerPanel(const QString& object_name);
|
||||
ViewerPanel(const QString &object_name);
|
||||
|
||||
protected:
|
||||
virtual void Retranslate() override;
|
||||
|
||||
virtual void Retranslate() override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -22,96 +22,111 @@
|
||||
|
||||
#include "window/mainwindow/mainwindow.h"
|
||||
|
||||
namespace olive {
|
||||
namespace olive
|
||||
{
|
||||
|
||||
#define super TimeBasedPanel
|
||||
|
||||
ViewerPanelBase::ViewerPanelBase(const QString& object_name) :
|
||||
super(object_name)
|
||||
ViewerPanelBase::ViewerPanelBase(const QString &object_name)
|
||||
: super(object_name)
|
||||
{
|
||||
connect(PanelManager::instance(), &PanelManager::FocusedPanelChanged, this, &ViewerPanelBase::FocusedPanelChanged);
|
||||
connect(PanelManager::instance(), &PanelManager::FocusedPanelChanged, this,
|
||||
&ViewerPanelBase::FocusedPanelChanged);
|
||||
}
|
||||
|
||||
void ViewerPanelBase::PlayPause()
|
||||
{
|
||||
GetViewerWidget()->TogglePlayPause();
|
||||
GetViewerWidget()->TogglePlayPause();
|
||||
}
|
||||
|
||||
void ViewerPanelBase::PlayInToOut()
|
||||
{
|
||||
GetViewerWidget()->Play(true);
|
||||
GetViewerWidget()->Play(true);
|
||||
}
|
||||
|
||||
void ViewerPanelBase::ShuttleLeft()
|
||||
{
|
||||
GetViewerWidget()->ShuttleLeft();
|
||||
GetViewerWidget()->ShuttleLeft();
|
||||
}
|
||||
|
||||
void ViewerPanelBase::ShuttleStop()
|
||||
{
|
||||
GetViewerWidget()->ShuttleStop();
|
||||
GetViewerWidget()->ShuttleStop();
|
||||
}
|
||||
|
||||
void ViewerPanelBase::ShuttleRight()
|
||||
{
|
||||
GetViewerWidget()->ShuttleRight();
|
||||
GetViewerWidget()->ShuttleRight();
|
||||
}
|
||||
|
||||
void ViewerPanelBase::ConnectTimeBasedPanel(TimeBasedPanel *panel)
|
||||
{
|
||||
connect(panel, &TimeBasedPanel::PlayPauseRequested, this, &ViewerPanelBase::PlayPause);
|
||||
connect(panel, &TimeBasedPanel::PlayInToOutRequested, this, &ViewerPanelBase::PlayInToOut);
|
||||
connect(panel, &TimeBasedPanel::ShuttleLeftRequested, this, &ViewerPanelBase::ShuttleLeft);
|
||||
connect(panel, &TimeBasedPanel::ShuttleStopRequested, this, &ViewerPanelBase::ShuttleStop);
|
||||
connect(panel, &TimeBasedPanel::ShuttleRightRequested, this, &ViewerPanelBase::ShuttleRight);
|
||||
connect(panel, &TimeBasedPanel::PlayPauseRequested, this,
|
||||
&ViewerPanelBase::PlayPause);
|
||||
connect(panel, &TimeBasedPanel::PlayInToOutRequested, this,
|
||||
&ViewerPanelBase::PlayInToOut);
|
||||
connect(panel, &TimeBasedPanel::ShuttleLeftRequested, this,
|
||||
&ViewerPanelBase::ShuttleLeft);
|
||||
connect(panel, &TimeBasedPanel::ShuttleStopRequested, this,
|
||||
&ViewerPanelBase::ShuttleStop);
|
||||
connect(panel, &TimeBasedPanel::ShuttleRightRequested, this,
|
||||
&ViewerPanelBase::ShuttleRight);
|
||||
}
|
||||
|
||||
void ViewerPanelBase::DisconnectTimeBasedPanel(TimeBasedPanel *panel)
|
||||
{
|
||||
disconnect(panel, &TimeBasedPanel::PlayPauseRequested, this, &ViewerPanelBase::PlayPause);
|
||||
disconnect(panel, &TimeBasedPanel::PlayInToOutRequested, this, &ViewerPanelBase::PlayInToOut);
|
||||
disconnect(panel, &TimeBasedPanel::ShuttleLeftRequested, this, &ViewerPanelBase::ShuttleLeft);
|
||||
disconnect(panel, &TimeBasedPanel::ShuttleStopRequested, this, &ViewerPanelBase::ShuttleStop);
|
||||
disconnect(panel, &TimeBasedPanel::ShuttleRightRequested, this, &ViewerPanelBase::ShuttleRight);
|
||||
disconnect(panel, &TimeBasedPanel::PlayPauseRequested, this,
|
||||
&ViewerPanelBase::PlayPause);
|
||||
disconnect(panel, &TimeBasedPanel::PlayInToOutRequested, this,
|
||||
&ViewerPanelBase::PlayInToOut);
|
||||
disconnect(panel, &TimeBasedPanel::ShuttleLeftRequested, this,
|
||||
&ViewerPanelBase::ShuttleLeft);
|
||||
disconnect(panel, &TimeBasedPanel::ShuttleStopRequested, this,
|
||||
&ViewerPanelBase::ShuttleStop);
|
||||
disconnect(panel, &TimeBasedPanel::ShuttleRightRequested, this,
|
||||
&ViewerPanelBase::ShuttleRight);
|
||||
}
|
||||
|
||||
void ViewerPanelBase::SetFullScreen(QScreen *screen)
|
||||
{
|
||||
GetViewerWidget()->SetFullScreen(screen);
|
||||
GetViewerWidget()->SetFullScreen(screen);
|
||||
}
|
||||
|
||||
void ViewerPanelBase::SetGizmos(Node *node)
|
||||
{
|
||||
GetViewerWidget()->SetGizmos(node);
|
||||
GetViewerWidget()->SetGizmos(node);
|
||||
}
|
||||
|
||||
void ViewerPanelBase::CacheEntireSequence()
|
||||
{
|
||||
GetViewerWidget()->CacheEntireSequence();
|
||||
GetViewerWidget()->CacheEntireSequence();
|
||||
}
|
||||
|
||||
void ViewerPanelBase::CacheSequenceInOut()
|
||||
{
|
||||
GetViewerWidget()->CacheSequenceInOut();
|
||||
GetViewerWidget()->CacheSequenceInOut();
|
||||
}
|
||||
|
||||
void ViewerPanelBase::SetViewerWidget(ViewerWidget *vw)
|
||||
{
|
||||
connect(vw, &ViewerWidget::TextureChanged, this, &ViewerPanelBase::TextureChanged);
|
||||
connect(vw, &ViewerWidget::ColorProcessorChanged, this, &ViewerPanelBase::ColorProcessorChanged);
|
||||
connect(vw, &ViewerWidget::ColorManagerChanged, this, &ViewerPanelBase::ColorManagerChanged);
|
||||
connect(vw, &ViewerWidget::TextureChanged, this,
|
||||
&ViewerPanelBase::TextureChanged);
|
||||
connect(vw, &ViewerWidget::ColorProcessorChanged, this,
|
||||
&ViewerPanelBase::ColorProcessorChanged);
|
||||
connect(vw, &ViewerWidget::ColorManagerChanged, this,
|
||||
&ViewerPanelBase::ColorManagerChanged);
|
||||
|
||||
SetTimeBasedWidget(vw);
|
||||
SetTimeBasedWidget(vw);
|
||||
}
|
||||
|
||||
void ViewerPanelBase::FocusedPanelChanged(PanelWidget *panel)
|
||||
{
|
||||
if (dynamic_cast<ViewerPanelBase*>(panel)) {
|
||||
auto vw = GetViewerWidget();
|
||||
if (vw->IsPlaying() && panel != this) {
|
||||
vw->Pause();
|
||||
}
|
||||
}
|
||||
if (dynamic_cast<ViewerPanelBase *>(panel)) {
|
||||
auto vw = GetViewerWidget();
|
||||
if (vw->IsPlaying() && panel != this) {
|
||||
vw->Pause();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -25,102 +25,101 @@
|
||||
#include "panel/timebased/timebased.h"
|
||||
#include "widget/viewer/viewer.h"
|
||||
|
||||
namespace olive {
|
||||
|
||||
class ViewerPanelBase : public TimeBasedPanel
|
||||
namespace olive
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
class ViewerPanelBase : public TimeBasedPanel {
|
||||
Q_OBJECT
|
||||
public:
|
||||
ViewerPanelBase(const QString& object_name);
|
||||
ViewerPanelBase(const QString &object_name);
|
||||
|
||||
ViewerWidget *GetViewerWidget() const
|
||||
{
|
||||
return static_cast<ViewerWidget*>(GetTimeBasedWidget());
|
||||
}
|
||||
ViewerWidget *GetViewerWidget() const
|
||||
{
|
||||
return static_cast<ViewerWidget *>(GetTimeBasedWidget());
|
||||
}
|
||||
|
||||
virtual void PlayPause() override;
|
||||
virtual void PlayPause() override;
|
||||
|
||||
virtual void PlayInToOut() override;
|
||||
virtual void PlayInToOut() override;
|
||||
|
||||
virtual void ShuttleLeft() override;
|
||||
virtual void ShuttleLeft() override;
|
||||
|
||||
virtual void ShuttleStop() override;
|
||||
virtual void ShuttleStop() override;
|
||||
|
||||
virtual void ShuttleRight() override;
|
||||
virtual void ShuttleRight() override;
|
||||
|
||||
void ConnectTimeBasedPanel(TimeBasedPanel* panel);
|
||||
void ConnectTimeBasedPanel(TimeBasedPanel *panel);
|
||||
|
||||
void DisconnectTimeBasedPanel(TimeBasedPanel* panel);
|
||||
void DisconnectTimeBasedPanel(TimeBasedPanel *panel);
|
||||
|
||||
/**
|
||||
/**
|
||||
* @brief Wrapper for ViewerWidget::SetFullScreen()
|
||||
*/
|
||||
void SetFullScreen(QScreen* screen = nullptr);
|
||||
void SetFullScreen(QScreen *screen = nullptr);
|
||||
|
||||
ColorManager *GetColorManager()
|
||||
{
|
||||
return GetViewerWidget()->color_manager();
|
||||
}
|
||||
ColorManager *GetColorManager()
|
||||
{
|
||||
return GetViewerWidget()->color_manager();
|
||||
}
|
||||
|
||||
void UpdateTextureFromNode()
|
||||
{
|
||||
GetViewerWidget()->UpdateTextureFromNode();
|
||||
}
|
||||
void UpdateTextureFromNode()
|
||||
{
|
||||
GetViewerWidget()->UpdateTextureFromNode();
|
||||
}
|
||||
|
||||
void AddPlaybackDevice(ViewerDisplayWidget *vw)
|
||||
{
|
||||
GetViewerWidget()->AddPlaybackDevice(vw);
|
||||
}
|
||||
void AddPlaybackDevice(ViewerDisplayWidget *vw)
|
||||
{
|
||||
GetViewerWidget()->AddPlaybackDevice(vw);
|
||||
}
|
||||
|
||||
void SetTimelineSelectedBlocks(const QVector<Block*> &b)
|
||||
{
|
||||
GetViewerWidget()->SetTimelineSelectedBlocks(b);
|
||||
}
|
||||
void SetTimelineSelectedBlocks(const QVector<Block *> &b)
|
||||
{
|
||||
GetViewerWidget()->SetTimelineSelectedBlocks(b);
|
||||
}
|
||||
|
||||
void SetNodeViewSelections(const QVector<Node*> &n)
|
||||
{
|
||||
GetViewerWidget()->SetNodeViewSelections(n);
|
||||
}
|
||||
void SetNodeViewSelections(const QVector<Node *> &n)
|
||||
{
|
||||
GetViewerWidget()->SetNodeViewSelections(n);
|
||||
}
|
||||
|
||||
void ConnectMulticamWidget(MulticamWidget *p)
|
||||
{
|
||||
GetViewerWidget()->ConnectMulticamWidget(p);
|
||||
}
|
||||
void ConnectMulticamWidget(MulticamWidget *p)
|
||||
{
|
||||
GetViewerWidget()->ConnectMulticamWidget(p);
|
||||
}
|
||||
|
||||
public slots:
|
||||
void SetGizmos(Node* node);
|
||||
void SetGizmos(Node *node);
|
||||
|
||||
void CacheEntireSequence();
|
||||
void CacheEntireSequence();
|
||||
|
||||
void CacheSequenceInOut();
|
||||
void CacheSequenceInOut();
|
||||
|
||||
void RequestStartEditingText()
|
||||
{
|
||||
GetViewerWidget()->RequestStartEditingText();
|
||||
}
|
||||
void RequestStartEditingText()
|
||||
{
|
||||
GetViewerWidget()->RequestStartEditingText();
|
||||
}
|
||||
|
||||
signals:
|
||||
/**
|
||||
/**
|
||||
* @brief Signal emitted when a new frame is loaded
|
||||
*/
|
||||
void TextureChanged(TexturePtr t);
|
||||
void TextureChanged(TexturePtr t);
|
||||
|
||||
/**
|
||||
/**
|
||||
* @brief Wrapper for ViewerGLWidget::ColorProcessorChanged()
|
||||
*/
|
||||
void ColorProcessorChanged(ColorProcessorPtr processor);
|
||||
void ColorProcessorChanged(ColorProcessorPtr processor);
|
||||
|
||||
/**
|
||||
/**
|
||||
* @brief Wrapper for ViewerGLWidget::ColorManagerChanged()
|
||||
*/
|
||||
void ColorManagerChanged(ColorManager* color_manager);
|
||||
void ColorManagerChanged(ColorManager *color_manager);
|
||||
|
||||
protected:
|
||||
void SetViewerWidget(ViewerWidget *vw);
|
||||
void SetViewerWidget(ViewerWidget *vw);
|
||||
|
||||
private slots:
|
||||
void FocusedPanelChanged(PanelWidget *panel);
|
||||
|
||||
void FocusedPanelChanged(PanelWidget *panel);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user