summaryrefslogtreecommitdiff
path: root/src/wx
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-06-17 16:21:01 +0100
committerCarl Hetherington <cth@carlh.net>2015-06-17 16:21:01 +0100
commitb16fa5f0de631821a7acc994645a291bc7aa90c9 (patch)
treee57b94391c640617faef6c4a727571cce7e73fa0 /src/wx
parentda66833e0a9f2197680baa6759db11eaf868f39d (diff)
Final tweaks and removal of Film::playlist().
Diffstat (limited to 'src/wx')
-rw-r--r--src/wx/content_menu.cc8
-rw-r--r--src/wx/timeline.cc18
-rw-r--r--src/wx/timeline.h19
3 files changed, 24 insertions, 21 deletions
diff --git a/src/wx/content_menu.cc b/src/wx/content_menu.cc
index daadab7d7..2e9fe43fe 100644
--- a/src/wx/content_menu.cc
+++ b/src/wx/content_menu.cc
@@ -122,12 +122,12 @@ ContentMenu::repeat ()
return;
}
- shared_ptr<const Film> film = _film.lock ();
+ shared_ptr<Film> film = _film.lock ();
if (!film) {
return;
}
- film->playlist()->repeat (_content, d->number ());
+ film->repeat_content (_content, d->number ());
d->Destroy ();
_content.clear ();
@@ -170,7 +170,7 @@ ContentMenu::remove ()
return;
}
- shared_ptr<const Film> film = _film.lock ();
+ shared_ptr<Film> film = _film.lock ();
if (!film) {
return;
}
@@ -210,7 +210,7 @@ ContentMenu::remove ()
}
if (!handled) {
- film->playlist()->remove (_content);
+ film->remove_content (_content);
}
_content.clear ();
diff --git a/src/wx/timeline.cc b/src/wx/timeline.cc
index b0197ad3d..3929cf1c2 100644
--- a/src/wx/timeline.cc
+++ b/src/wx/timeline.cc
@@ -64,12 +64,12 @@ Timeline::Timeline (wxWindow* parent, ContentPanel* cp, shared_ptr<Film> film)
Bind (wxEVT_MOTION, boost::bind (&Timeline::mouse_moved, this, _1));
Bind (wxEVT_SIZE, boost::bind (&Timeline::resized, this));
- playlist_changed ();
+ film_changed (Film::CONTENT);
SetMinSize (wxSize (640, tracks() * track_height() + 96));
- _playlist_changed_connection = film->playlist()->Changed.connect (bind (&Timeline::playlist_changed, this));
- _playlist_content_changed_connection = film->playlist()->ContentChanged.connect (bind (&Timeline::playlist_content_changed, this, _2));
+ _film_changed_connection = film->Changed.connect (bind (&Timeline::film_changed, this, _1));
+ _film_content_changed_connection = film->ContentChanged.connect (bind (&Timeline::film_content_changed, this, _2));
}
void
@@ -90,10 +90,12 @@ Timeline::paint ()
}
void
-Timeline::playlist_changed ()
+Timeline::film_changed (Film::Property p)
{
- ensure_ui_thread ();
- recreate_views ();
+ if (p == Film::CONTENT) {
+ ensure_ui_thread ();
+ recreate_views ();
+ }
}
void
@@ -107,7 +109,7 @@ Timeline::recreate_views ()
_views.clear ();
_views.push_back (_time_axis_view);
- ContentList content = fl->playlist()->content ();
+ ContentList content = fl->content ();
for (ContentList::iterator i = content.begin(); i != content.end(); ++i) {
if (dynamic_pointer_cast<VideoContent> (*i)) {
@@ -131,7 +133,7 @@ Timeline::recreate_views ()
}
void
-Timeline::playlist_content_changed (int property)
+Timeline::film_content_changed (int property)
{
ensure_ui_thread ();
diff --git a/src/wx/timeline.h b/src/wx/timeline.h
index cab0ea0e0..2afd0d194 100644
--- a/src/wx/timeline.h
+++ b/src/wx/timeline.h
@@ -17,14 +17,15 @@
*/
+#include "content_menu.h"
+#include "timeline_content_view.h"
+#include "lib/util.h"
+#include "lib/rect.h"
+#include "lib/film.h"
+#include <wx/wx.h>
#include <boost/shared_ptr.hpp>
#include <boost/weak_ptr.hpp>
#include <boost/signals2.hpp>
-#include <wx/wx.h>
-#include "lib/util.h"
-#include "lib/rect.h"
-#include "content_menu.h"
-#include "timeline_content_view.h"
class Film;
class ContentPanel;
@@ -78,8 +79,8 @@ private:
void left_up (wxMouseEvent &);
void right_down (wxMouseEvent &);
void mouse_moved (wxMouseEvent &);
- void playlist_changed ();
- void playlist_content_changed (int);
+ void film_changed (Film::Property);
+ void film_content_changed (int);
void resized ();
void assign_tracks ();
void set_position_from_event (wxMouseEvent &);
@@ -105,6 +106,6 @@ private:
ContentMenu _menu;
bool _snap;
- boost::signals2::scoped_connection _playlist_changed_connection;
- boost::signals2::scoped_connection _playlist_content_changed_connection;
+ boost::signals2::scoped_connection _film_changed_connection;
+ boost::signals2::scoped_connection _film_content_changed_connection;
};