summaryrefslogtreecommitdiff
path: root/src
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
parentda66833e0a9f2197680baa6759db11eaf868f39d (diff)
Final tweaks and removal of Film::playlist().
Diffstat (limited to 'src')
-rw-r--r--src/lib/film.cc18
-rw-r--r--src/lib/film.h5
-rw-r--r--src/wx/content_menu.cc8
-rw-r--r--src/wx/timeline.cc18
-rw-r--r--src/wx/timeline.h19
5 files changed, 39 insertions, 29 deletions
diff --git a/src/lib/film.cc b/src/lib/film.cc
index 769ef72b6..f41371892 100644
--- a/src/lib/film.cc
+++ b/src/lib/film.cc
@@ -916,12 +916,6 @@ Film::set_key (dcp::Key key)
signal_changed (KEY);
}
-shared_ptr<Playlist>
-Film::playlist () const
-{
- return _playlist;
-}
-
ContentList
Film::content () const
{
@@ -1226,3 +1220,15 @@ Film::audio_output_names () const
return vector<string> (n.begin(), n.begin() + audio_channels ());
}
+
+void
+Film::repeat_content (ContentList c, int n)
+{
+ _playlist->repeat (c, n);
+}
+
+void
+Film::remove_content (ContentList c)
+{
+ _playlist->remove (c);
+}
diff --git a/src/lib/film.h b/src/lib/film.h
index da1c09d2f..f268bc5b7 100644
--- a/src/lib/film.h
+++ b/src/lib/film.h
@@ -101,8 +101,6 @@ public:
std::vector<CPLSummary> cpls () const;
- boost::shared_ptr<Playlist> playlist () const;
-
int audio_frame_rate () const;
uint64_t required_disk_space () const;
@@ -141,6 +139,8 @@ public:
void make_audio_mapping_default (AudioMapping & mapping) const;
std::vector<std::string> audio_output_names () const;
+ void repeat_content (ContentList, int);
+
/** Identifiers for the parts of our state;
used for signalling changes.
*/
@@ -256,6 +256,7 @@ public:
void examine_and_add_content (boost::shared_ptr<Content>);
void add_content (boost::shared_ptr<Content>);
void remove_content (boost::shared_ptr<Content>);
+ void remove_content (ContentList);
void move_content_earlier (boost::shared_ptr<Content>);
void move_content_later (boost::shared_ptr<Content>);
void set_dcp_content_type (DCPContentType const *);
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;
};