mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-07-08 16:37:46 +02:00
2023-12-15 Fred Gleason <fredg@paravelsystems.com>
* Modified the call parameters of the 'Output Stream Meter Levels' ['MO'] CAE command to use play session serial numbers rather than card and stream numbers. * Fixed a regression in rdcartslots(1) that broke audio meters. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
parent
81c6ad8d1e
commit
35299494a4
@ -24543,3 +24543,8 @@
|
|||||||
2023-12-14 Fred Gleason <fredg@paravelsystems.com>
|
2023-12-14 Fred Gleason <fredg@paravelsystems.com>
|
||||||
* Fixed regressions in the CAE subsystem that broke play-out
|
* Fixed regressions in the CAE subsystem that broke play-out
|
||||||
positioning and active output port reporting.
|
positioning and active output port reporting.
|
||||||
|
2023-12-15 Fred Gleason <fredg@paravelsystems.com>
|
||||||
|
* Modified the call parameters of the 'Output Stream Meter Levels'
|
||||||
|
['MO'] CAE command to use play session serial numbers rather than
|
||||||
|
card and stream numbers.
|
||||||
|
* Fixed a regression in rdcartslots(1) that broke audio meters.
|
||||||
|
46
cae/cae.cpp
46
cae/cae.cpp
@ -1142,6 +1142,10 @@ void MainObject::updateMeters()
|
|||||||
Driver *dvr=GetDriver(i);
|
Driver *dvr=GetDriver(i);
|
||||||
if(dvr!=NULL) {
|
if(dvr!=NULL) {
|
||||||
for(int j=0;j<RD_MAX_PORTS;j++) {
|
for(int j=0;j<RD_MAX_PORTS;j++) {
|
||||||
|
|
||||||
|
//
|
||||||
|
// Input Port Statuses
|
||||||
|
//
|
||||||
if(dvr->getInputStatus(i,j)!=port_status[i][j]) {
|
if(dvr->getInputStatus(i,j)!=port_status[i][j]) {
|
||||||
port_status[i][j]=dvr->getInputStatus(i,j);
|
port_status[i][j]=dvr->getInputStatus(i,j);
|
||||||
if(port_status[i][j]) {
|
if(port_status[i][j]) {
|
||||||
@ -1151,6 +1155,10 @@ void MainObject::updateMeters()
|
|||||||
cae_server->sendCommand(QString::asprintf("IS %d %d 1!",i,j));
|
cae_server->sendCommand(QString::asprintf("IS %d %d 1!",i,j));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Port Meters
|
||||||
|
//
|
||||||
if(dvr->getInputMeters(i,j,levels)) {
|
if(dvr->getInputMeters(i,j,levels)) {
|
||||||
SendMeterLevelUpdate("I",i,j,levels);
|
SendMeterLevelUpdate("I",i,j,levels);
|
||||||
}
|
}
|
||||||
@ -1158,12 +1166,25 @@ void MainObject::updateMeters()
|
|||||||
SendMeterLevelUpdate("O",i,j,levels);
|
SendMeterLevelUpdate("O",i,j,levels);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Output Positions
|
||||||
|
//
|
||||||
dvr->getOutputPosition(i,positions);
|
dvr->getOutputPosition(i,positions);
|
||||||
SendMeterPositionUpdate(i,positions);
|
SendMeterPositionUpdate(i,positions);
|
||||||
for(int j=0;j<RD_MAX_STREAMS;j++) {
|
|
||||||
if(dvr->getStreamOutputMeters(i,j,levels)) {
|
//
|
||||||
SendStreamMeterLevelUpdate(i,j,levels);
|
// Output Stream Meters
|
||||||
}
|
//
|
||||||
|
for(QMap<uint64_t,PlaySession *>::const_iterator it=play_sessions.begin();
|
||||||
|
it!=play_sessions.end();it++) {
|
||||||
|
if((int)it.value()->cardNumber()==i) {
|
||||||
|
if(dvr->getStreamOutputMeters(it.value()->cardNumber(),
|
||||||
|
it.value()->streamNumber(),
|
||||||
|
levels)) {
|
||||||
|
SendStreamMeterLevelUpdate(it.value(),levels);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1587,18 +1608,15 @@ void MainObject::SendMeterLevelUpdate(const QString &type,int cardnum,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MainObject::SendStreamMeterLevelUpdate(int cardnum,int streamnum,
|
void MainObject::SendStreamMeterLevelUpdate(PlaySession *psess,short levels[])
|
||||||
short levels[])
|
|
||||||
{
|
{
|
||||||
QList<int> ids=cae_server->connectionIds();
|
if((cae_server->meterPort(psess->socketDescriptor())>0)&&
|
||||||
|
cae_server->metersEnabled(psess->socketDescriptor(),psess->cardNumber())) {
|
||||||
for(int l=0;l<ids.size();l++) {
|
SendMeterUpdate(QString::asprintf("MO %u %d %d",psess->serialNumber(),
|
||||||
if((cae_server->meterPort(ids.at(l))>0)&&
|
levels[0],levels[1]),
|
||||||
cae_server->metersEnabled(ids.at(l),cardnum)) {
|
psess->socketDescriptor());
|
||||||
SendMeterUpdate(QString::asprintf("MO %d %d %d %d",
|
|
||||||
cardnum,streamnum,levels[0],levels[1]),ids.at(l));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -122,7 +122,7 @@ class MainObject : public QObject
|
|||||||
void ClearDriverEntries() const;
|
void ClearDriverEntries() const;
|
||||||
void SendMeterLevelUpdate(const QString &type,int cardnum,int portnum,
|
void SendMeterLevelUpdate(const QString &type,int cardnum,int portnum,
|
||||||
short levels[]);
|
short levels[]);
|
||||||
void SendStreamMeterLevelUpdate(int cardnum,int streamnum,short levels[]);
|
void SendStreamMeterLevelUpdate(PlaySession *psess,short levels[]);
|
||||||
void SendMeterPositionUpdate(int cardnum,unsigned pos[]);
|
void SendMeterPositionUpdate(int cardnum,unsigned pos[]);
|
||||||
void SendMeterOutputStatusUpdate();
|
void SendMeterOutputStatusUpdate();
|
||||||
void SendMeterOutputStatusUpdate(int card,int port,int stream);
|
void SendMeterOutputStatusUpdate(int card,int port,int stream);
|
||||||
|
@ -1528,29 +1528,19 @@
|
|||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
<computeroutput>MO
|
<computeroutput>MO
|
||||||
<replaceable>card-num</replaceable>
|
<replaceable>serial</replaceable>
|
||||||
<replaceable>port-num</replaceable>
|
|
||||||
<replaceable>left-lvl</replaceable>
|
<replaceable>left-lvl</replaceable>
|
||||||
<replaceable>right-lvl</replaceable>!</computeroutput>
|
<replaceable>right-lvl</replaceable>!</computeroutput>
|
||||||
</para>
|
</para>
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>
|
||||||
<replaceable>card-num</replaceable>
|
<replaceable>serial</replaceable>
|
||||||
</term>
|
</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
The number of the audio adapter to use.
|
The serial number of the playback event, from the
|
||||||
</para>
|
<command>Load Playback</command> call.
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
<replaceable>port-num</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
The port number on the audio adapter.
|
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -43,6 +43,9 @@ __RDCae_PlayChannel::__RDCae_PlayChannel(unsigned card,unsigned port)
|
|||||||
d_card=card;
|
d_card=card;
|
||||||
d_port=port;
|
d_port=port;
|
||||||
d_position=0;
|
d_position=0;
|
||||||
|
for(int i=0;i<2;i++) {
|
||||||
|
d_stream_levels[i]=RD_MUTE_DEPTH;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -70,6 +73,21 @@ void __RDCae_PlayChannel::setPosition(unsigned pos)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void __RDCae_PlayChannel::getStreamLevels(short lvls[2])
|
||||||
|
{
|
||||||
|
for(int i=0;i<2;i++) {
|
||||||
|
lvls[i]=d_stream_levels[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void __RDCae_PlayChannel::setStreamLevels(short left_lvl,short right_lvl)
|
||||||
|
{
|
||||||
|
d_stream_levels[0]=left_lvl;
|
||||||
|
d_stream_levels[1]=right_lvl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool __RDCae_PlayChannel::operator==(const __RDCae_PlayChannel &other) const
|
bool __RDCae_PlayChannel::operator==(const __RDCae_PlayChannel &other) const
|
||||||
{
|
{
|
||||||
return (d_card==other.d_card)&&(d_port==other.d_port);
|
return (d_card==other.d_card)&&(d_port==other.d_port);
|
||||||
@ -151,7 +169,6 @@ RDCae::RDCae(RDStation *station,RDConfig *config,QObject *parent)
|
|||||||
for(unsigned k=0;k<2;k++) {
|
for(unsigned k=0;k<2;k++) {
|
||||||
cae_input_levels[i][j][k]=-10000;
|
cae_input_levels[i][j][k]=-10000;
|
||||||
cae_output_levels[i][j][k]=-10000;
|
cae_output_levels[i][j][k]=-10000;
|
||||||
cae_stream_output_levels[i][j][k]=-10000;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -415,11 +432,14 @@ void RDCae::outputMeterUpdate(int card,int port,short levels[2])
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void RDCae::outputStreamMeterUpdate(int card,int stream,short levels[2])
|
void RDCae::outputStreamMeterUpdate(unsigned serial,short levels[2])
|
||||||
{
|
{
|
||||||
UpdateMeters();
|
__RDCae_PlayChannel *chan=NULL;
|
||||||
levels[0]=cae_stream_output_levels[card][stream][0];
|
|
||||||
levels[1]=cae_stream_output_levels[card][stream][1];
|
if((chan=cae_play_channels.value(serial))!=NULL) {
|
||||||
|
UpdateMeters();
|
||||||
|
chan->getStreamLevels(levels);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -521,14 +541,12 @@ void RDCae::DispatchCommand(const QString &cmd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if((cmds.at(0)=="PP")&&(cmds.size()==3)) { // Position Play
|
if((cmds.at(0)=="PP")&&(cmds.size()==3)) { // Position Play
|
||||||
printf("Position Play\n");
|
|
||||||
unsigned serial=cmds.at(1).toUInt(&ok);
|
unsigned serial=cmds.at(1).toUInt(&ok);
|
||||||
if(ok) {
|
if(ok) {
|
||||||
unsigned pos=cmds.at(2).toUInt(&ok);
|
unsigned pos=cmds.at(2).toUInt(&ok);
|
||||||
if(ok) {
|
if(ok) {
|
||||||
if((chan=cae_play_channels.value(serial))!=NULL) {
|
if((chan=cae_play_channels.value(serial))!=NULL) {
|
||||||
if(SerialCheck(serial,LINE_NUMBER)) {
|
if(SerialCheck(serial,LINE_NUMBER)) {
|
||||||
printf("emitting playPositioned(%u,%u)\n",serial,pos);
|
|
||||||
emit playPositioned(serial,pos);
|
emit playPositioned(serial,pos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -654,6 +672,7 @@ void RDCae::UpdateMeters()
|
|||||||
char msg[1501];
|
char msg[1501];
|
||||||
int n;
|
int n;
|
||||||
QStringList args;
|
QStringList args;
|
||||||
|
__RDCae_PlayChannel *chan=NULL;
|
||||||
|
|
||||||
bool ok=false;
|
bool ok=false;
|
||||||
|
|
||||||
@ -675,11 +694,13 @@ void RDCae::UpdateMeters()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(args[0]=="MO") {
|
if(args[0]=="MO") {
|
||||||
if(args.size()==5) {
|
if(args.size()==4) {
|
||||||
cae_stream_output_levels[args[1].toInt()][args[2].toInt()][0]=
|
unsigned serial=args.at(1).toUInt(&ok);
|
||||||
args[3].toInt();
|
if(ok) {
|
||||||
cae_stream_output_levels[args[1].toInt()][args[2].toInt()][1]=
|
if((chan=cae_play_channels.value(serial))!=NULL) {
|
||||||
args[4].toInt();
|
chan->setStreamLevels(args.at(2).toShort(),args.at(3).toShort());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(args[0]=="MP") {
|
if(args[0]=="MP") {
|
||||||
|
@ -38,12 +38,15 @@ class __RDCae_PlayChannel
|
|||||||
unsigned port() const;
|
unsigned port() const;
|
||||||
unsigned position() const;
|
unsigned position() const;
|
||||||
void setPosition(unsigned pos);
|
void setPosition(unsigned pos);
|
||||||
|
void getStreamLevels(short lvls[2]);
|
||||||
|
void setStreamLevels(short left_lvl,short right_lvl);
|
||||||
bool operator==(const __RDCae_PlayChannel &other) const;
|
bool operator==(const __RDCae_PlayChannel &other) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
unsigned d_card;
|
unsigned d_card;
|
||||||
unsigned d_port;
|
unsigned d_port;
|
||||||
unsigned d_position;
|
unsigned d_position;
|
||||||
|
short d_stream_levels[2];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -85,7 +88,7 @@ class RDCae : public QObject
|
|||||||
bool inputStatus(int card,int port) const;
|
bool inputStatus(int card,int port) const;
|
||||||
void inputMeterUpdate(int card,int port,short levels[2]);
|
void inputMeterUpdate(int card,int port,short levels[2]);
|
||||||
void outputMeterUpdate(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(unsigned serial,short levels[2]);
|
||||||
unsigned playPosition(unsigned serial);
|
unsigned playPosition(unsigned serial);
|
||||||
void requestTimescale(int card);
|
void requestTimescale(int card);
|
||||||
bool playPortStatus(int card,int port,unsigned except_serial=0) const;
|
bool playPortStatus(int card,int port,unsigned except_serial=0) const;
|
||||||
@ -128,7 +131,6 @@ class RDCae : public QObject
|
|||||||
int cae_meter_port_range;
|
int cae_meter_port_range;
|
||||||
short cae_input_levels[RD_MAX_CARDS][RD_MAX_PORTS][2];
|
short cae_input_levels[RD_MAX_CARDS][RD_MAX_PORTS][2];
|
||||||
short cae_output_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];
|
|
||||||
QMap<unsigned,__RDCae_PlayChannel *> cae_play_channels;
|
QMap<unsigned,__RDCae_PlayChannel *> cae_play_channels;
|
||||||
RDStation *cae_station;
|
RDStation *cae_station;
|
||||||
RDConfig *cae_config;
|
RDConfig *cae_config;
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// The cart slot widget.
|
// The cart slot widget.
|
||||||
//
|
//
|
||||||
// (C) Copyright 2012-2021 Fred Gleason <fredg@paravelsystems.com>
|
// (C) Copyright 2012-2023 Fred Gleason <fredg@paravelsystems.com>
|
||||||
//
|
//
|
||||||
// This program is free software; you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License version 2 as
|
||||||
@ -373,14 +373,12 @@ void RDCartSlot::setPauseEnabled(bool state)
|
|||||||
|
|
||||||
void RDCartSlot::updateMeters()
|
void RDCartSlot::updateMeters()
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
short lvls[2];
|
short lvls[2];
|
||||||
|
|
||||||
switch(slot_deck->state()) {
|
switch(slot_deck->state()) {
|
||||||
case RDPlayDeck::Playing:
|
case RDPlayDeck::Playing:
|
||||||
case RDPlayDeck::Stopping:
|
case RDPlayDeck::Stopping:
|
||||||
slot_cae->
|
slot_cae->outputStreamMeterUpdate(slot_deck->serial(),lvls);
|
||||||
outputStreamMeterUpdate(slot_deck->card(),slot_deck->stream(),lvls);
|
|
||||||
slot_box->updateMeters(lvls);
|
slot_box->updateMeters(lvls);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -389,7 +387,6 @@ void RDCartSlot::updateMeters()
|
|||||||
case RDPlayDeck::Finished:
|
case RDPlayDeck::Finished:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -470,7 +467,6 @@ void RDCartSlot::optionsData()
|
|||||||
|
|
||||||
void RDCartSlot::stateChangedData(int id,RDPlayDeck::State state)
|
void RDCartSlot::stateChangedData(int id,RDPlayDeck::State state)
|
||||||
{
|
{
|
||||||
//printf("stateChangedData(%d,%d)\n",id,state);
|
|
||||||
short lvls[2]={-10000,-10000};
|
short lvls[2]={-10000,-10000};
|
||||||
RDCart *cart=NULL;
|
RDCart *cart=NULL;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user