2013-03-12 17:00:09 -04:00
|
|
|
/*
|
2019-08-02 17:26:43 -04:00
|
|
|
* Copyright (C) 2013-2018 Robin Gareus <robin@gareus.org>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
2024-09-25 20:38:59 -04:00
|
|
|
#pragma once
|
2013-03-12 17:00:09 -04:00
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include "ardour/ardour.h"
|
|
|
|
#include "ardour/types.h"
|
|
|
|
#include "ardour/session.h"
|
|
|
|
#include "ardour/session_handle.h"
|
2014-03-13 11:50:44 -04:00
|
|
|
#include "ardour/system_exec.h"
|
2013-03-12 17:00:09 -04:00
|
|
|
|
|
|
|
namespace ARDOUR {
|
|
|
|
class Session;
|
|
|
|
}
|
|
|
|
class PublicEditor;
|
|
|
|
|
|
|
|
enum XJSettingOptions {
|
|
|
|
XJ_WINDOW_SIZE = 1,
|
|
|
|
XJ_WINDOW_POS = 2,
|
|
|
|
XJ_WINDOW_ONTOP = 4,
|
|
|
|
XJ_LETTERBOX = 8,
|
|
|
|
XJ_OSD = 16,
|
|
|
|
XJ_OFFSET = 32,
|
|
|
|
XJ_FULLSCREEN = 64,
|
|
|
|
};
|
|
|
|
|
|
|
|
/** @class VideoMonitor
|
|
|
|
* @brief communication with xjadeo's remote-control interface
|
|
|
|
*/
|
|
|
|
class VideoMonitor : public sigc::trackable , public ARDOUR::SessionHandlePtr, public PBD::ScopedConnectionList
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
VideoMonitor (PublicEditor*, std::string);
|
|
|
|
virtual ~VideoMonitor ();
|
|
|
|
|
|
|
|
void set_filename (std::string filename);
|
|
|
|
void set_fps (float f) {fps = f;}
|
|
|
|
bool is_started ();
|
|
|
|
bool start ();
|
|
|
|
void quit ();
|
|
|
|
void open (std::string);
|
|
|
|
|
|
|
|
void set_session (ARDOUR::Session *s);
|
2013-04-08 22:05:07 -04:00
|
|
|
void save_session ();
|
|
|
|
void query_full_state (bool);
|
2013-03-12 17:00:09 -04:00
|
|
|
bool set_custom_setting (const std::string, const std::string);
|
|
|
|
const std::string get_custom_setting (const std::string);
|
|
|
|
void restore_settings_mask (int i) { _restore_settings_mask = i;}
|
2013-03-13 17:59:28 -04:00
|
|
|
int restore_settings_mask () const { return _restore_settings_mask;}
|
2013-03-12 17:00:09 -04:00
|
|
|
|
2017-09-18 12:39:17 -04:00
|
|
|
void set_offset (ARDOUR::sampleoffset_t);
|
|
|
|
void manual_seek (ARDOUR::samplepos_t, bool, ARDOUR::sampleoffset_t);
|
2013-03-12 17:00:09 -04:00
|
|
|
void srsupdate ();
|
2013-04-03 16:29:04 -04:00
|
|
|
void querystate ();
|
2013-03-12 17:00:09 -04:00
|
|
|
bool synced_by_manual_seeks() { return sync_by_manual_seek; }
|
|
|
|
|
|
|
|
sigc::signal<void> Terminated;
|
2024-10-18 12:03:28 -04:00
|
|
|
PBD::Signal<void(std::string)> UiState;
|
2013-04-03 16:29:04 -04:00
|
|
|
void send_cmd (int what, int param);
|
2013-03-12 17:00:09 -04:00
|
|
|
|
|
|
|
#if 1
|
|
|
|
void set_debug (bool onoff) { debug_enable = onoff; }
|
|
|
|
#endif
|
|
|
|
|
|
|
|
protected:
|
|
|
|
PublicEditor *editor;
|
2014-03-13 11:50:44 -04:00
|
|
|
ARDOUR::SystemExec *process;
|
2013-03-12 17:00:09 -04:00
|
|
|
float fps;
|
|
|
|
void parse_output (std::string d, size_t s);
|
|
|
|
void terminated ();
|
2013-06-09 16:56:03 -04:00
|
|
|
void forward_keyevent (unsigned int);
|
2013-03-12 17:00:09 -04:00
|
|
|
|
|
|
|
void parameter_changed (std::string const & p);
|
|
|
|
|
|
|
|
typedef std::map<std::string,std::string> XJSettings;
|
|
|
|
|
|
|
|
int _restore_settings_mask;
|
|
|
|
bool skip_setting(std::string);
|
|
|
|
XJSettings xjadeo_settings;
|
|
|
|
|
|
|
|
void xjadeo_sync_setup ();
|
2018-01-21 05:27:26 -05:00
|
|
|
ARDOUR::samplepos_t manually_seeked_frame;
|
2017-09-18 12:39:17 -04:00
|
|
|
ARDOUR::sampleoffset_t video_offset;
|
2013-03-12 17:00:09 -04:00
|
|
|
bool sync_by_manual_seek;
|
|
|
|
sigc::connection clock_connection;
|
2013-04-03 16:29:04 -04:00
|
|
|
sigc::connection state_connection;
|
|
|
|
int state_clk_divide;
|
|
|
|
int starting;
|
2013-04-08 22:05:07 -04:00
|
|
|
int knownstate;
|
2013-04-03 16:29:04 -04:00
|
|
|
int osdmode;
|
2013-06-09 16:56:03 -04:00
|
|
|
|
2024-10-18 12:03:28 -04:00
|
|
|
PBD::Signal<void(unsigned int)> XJKeyEvent;
|
2013-03-12 17:00:09 -04:00
|
|
|
#if 1
|
|
|
|
bool debug_enable;
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|