don't use shared ptrs for project items

This commit is contained in:
itsmattkc
2020-12-16 10:28:43 +11:00
parent 1cd07bc1f7
commit e12013e2fb
31 changed files with 209 additions and 255 deletions
+7 -7
View File
@@ -161,7 +161,7 @@ ColorManager *Project::color_manager()
return &color_manager_;
}
QList<ItemPtr> Project::get_items_of_type(Item::Type type) const
QVector<Item *> Project::get_items_of_type(Item::Type type) const
{
return root_.get_children_of_type(type, true);
}
@@ -204,10 +204,10 @@ const QString &Project::cache_path(bool default_if_empty) const
void Project::ColorConfigChanged()
{
QList<ItemPtr> footage = this->get_items_of_type(Item::kFootage);
QVector<Item*> footage = this->get_items_of_type(Item::kFootage);
foreach (ItemPtr item, footage) {
foreach (StreamPtr s, std::static_pointer_cast<Footage>(item)->streams()) {
foreach (Item* item, footage) {
foreach (StreamPtr s, static_cast<Footage*>(item)->streams()) {
if (s->type() == Stream::kVideo) {
std::static_pointer_cast<VideoStream>(s)->ColorConfigChanged();
}
@@ -217,10 +217,10 @@ void Project::ColorConfigChanged()
void Project::DefaultColorSpaceChanged()
{
QList<ItemPtr> footage = this->get_items_of_type(Item::kFootage);
QVector<Item*> footage = this->get_items_of_type(Item::kFootage);
foreach (ItemPtr item, footage) {
foreach (StreamPtr s, std::static_pointer_cast<Footage>(item)->streams()) {
foreach (Item* item, footage) {
foreach (StreamPtr s, static_cast<Footage*>(item)->streams()) {
if (s->type() == Stream::kVideo) {
std::static_pointer_cast<VideoStream>(s)->DefaultColorSpaceChanged();
}