Ardour  9.0-pre0-582-g084a23a80d
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 #pragma once
20 
21 #include <string>
22 
23 #include <sigc++/signal.h>
24 #include "ardour/ardour.h"
25 #include "ardour/session.h"
26 #include "ardour/session_handle.h"
27 #include "video_image_frame.h"
28 #include "video_monitor.h"
29 #include "pbd/signals.h"
30 #include "canvas/container.h"
31 
32 namespace ARDOUR {
33  class Session;
34 }
35 
36 class PublicEditor;
37 
53 class VideoTimeLine : public sigc::trackable, public ARDOUR::SessionHandlePtr, public PBD::ScopedConnectionList, public PBD::StatefulDestructible
54 {
55  public:
57  virtual ~VideoTimeLine ();
58 
61  void set_height (int);
62 
63  void save_undo (void);
64  XMLNode& get_state () const;
65  int set_state (const XMLNode&, int version);
66 
67  bool video_file_info (std::string, bool);
68  double get_video_file_fps () { return video_file_fps; }
69  void set_update_session_fps (bool v=true) { auto_set_session_fps = v; }
70 
71  void set_offset_locked (bool v);
73  bool is_offset_locked () { return video_offset_lock; }
74 
76 
79  void control_video_monitor (int, int);
82 
83  void parameter_changed (std::string const & p);
84  void set_video_server_url (std::string);
85  void set_video_server_docroot (std::string);
86 
87  bool found_xjadeo () { return ((_xjadeo_bin.empty())?false:true); }
88  bool check_server ();
91  void vmon_update ();
92  void flush_cache ();
93  void save_session ();
94  void close_session ();
95  void sync_session_state (); /* video-monitor does not actively report window/pos changes, query it */
96  float get_apv(); /* audio samples per video frame; */
100  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
101 
102  protected:
103 
107 
108  std::string _xjadeo_bin;
109  void find_xjadeo ();
110  void find_harvid ();
111 
112 
117  std::string video_filename;
123 
124  std::string video_server_url;
125  std::string server_docroot;
126 
127  void xjadeo_readversion (std::string d, size_t s);
128  void harvid_readversion (std::string d, size_t s);
129  std::string xjadeo_version;
130  std::string harvid_version;
131 
132  typedef std::list<VideoImageFrame*> VideoFrames;
134  VideoImageFrame* get_video_frame (samplepos_t vfn, int cut=0, int rightend = -1);
135 
136  void remove_frames ();
138 
139  std::string translated_filename ();
140 
143 
145  PBD::Signal<void(std::string)> GuiUpdate;
146  void gui_update (const std::string &);
147 
149 };
150 
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:47
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()
PBD::Signal< void(std::string)> GuiUpdate
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()
PBD::Signal< void()> VtlUpdate
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
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)
void find_harvid()
Definition: xml++.h:114
Temporal::samplecnt_t samplecnt_t
Temporal::sampleoffset_t sampleoffset_t
Temporal::samplepos_t samplepos_t