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:
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user