Ardour  8.12
video_timeline.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2013-2017 Paul Davis <paul@linuxaudiosystems.com>
3  * Copyright (C) 2013-2018 Robin Gareus <robin@gareus.org>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 #ifndef __ardour_video_timeline_h__
20 #define __ardour_video_timeline_h__
21 
22 #include <string>
23 
24 #include <sigc++/signal.h>
25 #include "ardour/ardour.h"
26 #include "ardour/session.h"
27 #include "ardour/session_handle.h"
28 #include "video_image_frame.h"
29 #include "video_monitor.h"
30 #include "pbd/signals.h"
31 #include "canvas/container.h"
32 
33 namespace ARDOUR {
34  class Session;
35 }
36 
37 class PublicEditor;
38 
54 class VideoTimeLine : public sigc::trackable, public ARDOUR::SessionHandlePtr, public PBD::ScopedConnectionList, public PBD::StatefulDestructible
55 {
56  public:
58  virtual ~VideoTimeLine ();
59 
62  void set_height (int);
63 
64  void save_undo (void);
65  XMLNode& get_state () const;
66  int set_state (const XMLNode&, int version);
67 
68  bool video_file_info (std::string, bool);
69  double get_video_file_fps () { return video_file_fps; }
70  void set_update_session_fps (bool v=true) { auto_set_session_fps = v; }
71 
72  void set_offset_locked (bool v);
74  bool is_offset_locked () { return video_offset_lock; }
75 
77 
80  void control_video_monitor (int, int);
83 
84  void parameter_changed (std::string const & p);
85  void set_video_server_url (std::string);
86  void set_video_server_docroot (std::string);
87 
88  bool found_xjadeo () { return ((_xjadeo_bin.empty())?false:true); }
89  bool check_server ();
92  void vmon_update ();
93  void flush_cache ();
94  void save_session ();
95  void close_session ();
96  void sync_session_state (); /* video-monitor does not actively report window/pos changes, query it */
97  float get_apv(); /* audio samples per video frame; */
101  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
102 
103  protected:
104 
108 
109  std::string _xjadeo_bin;
110  void find_xjadeo ();
111  void find_harvid ();
112 
113 
118  std::string video_filename;
124 
125  std::string video_server_url;
126  std::string server_docroot;
127 
128  void xjadeo_readversion (std::string d, size_t s);
129  void harvid_readversion (std::string d, size_t s);
130  std::string xjadeo_version;
131  std::string harvid_version;
132 
133  typedef std::list<VideoImageFrame*> VideoFrames;
135  VideoImageFrame* get_video_frame (samplepos_t vfn, int cut=0, int rightend = -1);
136 
137  void remove_frames ();
139 
140  std::string translated_filename ();
141 
144 
145  PBD::Signal0<void> VtlUpdate;
146  PBD::Signal1<void,std::string> GuiUpdate;
147  void gui_update (const std::string &);
148 
150 };
151 
152 #endif /* __ardour_video_timeline_h__ */
Representation of the interface of the Editor class.
a single video-frame to be displayed in the video timeline
communication with xjadeo's remote-control interface
Definition: video_monitor.h:48
video-timline controller and display
VideoMonitor * vmonitor
void update_video_timeline()
float get_apv()
std::string xjadeo_version
ARDOUR::sampleoffset_t get_video_start_offset()
void toggle_offset_locked()
VideoTimeLine(PublicEditor *, ArdourCanvas::Container *, int)
ARDOUR::samplecnt_t get_duration()
void sync_session_state()
void close_video_monitor()
void flush_local_cache()
samplepos_t video_duration
void save_undo(void)
void close_session()
ArdourCanvas::Container * videotl_group
std::string harvid_version
void terminated_video_monitor()
void open_video_monitor()
std::string video_server_url
double get_video_file_fps()
double video_aspect_ratio
void set_height(int)
bool is_offset_locked()
bool check_server_docroot()
void save_session()
bool found_xjadeo()
void remove_frames()
void set_session(ARDOUR::Session *s)
void harvid_readversion(std::string d, size_t s)
void set_offset_locked(bool v)
bool check_server()
void gui_update(const std::string &)
double video_file_fps
virtual ~VideoTimeLine()
void set_video_server_url(std::string)
std::string video_filename
PBD::Signal1< void, std::string > GuiUpdate
void flush_cache()
std::string _xjadeo_bin
XMLNode & get_state() const
VideoImageFrame * get_video_frame(samplepos_t vfn, int cut=0, int rightend=-1)
void vmon_update()
std::string server_docroot
void find_xjadeo()
ARDOUR::sampleoffset_t quantify_samples_to_apv(ARDOUR::sampleoffset_t offset)
ARDOUR::sampleoffset_t video_offset_p
std::string translated_filename()
VideoFrames video_frames
void manual_seek_video_monitor(samplepos_t pos)
void set_update_session_fps(bool v=true)
ARDOUR::sampleoffset_t get_offset()
std::list< VideoImageFrame * > VideoFrames
PBD::ScopedConnection sessionsave
int set_state(const XMLNode &, int version)
ARDOUR::sampleoffset_t video_start_offset
void parameter_changed(std::string const &p)
bool auto_set_session_fps
void xjadeo_readversion(std::string d, size_t s)
void set_video_server_docroot(std::string)
PublicEditor * editor
bool video_file_info(std::string, bool)
void control_video_monitor(int, int)
ARDOUR::sampleoffset_t video_offset
void set_offset(ARDOUR::sampleoffset_t offset)
PBD::Signal0< void > VtlUpdate
void find_harvid()
Definition: xml++.h:114
Temporal::samplecnt_t samplecnt_t
Temporal::sampleoffset_t sampleoffset_t
Temporal::samplepos_t samplepos_t