projects
/
dcpomatic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
da66833
)
Final tweaks and removal of Film::playlist().
author
Carl Hetherington
<cth@carlh.net>
Wed, 17 Jun 2015 15:21:01 +0000
(16:21 +0100)
committer
Carl Hetherington
<cth@carlh.net>
Wed, 17 Jun 2015 15:21:01 +0000
(16:21 +0100)
src/lib/film.cc
patch
|
blob
|
history
src/lib/film.h
patch
|
blob
|
history
src/wx/content_menu.cc
patch
|
blob
|
history
src/wx/timeline.cc
patch
|
blob
|
history
src/wx/timeline.h
patch
|
blob
|
history
test/frame_rate_test.cc
patch
|
blob
|
history
diff --git
a/src/lib/film.cc
b/src/lib/film.cc
index 769ef72b6f56b2337469cde50c61a86d439fd170..f41371892963b1d22df478be6d2a1f15786d2d99 100644
(file)
--- a/
src/lib/film.cc
+++ b/
src/lib/film.cc
@@
-916,12
+916,6
@@
Film::set_key (dcp::Key key)
signal_changed (KEY);
}
signal_changed (KEY);
}
-shared_ptr<Playlist>
-Film::playlist () const
-{
- return _playlist;
-}
-
ContentList
Film::content () const
{
ContentList
Film::content () const
{
@@
-1226,3
+1220,15
@@
Film::audio_output_names () const
return vector<string> (n.begin(), n.begin() + audio_channels ());
}
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 da1c09d2fa5739e2f209b2d9cb3bb97831ea2769..f268bc5b7c6050737c8bb5730d7db8b33ebb71c2 100644
(file)
--- a/
src/lib/film.h
+++ b/
src/lib/film.h
@@
-101,8
+101,6
@@
public:
std::vector<CPLSummary> cpls () const;
std::vector<CPLSummary> cpls () const;
- boost::shared_ptr<Playlist> playlist () const;
-
int audio_frame_rate () const;
uint64_t required_disk_space () 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 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.
*/
/** 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 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 *);
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 daadab7d7d6ce15cb53ce2869a10ce9e7370b3a6..2e9fe43fe6333568792dbeaf1e1845dffe57c41c 100644
(file)
--- a/
src/wx/content_menu.cc
+++ b/
src/wx/content_menu.cc
@@
-122,12
+122,12
@@
ContentMenu::repeat ()
return;
}
return;
}
- shared_ptr<
const
Film> film = _film.lock ();
+ shared_ptr<Film> film = _film.lock ();
if (!film) {
return;
}
if (!film) {
return;
}
- film->
playlist()->repea
t (_content, d->number ());
+ film->
repeat_conten
t (_content, d->number ());
d->Destroy ();
_content.clear ();
d->Destroy ();
_content.clear ();
@@
-170,7
+170,7
@@
ContentMenu::remove ()
return;
}
return;
}
- shared_ptr<
const
Film> film = _film.lock ();
+ shared_ptr<Film> film = _film.lock ();
if (!film) {
return;
}
if (!film) {
return;
}
@@
-210,7
+210,7
@@
ContentMenu::remove ()
}
if (!handled) {
}
if (!handled) {
- film->
playlist()->remove
(_content);
+ film->
remove_content
(_content);
}
_content.clear ();
}
_content.clear ();
diff --git
a/src/wx/timeline.cc
b/src/wx/timeline.cc
index b0197ad3dd12a19abb2b357b517197b5b69d9c05..3929cf1c24d1cdb48ad5d96e96905f579be4544c 100644
(file)
--- 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));
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));
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
}
void
@@
-90,10
+90,12
@@
Timeline::paint ()
}
void
}
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
}
void
@@
-107,7
+109,7
@@
Timeline::recreate_views ()
_views.clear ();
_views.push_back (_time_axis_view);
_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)) {
for (ContentList::iterator i = content.begin(); i != content.end(); ++i) {
if (dynamic_pointer_cast<VideoContent> (*i)) {
@@
-131,7
+133,7
@@
Timeline::recreate_views ()
}
void
}
void
-Timeline::
playlist
_content_changed (int property)
+Timeline::
film
_content_changed (int property)
{
ensure_ui_thread ();
{
ensure_ui_thread ();
diff --git
a/src/wx/timeline.h
b/src/wx/timeline.h
index cab0ea0e08525bc36221cbf401c360ee9b750757..2afd0d1945e7fb167510572d21f2e613bbbce117 100644
(file)
--- 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 <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;
class Film;
class ContentPanel;
@@
-78,8
+79,8
@@
private:
void left_up (wxMouseEvent &);
void right_down (wxMouseEvent &);
void mouse_moved (wxMouseEvent &);
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 &);
void resized ();
void assign_tracks ();
void set_position_from_event (wxMouseEvent &);
@@
-105,6
+106,6
@@
private:
ContentMenu _menu;
bool _snap;
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;
};
};
diff --git
a/test/frame_rate_test.cc
b/test/frame_rate_test.cc
index 39a64504d70207b60667e908c810be140a47decb..cf3dc261275ee64d6b4c746b814e2ecc523aeed4 100644
(file)
--- a/
test/frame_rate_test.cc
+++ b/
test/frame_rate_test.cc
@@
-53,7
+53,7
@@
BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single)
Config::instance()->set_allowed_dcp_frame_rates (afr);
content->_video_frame_rate = 60;
Config::instance()->set_allowed_dcp_frame_rates (afr);
content->_video_frame_rate = 60;
- int best = film->
playlist()->best_dcp
_frame_rate ();
+ int best = film->
best_video
_frame_rate ();
FrameRateChange frc = FrameRateChange (60, best);
BOOST_CHECK_EQUAL (best, 30);
BOOST_CHECK_EQUAL (frc.skip, true);
FrameRateChange frc = FrameRateChange (60, best);
BOOST_CHECK_EQUAL (best, 30);
BOOST_CHECK_EQUAL (frc.skip, true);
@@
-62,7
+62,7
@@
BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single)
BOOST_CHECK_CLOSE (frc.speed_up, 1, 0.1);
content->_video_frame_rate = 50;
BOOST_CHECK_CLOSE (frc.speed_up, 1, 0.1);
content->_video_frame_rate = 50;
- best = film->
playlist()->best_dcp
_frame_rate ();
+ best = film->
best_video
_frame_rate ();
frc = FrameRateChange (50, best);
BOOST_CHECK_EQUAL (best, 25);
BOOST_CHECK_EQUAL (frc.skip, true);
frc = FrameRateChange (50, best);
BOOST_CHECK_EQUAL (best, 25);
BOOST_CHECK_EQUAL (frc.skip, true);
@@
-71,7
+71,7
@@
BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single)
BOOST_CHECK_CLOSE (frc.speed_up, 1, 0.1);
content->_video_frame_rate = 48;
BOOST_CHECK_CLOSE (frc.speed_up, 1, 0.1);
content->_video_frame_rate = 48;
- best = film->
playlist()->best_dcp
_frame_rate ();
+ best = film->
best_video
_frame_rate ();
frc = FrameRateChange (48, best);
BOOST_CHECK_EQUAL (best, 24);
BOOST_CHECK_EQUAL (frc.skip, true);
frc = FrameRateChange (48, best);
BOOST_CHECK_EQUAL (best, 24);
BOOST_CHECK_EQUAL (frc.skip, true);
@@
-80,7
+80,7
@@
BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single)
BOOST_CHECK_CLOSE (frc.speed_up, 1, 0.1);
content->_video_frame_rate = 30;
BOOST_CHECK_CLOSE (frc.speed_up, 1, 0.1);
content->_video_frame_rate = 30;
- best = film->
playlist()->best_dcp
_frame_rate ();
+ best = film->
best_video
_frame_rate ();
frc = FrameRateChange (30, best);
BOOST_CHECK_EQUAL (best, 30);
BOOST_CHECK_EQUAL (frc.skip, false);
frc = FrameRateChange (30, best);
BOOST_CHECK_EQUAL (best, 30);
BOOST_CHECK_EQUAL (frc.skip, false);
@@
-89,7
+89,7
@@
BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single)
BOOST_CHECK_CLOSE (frc.speed_up, 1, 0.1);
content->_video_frame_rate = 29.97;
BOOST_CHECK_CLOSE (frc.speed_up, 1, 0.1);
content->_video_frame_rate = 29.97;
- best = film->
playlist()->best_dcp
_frame_rate ();
+ best = film->
best_video
_frame_rate ();
frc = FrameRateChange (29.97, best);
BOOST_CHECK_EQUAL (best, 30);
BOOST_CHECK_EQUAL (frc.skip, false);
frc = FrameRateChange (29.97, best);
BOOST_CHECK_EQUAL (best, 30);
BOOST_CHECK_EQUAL (frc.skip, false);
@@
-98,7
+98,7
@@
BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single)
BOOST_CHECK_CLOSE (frc.speed_up, 30 / 29.97, 0.1);
content->_video_frame_rate = 25;
BOOST_CHECK_CLOSE (frc.speed_up, 30 / 29.97, 0.1);
content->_video_frame_rate = 25;
- best = film->
playlist()->best_dcp
_frame_rate ();
+ best = film->
best_video
_frame_rate ();
frc = FrameRateChange (25, best);
BOOST_CHECK_EQUAL (best, 25);
BOOST_CHECK_EQUAL (frc.skip, false);
frc = FrameRateChange (25, best);
BOOST_CHECK_EQUAL (best, 25);
BOOST_CHECK_EQUAL (frc.skip, false);
@@
-107,7
+107,7
@@
BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single)
BOOST_CHECK_CLOSE (frc.speed_up, 1, 0.1);
content->_video_frame_rate = 24;
BOOST_CHECK_CLOSE (frc.speed_up, 1, 0.1);
content->_video_frame_rate = 24;
- best = film->
playlist()->best_dcp
_frame_rate ();
+ best = film->
best_video
_frame_rate ();
frc = FrameRateChange (24, best);
BOOST_CHECK_EQUAL (best, 24);
BOOST_CHECK_EQUAL (frc.skip, false);
frc = FrameRateChange (24, best);
BOOST_CHECK_EQUAL (best, 24);
BOOST_CHECK_EQUAL (frc.skip, false);
@@
-116,7
+116,7
@@
BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single)
BOOST_CHECK_CLOSE (frc.speed_up, 1, 0.1);
content->_video_frame_rate = 14.5;
BOOST_CHECK_CLOSE (frc.speed_up, 1, 0.1);
content->_video_frame_rate = 14.5;
- best = film->
playlist()->best_dcp
_frame_rate ();
+ best = film->
best_video
_frame_rate ();
frc = FrameRateChange (14.5, best);
BOOST_CHECK_EQUAL (best, 30);
BOOST_CHECK_EQUAL (frc.skip, false);
frc = FrameRateChange (14.5, best);
BOOST_CHECK_EQUAL (best, 30);
BOOST_CHECK_EQUAL (frc.skip, false);
@@
-125,7
+125,7
@@
BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single)
BOOST_CHECK_CLOSE (frc.speed_up, 15 / 14.5, 0.1);
content->_video_frame_rate = 12.6;
BOOST_CHECK_CLOSE (frc.speed_up, 15 / 14.5, 0.1);
content->_video_frame_rate = 12.6;
- best = film->
playlist()->best_dcp
_frame_rate ();
+ best = film->
best_video
_frame_rate ();
frc = FrameRateChange (12.6, best);
BOOST_CHECK_EQUAL (best, 25);
BOOST_CHECK_EQUAL (frc.skip, false);
frc = FrameRateChange (12.6, best);
BOOST_CHECK_EQUAL (best, 25);
BOOST_CHECK_EQUAL (frc.skip, false);
@@
-134,7
+134,7
@@
BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single)
BOOST_CHECK_CLOSE (frc.speed_up, 25 / 25.2, 0.1);
content->_video_frame_rate = 12.4;
BOOST_CHECK_CLOSE (frc.speed_up, 25 / 25.2, 0.1);
content->_video_frame_rate = 12.4;
- best = film->
playlist()->best_dcp
_frame_rate ();
+ best = film->
best_video
_frame_rate ();
frc = FrameRateChange (12.4, best);
BOOST_CHECK_EQUAL (best, 25);
BOOST_CHECK_EQUAL (frc.skip, false);
frc = FrameRateChange (12.4, best);
BOOST_CHECK_EQUAL (best, 25);
BOOST_CHECK_EQUAL (frc.skip, false);
@@
-143,7
+143,7
@@
BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single)
BOOST_CHECK_CLOSE (frc.speed_up, 25 / 24.8, 0.1);
content->_video_frame_rate = 12;
BOOST_CHECK_CLOSE (frc.speed_up, 25 / 24.8, 0.1);
content->_video_frame_rate = 12;
- best = film->
playlist()->best_dcp
_frame_rate ();
+ best = film->
best_video
_frame_rate ();
frc = FrameRateChange (12, best);
BOOST_CHECK_EQUAL (best, 24);
BOOST_CHECK_EQUAL (frc.skip, false);
frc = FrameRateChange (12, best);
BOOST_CHECK_EQUAL (best, 24);
BOOST_CHECK_EQUAL (frc.skip, false);
@@
-161,7
+161,7
@@
BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single)
Config::instance()->set_allowed_dcp_frame_rates (afr);
content->_video_frame_rate = 60;
Config::instance()->set_allowed_dcp_frame_rates (afr);
content->_video_frame_rate = 60;
- best = film->
playlist()->best_dcp
_frame_rate ();
+ best = film->
best_video
_frame_rate ();
frc = FrameRateChange (60, best);
BOOST_CHECK_EQUAL (best, 60);
BOOST_CHECK_EQUAL (frc.skip, false);
frc = FrameRateChange (60, best);
BOOST_CHECK_EQUAL (best, 60);
BOOST_CHECK_EQUAL (frc.skip, false);
@@
-170,7
+170,7
@@
BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single)
BOOST_CHECK_CLOSE (frc.speed_up, 1, 0.1);
content->_video_frame_rate = 50;
BOOST_CHECK_CLOSE (frc.speed_up, 1, 0.1);
content->_video_frame_rate = 50;
- best = film->
playlist()->best_dcp
_frame_rate ();
+ best = film->
best_video
_frame_rate ();
frc = FrameRateChange (50, best);
BOOST_CHECK_EQUAL (best, 50);
BOOST_CHECK_EQUAL (frc.skip, false);
frc = FrameRateChange (50, best);
BOOST_CHECK_EQUAL (best, 50);
BOOST_CHECK_EQUAL (frc.skip, false);
@@
-179,7
+179,7
@@
BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single)
BOOST_CHECK_CLOSE (frc.speed_up, 1, 0.1);
content->_video_frame_rate = 48;
BOOST_CHECK_CLOSE (frc.speed_up, 1, 0.1);
content->_video_frame_rate = 48;
- best = film->
playlist()->best_dcp
_frame_rate ();
+ best = film->
best_video
_frame_rate ();
frc = FrameRateChange (48, best);
BOOST_CHECK_EQUAL (best, 48);
BOOST_CHECK_EQUAL (frc.skip, false);
frc = FrameRateChange (48, best);
BOOST_CHECK_EQUAL (best, 48);
BOOST_CHECK_EQUAL (frc.skip, false);
@@
-202,7
+202,7
@@
BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single)
Config::instance()->set_allowed_dcp_frame_rates (afr);
content->_video_frame_rate = 25;
Config::instance()->set_allowed_dcp_frame_rates (afr);
content->_video_frame_rate = 25;
- best = film->
playlist()->best_dcp
_frame_rate ();
+ best = film->
best_video
_frame_rate ();
frc = FrameRateChange (25, best);
BOOST_CHECK_EQUAL (best, 24);
BOOST_CHECK_EQUAL (frc.skip, false);
frc = FrameRateChange (25, best);
BOOST_CHECK_EQUAL (best, 24);
BOOST_CHECK_EQUAL (frc.skip, false);
@@
-234,7
+234,7
@@
BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_double)
A->_video_frame_rate = 30;
B->_video_frame_rate = 24;
A->_video_frame_rate = 30;
B->_video_frame_rate = 24;
- BOOST_CHECK_EQUAL (film->
playlist()->best_dcp
_frame_rate(), 25);
+ BOOST_CHECK_EQUAL (film->
best_video
_frame_rate(), 25);
}
BOOST_AUTO_TEST_CASE (audio_sampling_rate_test)
}
BOOST_AUTO_TEST_CASE (audio_sampling_rate_test)