began new infrastructure
Yep, this is another one of my "famous" sweeping rewrites. Expect things to break. Goals for this are: - Greatly simplify node connections (particularly with arrays) so the code requires less maintenance/is more stable - Redesign node structure to address issues where UI would stall for lengthy periods of time - Less reliance on shared ptrs/greater reliance on QObject system for inheritance/memory management - General code cleanup and improvements
This commit is contained in:
@@ -541,9 +541,9 @@ void ProjectExplorer::DeselectAll()
|
||||
CurrentView()->selectionModel()->clearSelection();
|
||||
}
|
||||
|
||||
QList<MediaInput *> ProjectExplorer::GetMediaNodesUsingFootage(Footage *item)
|
||||
QVector<MediaInput *> ProjectExplorer::GetMediaNodesUsingFootage(Footage *item)
|
||||
{
|
||||
QList<MediaInput *> list;
|
||||
QVector<MediaInput *> list;
|
||||
|
||||
// Get all sequences.
|
||||
QVector<Item*> sequences = model_.project()->get_items_of_type(Item::kSequence);
|
||||
@@ -552,12 +552,10 @@ QList<MediaInput *> ProjectExplorer::GetMediaNodesUsingFootage(Footage *item)
|
||||
foreach (Item* s, sequences) {
|
||||
const QList<Node*>& nodes = static_cast<Sequence*>(s)->nodes();
|
||||
foreach (Node* n, nodes) {
|
||||
if (n->IsMedia()) {
|
||||
MediaInput* media_node = static_cast<MediaInput*>(n);
|
||||
MediaInput* media_node = dynamic_cast<MediaInput*>(n);
|
||||
|
||||
if (media_node->stream()->footage() == item) {
|
||||
list.append(media_node);
|
||||
}
|
||||
if (media_node && media_node->stream()->footage() == item) {
|
||||
list.append(media_node);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -593,7 +591,7 @@ void ProjectExplorer::DeleteSelected()
|
||||
// If this is footage, check if it's used anywhere in any sequence
|
||||
Footage* footage = static_cast<Footage*>(item);
|
||||
|
||||
QList<MediaInput*> footage_nodes = GetMediaNodesUsingFootage(footage);
|
||||
QVector<MediaInput*> footage_nodes = GetMediaNodesUsingFootage(footage);
|
||||
|
||||
if (!footage_nodes.isEmpty()) {
|
||||
// Footage is in use, show messagebox asking what to do about it
|
||||
|
||||
@@ -105,11 +105,11 @@ private:
|
||||
/**
|
||||
* @brief Check if an item is in use anywhere and return any relevant input nodes
|
||||
*/
|
||||
QList<MediaInput*> GetMediaNodesUsingFootage(Footage* item);
|
||||
QVector<MediaInput*> GetMediaNodesUsingFootage(Footage* item);
|
||||
|
||||
/**
|
||||
* @brief Get all the blocks that solely rely on an input node
|
||||
*
|
||||
*
|
||||
* Ignores blocks that depend on multiple inputs
|
||||
*/
|
||||
QList<Block*> GetFootageBlocks(QList<Node*> nodes);
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
namespace olive {
|
||||
|
||||
OfflineFootageCommand::OfflineFootageCommand(const QList<MediaInput *> &media, QUndoCommand* parent) :
|
||||
OfflineFootageCommand::OfflineFootageCommand(const QVector<MediaInput *> &media, QUndoCommand* parent) :
|
||||
UndoCommand(parent)
|
||||
{
|
||||
foreach (MediaInput* i, media) {
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace olive {
|
||||
*/
|
||||
class OfflineFootageCommand : public UndoCommand {
|
||||
public:
|
||||
OfflineFootageCommand(const QList<MediaInput*>& media, QUndoCommand* parent = nullptr);
|
||||
OfflineFootageCommand(const QVector<MediaInput*>& media, QUndoCommand* parent = nullptr);
|
||||
|
||||
virtual Project* GetRelevantProject() const override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user