updated timeline tools to take custom mouse events
This commit is contained in:
@@ -39,7 +39,7 @@ TimelineOutput::TimelineOutput()
|
||||
AddParameter(track_input);
|
||||
track_inputs_[i] = track_input;
|
||||
|
||||
TrackList* list = new TrackList(this, track_input);
|
||||
TrackList* list = new TrackList(this, static_cast<TrackType>(i), track_input);
|
||||
track_lists_[i] = list;
|
||||
connect(list, SIGNAL(TrackListChanged()), this, SLOT(UpdateTrackCache()));
|
||||
connect(list, SIGNAL(LengthChanged(const rational &)), this, SLOT(UpdateLength(const rational &)));
|
||||
@@ -141,12 +141,12 @@ void TimelineOutput::SetTimebase(const rational &timebase)
|
||||
}
|
||||
}
|
||||
|
||||
NodeInput *TimelineOutput::track_input(TimelineOutput::TrackType type)
|
||||
NodeInput *TimelineOutput::track_input(TrackType type)
|
||||
{
|
||||
return track_inputs_.at(type);
|
||||
}
|
||||
|
||||
TrackList *TimelineOutput::track_list(TimelineOutput::TrackType type)
|
||||
TrackList *TimelineOutput::track_list(TrackType type)
|
||||
{
|
||||
return track_lists_.at(type);
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "node/block/block.h"
|
||||
#include "node/output/track/track.h"
|
||||
#include "tracklist.h"
|
||||
#include "tracktypes.h"
|
||||
|
||||
/**
|
||||
* @brief Node that represents the end of the Timeline as well as a time traversal Node
|
||||
@@ -33,14 +34,6 @@ class TimelineOutput : public Node
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum TrackType {
|
||||
kTrackTypeNone = -1,
|
||||
kTrackTypeVideo,
|
||||
kTrackTypeAudio,
|
||||
kTrackTypeSubtitle,
|
||||
kTrackTypeCount
|
||||
};
|
||||
|
||||
TimelineOutput();
|
||||
|
||||
virtual QString Name() override;
|
||||
|
||||
@@ -23,9 +23,10 @@
|
||||
#include "node/blend/alphaover/alphaover.h"
|
||||
#include "timeline.h"
|
||||
|
||||
TrackList::TrackList(TimelineOutput* parent, NodeInput *track_input) :
|
||||
TrackList::TrackList(TimelineOutput* parent, const enum TrackType &type, NodeInput *track_input) :
|
||||
QObject(parent),
|
||||
track_input_(track_input)
|
||||
track_input_(track_input),
|
||||
type_(type)
|
||||
{
|
||||
connect(parent, SIGNAL(EdgeAdded(NodeEdgePtr)), this, SLOT(TrackConnectionAdded(NodeEdgePtr)));
|
||||
connect(parent, SIGNAL(EdgeRemoved(NodeEdgePtr)), this, SLOT(TrackConnectionRemoved(NodeEdgePtr)));
|
||||
@@ -125,6 +126,11 @@ const rational &TrackList::TrackLength()
|
||||
return total_length_;
|
||||
}
|
||||
|
||||
const enum TrackType &TrackList::TrackType()
|
||||
{
|
||||
return type_;
|
||||
}
|
||||
|
||||
void TrackList::AddTrack()
|
||||
{
|
||||
TrackOutput* track = new TrackOutput();
|
||||
|
||||
@@ -25,13 +25,14 @@
|
||||
|
||||
#include "node/graph.h"
|
||||
#include "node/output/track/track.h"
|
||||
#include "tracktypes.h"
|
||||
|
||||
class TimelineOutput;
|
||||
|
||||
class TrackList : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
TrackList(TimelineOutput *parent, NodeInput* track_input);
|
||||
TrackList(TimelineOutput *parent, const enum TrackType& type, NodeInput* track_input);
|
||||
|
||||
TrackOutput* attached_track();
|
||||
|
||||
@@ -53,6 +54,8 @@ public:
|
||||
|
||||
const rational& TrackLength();
|
||||
|
||||
const enum TrackType& TrackType();
|
||||
|
||||
public slots:/**
|
||||
* @brief Slot for when the track connection is added
|
||||
*/
|
||||
@@ -114,6 +117,8 @@ private:
|
||||
|
||||
rational total_length_;
|
||||
|
||||
enum TrackType type_;
|
||||
|
||||
private slots:
|
||||
void UpdateTotalLength();
|
||||
};
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
#ifndef TRACKTYPES_H
|
||||
#define TRACKTYPES_H
|
||||
|
||||
enum TrackType {
|
||||
kTrackTypeNone = -1,
|
||||
kTrackTypeVideo,
|
||||
kTrackTypeAudio,
|
||||
kTrackTypeSubtitle,
|
||||
kTrackTypeCount
|
||||
};
|
||||
|
||||
#endif // TRACKTYPES_H
|
||||
Reference in New Issue
Block a user