fix a couple of problems with it (#1010).
+2016-11-25 Carl Hetherington <cth@carlh.net>
+
+ * Allow multi-edit of content timing details (#1010).
+
2016-11-23 Carl Hetherington <cth@carlh.net>
* Fix crash on pressing enter in a crop control on Windows (#1009).
2016-11-23 Carl Hetherington <cth@carlh.net>
* Fix crash on pressing enter in a crop control on Windows (#1009).
_video_panel->Enable (video_selection.size() > 0 && _generally_sensitive);
_audio_panel->Enable (audio_selection.size() > 0 && _generally_sensitive);
_subtitle_panel->Enable (selection.size() == 1 && selection.front()->subtitle && _generally_sensitive);
_video_panel->Enable (video_selection.size() > 0 && _generally_sensitive);
_audio_panel->Enable (audio_selection.size() > 0 && _generally_sensitive);
_subtitle_panel->Enable (selection.size() == 1 && selection.front()->subtitle && _generally_sensitive);
- _timing_panel->Enable (selection.size() == 1 && _generally_sensitive);
+ _timing_panel->Enable (_generally_sensitive);
void
TimingPanel::position_changed ()
{
void
TimingPanel::position_changed ()
{
+ DCPTime const pos = _position->get (_parent->film()->video_frame_rate ());
BOOST_FOREACH (shared_ptr<Content> i, _parent->selected ()) {
BOOST_FOREACH (shared_ptr<Content> i, _parent->selected ()) {
- i->set_position (_position->get (_parent->film()->video_frame_rate ()));
}
}
void
TimingPanel::full_length_changed ()
{
}
}
void
TimingPanel::full_length_changed ()
{
+ int const vfr = _parent->film()->video_frame_rate ();
+ Frame const len = _full_length->get (vfr).frames_round (vfr);
BOOST_FOREACH (shared_ptr<Content> i, _parent->selected ()) {
shared_ptr<ImageContent> ic = dynamic_pointer_cast<ImageContent> (i);
if (ic && ic->still ()) {
BOOST_FOREACH (shared_ptr<Content> i, _parent->selected ()) {
shared_ptr<ImageContent> ic = dynamic_pointer_cast<ImageContent> (i);
if (ic && ic->still ()) {
- int const vfr = _parent->film()->video_frame_rate ();
- ic->video->set_length (_full_length->get (vfr).frames_round (vfr));
+ ic->video->set_length (len);
shared_ptr<Content> ref;
optional<FrameRateChange> ref_frc;
optional<DCPTime> ref_ph;
shared_ptr<Content> ref;
optional<FrameRateChange> ref_frc;
optional<DCPTime> ref_ph;
+
+ ContentTime const trim = _trim_start->get (_parent->film()->video_frame_rate ());
+
BOOST_FOREACH (shared_ptr<Content> i, _parent->selected ()) {
if (i->position() <= ph && ph < i->end()) {
/* The playhead is in i. Use it as a reference to work out
BOOST_FOREACH (shared_ptr<Content> i, _parent->selected ()) {
if (i->position() <= ph && ph < i->end()) {
/* The playhead is in i. Use it as a reference to work out
ref_ph = ph - i->position() + DCPTime (i->trim_start(), ref_frc.get());
}
ref_ph = ph - i->position() + DCPTime (i->trim_start(), ref_frc.get());
}
- i->set_trim_start (_trim_start->get (_parent->film()->video_frame_rate ()));
+ i->set_trim_start (trim);
{
_viewer->set_coalesce_player_changes (true);
{
_viewer->set_coalesce_player_changes (true);
+ ContentTime const trim = _trim_end->get (_parent->film()->video_frame_rate ());
BOOST_FOREACH (shared_ptr<Content> i, _parent->selected ()) {
BOOST_FOREACH (shared_ptr<Content> i, _parent->selected ()) {
- i->set_trim_end (_trim_end->get (_parent->film()->video_frame_rate ()));
+ i->set_trim_end (trim);
}
/* XXX: maybe playhead-off-the-end-of-the-film should be handled elsewhere */
}
/* XXX: maybe playhead-off-the-end-of-the-film should be handled elsewhere */
void
TimingPanel::play_length_changed ()
{
void
TimingPanel::play_length_changed ()
{
+ DCPTime const play_length = _play_length->get (_parent->film()->video_frame_rate());
BOOST_FOREACH (shared_ptr<Content> i, _parent->selected ()) {
FrameRateChange const frc = _parent->film()->active_frame_rate_change (i->position ());
i->set_trim_end (
BOOST_FOREACH (shared_ptr<Content> i, _parent->selected ()) {
FrameRateChange const frc = _parent->film()->active_frame_rate_change (i->position ());
i->set_trim_end (
- ContentTime (i->full_length() - _play_length->get (_parent->film()->video_frame_rate()), frc)
- - i->trim_start ()
+ ContentTime (i->full_length() - play_length, frc) - i->trim_start ()