created new sequence dialog

This commit is contained in:
itsmattkc
2019-07-21 18:21:40 -07:00
parent 9cfed140b3
commit f8830beac7
37 changed files with 911 additions and 101 deletions
+26
View File
@@ -132,6 +132,32 @@ bool Item::CanHaveChildren() const
return false;
}
bool Item::ChildExistsWithName(const QString &name)
{
return ChildExistsWithNameInternal(name, this);
}
bool Item::ChildExistsWithNameInternal(const QString &name, Item *folder)
{
// Loop through all children
for (int i=0;i<folder->child_count();i++) {
Item* child = folder->child(i);
// If this child has the same name, return true
if (child->name() == name) {
return true;
} else if (child->CanHaveChildren()) {
// If the child has children, run function recursively on this item
if (ChildExistsWithNameInternal(name, child)) {
// If it returns true, we've found a child so we can return now
return true;
}
}
}
return false;
}
void Item::Lock()
{
mutex_.lock();
+4
View File
@@ -98,10 +98,14 @@ public:
virtual bool CanHaveChildren() const;
bool ChildExistsWithName(const QString& name);
void Lock();
void Unlock();
private:
bool ChildExistsWithNameInternal(const QString& name, Item* folder);
QList<ItemPtr> children_;
Item* parent_;
+27 -12
View File
@@ -20,6 +20,10 @@
#include "sequence.h"
extern "C" {
#include <libavcodec/avcodec.h>
}
#include "ui/icons/icons.h"
Sequence::Sequence()
@@ -47,9 +51,9 @@ const int &Sequence::video_height() const
return video_height_;
}
void Sequence::set_video_height(const int &video_height)
void Sequence::set_video_height(const int &height)
{
video_height_ = video_height;
video_height_ = height;
}
const rational &Sequence::video_time_base()
@@ -62,16 +66,6 @@ void Sequence::set_video_time_base(const rational &time_base)
video_time_base_ = time_base;
}
const int &Sequence::audio_sampling_rate()
{
return audio_sampling_rate_;
}
void Sequence::set_audio_sampling_rate(const int &sample_rate)
{
audio_sampling_rate_ = sample_rate;
}
const rational &Sequence::audio_time_base()
{
return audio_time_base_;
@@ -81,3 +75,24 @@ void Sequence::set_audio_time_base(const rational &time_base)
{
audio_time_base_ = time_base;
}
const uint64_t &Sequence::audio_channel_layout()
{
return audio_channel_layout_;
}
void Sequence::set_audio_channel_layout(const uint64_t &channel_layout)
{
audio_channel_layout_ = channel_layout;
}
void Sequence::SetDefaultParameters()
{
// FIXME: Make these configurable
set_video_width(1920);
set_video_height(1080);
set_video_time_base(rational(1001, 30000));
set_audio_time_base(rational(1, 48000));
set_audio_channel_layout(AV_CH_LAYOUT_STEREO);
}
+9 -5
View File
@@ -44,26 +44,30 @@ public:
void set_video_width(const int& width);
const int& video_height() const;
void set_video_height(const int& video_height);
void set_video_height(const int& height);
const rational& video_time_base();
void set_video_time_base(const rational& time_base);
/* AUDIO GETTER/SETTER FUNCTIONS */
const int& audio_sampling_rate();
void set_audio_sampling_rate(const int& sample_rate);
const rational& audio_time_base();
void set_audio_time_base(const rational& time_base);
const uint64_t& audio_channel_layout();
void set_audio_channel_layout(const uint64_t& channel_layout);
void SetDefaultParameters();
private:
int video_width_;
int video_height_;
rational video_time_base_;
int audio_sampling_rate_;
rational audio_time_base_;
uint64_t audio_channel_layout_;
};
using SequencePtr = std::shared_ptr<Sequence>;
#endif // SEQUENCE_H