ardour
video_timeline.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2010 Paul Davis
3  Author: 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
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 
19 */
20 #ifndef __ardour_video_timeline_h__
21 #define __ardour_video_timeline_h__
22 
23 #include <string>
24 
25 #include <sigc++/signal.h>
26 #include "ardour/ardour.h"
27 #include "ardour/session.h"
28 #include "ardour/session_handle.h"
29 #include "video_image_frame.h"
30 #include "video_monitor.h"
31 #include "pbd/signals.h"
32 #include "canvas/container.h"
33 
34 namespace ARDOUR {
35  class Session;
36 }
37 
38 class PublicEditor;
39 
55 class VideoTimeLine : public sigc::trackable, public ARDOUR::SessionHandlePtr, public PBD::ScopedConnectionList, public PBD::StatefulDestructible
56 {
57  public:
58  VideoTimeLine (PublicEditor*, ArdourCanvas::Container*, int);
59  virtual ~VideoTimeLine ();
60 
61  void set_session (ARDOUR::Session *s);
62  void update_video_timeline ();
63  void set_height (int);
64 
65  void save_undo (void);
66  XMLNode& get_state ();
67  int set_state (const XMLNode&, int version);
68 
69  bool video_file_info (std::string, bool);
70  double get_video_file_fps () { return video_file_fps; }
71  void set_update_session_fps (bool v=true) { auto_set_session_fps = v; }
72 
73  void set_offset_locked (bool v);
74  void toggle_offset_locked ();
75  bool is_offset_locked () { return video_offset_lock; }
76 
77  void open_video_monitor ();
78  void close_video_monitor ();
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 ();
89  bool check_server_docroot ();
90  void flush_local_cache ();
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::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
101 
102  protected:
103 
105  ArdourCanvas::Container *videotl_group;
107 
108  std::string _xjadeo_bin;
109  void find_xjadeo ();
110 
111 
116  std::string video_filename;
122 
123  std::string video_server_url;
124  std::string server_docroot;
125 
126  void xjadeo_readversion (std::string d, size_t s);
127  std::string xjadeo_version;
128 
129  typedef std::list<VideoImageFrame*> VideoFrames;
130  VideoFrames video_frames;
131  VideoImageFrame *get_video_frame (framepos_t vfn, int cut=0, int rightend = -1);
133  void remove_frames ();
134 
135  std::string translated_filename ();
136 
139 
140  PBD::Signal0<void> VtlUpdate;
141  PBD::Signal1<void,std::string> GuiUpdate;
142  void gui_update (const std::string &);
143 
145 };
146 
147 #endif /* __ardour_video_timeline_h__ */
std::string video_server_url
void gui_update(const std::string &)
void set_offset(ARDOUR::frameoffset_t offset)
ARDOUR::frameoffset_t get_offset()
void set_height(int)
void close_video_monitor()
void control_video_monitor(int, int)
void open_video_monitor()
void parameter_changed(std::string const &p)
void save_undo(void)
Representation of the interface of the Editor class.
ARDOUR::frameoffset_t video_start_offset
void xjadeo_readversion(std::string d, size_t s)
a single video-frame to be displayed in the video timeline
std::string server_docroot
ARDOUR::frameoffset_t quantify_frames_to_apv(ARDOUR::frameoffset_t offset)
double get_video_file_fps()
PBD::Signal0< void > VtlUpdate
communication with xjadeo's remote-control interface
Definition: video_monitor.h:49
bool video_file_info(std::string, bool)
std::string translated_filename()
std::list< VideoImageFrame * > VideoFrames
std::string xjadeo_version
void terminated_video_monitor()
std::string video_filename
void sync_session_state()
VideoMonitor * vmonitor
int64_t framecnt_t
Definition: types.h:76
void set_video_server_url(std::string)
PBD::Signal1< void, std::string > GuiUpdate
void set_session(ARDOUR::Session *s)
Definition: amp.h:29
VideoTimeLine(PublicEditor *, ArdourCanvas::Container *, int)
std::string _xjadeo_bin
void update_video_timeline()
void flush_local_cache()
VideoImageFrame * get_video_frame(framepos_t vfn, int cut=0, int rightend=-1)
int64_t frameoffset_t
Definition: types.h:71
virtual ~VideoTimeLine()
ArdourCanvas::Container * videotl_group
XMLNode & get_state()
void toggle_offset_locked()
bool auto_set_session_fps
PBD::ScopedConnection sessionsave
Definition: xml++.h:95
int set_state(const XMLNode &, int version)
video-timline controller and display
ARDOUR::frameoffset_t video_offset_p
PublicEditor * editor
ARDOUR::framecnt_t get_duration()
double video_file_fps
void set_video_server_docroot(std::string)
framepos_t video_duration
bool found_xjadeo()
bool is_offset_locked()
ARDOUR::frameoffset_t video_offset
void set_offset_locked(bool v)
int64_t framepos_t
double video_aspect_ratio
void manual_seek_video_monitor(framepos_t pos)
VideoFrames video_frames
void set_update_session_fps(bool v=true)
bool check_server_docroot()