2023-11-03 Fred Gleason <fredg@paravelsystems.com>

* Added 'RDCoreApplication::ExitInternalError' to the
	'RDCoreApplication::ExitCode' enumeration.
	* Refactored the 'RDCae' class to use the native BSD sockets API
	instead of 'QTcpSocket'.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason
2023-11-03 11:37:41 -04:00
parent 8bb5b3c9e4
commit c9953bffe2
18 changed files with 177 additions and 128 deletions

View File

@@ -2,7 +2,7 @@
//
// Connection to the Rivendell Core Audio Engine
//
// (C) Copyright 2002-2023 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2002-2016 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
@@ -21,9 +21,11 @@
#ifndef RDCAE_H
#define RDCAE_H
//#include <q3socketdevice.h>
#include <QLabel>
#include <QList>
#include <QObject>
#include <QUdpSocket>
#include <rd.h>
#include <rdcmd_cache.h>
@@ -40,11 +42,11 @@ class RDCae : public QObject
enum AudioCoding {Pcm16=0,MpegL1=1,MpegL2=2,MpegL3=3,Pcm24=4};
RDCae(RDStation *station,RDConfig *config,QObject *parent=0);
~RDCae();
void connectHost();
bool connectHost(QString *err_msg);
void enableMetering(QList<int> *cards);
bool loadPlay(int card,QString name,int *stream,int *handle);
void unloadPlay(int handle);
void positionPlay(int handle,int msec);
void positionPlay(int handle,int pos);
void play(int handle,unsigned length,int speed,bool pitch);
void stopPlay(int handle);
void loadRecord(int card,int stream,QString name,AudioCoding coding,
@@ -76,7 +78,7 @@ class RDCae : public QObject
signals:
void isConnected(bool state);
void playLoaded(int handle);
void playPositioned(int handle,unsigned msec);
void playPositioned(int handle,unsigned pos);
void playing(int handle);
void playStopped(int handle);
void playUnloaded(int handle);
@@ -102,6 +104,7 @@ class RDCae : public QObject
int StreamNumber(const char *arg);
int GetHandle(const char *arg);
void UpdateMeters();
// Q3SocketDevice *cae_socket;
int cae_socket;
bool debug;
char args[CAE_MAX_ARGS][CAE_MAX_LENGTH];
@@ -111,7 +114,9 @@ class RDCae : public QObject
bool input_status[RD_MAX_CARDS][RD_MAX_PORTS];
int cae_handle[RD_MAX_CARDS][RD_MAX_STREAMS];
unsigned cae_pos[RD_MAX_CARDS][RD_MAX_STREAMS];
QUdpSocket *cae_meter_socket;
// Q3SocketDevice *cae_meter_socket;
int cae_meter_socket;
uint16_t cae_meter_port;
int cae_meter_base_port;
int cae_meter_port_range;
short cae_input_levels[RD_MAX_CARDS][RD_MAX_PORTS][2];