mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-10-16 15:41:13 +02:00
2023-10-13 Fred Gleason <fredg@paravelsystems.com>
* Modified the 'Output Stream Meter Levels' [MO'] CAE command to use serial numbers rather than card/stream numbers. * Fixed a regression in rdcartslots(1) that broke audio level metering. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
@@ -24445,3 +24445,8 @@
|
||||
* Fixed a regression in rdcartslots(1) that displayed red or green
|
||||
color around the edges of start buttons when the buttons were
|
||||
disabled.
|
||||
2023-10-13 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Modified the 'Output Stream Meter Levels' [MO'] CAE command to
|
||||
use serial numbers rather than card/stream numbers.
|
||||
* Fixed a regression in rdcartslots(1) that broke audio level
|
||||
metering.
|
||||
|
@@ -1888,9 +1888,11 @@ void MainObject::SendStreamMeterLevelUpdate(int cardnum,int streamnum,
|
||||
for(QMap<SessionId,Session *>::const_iterator it=cae_play_sessions.begin();
|
||||
it!=cae_play_sessions.end();it++) {
|
||||
if((it.value()->cardNumber()==cardnum)&&
|
||||
(it.value()->streamNumber()==streamnum)&&
|
||||
(cae_server->meterPort(it.key())>0)) {
|
||||
SendMeterUpdate(QString::asprintf("MO %d %d %d %d",
|
||||
cardnum,streamnum,levels[0],levels[1]),
|
||||
SendMeterUpdate(QString::asprintf("MO %d %d %d",
|
||||
it.key().serialNumber(),
|
||||
levels[0],levels[1]),
|
||||
it.key());
|
||||
}
|
||||
}
|
||||
|
@@ -1331,29 +1331,18 @@
|
||||
</para>
|
||||
<para>
|
||||
<computeroutput>MO
|
||||
<replaceable>card-num</replaceable>
|
||||
<replaceable>port-num</replaceable>
|
||||
<replaceable>serial</replaceable>
|
||||
<replaceable>left-lvl</replaceable>
|
||||
<replaceable>right-lvl</replaceable>!</computeroutput>
|
||||
</para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<replaceable>card-num</replaceable>
|
||||
<replaceable>serial</replaceable>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
The number of the audio adapter to use.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<replaceable>port-num</replaceable>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
The port number on the audio adapter.
|
||||
Serial number of the originating output session.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@@ -38,6 +38,15 @@
|
||||
//
|
||||
// #define DEBUG_LATENCY
|
||||
|
||||
__RDCaeMeterPoint::__RDCaeMeterPoint()
|
||||
{
|
||||
levels[0]=RD_MUTE_DEPTH;
|
||||
levels[1]=RD_MUTE_DEPTH;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
RDCae::RDCae(RDStation *station,RDConfig *config,QObject *parent)
|
||||
: QObject(parent)
|
||||
{
|
||||
@@ -101,7 +110,7 @@ RDCae::RDCae(RDStation *station,RDConfig *config,QObject *parent)
|
||||
for(unsigned k=0;k<2;k++) {
|
||||
cae_input_levels[i][j][k]=-10000;
|
||||
cae_output_levels[i][j][k]=-10000;
|
||||
cae_stream_output_levels[i][j][k]=-10000;
|
||||
// cae_stream_output_levels[i][j][k]=-10000;
|
||||
}
|
||||
for(int k=0;k<RD_MAX_STREAMS;k++) {
|
||||
cae_output_status_flags[i][j][k]=false;
|
||||
@@ -195,6 +204,7 @@ int RDCae::startPlayback(const QString &cutname,int cardnum,int portnum,
|
||||
{
|
||||
int serial=cae_next_serial_number++;
|
||||
|
||||
cae_stream_output_levels[serial]=new __RDCaeMeterPoint();
|
||||
SendCommand(QString::asprintf("PY %d %s %d %d %d %d %d",
|
||||
serial,cutname.toUtf8().constData(),
|
||||
cardnum,portnum,start_pos,end_pos,100000));
|
||||
@@ -226,6 +236,10 @@ void RDCae::resumePlayback(int serial)
|
||||
void RDCae::stopPlayback(int serial)
|
||||
{
|
||||
SendCommand(QString::asprintf("SP %d",serial));
|
||||
if(cae_stream_output_levels.value(serial)!=NULL) {
|
||||
delete cae_stream_output_levels.value(serial);
|
||||
cae_stream_output_levels.remove(serial);
|
||||
}
|
||||
emit playbackStopped(serial);
|
||||
}
|
||||
|
||||
@@ -395,11 +409,17 @@ void RDCae::outputMeterUpdate(int card,int port,short levels[2])
|
||||
}
|
||||
|
||||
|
||||
void RDCae::outputStreamMeterUpdate(int card,int stream,short levels[2])
|
||||
void RDCae::outputStreamMeterUpdate(int serial,short levels[2])
|
||||
{
|
||||
__RDCaeMeterPoint *mp=NULL;
|
||||
|
||||
UpdateMeters();
|
||||
levels[0]=cae_stream_output_levels[card][stream][0];
|
||||
levels[1]=cae_stream_output_levels[card][stream][1];
|
||||
if((mp=cae_stream_output_levels.value(serial))!=NULL) {
|
||||
levels[0]=mp->levels[0];
|
||||
levels[1]=mp->levels[1];
|
||||
}
|
||||
// levels[0]=cae_stream_output_levels[card][stream][0];
|
||||
// levels[1]=cae_stream_output_levels[card][stream][1];
|
||||
}
|
||||
|
||||
|
||||
@@ -582,6 +602,10 @@ void RDCae::ProcessCommand(const QString &cmd)
|
||||
if((f0.at(0)=="SP")&&(f0.size()==2)) { // Playback Stopped
|
||||
serial=f0.at(1).toInt(&ok);
|
||||
if(ok&&(serial>0)) {
|
||||
if(cae_stream_output_levels.value(serial)!=NULL) {
|
||||
delete cae_stream_output_levels.value(serial);
|
||||
cae_stream_output_levels.remove(serial);
|
||||
}
|
||||
emit playbackStopped(serial);
|
||||
}
|
||||
}
|
||||
@@ -759,6 +783,7 @@ void RDCae::UpdateMeters()
|
||||
char msg[1501];
|
||||
int n;
|
||||
QStringList args;
|
||||
__RDCaeMeterPoint *mp=NULL;
|
||||
|
||||
while((n=cae_meter_socket->readDatagram(msg,1500))>0) {
|
||||
msg[n]=0;
|
||||
@@ -778,11 +803,11 @@ void RDCae::UpdateMeters()
|
||||
}
|
||||
}
|
||||
if(args[0]=="MO") {
|
||||
if(args.size()==5) {
|
||||
cae_stream_output_levels[args[1].toInt()][args[2].toInt()][0]=
|
||||
args[3].toInt();
|
||||
cae_stream_output_levels[args[1].toInt()][args[2].toInt()][1]=
|
||||
args[4].toInt();
|
||||
if(args.size()==4) {
|
||||
if((mp=cae_stream_output_levels.value(args[1].toInt()))!=NULL) {
|
||||
mp->levels[0]=args[2].toInt();
|
||||
mp->levels[1]=args[3].toInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
if(args[0]=="MP") {
|
||||
|
18
lib/rdcae.h
18
lib/rdcae.h
@@ -31,6 +31,16 @@
|
||||
#include <rdstation.h>
|
||||
#include <rdconfig.h>
|
||||
|
||||
class __RDCaeMeterPoint
|
||||
{
|
||||
public:
|
||||
__RDCaeMeterPoint();
|
||||
short levels[2];
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
class RDCae : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -69,7 +79,8 @@ class RDCae : public QObject
|
||||
bool inputStatus(int card,int port) const;
|
||||
void inputMeterUpdate(int card,int port,short levels[2]);
|
||||
void outputMeterUpdate(int card,int port,short levels[2]);
|
||||
void outputStreamMeterUpdate(int card,int stream,short levels[2]);
|
||||
// void outputStreamMeterUpdate(int card,int stream,short levels[2]);
|
||||
void outputStreamMeterUpdate(int serial,short levels[2]);
|
||||
unsigned playPosition(int handle);
|
||||
void requestTimescale(int card);
|
||||
bool playPortActive(int card,int port,int except_stream=-1);
|
||||
@@ -124,7 +135,10 @@ class RDCae : public QObject
|
||||
int cae_meter_port_range;
|
||||
short cae_input_levels[RD_MAX_CARDS][RD_MAX_PORTS][2];
|
||||
short cae_output_levels[RD_MAX_CARDS][RD_MAX_PORTS][2];
|
||||
short cae_stream_output_levels[RD_MAX_CARDS][RD_MAX_PORTS][2];
|
||||
|
||||
// short cae_stream_output_levels[RD_MAX_CARDS][RD_MAX_PORTS][2];
|
||||
QMap<int,__RDCaeMeterPoint *> cae_stream_output_levels;
|
||||
|
||||
unsigned cae_output_positions[RD_MAX_CARDS][RD_MAX_STREAMS];
|
||||
bool cae_output_status_flags[RD_MAX_CARDS][RD_MAX_PORTS][RD_MAX_STREAMS];
|
||||
std::vector<RDCmdCache> delayed_cmds;
|
||||
|
@@ -379,8 +379,7 @@ void RDCartSlot::updateMeters()
|
||||
switch(slot_deck->state()) {
|
||||
case RDPlayDeck::Playing:
|
||||
case RDPlayDeck::Stopping:
|
||||
slot_cae->
|
||||
outputStreamMeterUpdate(slot_deck->card(),slot_deck->stream(),lvls);
|
||||
slot_cae->outputStreamMeterUpdate(slot_deck->serialNumber(),lvls);
|
||||
slot_box->updateMeters(lvls);
|
||||
break;
|
||||
|
||||
|
@@ -105,6 +105,12 @@ void RDPlayDeck::setId(int id)
|
||||
}
|
||||
|
||||
|
||||
int RDPlayDeck::serialNumber() const
|
||||
{
|
||||
return play_serial;
|
||||
}
|
||||
|
||||
|
||||
int RDPlayDeck::owner() const
|
||||
{
|
||||
return play_owner;
|
||||
|
@@ -45,6 +45,7 @@ class RDPlayDeck : public QObject
|
||||
~RDPlayDeck();
|
||||
int id() const;
|
||||
void setId(int id);
|
||||
int serialNumber() const;
|
||||
int owner() const;
|
||||
void setOwner(int owner);
|
||||
RDCart *cart() const;
|
||||
|
Reference in New Issue
Block a user