mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-04-16 22:23:16 +02:00
* Fixed warnings in 'lib/rdaudioconvert.cpp'. * Fixed warnings in 'lib/rdaudioexport.cpp'. * Fixed warnings in 'lib/rdaudioimport.cpp'. * Fixed warnings in 'lib/rdcart_dialog.cpp'. * Fixed warnings in 'lib/rdconf.cpp'. * Fixed warnings in 'lib/rdcopyaudio.cpp'. * Fixed warnings in 'lib/rdescape_string.cpp'. * Fixed warnings in 'lib/rdevent_line.cpp'. * Fixed warnings in 'lib/rdfeed.cpp'. * Refactored 'RDOneShot' to use int values in 'lib/rdoneshot.cpp' and 'lib/rdoneshot.h'. * Fixed warnings in 'lib/rdpeaksexport.cpp'. * Fixed warnings in 'lib/rdtrimaudio.cpp'. * Fixed warnings in 'lib/rdwavefile.cpp'. * Fixed warnings in 'rdhpi/rdhpiplaystream.cpp'. * Fixed warnings in 'rdhpi/rdhpirecordstream.cpp'. * Fixed warnings in 'rdhpi/rdhpisoundcard.cpp'. * Fixed warnings in 'pam_rd/pam_rd.cpp'. * Fixed warnings in 'rdadmin/edit_rdairplay.cpp'. * Fixed warnings in 'rdairplay/list_log.cpp'. * Fixed warnings in 'rdairplay/log_play.cpp'. * Fixed warnings in 'rdairplay/pie_counter.cpp'. * Fixed warnings in 'rdairplay/rlm_host.cpp'. * Fixed warnings in 'rdcatchd/rdcatchd.cpp'. * Fixed warnings in 'rdlogedit/editlog.cpp'. * Fixed warnings in 'rdlogmanager/rdlogmanager.cpp'. * Fixed warnings in 'rdrepl/replfactory.h'. * Fixed warnings in 'ripcd/acu1p.cpp' and 'ripcd/acu1p.h'. * Fixed warnings in 'ripcd/bt16x2.cpp' and 'ripcd/bt16x2.h'. * Fixed warnings in 'ripcd/btss164.cpp' and 'ripcd/btss164.h'. * Fixed warnings in 'ripcd/btss42.cpp' and 'ripcd/btss42.h'. * Fixed warnings in 'ripcd/btss44.cpp' and 'ripcd/btss44.h'. * Fixed warnings in 'ripcd/btss82.cpp' and 'ripcd/btss82.h'. * Fixed warnings in 'ripcd/btsrc16.cpp' and 'ripcd/btsrc16.h'. * Fixed warnings in 'ripcd/btsrc8iii.cpp' and 'ripcd/btsrc8iii.h'. * Fixed warnings in 'ripcd/livewire_mcastgpio.cpp'. * Fixed warnings in 'ripcd/local_gpio.cpp' and 'ripcd/local_gpio.h'. * Fixed warnings in 'ripcd/sas64000gpi.cpp' and 'ripcd/sas64000gpi.h'. * Fixed warnings in 'ripcd/vguest.cpp' and 'ripcd/vguest.h'. * Fixed warnings in 'utils/rdhpiinfo/rdhpiinfo.cpp' * Fixed warnings in 'utils/rdgen/wavlib.cpp' * Fixed warnings in 'utils/rdimport/rdimport.cpp' * Fixed warnings in 'utils/rdsoftkeys/rdsoftkeys.cpp' * Fixed warnings in 'web/rdxport/export.cpp'
121 lines
3.6 KiB
C++
121 lines
3.6 KiB
C++
// vguest.h
|
|
//
|
|
// A Rivendell switcher driver for the Logitek vGuest Protocol
|
|
//
|
|
// (C) Copyright 2002-2005 Fred Gleason <fredg@paravelsystems.com>
|
|
//
|
|
// $Id: vguest.h,v 1.17.8.1 2013/11/06 01:32:31 cvs Exp $
|
|
//
|
|
// This program is free software; you can redistribute it and/or modify
|
|
// it under the terms of the GNU General Public License version 2 as
|
|
// published by the Free Software Foundation.
|
|
//
|
|
// 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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
//
|
|
|
|
#ifndef VGUEST_H
|
|
#define VGUEST_H
|
|
|
|
#include <vector>
|
|
|
|
#include <qhostaddress.h>
|
|
#include <qtimer.h>
|
|
|
|
#include <rdsocket.h>
|
|
#include <rd.h>
|
|
#include <rdmatrix.h>
|
|
#include <rdmacro.h>
|
|
#include <rdtty.h>
|
|
#include <rdoneshot.h>
|
|
|
|
#include <switcher.h>
|
|
|
|
#define VGUEST_RECONNECT_MIN_INTERVAL 5000
|
|
#define VGUEST_RECONNECT_MAX_INTERVAL 15000.0
|
|
#define VGUEST_MAX_COMMAND_LENGTH 255
|
|
#define VGUEST_ID_BYTE 0x0C;
|
|
#define VGUEST_DEFAULT_SURFACE_NUMBER 1
|
|
#define VGUEST_DEFAULT_PORT 10212
|
|
#define VGUEST_MAX_TEXT_LENGTH 60
|
|
#define VGUEST_PING_INTERVAL 15000
|
|
|
|
class VGuest : public Switcher
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
VGuest(RDMatrix *matrix,QObject *parent=0,const char *name=0);
|
|
~VGuest();
|
|
RDMatrix::Type type();
|
|
unsigned gpiQuantity();
|
|
unsigned gpoQuantity();
|
|
bool primaryTtyActive();
|
|
bool secondaryTtyActive();
|
|
void processCommand(RDMacro *cmd);
|
|
|
|
private slots:
|
|
void ipConnect(int id);
|
|
void connectedData(int id);
|
|
void connectionClosedData(int id);
|
|
void readyReadData(int id);
|
|
void errorData(int err,int id);
|
|
void gpioOneshotData(int value);
|
|
void pingData(int id);
|
|
void pingResponseData(int id);
|
|
|
|
private:
|
|
void SendCommand(char *str,int len);
|
|
void DispatchCommand(char *cmd,int len,int id);
|
|
void MetadataCommand(char *cmd,int len,int id);
|
|
int GetRelay(int enginenum,int devicenum,int surfacenum,int relaynum);
|
|
int GetHoldoff();
|
|
QString RenderCommand(char *cmd,int len);
|
|
QString PadString(QString str,unsigned len);
|
|
void ExecuteMacroCart(unsigned cartnum);
|
|
RDTTYDevice *vguest_device[2];
|
|
RDSocket *vguest_socket[2];
|
|
int vguest_matrix;
|
|
QHostAddress vguest_ipaddress[2];
|
|
int vguest_ipport[2];
|
|
int vguest_inputs;
|
|
QString vguest_username[2];
|
|
QString vguest_password[2];
|
|
unsigned vguest_start_cart[2];
|
|
unsigned vguest_stop_cart[2];
|
|
int vguest_outputs;
|
|
int vguest_gpis;
|
|
int vguest_gpos;
|
|
int vguest_istate[2];
|
|
int vguest_cmd_length[2];
|
|
int vguest_cmd_ptr[2];
|
|
char vguest_cmd_buffer[2][VGUEST_MAX_COMMAND_LENGTH];
|
|
QSignalMapper *vguest_ping_mapper;
|
|
QTimer *vguest_ping_timer[2];
|
|
QSignalMapper *vguest_ping_response_mapper;
|
|
QTimer *vguest_ping_response_timer[2];
|
|
QTimer *vguest_reconnect_timer[2];
|
|
bool vguest_error_notified[2];
|
|
RDMatrix::PortType vguest_porttype[2];
|
|
std::vector<int>vguest_input_engine_nums;
|
|
std::vector<int>vguest_input_device_nums;
|
|
std::vector<int>vguest_output_engine_nums;
|
|
std::vector<int>vguest_output_device_nums;
|
|
std::vector<int>vguest_relays_engine_nums;
|
|
std::vector<int>vguest_relays_device_nums;
|
|
std::vector<int>vguest_relays_surface_nums;
|
|
std::vector<int>vguest_relays_relay_nums;
|
|
std::vector<int>vguest_displays_engine_nums;
|
|
std::vector<int>vguest_displays_device_nums;
|
|
std::vector<int>vguest_displays_surface_nums;
|
|
RDOneShot *vguest_gpio_oneshot;
|
|
};
|
|
|
|
|
|
#endif // VGUEST_H
|