merged timeline and viewer nodes together
This commit is contained in:
@@ -172,7 +172,7 @@ void TimelineWidget::SetTime(int64_t timestamp)
|
||||
UpdateInternalTime(timestamp);
|
||||
}
|
||||
|
||||
void TimelineWidget::ConnectTimelineNode(TimelineOutput *node)
|
||||
void TimelineWidget::ConnectTimelineNode(ViewerOutput *node)
|
||||
{
|
||||
if (timeline_node_ != nullptr) {
|
||||
disconnect(timeline_node_, SIGNAL(LengthChanged(const rational&)), this, SLOT(UpdateTimelineLength(const rational&)));
|
||||
@@ -204,7 +204,7 @@ void TimelineWidget::ConnectTimelineNode(TimelineOutput *node)
|
||||
connect(timeline_node_, SIGNAL(TimebaseChanged(const rational&)), this, SLOT(SetTimebase(const rational&)));
|
||||
connect(timeline_node_, SIGNAL(TrackHeightChanged(TrackType, int, int)), this, SLOT(TrackHeightChanged(TrackType, int, int)));
|
||||
|
||||
SetTimebase(timeline_node_->timebase());
|
||||
SetTimebase(timeline_node_->video_params().time_base());
|
||||
|
||||
for (int i=0;i<views_.size();i++) {
|
||||
TrackType track_type = static_cast<TrackType>(i);
|
||||
@@ -214,7 +214,7 @@ void TimelineWidget::ConnectTimelineNode(TimelineOutput *node)
|
||||
|
||||
track_view->ConnectTrackList(track_list);
|
||||
view->ConnectTrackList(track_list);
|
||||
view->SetEndTime(timeline_node_->timeline_length());
|
||||
view->SetEndTime(timeline_node_->Length());
|
||||
|
||||
// Defer to the track to make all the block UI items necessary
|
||||
foreach (TrackOutput* track, timeline_node_->track_list(track_type)->Tracks()) {
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "core.h"
|
||||
#include "timelineandtrackview.h"
|
||||
#include "node/output/viewer/viewer.h"
|
||||
#include "widget/slider/timeslider.h"
|
||||
#include "widget/timelinewidget/timelinescaledobject.h"
|
||||
#include "widget/timeruler/timeruler.h"
|
||||
@@ -26,7 +27,7 @@ public:
|
||||
|
||||
void SetTime(int64_t timestamp);
|
||||
|
||||
void ConnectTimelineNode(TimelineOutput* node);
|
||||
void ConnectTimelineNode(ViewerOutput *node);
|
||||
|
||||
void DisconnectTimelineNode();
|
||||
|
||||
@@ -350,7 +351,7 @@ private:
|
||||
|
||||
TimeRuler* ruler_;
|
||||
|
||||
TimelineOutput* timeline_node_;
|
||||
ViewerOutput* timeline_node_;
|
||||
|
||||
int64_t playhead_;
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <QScrollArea>
|
||||
#include <QSplitter>
|
||||
|
||||
#include "node/output/timeline/tracklist.h"
|
||||
#include "node/output/track/tracklist.h"
|
||||
#include "trackviewitem.h"
|
||||
#include "trackviewsplitter.h"
|
||||
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
|
||||
#include "node/block/block.h"
|
||||
#include "node/block/gap/gap.h"
|
||||
#include "node/output/timeline/timeline.h"
|
||||
#include "node/output/track/track.h"
|
||||
#include "node/output/track/tracklist.h"
|
||||
|
||||
class BlockResizeCommand : public QUndoCommand {
|
||||
public:
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#include <QDropEvent>
|
||||
|
||||
#include "node/block/clip/clip.h"
|
||||
#include "node/output/timeline/timeline.h"
|
||||
#include "timelineviewbase.h"
|
||||
#include "timelineviewblockitem.h"
|
||||
#include "timelineviewmouseevent.h"
|
||||
|
||||
@@ -198,11 +198,11 @@ void TimeRuler::paintEvent(QPaintEvent *)
|
||||
|
||||
// Calculate line dimensions
|
||||
QFontMetrics fm = p.fontMetrics();
|
||||
int line_bottom = height();
|
||||
int long_height = fm.height();
|
||||
int short_height = long_height/2;
|
||||
int long_y = height() - long_height;
|
||||
int short_y = height() - short_height;
|
||||
int line_bottom = height();
|
||||
int long_y = line_bottom - long_height;
|
||||
int short_y = line_bottom - short_height;
|
||||
|
||||
// Draw long lines
|
||||
int last_long_unit = -1;
|
||||
@@ -272,7 +272,7 @@ void TimeRuler::paintEvent(QPaintEvent *)
|
||||
if (playhead_pos + playhead_width_ >= 0 && playhead_pos - playhead_width_ < width()) {
|
||||
p.setPen(Qt::NoPen);
|
||||
p.setBrush(style_.PlayheadColor());
|
||||
DrawPlayhead(&p, playhead_pos, height());
|
||||
DrawPlayhead(&p, playhead_pos, line_bottom);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -307,6 +307,11 @@ void TimeRuler::DrawPlayhead(QPainter *p, int x, int y)
|
||||
p->drawPolygon(points, 6);
|
||||
}
|
||||
|
||||
int TimeRuler::CacheStatusHeight() const
|
||||
{
|
||||
return fontMetrics().height() / 4;
|
||||
}
|
||||
|
||||
double TimeRuler::ScreenToUnitFloat(int screen)
|
||||
{
|
||||
return (screen + scroll_) / scale_ / timebase_dbl_;
|
||||
|
||||
@@ -64,17 +64,10 @@ signals:
|
||||
void TimeChanged(int64_t);
|
||||
|
||||
private:
|
||||
enum Component {
|
||||
kNone,
|
||||
kDay,
|
||||
kHour,
|
||||
kMinute,
|
||||
kSecond,
|
||||
kFrame
|
||||
};
|
||||
|
||||
void DrawPlayhead(QPainter* p, int x, int y);
|
||||
|
||||
int CacheStatusHeight() const;
|
||||
|
||||
double ScreenToUnitFloat(int screen);
|
||||
|
||||
int64_t ScreenToUnit(int screen);
|
||||
|
||||
Reference in New Issue
Block a user