serialize rationals correctly and move block name to a node input

Since rationals aren't a known Qt format, the QVariant container can't
automatically convert them to and from strings (for XML serialization). We have
to hijack these functions and do the conversion manually for those types.

Also moved the block name type to a node input, which means it's serialized
and copied by default (I'm not sure why it wasn't already like this).
This commit is contained in:
itsmattkc
2020-01-14 00:59:49 +11:00
parent 0ea98be443
commit 16904c976f
10 changed files with 50 additions and 34 deletions
+2 -5
View File
@@ -73,7 +73,7 @@ public:
bool is_still() const;
bool is_reversed() const;
const QString& block_name() const;
QString block_name() const;
void set_block_name(const QString& name);
static void Link(Block* a, Block* b);
@@ -108,12 +108,11 @@ protected:
rational MediaToSequenceTime(const rational& media_time) const;
static void CopyParameters(const Block *source, Block* dest);
Block* previous_;
Block* next_;
private:
NodeInput* name_input_;
NodeInput* length_input_;
NodeInput* media_in_input_;
NodeInput* speed_input_;
@@ -121,8 +120,6 @@ private:
rational in_point_;
rational out_point_;
QString block_name_;
QVector<Block*> linked_clips_;
private slots: