: View (tl)
, _y (y)
{}
+
+ Rect bbox () const
+ {
+ return Rect (0, _y - 4, _timeline.width(), 24);
+ }
+
+ void set_y (int y)
+ {
+ _y = y;
+ force_redraw ();
+ }
+
+private:
void do_paint (wxGraphicsContext* gc)
{
}
}
- Rect bbox () const
- {
- return Rect (0, _y - 4, _timeline.width(), 24);
- }
-
private:
int _y;
};
: wxPanel (parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE)
, _film_editor (ed)
, _film (film)
+ , _time_axis_view (new TimeAxisView (*this, 32))
, _tracks (0)
, _pixels_per_time_unit (0)
, _left_down (false)
SetMinSize (wxSize (640, tracks() * track_height() + 96));
_playlist_connection = film->playlist()->Changed.connect (bind (&Timeline::playlist_changed, this));
+
+ _views.push_back (_time_axis_view);
}
void
}
assign_tracks ();
-
- _views.push_back (shared_ptr<View> (new TimeAxisView (*this, tracks() * track_height() + 32)));
-
Refresh ();
}
shared_ptr<ContentView> cv = dynamic_pointer_cast<ContentView> (*i);
if (cv) {
cv->set_track (0);
+ _tracks = 1;
}
}
acv->set_track (t);
_tracks = max (_tracks, t + 1);
}
+
+ _time_axis_view->set_y (tracks() * track_height() + 32);
}
int
class View;
class ContentView;
class FilmEditor;
+class TimeAxisView;
class Timeline : public wxPanel
{
}
int track_height () const {
- return 64;
+ return 48;
}
double pixels_per_time_unit () const {
FilmEditor* _film_editor;
boost::weak_ptr<Film> _film;
std::list<boost::shared_ptr<View> > _views;
+ boost::shared_ptr<TimeAxisView> _time_axis_view;
int _tracks;
double _pixels_per_time_unit;
bool _left_down;