moved media to smart pointers
This commit is contained in:
+17
-9
@@ -67,12 +67,6 @@ Media::Media(Media* iparent) {
|
||||
type = -1;
|
||||
}
|
||||
|
||||
Media::~Media() {
|
||||
for (int i=0;i<children.size();i++) {
|
||||
delete children.at(i);
|
||||
}
|
||||
}
|
||||
|
||||
Footage* Media::to_footage() {
|
||||
return static_cast<Footage*>(object.get());
|
||||
}
|
||||
@@ -262,7 +256,7 @@ int Media::get_sampling_rate(int stream) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Media::appendChild(Media *child) {
|
||||
void Media::appendChild(MediaPtr child) {
|
||||
child->set_parent(this);
|
||||
children.append(child);
|
||||
}
|
||||
@@ -279,7 +273,7 @@ bool Media::setData(int col, const QVariant &value) {
|
||||
}
|
||||
|
||||
Media *Media::child(int row) {
|
||||
return children.value(row);
|
||||
return children.value(row).get();
|
||||
}
|
||||
|
||||
int Media::childCount() const {
|
||||
@@ -348,7 +342,11 @@ QVariant Media::data(int column, int role) {
|
||||
|
||||
int Media::row() const {
|
||||
if (parent) {
|
||||
return parent->children.indexOf(const_cast<Media*>(this));
|
||||
for (int i=0;i<parent->children.size();i++) {
|
||||
if (parent->children.at(i).get() == this) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -361,6 +359,16 @@ void Media::removeChild(int i) {
|
||||
children.removeAt(i);
|
||||
}
|
||||
|
||||
MediaPtr Media::get_shared_ptr(Media *m)
|
||||
{
|
||||
for (int i=0;i<children.size();i++) {
|
||||
if (children.at(i).get() == m) {
|
||||
return children.at(i);
|
||||
}
|
||||
}
|
||||
return MediaPtr();
|
||||
}
|
||||
|
||||
QVector<Marker> &Media::get_markers() {
|
||||
// returns the marker array from the internal object
|
||||
//
|
||||
|
||||
+8
-4
@@ -39,11 +39,14 @@ using SequencePtr = std::shared_ptr<Sequence>;
|
||||
|
||||
using VoidPtr = std::shared_ptr<void>;
|
||||
|
||||
class Media;
|
||||
using MediaPtr = std::shared_ptr<Media>;
|
||||
|
||||
class Media
|
||||
{
|
||||
public:
|
||||
Media(Media* iparent);
|
||||
~Media();
|
||||
Media(Media* iparent = nullptr);
|
||||
|
||||
Footage *to_footage();
|
||||
SequencePtr to_sequence();
|
||||
void set_icon(const QString& str);
|
||||
@@ -62,7 +65,7 @@ public:
|
||||
int get_sampling_rate(int stream = -1);
|
||||
|
||||
// item functions
|
||||
void appendChild(Media *child);
|
||||
void appendChild(MediaPtr child);
|
||||
bool setData(int col, const QVariant &value);
|
||||
Media *child(int row);
|
||||
int childCount() const;
|
||||
@@ -71,6 +74,7 @@ public:
|
||||
int row() const;
|
||||
Media *parentItem();
|
||||
void removeChild(int i);
|
||||
MediaPtr get_shared_ptr(Media* m);
|
||||
|
||||
// get markers from internal object
|
||||
QVector<Marker>& get_markers();
|
||||
@@ -84,7 +88,7 @@ private:
|
||||
VoidPtr object;
|
||||
|
||||
// item functions
|
||||
QList<Media*> children;
|
||||
QList<MediaPtr> children;
|
||||
Media* parent;
|
||||
QString folder_name;
|
||||
QString tooltip;
|
||||
|
||||
+113
-98
@@ -28,77 +28,77 @@
|
||||
|
||||
ProjectModel olive::project_model;
|
||||
|
||||
ProjectModel::ProjectModel(QObject *parent) : QAbstractItemModel(parent), root_item(nullptr) {
|
||||
make_root();
|
||||
ProjectModel::ProjectModel(QObject *parent) : QAbstractItemModel(parent), root_item_(nullptr) {
|
||||
make_root();
|
||||
}
|
||||
|
||||
ProjectModel::~ProjectModel() {
|
||||
destroy_root();
|
||||
destroy_root();
|
||||
}
|
||||
|
||||
void ProjectModel::make_root() {
|
||||
root_item = new Media(nullptr);
|
||||
root_item->temp_id = 0;
|
||||
root_item->root = true;
|
||||
root_item_ = std::make_shared<Media>();
|
||||
root_item_->temp_id = 0;
|
||||
root_item_->root = true;
|
||||
}
|
||||
|
||||
void ProjectModel::destroy_root() {
|
||||
if (panel_sequence_viewer != nullptr) panel_sequence_viewer->viewer_widget->delete_function();
|
||||
if (panel_footage_viewer != nullptr) panel_footage_viewer->viewer_widget->delete_function();
|
||||
if (panel_sequence_viewer != nullptr) panel_sequence_viewer->viewer_widget->delete_function();
|
||||
if (panel_footage_viewer != nullptr) panel_footage_viewer->viewer_widget->delete_function();
|
||||
|
||||
if (root_item != nullptr) {
|
||||
delete root_item;
|
||||
}
|
||||
root_item_ = std::make_shared<Media>();
|
||||
}
|
||||
|
||||
void ProjectModel::clear() {
|
||||
beginResetModel();
|
||||
destroy_root();
|
||||
make_root();
|
||||
endResetModel();
|
||||
beginResetModel();
|
||||
destroy_root();
|
||||
make_root();
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
Media *ProjectModel::get_root() {
|
||||
return root_item;
|
||||
Media *ProjectModel::get_root() const {
|
||||
return root_item_.get();
|
||||
}
|
||||
|
||||
QVariant ProjectModel::data(const QModelIndex &index, int role) const {
|
||||
if (!index.isValid())
|
||||
return QVariant();
|
||||
if (!index.isValid())
|
||||
return QVariant();
|
||||
|
||||
return static_cast<Media*>(index.internalPointer())->data(index.column(), role);
|
||||
return static_cast<Media*>(index.internalPointer())->data(index.column(), role);
|
||||
}
|
||||
|
||||
Qt::ItemFlags ProjectModel::flags(const QModelIndex &index) const {
|
||||
if (!index.isValid())
|
||||
return Qt::ItemIsDropEnabled;
|
||||
if (!index.isValid())
|
||||
return Qt::ItemIsDropEnabled;
|
||||
|
||||
return QAbstractItemModel::flags(index) | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled | Qt::ItemIsEditable;
|
||||
return QAbstractItemModel::flags(index) | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled | Qt::ItemIsEditable;
|
||||
}
|
||||
|
||||
QVariant ProjectModel::headerData(int section, Qt::Orientation orientation, int role) const {
|
||||
if (orientation == Qt::Horizontal && role == Qt::DisplayRole)
|
||||
return root_item->data(section, role);
|
||||
if (orientation == Qt::Horizontal && role == Qt::DisplayRole)
|
||||
return root_item_->data(section, role);
|
||||
|
||||
return QVariant();
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
QModelIndex ProjectModel::index(int row, int column, const QModelIndex &parent) const {
|
||||
if (!hasIndex(row, column, parent))
|
||||
return QModelIndex();
|
||||
if (!hasIndex(row, column, parent))
|
||||
return QModelIndex();
|
||||
|
||||
Media *parentItem;
|
||||
Media *parentItem;
|
||||
|
||||
if (!parent.isValid())
|
||||
parentItem = root_item;
|
||||
else
|
||||
parentItem = static_cast<Media*>(parent.internalPointer());
|
||||
if (!parent.isValid()) {
|
||||
parentItem = get_root();
|
||||
} else {
|
||||
parentItem = static_cast<Media*>(parent.internalPointer());
|
||||
}
|
||||
|
||||
Media *childItem = parentItem->child(row);
|
||||
if (childItem)
|
||||
return createIndex(row, column, childItem);
|
||||
else
|
||||
return QModelIndex();
|
||||
Media *childItem = parentItem->child(row);
|
||||
if (childItem) {
|
||||
return createIndex(row, column, childItem);
|
||||
} else {
|
||||
return QModelIndex();
|
||||
}
|
||||
}
|
||||
|
||||
QModelIndex ProjectModel::create_index(int arow, int acolumn, void* adata) {
|
||||
@@ -106,14 +106,14 @@ QModelIndex ProjectModel::create_index(int arow, int acolumn, void* adata) {
|
||||
}
|
||||
|
||||
QModelIndex ProjectModel::parent(const QModelIndex &index) const {
|
||||
if (!index.isValid())
|
||||
return QModelIndex();
|
||||
if (!index.isValid())
|
||||
return QModelIndex();
|
||||
|
||||
Media *childItem = static_cast<Media*>(index.internalPointer());
|
||||
Media *parentItem = childItem->parentItem();
|
||||
Media *childItem = static_cast<Media*>(index.internalPointer());
|
||||
Media *parentItem = childItem->parentItem();
|
||||
|
||||
if (parentItem == root_item)
|
||||
return QModelIndex();
|
||||
if (parentItem == get_root())
|
||||
return QModelIndex();
|
||||
|
||||
return createIndex(parentItem->row(), 0, parentItem);
|
||||
}
|
||||
@@ -142,89 +142,104 @@ bool ProjectModel::hasChildren(const QModelIndex &parent) const
|
||||
}
|
||||
|
||||
bool ProjectModel::setData(const QModelIndex &index, const QVariant &value, int role) {
|
||||
if (role != Qt::EditRole)
|
||||
return false;
|
||||
if (role != Qt::EditRole)
|
||||
return false;
|
||||
|
||||
Media *item = static_cast<Media*>(index.internalPointer());
|
||||
bool result = item->setData(index.column(), value);
|
||||
Media *item = static_cast<Media*>(index.internalPointer());
|
||||
bool result = item->setData(index.column(), value);
|
||||
|
||||
if (result)
|
||||
emit dataChanged(index, index);
|
||||
if (result)
|
||||
emit dataChanged(index, index);
|
||||
|
||||
return result;
|
||||
return result;
|
||||
}
|
||||
|
||||
int ProjectModel::rowCount(const QModelIndex &parent) const {
|
||||
Media *parentItem;
|
||||
if (parent.column() > 0)
|
||||
return 0;
|
||||
if (parent.column() > 0)
|
||||
return 0;
|
||||
|
||||
if (!parent.isValid()) {
|
||||
parentItem = root_item;
|
||||
} else {
|
||||
parentItem = static_cast<Media*>(parent.internalPointer());
|
||||
}
|
||||
if (!parent.isValid()) {
|
||||
parentItem = get_root();
|
||||
} else {
|
||||
parentItem = static_cast<Media*>(parent.internalPointer());
|
||||
}
|
||||
|
||||
return parentItem->childCount();
|
||||
return parentItem->childCount();
|
||||
}
|
||||
|
||||
int ProjectModel::columnCount(const QModelIndex &parent) const {
|
||||
if (parent.isValid())
|
||||
return static_cast<Media*>(parent.internalPointer())->columnCount();
|
||||
else
|
||||
return root_item->columnCount();
|
||||
if (parent.isValid())
|
||||
return static_cast<Media*>(parent.internalPointer())->columnCount();
|
||||
else
|
||||
return root_item_->columnCount();
|
||||
}
|
||||
|
||||
Media *ProjectModel::getItem(const QModelIndex &index) const {
|
||||
if (index.isValid()) {
|
||||
Media *item = static_cast<Media*>(index.internalPointer());
|
||||
if (item)
|
||||
return item;
|
||||
}
|
||||
return root_item;
|
||||
if (index.isValid()) {
|
||||
Media *item = static_cast<Media*>(index.internalPointer());
|
||||
if (item)
|
||||
return item;
|
||||
}
|
||||
return get_root();
|
||||
}
|
||||
|
||||
void ProjectModel::set_icon(Media* m, const QIcon &ico) {
|
||||
QModelIndex index = createIndex(m->row(), 0, m);
|
||||
m->set_icon(ico);
|
||||
emit dataChanged(index, index);
|
||||
QModelIndex index = createIndex(m->row(), 0, m);
|
||||
m->set_icon(ico);
|
||||
emit dataChanged(index, index);
|
||||
}
|
||||
|
||||
void ProjectModel::appendChild(Media *parent, Media *child) {
|
||||
if (parent == nullptr) parent = root_item;
|
||||
beginInsertRows(parent == root_item ? QModelIndex() : createIndex(parent->row(), 0, parent), parent->childCount(), parent->childCount());
|
||||
parent->appendChild(child);
|
||||
endInsertRows();
|
||||
void ProjectModel::appendChild(Media* parent, MediaPtr child) {
|
||||
if (parent == nullptr) {
|
||||
parent = get_root();
|
||||
}
|
||||
beginInsertRows(parent == get_root() ?
|
||||
QModelIndex() : createIndex(parent->row(), 0, parent), parent->childCount(), parent->childCount());
|
||||
parent->appendChild(child);
|
||||
endInsertRows();
|
||||
}
|
||||
|
||||
void ProjectModel::moveChild(Media *child, Media *to) {
|
||||
if (to == nullptr) to = root_item;
|
||||
Media* from = child->parentItem();
|
||||
beginMoveRows(
|
||||
from == root_item ? QModelIndex() : createIndex(from->row(), 0, from),
|
||||
child->row(),
|
||||
child->row(),
|
||||
to == root_item ? QModelIndex() : createIndex(to->row(), 0, to),
|
||||
to->childCount()
|
||||
);
|
||||
from->removeChild(child->row());
|
||||
to->appendChild(child);
|
||||
endMoveRows();
|
||||
void ProjectModel::moveChild(MediaPtr child, Media *to) {
|
||||
if (to == nullptr) {
|
||||
to = get_root();
|
||||
}
|
||||
|
||||
Media* from = child->parentItem();
|
||||
|
||||
beginMoveRows(
|
||||
from == get_root() ? QModelIndex() : createIndex(from->row(), 0, from),
|
||||
child->row(),
|
||||
child->row(),
|
||||
to == get_root() ? QModelIndex() : createIndex(to->row(), 0, to),
|
||||
to->childCount()
|
||||
);
|
||||
|
||||
from->removeChild(child->row());
|
||||
to->appendChild(child);
|
||||
endMoveRows();
|
||||
}
|
||||
|
||||
void ProjectModel::removeChild(Media* parent, Media* m) {
|
||||
if (parent == nullptr) parent = root_item;
|
||||
beginRemoveRows(parent == root_item ? QModelIndex() : createIndex(parent->row(), 0, parent), m->row(), m->row());
|
||||
parent->removeChild(m->row());
|
||||
endRemoveRows();
|
||||
if (parent == nullptr) {
|
||||
parent = get_root();
|
||||
}
|
||||
beginRemoveRows(parent == get_root() ?
|
||||
QModelIndex() : createIndex(parent->row(), 0, parent), m->row(), m->row());
|
||||
parent->removeChild(m->row());
|
||||
endRemoveRows();
|
||||
}
|
||||
|
||||
Media* ProjectModel::child(int i, Media* parent) {
|
||||
if (parent == nullptr) parent = root_item;
|
||||
return parent->child(i);
|
||||
if (parent == nullptr) {
|
||||
parent = get_root();
|
||||
}
|
||||
return parent->child(i);
|
||||
}
|
||||
|
||||
int ProjectModel::childCount(Media *parent) {
|
||||
if (parent == nullptr) parent = root_item;
|
||||
return parent->childCount();
|
||||
if (parent == nullptr) {
|
||||
parent = get_root();
|
||||
}
|
||||
return parent->childCount();
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ public:
|
||||
void make_root();
|
||||
void destroy_root();
|
||||
void clear();
|
||||
Media* get_root();
|
||||
Media* get_root() const;
|
||||
QVariant data(const QModelIndex &index, int role) const override;
|
||||
Qt::ItemFlags flags(const QModelIndex &index) const override;
|
||||
QVariant headerData(int section, Qt::Orientation orientation,
|
||||
@@ -51,15 +51,15 @@ public:
|
||||
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
Media* getItem(const QModelIndex &index) const;
|
||||
|
||||
void appendChild(Media* parent, Media* child);
|
||||
void moveChild(Media* child, Media* to);
|
||||
void appendChild(Media *parent, MediaPtr child);
|
||||
void moveChild(MediaPtr child, Media* to);
|
||||
void removeChild(Media* parent, Media* m);
|
||||
Media* child(int i, Media* parent = nullptr);
|
||||
int childCount(Media* parent = nullptr);
|
||||
void set_icon(Media* m, const QIcon &ico);
|
||||
|
||||
private:
|
||||
Media* root_item;
|
||||
MediaPtr root_item_;
|
||||
};
|
||||
|
||||
namespace olive {
|
||||
|
||||
@@ -261,9 +261,12 @@ void SourcesCommon::mouseDoubleClickEvent(const QModelIndexList& selected_items)
|
||||
}
|
||||
}
|
||||
|
||||
void SourcesCommon::dropEvent(QWidget* parent, QDropEvent *event, const QModelIndex& drop_item, const QModelIndexList& items) {
|
||||
void SourcesCommon::dropEvent(QWidget* parent,
|
||||
QDropEvent *event,
|
||||
const QModelIndex& drop_item,
|
||||
const QModelIndexList& items) {
|
||||
const QMimeData* mimeData = event->mimeData();
|
||||
Media* m = project_parent->item_to_media(drop_item);
|
||||
MediaPtr m = project_parent->item_to_media_ptr(drop_item);
|
||||
if (mimeData->hasUrls()) {
|
||||
// drag files in from outside
|
||||
QList<QUrl> urls = mimeData->urls();
|
||||
@@ -305,11 +308,11 @@ void SourcesCommon::dropEvent(QWidget* parent, QDropEvent *event, const QModelIn
|
||||
// dragging files within project
|
||||
// if we dragged to the root OR dragged to a folder
|
||||
if (!drop_item.isValid() || m->get_type() == MEDIA_TYPE_FOLDER) {
|
||||
QVector<Media*> move_items;
|
||||
QVector<MediaPtr> move_items;
|
||||
for (int i=0;i<items.size();i++) {
|
||||
const QModelIndex& item = items.at(i);
|
||||
const QModelIndex& parent = item.parent();
|
||||
Media* s = project_parent->item_to_media(item);
|
||||
MediaPtr s = project_parent->item_to_media_ptr(item);
|
||||
if (parent != drop_item && item != drop_item) {
|
||||
bool ignore = false;
|
||||
if (parent.isValid()) {
|
||||
@@ -332,7 +335,7 @@ void SourcesCommon::dropEvent(QWidget* parent, QDropEvent *event, const QModelIn
|
||||
}
|
||||
if (move_items.size() > 0) {
|
||||
MediaMove* mm = new MediaMove();
|
||||
mm->to = m;
|
||||
mm->to = m.get();
|
||||
mm->items = move_items;
|
||||
olive::UndoStack.push(mm);
|
||||
}
|
||||
|
||||
+13
-58
@@ -322,76 +322,32 @@ void DeleteTransitionCommand::doRedo() {
|
||||
}
|
||||
}
|
||||
|
||||
NewSequenceCommand::NewSequenceCommand(Media *s, Media* iparent) {
|
||||
seq = s;
|
||||
parent = iparent;
|
||||
done = false;
|
||||
|
||||
if (parent == nullptr) parent = olive::project_model.get_root();
|
||||
}
|
||||
|
||||
NewSequenceCommand::~NewSequenceCommand() {
|
||||
if (!done) delete seq;
|
||||
}
|
||||
|
||||
void NewSequenceCommand::doUndo() {
|
||||
olive::project_model.removeChild(parent, seq);
|
||||
|
||||
done = false;
|
||||
}
|
||||
|
||||
void NewSequenceCommand::doRedo() {
|
||||
olive::project_model.appendChild(parent, seq);
|
||||
|
||||
done = true;
|
||||
}
|
||||
|
||||
AddMediaCommand::AddMediaCommand(Media* iitem, Media *iparent) {
|
||||
item = iitem;
|
||||
parent = iparent;
|
||||
done = false;
|
||||
}
|
||||
|
||||
AddMediaCommand::~AddMediaCommand() {
|
||||
if (!done) {
|
||||
delete item;
|
||||
}
|
||||
AddMediaCommand::AddMediaCommand(MediaPtr iitem, Media *iparent) :
|
||||
item(iitem),
|
||||
parent(iparent)
|
||||
{
|
||||
}
|
||||
|
||||
void AddMediaCommand::doUndo() {
|
||||
olive::project_model.removeChild(parent, item);
|
||||
done = false;
|
||||
|
||||
olive::project_model.removeChild(parent, item.get());
|
||||
}
|
||||
|
||||
void AddMediaCommand::doRedo() {
|
||||
olive::project_model.appendChild(parent, item);
|
||||
|
||||
done = true;
|
||||
}
|
||||
|
||||
DeleteMediaCommand::DeleteMediaCommand(Media* i) {
|
||||
item = i;
|
||||
parent = i->parentItem();
|
||||
}
|
||||
|
||||
DeleteMediaCommand::~DeleteMediaCommand() {
|
||||
if (done) {
|
||||
delete item;
|
||||
}
|
||||
DeleteMediaCommand::DeleteMediaCommand(MediaPtr i) :
|
||||
item(i),
|
||||
parent(i->parentItem())
|
||||
{
|
||||
}
|
||||
|
||||
void DeleteMediaCommand::doUndo() {
|
||||
olive::project_model.appendChild(parent, item);
|
||||
|
||||
|
||||
done = false;
|
||||
}
|
||||
|
||||
void DeleteMediaCommand::doRedo() {
|
||||
olive::project_model.removeChild(parent, item);
|
||||
|
||||
done = true;
|
||||
olive::project_model.removeChild(parent, item.get());
|
||||
}
|
||||
|
||||
AddClipCommand::AddClipCommand(Sequence *s, QVector<ClipPtr>& add) {
|
||||
@@ -501,7 +457,7 @@ void CheckboxCommand::doRedo() {
|
||||
}
|
||||
}
|
||||
|
||||
ReplaceMediaCommand::ReplaceMediaCommand(Media* i, QString s) {
|
||||
ReplaceMediaCommand::ReplaceMediaCommand(MediaPtr i, QString s) {
|
||||
item = i;
|
||||
new_filename = s;
|
||||
old_filename = item->to_footage()->url;
|
||||
@@ -514,7 +470,7 @@ void ReplaceMediaCommand::replace(QString& filename) {
|
||||
Sequence* s = all_sequences.at(i)->to_sequence().get();
|
||||
for (int j=0;j<s->clips.size();j++) {
|
||||
ClipPtr c = s->clips.at(j);
|
||||
if (c != nullptr && c->media() == item && c->IsOpen()) {
|
||||
if (c != nullptr && c->media() == item.get() && c->IsOpen()) {
|
||||
c->Close(true);
|
||||
c->replaced = true;
|
||||
}
|
||||
@@ -525,7 +481,7 @@ void ReplaceMediaCommand::replace(QString& filename) {
|
||||
QStringList files;
|
||||
files.append(filename);
|
||||
panel_project->process_file_list(files, false, item, nullptr);
|
||||
PreviewGenerator::AnalyzeMedia(item);
|
||||
PreviewGenerator::AnalyzeMedia(item.get());
|
||||
}
|
||||
|
||||
void ReplaceMediaCommand::doUndo() {
|
||||
@@ -615,7 +571,6 @@ void MediaMove::doUndo() {
|
||||
for (int i=0;i<items.size();i++) {
|
||||
olive::project_model.moveChild(items.at(i), froms.at(i));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void MediaMove::doRedo() {
|
||||
|
||||
+7
-23
@@ -191,40 +191,24 @@ private:
|
||||
long new_out;
|
||||
};
|
||||
|
||||
class NewSequenceCommand : public OliveAction {
|
||||
public:
|
||||
NewSequenceCommand(Media* s, Media* iparent);
|
||||
virtual ~NewSequenceCommand() override;
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
Media* seq;
|
||||
Media* parent;
|
||||
bool done;
|
||||
};
|
||||
|
||||
class AddMediaCommand : public OliveAction {
|
||||
public:
|
||||
AddMediaCommand(Media* iitem, Media* iparent);
|
||||
virtual ~AddMediaCommand() override;
|
||||
AddMediaCommand(MediaPtr iitem, Media* iparent);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
Media* item;
|
||||
MediaPtr item;
|
||||
Media* parent;
|
||||
bool done;
|
||||
};
|
||||
|
||||
class DeleteMediaCommand : public OliveAction {
|
||||
public:
|
||||
DeleteMediaCommand(Media *i);
|
||||
virtual ~DeleteMediaCommand() override;
|
||||
DeleteMediaCommand(MediaPtr i);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
Media* item;
|
||||
MediaPtr item;
|
||||
Media* parent;
|
||||
bool done;
|
||||
};
|
||||
|
||||
class AddClipCommand : public OliveAction {
|
||||
@@ -265,11 +249,11 @@ private:
|
||||
|
||||
class ReplaceMediaCommand : public OliveAction {
|
||||
public:
|
||||
ReplaceMediaCommand(Media*, QString);
|
||||
ReplaceMediaCommand(MediaPtr, QString);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
Media *item;
|
||||
MediaPtr item;
|
||||
QString old_filename;
|
||||
QString new_filename;
|
||||
void replace(QString& filename);
|
||||
@@ -304,7 +288,7 @@ private:
|
||||
class MediaMove : public OliveAction {
|
||||
public:
|
||||
MediaMove();
|
||||
QVector<Media*> items;
|
||||
QVector<MediaPtr> items;
|
||||
Media* to;
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
|
||||
Reference in New Issue
Block a user