Rivendellaudio/cae/session.h
Fred Gleason c8e6dd62e8 2023-09-09 Fred Gleason <fredg@paravelsystems.com>
* Modified the communications layer to use UDP command messaging.
	* Disabled the 'Meter Enable' ['ME'] CAE command.
	* Implemented the 'Start Playback' ['PY'] CAE command.
	* Implemented the modified 'Play Position' ['PP'] CAE command.
	* Implemented the modified 'Stop Playback' ['SP'] CAE command.
	* Stubbed out the new 'Pause Playback' ['PE'] CAE command.
	* Stubbed out the new 'Resume Playback' ['PR'] CAE command.
	* Implemented the modified 'Set Output Volume' ['OV'] CAE command.
	* Implemented the modified 'Fade Output Volume' ['FV'] CAE command.
	* Stubbed out the new 'Cue Recording' ['LR'] CAE command.
	* Stubbed out the new 'Start Recording' ['RD'] CAE command.
	* Stubbed out the new 'Cue and Start Recording' ['RC'] CAE command.
	* Stubbed out the modified 'Stop Recording' ['SR'] CAE command.
	* Implemented the modified 'Get Input Status' ['IS'] CAE command.
	* Implemented the modified 'Set Audio Passthrough Level' ['AL'] CAE
	command.
	* Implemented the new 'Update Audio Ports' ['AP'] CAE command.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
2023-09-08 15:09:47 -04:00

89 lines
2.2 KiB
C++

// session.h
//
// Persistent context for CAE protocol commands
//
// (C) Copyright 2023 Fred Gleason <fredg@paravelsystems.com>
//
// 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 SESSION_H
#define SESSION_H
#include <stdint.h>
#include <QHostAddress>
class SessionId
{
public:
SessionId(const QHostAddress &addr,uint16_t port,int pid=0,int serial=0);
SessionId();
QHostAddress address() const;
uint16_t port() const;
int processId() const;
void setProcessId(int pid);
int serialNumber() const;
void setSerialNumber(int serial);
QString dump() const;
bool operator<(const SessionId &other) const;
private:
QHostAddress d_address;
uint16_t d_port;
int d_process_id;
int d_serial_number;
};
class Session
{
public:
Session(const QHostAddress &addr,uint16_t port,int pid,int serial);
Session(const SessionId &sid);
SessionId sessionId() const;
int cardNumber() const;
void setCardNumber(int cardnum);
int portNumber() const;
void setPortNumber(int portnum);
int streamNumber() const;
void setStreamNumber(int streamnum);
uint16_t meterPort() const;
void setMeterPort(uint16_t port);
int startPosition() const;
void setStartPosition(int pos);
int endPosition() const;
void setEndPosition(int pos);
int speed() const;
void setSpeed(int speed);
bool metersEnabled();
void setMetersEnabled(bool state);
private:
SessionId d_session_id;
int d_card_number;
int d_port_number;
int d_stream_number;
int d_start_position;
int d_end_position;
int d_speed;
uint16_t d_meter_port;
bool d_meters_enabled;
};
#endif // SESSION_H