X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fvideo_timeline.h;h=55dd29a89720f4341553bfa3b6d3d0d7121de8a6;hb=2e9fcceb1e389aad4a3771c357f8504f27a49470;hp=8775a64265951e351729a2ca181fae7ee352e0bd;hpb=6830d83236ae047eb077802cdb54eff5492928d3;p=ardour.git diff --git a/gtk2_ardour/video_timeline.h b/gtk2_ardour/video_timeline.h index 8775a64265..55dd29a897 100644 --- a/gtk2_ardour/video_timeline.h +++ b/gtk2_ardour/video_timeline.h @@ -17,8 +17,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifdef WITH_VIDEOTIMELINE - #ifndef __ardour_video_timeline_h__ #define __ardour_video_timeline_h__ @@ -31,7 +29,7 @@ #include "video_image_frame.h" #include "video_monitor.h" #include "pbd/signals.h" -#include "canvas/group.h" +#include "canvas/container.h" namespace ARDOUR { class Session; @@ -47,7 +45,7 @@ class PublicEditor; * creates \ref VideoImageFrame as neccesary (which * query the server for image-data). * - * This class contains the algorithm to position the single frames + * This class contains the algorithm to position the single samples * on the timeline according to current-zoom level and video-file * attributes. see \ref update_video_timeline() * @@ -57,7 +55,7 @@ class PublicEditor; class VideoTimeLine : public sigc::trackable, public ARDOUR::SessionHandlePtr, public PBD::ScopedConnectionList, public PBD::StatefulDestructible { public: - VideoTimeLine (PublicEditor*, ArdourCanvas::Group*, int); + VideoTimeLine (PublicEditor*, ArdourCanvas::Container*, int); virtual ~VideoTimeLine (); void set_session (ARDOUR::Session *s); @@ -72,15 +70,15 @@ class VideoTimeLine : public sigc::trackable, public ARDOUR::SessionHandlePtr, p double get_video_file_fps () { return video_file_fps; } void set_update_session_fps (bool v=true) { auto_set_session_fps = v; } - void set_offset_locked (bool v) { video_offset_lock = v; } - void toggle_offset_locked () { video_offset_lock = !video_offset_lock; } + void set_offset_locked (bool v); + void toggle_offset_locked (); bool is_offset_locked () { return video_offset_lock; } void open_video_monitor (); void close_video_monitor (); void control_video_monitor (int, int); void terminated_video_monitor (); - void manual_seek_video_monitor (framepos_t pos); + void manual_seek_video_monitor (samplepos_t pos); void parameter_changed (std::string const & p); void set_video_server_url (std::string); @@ -88,31 +86,34 @@ class VideoTimeLine : public sigc::trackable, public ARDOUR::SessionHandlePtr, p bool found_xjadeo () { return ((_xjadeo_bin.empty())?false:true); } bool check_server (); + bool check_server_docroot (); void flush_local_cache (); void vmon_update (); void flush_cache (); void save_session (); void close_session (); - float get_apv(); /* audio frames per video frame; */ - ARDOUR::framecnt_t get_duration () { return video_duration;} - ARDOUR::frameoffset_t get_offset () { return video_offset;} - ARDOUR::frameoffset_t quantify_frames_to_apv (ARDOUR::frameoffset_t offset) { return floor(offset/get_apv())*get_apv(); } - void set_offset (ARDOUR::frameoffset_t offset) { video_offset = quantify_frames_to_apv(offset); } // this function does not update video_offset_p, call save_undo() to finalize changes to this! - this fn is currently only used from editor_drag.cc + void sync_session_state (); /* video-monitor does not actively report window/pos changes, query it */ + float get_apv(); /* audio samples per video frame; */ + ARDOUR::samplecnt_t get_duration () { return video_duration;} + ARDOUR::sampleoffset_t get_offset () { return video_offset;} + ARDOUR::sampleoffset_t quantify_samples_to_apv (ARDOUR::sampleoffset_t offset) { return rint(offset/get_apv())*get_apv(); } + void set_offset (ARDOUR::sampleoffset_t offset) { video_offset = quantify_samples_to_apv(offset); } // this function does not update video_offset_p, call save_undo() to finalize changes to this! - this fn is currently only used from editor_drag.cc protected: PublicEditor *editor; - ArdourCanvas::Group *videotl_bar_group; + ArdourCanvas::Container *videotl_group; int bar_height; std::string _xjadeo_bin; void find_xjadeo (); + void find_harvid (); - ARDOUR::frameoffset_t video_start_offset; /**< unit: audio-frames - video-file */ - ARDOUR::frameoffset_t video_offset; /**< unit: audio-frames - session */ - ARDOUR::frameoffset_t video_offset_p; /**< used for undo from editor_drag.cc */ - framepos_t video_duration; /**< unit: audio-frames */ + ARDOUR::sampleoffset_t video_start_offset; /**< unit: audio-samples - video-file */ + ARDOUR::sampleoffset_t video_offset; /**< unit: audio-samples - session */ + ARDOUR::sampleoffset_t video_offset_p; /**< used for undo from editor_drag.cc */ + samplepos_t video_duration; /**< unit: audio-samples */ std::string video_filename; bool local_file; double video_aspect_ratio; @@ -123,11 +124,16 @@ class VideoTimeLine : public sigc::trackable, public ARDOUR::SessionHandlePtr, p std::string video_server_url; std::string server_docroot; - typedef std::list VideoFrames; - VideoFrames video_frames; - VideoImageFrame *get_video_frame (framepos_t vfn, int cut=0, int rightend = -1); - bool flush_frames; - void remove_frames (); + void xjadeo_readversion (std::string d, size_t s); + void harvid_readversion (std::string d, size_t s); + std::string xjadeo_version; + std::string harvid_version; + + typedef std::list VideoSamples; + VideoSamples video_frames; + VideoImageFrame *get_video_frame (samplepos_t vfn, int cut=0, int rightend = -1); + bool flush_samples; + void remove_samples (); std::string translated_filename (); @@ -137,8 +143,8 @@ class VideoTimeLine : public sigc::trackable, public ARDOUR::SessionHandlePtr, p PBD::Signal0 VtlUpdate; PBD::Signal1 GuiUpdate; void gui_update (const std::string &); + + PBD::ScopedConnection sessionsave; }; #endif /* __ardour_video_timeline_h__ */ - -#endif /* WITH_VIDEOTIMELINE */