2 * Copyright (C) 2013-2018 Robin Gareus <robin@gareus.org>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 #ifndef __ardour_video_monitor_h__
19 #define __ardour_video_monitor_h__
23 #include "ardour/ardour.h"
24 #include "ardour/types.h"
25 #include "ardour/session.h"
26 #include "ardour/session_handle.h"
27 #include "ardour/system_exec.h"
34 enum XJSettingOptions {
44 /** @class VideoMonitor
45 * @brief communication with xjadeo's remote-control interface
47 class VideoMonitor : public sigc::trackable , public ARDOUR::SessionHandlePtr, public PBD::ScopedConnectionList
50 VideoMonitor (PublicEditor*, std::string);
51 virtual ~VideoMonitor ();
53 void set_filename (std::string filename);
54 void set_fps (float f) {fps = f;}
58 void open (std::string);
60 void set_session (ARDOUR::Session *s);
62 void query_full_state (bool);
63 bool set_custom_setting (const std::string, const std::string);
64 const std::string get_custom_setting (const std::string);
65 void restore_settings_mask (int i) { _restore_settings_mask = i;}
66 int restore_settings_mask () const { return _restore_settings_mask;}
68 void set_offset (ARDOUR::sampleoffset_t);
69 void manual_seek (ARDOUR::samplepos_t, bool, ARDOUR::sampleoffset_t);
72 bool synced_by_manual_seeks() { return sync_by_manual_seek; }
74 sigc::signal<void> Terminated;
75 PBD::Signal1<void,std::string> UiState;
76 void send_cmd (int what, int param);
79 void set_debug (bool onoff) { debug_enable = onoff; }
84 ARDOUR::SystemExec *process;
86 void parse_output (std::string d, size_t s);
88 void forward_keyevent (unsigned int);
90 void parameter_changed (std::string const & p);
92 typedef std::map<std::string,std::string> XJSettings;
94 int _restore_settings_mask;
95 bool skip_setting(std::string);
96 XJSettings xjadeo_settings;
98 void xjadeo_sync_setup ();
99 ARDOUR::samplepos_t manually_seeked_frame;
100 ARDOUR::sampleoffset_t video_offset;
101 bool sync_by_manual_seek;
102 sigc::connection clock_connection;
103 sigc::connection state_connection;
104 int state_clk_divide;
109 PBD::Signal1<void, unsigned int> XJKeyEvent;
115 #endif /* __ardour_video_monitor_h__ */