implement entire project in nodes

Project items are now represented directly in nodes opening up more versatility and possibilities. This is the first iteration of this and will be buggy. Need to test thoroughly.
This commit is contained in:
itsmattkc
2021-02-15 21:31:57 +11:00
parent 155470bec1
commit d7c5ac4b44
174 changed files with 3515 additions and 4658 deletions
+1 -1
View File
@@ -60,7 +60,7 @@ void FootageViewerPanel::SetFootage(Footage *f)
if (f) {
// SetSubtitle() will call Retranslate(), so we don't need to call it here
SetSubtitle(f->name());
SetSubtitle(f->GetLabel());
// Pop this panel up so the user doesn't think nothing's happening if it's behind another tab
this->show();
+6 -6
View File
@@ -108,7 +108,7 @@ QModelIndex ProjectPanel::get_root_index() const
return explorer_->get_root_index();
}
void ProjectPanel::set_root(Item *item)
void ProjectPanel::set_root(Folder *item)
{
explorer_->set_root(item);
@@ -184,10 +184,10 @@ void ProjectPanel::ItemDoubleClickSlot(Item *item)
if (item == nullptr) {
// If the user double clicks on empty space, show the import dialog
Core::instance()->DialogImportShow();
} else if (item->type() == Item::kFootage) {
} else if (dynamic_cast<Footage*>(item)) {
// Open this footage in a FootageViewer
PanelManager::instance()->MostRecentlyFocused<FootageViewerPanel>()->SetFootage(static_cast<Footage*>(item));
} else if (item->type() == Item::kSequence) {
} else if (dynamic_cast<Sequence*>(item)) {
// Open this sequence in the Timeline
Core::instance()->main_window()->OpenSequence(static_cast<Sequence*>(item));
}
@@ -210,10 +210,10 @@ void ProjectPanel::UpdateSubtitle()
if (explorer_->get_root_index().isValid()) {
QString folder_path;
Item* item = static_cast<Item*>(explorer_->get_root_index().internalPointer());
Folder* item = static_cast<Folder*>(explorer_->get_root_index().internalPointer());
do {
folder_path.prepend(QStringLiteral("/%1").arg(item->name()));
folder_path.prepend(QStringLiteral("/%1").arg(item->GetLabel()));
item = item->item_parent();
} while (item != project()->root());
@@ -238,7 +238,7 @@ QVector<Footage *> ProjectPanel::GetSelectedFootage() const
QVector<Footage*> footage;
foreach (Item* i, items) {
if (i->type() == Item::kFootage) {
if (dynamic_cast<Footage*>(i)) {
footage.append(static_cast<Footage*>(i));
}
}
+1 -1
View File
@@ -42,7 +42,7 @@ public:
QModelIndex get_root_index() const;
void set_root(Item* item);
void set_root(Folder* item);
QVector<Item *> SelectedItems() const;
+2 -2
View File
@@ -113,7 +113,7 @@ TimeBasedWidget *TimeBasedPanel::GetTimeBasedWidget() const
return widget_;
}
ViewerOutput *TimeBasedPanel::GetConnectedViewer() const
Sequence *TimeBasedPanel::GetConnectedViewer() const
{
return widget_->GetConnectedNode();
}
@@ -123,7 +123,7 @@ TimeRuler *TimeBasedPanel::ruler() const
return widget_->ruler();
}
void TimeBasedPanel::ConnectViewerNode(ViewerOutput *node)
void TimeBasedPanel::ConnectViewerNode(Sequence *node)
{
if (widget_->GetConnectedNode() == node) {
return;
+2 -2
View File
@@ -32,13 +32,13 @@ class TimeBasedPanel : public PanelWidget
public:
TimeBasedPanel(const QString& object_name, QWidget *parent = nullptr);
void ConnectViewerNode(ViewerOutput* node);
void ConnectViewerNode(Sequence *node);
void DisconnectViewerNode();
rational GetTime();
ViewerOutput* GetConnectedViewer() const;
Sequence *GetConnectedViewer() const;
TimeRuler* ruler() const;