moved timeline tracktypes into timelinecommon.h
This commit is contained in:
@@ -28,7 +28,7 @@
|
||||
#include "node/graph.h"
|
||||
|
||||
TrackOutput::TrackOutput() :
|
||||
track_type_(kTrackTypeNone),
|
||||
track_type_(Timeline::kTrackTypeNone),
|
||||
block_invalidate_cache_stack_(0),
|
||||
index_(-1),
|
||||
locked_(false)
|
||||
@@ -48,12 +48,12 @@ TrackOutput::TrackOutput() :
|
||||
track_height_ = GetDefaultTrackHeight();
|
||||
}
|
||||
|
||||
void TrackOutput::set_track_type(const TrackType &track_type)
|
||||
void TrackOutput::set_track_type(const Timeline::TrackType &track_type)
|
||||
{
|
||||
track_type_ = track_type;
|
||||
}
|
||||
|
||||
const TrackType& TrackOutput::track_type()
|
||||
const Timeline::TrackType& TrackOutput::track_type()
|
||||
{
|
||||
return track_type_;
|
||||
}
|
||||
@@ -343,17 +343,17 @@ int TrackOutput::GetTrackHeightMinimum()
|
||||
return qApp->fontMetrics().height() * 3 / 2;
|
||||
}
|
||||
|
||||
QString TrackOutput::GetDefaultTrackName(TrackType type, int index)
|
||||
QString TrackOutput::GetDefaultTrackName(Timeline::TrackType type, int index)
|
||||
{
|
||||
// Starts tracks at 1 rather than 0
|
||||
int user_friendly_index = index+1;
|
||||
|
||||
switch (type) {
|
||||
case kTrackTypeVideo: return tr("Video %1").arg(user_friendly_index);
|
||||
case kTrackTypeAudio: return tr("Audio %1").arg(user_friendly_index);
|
||||
case kTrackTypeSubtitle: return tr("Subtitle %1").arg(user_friendly_index);
|
||||
case kTrackTypeNone:
|
||||
case kTrackTypeCount:
|
||||
case Timeline::kTrackTypeVideo: return tr("Video %1").arg(user_friendly_index);
|
||||
case Timeline::kTrackTypeAudio: return tr("Audio %1").arg(user_friendly_index);
|
||||
case Timeline::kTrackTypeSubtitle: return tr("Subtitle %1").arg(user_friendly_index);
|
||||
case Timeline::kTrackTypeNone:
|
||||
case Timeline::kTrackTypeCount:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
#ifndef TRACKOUTPUT_H
|
||||
#define TRACKOUTPUT_H
|
||||
|
||||
#include "common/timelinecommon.h"
|
||||
#include "node/block/block.h"
|
||||
#include "timeline/tracktypes.h"
|
||||
|
||||
/**
|
||||
* @brief A time traversal Node for sorting through one channel/track of Blocks
|
||||
@@ -33,8 +33,8 @@ class TrackOutput : public Block
|
||||
public:
|
||||
TrackOutput();
|
||||
|
||||
const TrackType& track_type();
|
||||
void set_track_type(const TrackType& track_type);
|
||||
const Timeline::TrackType& track_type();
|
||||
void set_track_type(const Timeline::TrackType& track_type);
|
||||
|
||||
virtual Type type() const override;
|
||||
|
||||
@@ -126,7 +126,7 @@ public:
|
||||
|
||||
static int GetTrackHeightMinimum();
|
||||
|
||||
static QString GetDefaultTrackName(TrackType type, int index);
|
||||
static QString GetDefaultTrackName(Timeline::TrackType type, int index);
|
||||
|
||||
bool IsMuted() const;
|
||||
|
||||
@@ -173,7 +173,7 @@ private:
|
||||
|
||||
NodeInput* muted_input_;
|
||||
|
||||
TrackType track_type_;
|
||||
Timeline::TrackType track_type_;
|
||||
|
||||
rational track_length_;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "node/factory.h"
|
||||
#include "node/output/viewer/viewer.h"
|
||||
|
||||
TrackList::TrackList(ViewerOutput *parent, const enum TrackType &type, NodeInputArray *track_input) :
|
||||
TrackList::TrackList(ViewerOutput *parent, const Timeline::TrackType &type, NodeInputArray *track_input) :
|
||||
QObject(parent),
|
||||
track_input_(track_input),
|
||||
type_(type)
|
||||
@@ -33,7 +33,7 @@ TrackList::TrackList(ViewerOutput *parent, const enum TrackType &type, NodeInput
|
||||
connect(track_input, SIGNAL(SizeChanged(int)), this, SLOT(TrackListSizeChanged(int)));
|
||||
}
|
||||
|
||||
const TrackType &TrackList::type() const
|
||||
const Timeline::TrackType &TrackList::type() const
|
||||
{
|
||||
return type_;
|
||||
}
|
||||
@@ -79,11 +79,6 @@ const rational &TrackList::TrackLength() const
|
||||
return total_length_;
|
||||
}
|
||||
|
||||
const enum TrackType &TrackList::TrackType() const
|
||||
{
|
||||
return type_;
|
||||
}
|
||||
|
||||
int TrackList::TrackCount() const
|
||||
{
|
||||
return track_cache_.size();
|
||||
@@ -195,7 +190,7 @@ void TrackList::TrackDisconnected(NodeEdgePtr edge)
|
||||
emit TrackRemoved(track);
|
||||
|
||||
track->SetIndex(-1);
|
||||
track->set_track_type(kTrackTypeNone);
|
||||
track->set_track_type(Timeline::kTrackTypeNone);
|
||||
|
||||
disconnect(track, SIGNAL(BlockAdded(Block*)), this, SLOT(TrackAddedBlock(Block*)));
|
||||
disconnect(track, SIGNAL(BlockRemoved(Block*)), this, SLOT(TrackRemovedBlock(Block*)));
|
||||
|
||||
@@ -23,18 +23,18 @@
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include "common/timelinecommon.h"
|
||||
#include "node/graph.h"
|
||||
#include "node/output/track/track.h"
|
||||
#include "timeline/tracktypes.h"
|
||||
|
||||
class ViewerOutput;
|
||||
|
||||
class TrackList : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
TrackList(ViewerOutput *parent, const enum TrackType& type, NodeInputArray* track_input);
|
||||
TrackList(ViewerOutput *parent, const Timeline::TrackType& type, NodeInputArray* track_input);
|
||||
|
||||
const enum TrackType& type() const;
|
||||
const Timeline::TrackType& type() const;
|
||||
|
||||
const QVector<TrackOutput*>& Tracks() const;
|
||||
|
||||
@@ -46,8 +46,6 @@ public:
|
||||
|
||||
const rational& TrackLength() const;
|
||||
|
||||
const enum TrackType& TrackType() const;
|
||||
|
||||
int TrackCount() const;
|
||||
|
||||
signals:
|
||||
@@ -77,7 +75,7 @@ private:
|
||||
|
||||
rational total_length_;
|
||||
|
||||
enum TrackType type_;
|
||||
enum Timeline::TrackType type_;
|
||||
|
||||
private slots:
|
||||
/**
|
||||
|
||||
@@ -32,16 +32,16 @@ ViewerOutput::ViewerOutput()
|
||||
AddInput(length_input_);
|
||||
|
||||
// Create TrackList instances
|
||||
track_inputs_.resize(kTrackTypeCount);
|
||||
track_lists_.resize(kTrackTypeCount);
|
||||
track_inputs_.resize(Timeline::kTrackTypeCount);
|
||||
track_lists_.resize(Timeline::kTrackTypeCount);
|
||||
|
||||
for (int i=0;i<kTrackTypeCount;i++) {
|
||||
for (int i=0;i<Timeline::kTrackTypeCount;i++) {
|
||||
// Create track input
|
||||
NodeInputArray* track_input = new NodeInputArray(QStringLiteral("track_in_%1").arg(i), NodeParam::kAny);
|
||||
AddInput(track_input);
|
||||
track_inputs_.replace(i, track_input);
|
||||
|
||||
TrackList* list = new TrackList(this, static_cast<TrackType>(i), track_input);
|
||||
TrackList* list = new TrackList(this, static_cast<Timeline::TrackType>(i), track_input);
|
||||
track_lists_.replace(i, list);
|
||||
connect(list, SIGNAL(TrackListChanged()), this, SLOT(UpdateTrackCache()));
|
||||
connect(list, SIGNAL(LengthChanged(const rational &)), this, SLOT(UpdateLength(const rational &)));
|
||||
@@ -213,18 +213,18 @@ void ViewerOutput::Retranslate()
|
||||
for (int i=0;i<track_inputs_.size();i++) {
|
||||
QString input_name;
|
||||
|
||||
switch (static_cast<TrackType>(i)) {
|
||||
case kTrackTypeVideo:
|
||||
switch (static_cast<Timeline::TrackType>(i)) {
|
||||
case Timeline::kTrackTypeVideo:
|
||||
input_name = tr("Video Tracks");
|
||||
break;
|
||||
case kTrackTypeAudio:
|
||||
case Timeline::kTrackTypeAudio:
|
||||
input_name = tr("Audio Tracks");
|
||||
break;
|
||||
case kTrackTypeSubtitle:
|
||||
case Timeline::kTrackTypeSubtitle:
|
||||
input_name = tr("Subtitle Tracks");
|
||||
break;
|
||||
case kTrackTypeNone:
|
||||
case kTrackTypeCount:
|
||||
case Timeline::kTrackTypeNone:
|
||||
case Timeline::kTrackTypeCount:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -238,25 +238,25 @@ const QVector<TrackOutput *>& ViewerOutput::Tracks() const
|
||||
return track_cache_;
|
||||
}
|
||||
|
||||
NodeInput *ViewerOutput::track_input(TrackType type) const
|
||||
NodeInput *ViewerOutput::track_input(Timeline::TrackType type) const
|
||||
{
|
||||
return track_inputs_.at(type);
|
||||
}
|
||||
|
||||
TrackList *ViewerOutput::track_list(TrackType type) const
|
||||
TrackList *ViewerOutput::track_list(Timeline::TrackType type) const
|
||||
{
|
||||
return track_lists_.at(type);
|
||||
}
|
||||
|
||||
void ViewerOutput::TrackListAddedBlock(Block *block, int index)
|
||||
{
|
||||
TrackType type = static_cast<TrackList*>(sender())->TrackType();
|
||||
Timeline::TrackType type = static_cast<TrackList*>(sender())->type();
|
||||
emit BlockAdded(block, TrackReference(type, index));
|
||||
}
|
||||
|
||||
void ViewerOutput::TrackListAddedTrack(TrackOutput *track)
|
||||
{
|
||||
TrackType type = static_cast<TrackList*>(sender())->TrackType();
|
||||
Timeline::TrackType type = static_cast<TrackList*>(sender())->type();
|
||||
emit TrackAdded(track, type);
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
#include "render/videoparams.h"
|
||||
#include "render/audioparams.h"
|
||||
#include "timeline/trackreference.h"
|
||||
#include "timeline/tracktypes.h"
|
||||
|
||||
/**
|
||||
* @brief A bridge between a node system and a ViewerPanel
|
||||
@@ -69,9 +68,9 @@ public:
|
||||
|
||||
const QVector<TrackOutput *> &Tracks() const;
|
||||
|
||||
NodeInput* track_input(TrackType type) const;
|
||||
NodeInput* track_input(Timeline::TrackType type) const;
|
||||
|
||||
TrackList* track_list(TrackType type) const;
|
||||
TrackList* track_list(Timeline::TrackType type) const;
|
||||
|
||||
virtual void Retranslate() override;
|
||||
|
||||
@@ -96,10 +95,10 @@ signals:
|
||||
void BlockAdded(Block* block, TrackReference track);
|
||||
void BlockRemoved(Block* block);
|
||||
|
||||
void TrackAdded(TrackOutput* track, TrackType type);
|
||||
void TrackAdded(TrackOutput* track, Timeline::TrackType type);
|
||||
void TrackRemoved(TrackOutput* track);
|
||||
|
||||
void TrackHeightChanged(TrackType type, int index, int height);
|
||||
void TrackHeightChanged(Timeline::TrackType type, int index, int height);
|
||||
|
||||
private:
|
||||
QUuid uuid_;
|
||||
|
||||
Reference in New Issue
Block a user