diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-09-17 15:22:57 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-10-12 11:05:26 +0100 |
| commit | 56cb528a5781e67d84bdfb6cb8223931b4d283d0 (patch) | |
| tree | 53ae6efee609af6fcbfa6f14d062dcf3bbc8941b /src/lib | |
| parent | dbfbdcba0f5f08a932ba199039f2ca1530e482ac (diff) | |
Un-attached reel UI.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/film.cc | 21 | ||||
| -rw-r--r-- | src/lib/film.h | 13 | ||||
| -rw-r--r-- | src/lib/types.h | 7 |
3 files changed, 41 insertions, 0 deletions
diff --git a/src/lib/film.cc b/src/lib/film.cc index 77e1be872..c0060b040 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -126,6 +126,8 @@ Film::Film (boost::filesystem::path dir, bool log) , _sequence_video (true) , _interop (Config::instance()->default_interop ()) , _audio_processor (0) + , _reel_type (REELTYPE_SINGLE) + , _reel_length (2000000000) , _state_version (current_state_version) , _dirty (false) { @@ -344,6 +346,8 @@ Film::metadata () const if (_audio_processor) { root->add_child("AudioProcessor")->add_child_text (_audio_processor->id ()); } + root->add_child("ReelType")->add_child_text (raw_convert<string> (_reel_type)); + root->add_child("ReelLength")->add_child_text (raw_convert<string> (_reel_length)); _playlist->as_xml (root->add_child ("Playlist")); return doc; @@ -427,6 +431,9 @@ Film::read_metadata () _audio_processor = 0; } + _reel_type = static_cast<ReelType> (f.optional_number_child<int>("ReelType").get_value_or (static_cast<int>(REELTYPE_SINGLE))); + _reel_length = f.optional_number_child<int64_t>("ReelLength").get_value_or (2000000000); + list<string> notes; /* This method is the only one that can return notes (so far) */ _playlist->set_from_xml (shared_from_this(), f.node_child ("Playlist"), _state_version, notes); @@ -817,6 +824,20 @@ Film::set_audio_processor (AudioProcessor const * processor) } void +Film::set_reel_type (ReelType t) +{ + _reel_type = t; + signal_changed (REEL_TYPE); +} + +void +Film::set_reel_length (int64_t r) +{ + _reel_length = r; + signal_changed (REEL_LENGTH); +} + +void Film::signal_changed (Property p) { _dirty = true; diff --git a/src/lib/film.h b/src/lib/film.h index 937ab99e8..76068136a 100644 --- a/src/lib/film.h +++ b/src/lib/film.h @@ -177,6 +177,8 @@ public: SEQUENCE_VIDEO, INTEROP, AUDIO_PROCESSOR, + REEL_TYPE, + REEL_LENGTH }; @@ -252,6 +254,13 @@ public: return _audio_processor; } + ReelType reel_type () const { + return _reel_type; + } + + int64_t reel_length () const { + return _reel_length; + } /* SET */ @@ -280,6 +289,8 @@ public: void set_sequence_video (bool); void set_interop (bool); void set_audio_processor (AudioProcessor const * processor); + void set_reel_type (ReelType); + void set_reel_length (int64_t); /** Emitted when some property has of the Film has changed */ mutable boost::signals2::signal<void (Property)> Changed; @@ -340,6 +351,8 @@ private: bool _sequence_video; bool _interop; AudioProcessor const * _audio_processor; + ReelType _reel_type; + int64_t _reel_length; int _state_version; diff --git a/src/lib/types.h b/src/lib/types.h index d0f4ec1f8..5486f8612 100644 --- a/src/lib/types.h +++ b/src/lib/types.h @@ -84,6 +84,13 @@ enum Part PART_WHOLE }; +enum ReelType +{ + REELTYPE_SINGLE, + REELTYPE_ONE_PER_VIDEO, + REELTYPE_BY_LENGTH +}; + /** @struct Crop * @brief A description of the crop of an image or video. */ |
