vtl: video sets session start/end markers.

This commit is contained in:
Robin Gareus 2013-03-27 18:21:09 +01:00
parent ba7def458e
commit b3fa4dd8f3
3 changed files with 22 additions and 2 deletions

View File

@ -1611,6 +1611,11 @@ NoteResizeDrag::aborted (bool)
#ifdef WITH_VIDEOTIMELINE
#ifndef MAX
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
#endif
AVDraggingView::AVDraggingView (RegionView* v)
: view (v)
{
@ -1751,6 +1756,12 @@ VideoTimeLineDrag::finished (GdkEvent * /*event*/, bool movement_occurred)
_editor->session()->add_command (new StatefulDiffCommand (i->view->region()));
}
_editor->session()->maybe_update_session_range(
MAX(ARDOUR_UI::instance()->video_timeline->get_offset(), 0),
MAX(ARDOUR_UI::instance()->video_timeline->get_offset() + ARDOUR_UI::instance()->video_timeline->get_duration(), 0)
);
_editor->commit_reversible_command ();
_editor->update_canvas_now ();
}

View File

@ -46,6 +46,9 @@ using namespace ARDOUR;
using namespace PBD;
using namespace Timecode;
#ifndef MAX
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
#endif
VideoTimeLine::VideoTimeLine (PublicEditor *ed, ArdourCanvas::Group *vbg, int initial_height)
: editor (ed)
@ -456,6 +459,7 @@ VideoTimeLine::translated_filename ()
bool
VideoTimeLine::video_file_info (std::string filename, bool local)
{
local_file = local;
if (filename.at(0) == G_DIR_SEPARATOR || !local_file) {
video_filename = filename;
@ -514,6 +518,11 @@ VideoTimeLine::video_file_info (std::string filename, bool local)
}
flush_local_cache ();
_session->maybe_update_session_range(
MAX(get_offset(), 0),
MAX(get_offset() + get_duration(), 0)
);
if (found_xjadeo() && local_file) {
GuiUpdate("set-xjadeo-sensitive-on");
if (vmonitor && vmonitor->is_started()) {

View File

@ -732,6 +732,8 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
void request_play_range (std::list<AudioRange>*, bool leave_rolling = false);
bool get_play_range () const { return _play_range; }
void maybe_update_session_range (framepos_t, framepos_t);
/* buffers for gain and pan */
gain_t* gain_automation_buffer () const;
@ -900,8 +902,6 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
Slave* _slave;
bool _silent;
void maybe_update_session_range (framepos_t, framepos_t);
// varispeed playback
double _transport_speed;
double _default_transport_speed;