Mercurial > hg > dmlib
diff edtimeline.h @ 393:5137db55f00b
More work towards the editor ..
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 19 Oct 2012 05:50:11 +0300 |
parents | 69ca8a83c25a |
children | 9993873ff655 |
line wrap: on
line diff
--- a/edtimeline.h Fri Oct 19 05:26:34 2012 +0300 +++ b/edtimeline.h Fri Oct 19 05:50:11 2012 +0300 @@ -2,16 +2,22 @@ #define EDTIMELINE_H #include <QWidget> +#include <QCheckBox> +#include <QLabel> #include "dmengine.h" -class TimelineTrackView : public QWidget + +class QTimelineTrackDisplay : public QWidget { Q_OBJECT public: - TimelineTrackView(QWidget *parent = 0); + DMTimelineTrack *track; + + QTimelineTrackDisplay(QWidget *parent = 0); void setTrack(DMTimelineTrack *mtrack); - DMTimelineTrack * getTrack(); + + float getTimeFromCoord(float value); void setTime(const int mtime); void setOffset(const int moffs); @@ -28,9 +34,52 @@ void paintEvent(QPaintEvent *event); private: + bool dragging; + QPoint dragPoint; + int dragOffs; // milliseconds + float scale; int time, offs; - DMTimelineTrack *track; +}; + + +class QTimelineTrackView : public QWidget +{ + Q_OBJECT + +private: + QLabel *infoName, *infoData; + QCheckBox *enabledCheck; + +public: + QTimelineTrackDisplay *track; + + QTimelineTrackView(QWidget *parent = 0); + void setTrack(DMTimelineTrack *mtrack); + +private slots: + void slotEnabledChanged(bool); + +//signals: +// void enabledChanged(bool); +}; + + +class QTimelineView : public QWidget +{ + Q_OBJECT + +private: + DMTimeline *tl; + QList<QTimelineTrackView *> tracks; + +public: + QTimelineView(QWidget *parent = 0); + void setTimeline(DMTimeline *mtl); + + void setTime(const int mtime); + void setOffset(const int moffs); + void setScale(const float mscale); }; #endif