mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-05-25 00:45:56 +02:00
2023-10-09 Fred Gleason <fredg@paravelsystems.com>
* Fixed regressions in 'RDCae' that broke various mixer CAE commands. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
parent
4c7e11116e
commit
fee45742ef
@ -24439,3 +24439,5 @@
|
||||
Audio' dialogs that broke audio stoppage and looping.
|
||||
* Fixed a regression in caed(1) that caused play-out streams to
|
||||
be leaked when a play-out hit EOF.
|
||||
2023-10-09 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Fixed regressions in 'RDCae' that broke various mixer CAE commands.
|
||||
|
@ -186,7 +186,7 @@ void RDCae::enableMetering(QList<int> *cards)
|
||||
}
|
||||
}
|
||||
}
|
||||
SendCommand(cmd+"!");
|
||||
SendCommand(cmd);
|
||||
}
|
||||
|
||||
|
||||
@ -322,7 +322,7 @@ void RDCae::loadRecord(int card,int stream,QString name,
|
||||
{
|
||||
// printf("RDCae::loadRecord(%d,%d,%s,%d,%d,%d,%d)\n",
|
||||
// card,stream,(const char *)name,coding,chan,samp_rate,bit_rate);
|
||||
SendCommand(QString::asprintf("LR %d %d %d %d %d %d %s!",
|
||||
SendCommand(QString::asprintf("LR %d %d %d %d %d %d %s",
|
||||
card,stream,(int)coding,chan,samp_rate,
|
||||
bit_rate,name.toUtf8().constData()));
|
||||
}
|
||||
@ -331,46 +331,45 @@ void RDCae::loadRecord(int card,int stream,QString name,
|
||||
void RDCae::unloadRecord(int card,int stream)
|
||||
|
||||
{
|
||||
SendCommand(QString::asprintf("UR %d %d!",card,stream));
|
||||
SendCommand(QString::asprintf("UR %d %d",card,stream));
|
||||
}
|
||||
|
||||
|
||||
void RDCae::record(int card,int stream,unsigned length,int threshold)
|
||||
{
|
||||
SendCommand(QString::asprintf("RD %d %d %u %d!",
|
||||
SendCommand(QString::asprintf("RD %d %d %u %d",
|
||||
card,stream,length,threshold));
|
||||
}
|
||||
|
||||
|
||||
void RDCae::stopRecord(int card,int stream)
|
||||
{
|
||||
SendCommand(QString::asprintf("SR %d %d!",card,stream));
|
||||
SendCommand(QString::asprintf("SR %d %d",card,stream));
|
||||
}
|
||||
|
||||
|
||||
void RDCae::setOutputVolume(int card,int stream,int port,int level)
|
||||
{
|
||||
SendCommand(QString::asprintf("OV %d %d %d %d!",card,stream,port,level));
|
||||
SendCommand(QString::asprintf("OV %d %d %d %d",card,stream,port,level));
|
||||
}
|
||||
|
||||
|
||||
void RDCae::setOutputPort(int card,int stream,int port)
|
||||
{
|
||||
SendCommand(QString::asprintf("OP %d %d %d 0!",card,stream,port));
|
||||
SendCommand(QString::asprintf("OP %d %d %d 0",card,stream,port));
|
||||
}
|
||||
|
||||
|
||||
void RDCae::fadeOutputVolume(int card,int stream,int port,int level,int length)
|
||||
{
|
||||
SendCommand(QString::asprintf("FV %d %d %d %d %d!",
|
||||
SendCommand(QString::asprintf("FV %d %d %d %d %d",
|
||||
card,stream,port,level,length));
|
||||
}
|
||||
|
||||
|
||||
void RDCae::setPassthroughVolume(int card,int in_port,int out_port,int level)
|
||||
{
|
||||
SendCommand(QString().
|
||||
sprintf("AL %d %d %d %d!",card,in_port,out_port,level));
|
||||
SendCommand(QString::asprintf("AL %d %d %d %d",card,in_port,out_port,level));
|
||||
}
|
||||
|
||||
|
||||
|
@ -31,7 +31,7 @@ RDPlayDeck::RDPlayDeck(RDCae *cae,int id,QObject *parent)
|
||||
play_start_time=QTime();
|
||||
play_owner=-1;
|
||||
play_last_start_position=0;
|
||||
play_handle=-1;
|
||||
play_serial=-1;
|
||||
play_audio_length=0;
|
||||
play_channel=-1;
|
||||
play_hook_mode=false;
|
||||
@ -50,8 +50,9 @@ RDPlayDeck::RDPlayDeck(RDCae *cae,int id,QObject *parent)
|
||||
// CAE Connection
|
||||
//
|
||||
play_cae=cae;
|
||||
connect(play_cae,SIGNAL(playing(int)),this,SLOT(playingData(int)));
|
||||
connect(play_cae,SIGNAL(playStopped(int)),this,SLOT(playStoppedData(int)));
|
||||
connect(play_cae,SIGNAL(playStarted(int)),this,SLOT(playStartedData(int)));
|
||||
connect(play_cae,SIGNAL(playbackStopped(int)),
|
||||
this,SLOT(playbackStoppedData(int)));
|
||||
play_cart=NULL;
|
||||
play_cut=NULL;
|
||||
play_card=-1;
|
||||
@ -86,7 +87,7 @@ RDPlayDeck::RDPlayDeck(RDCae *cae,int id,QObject *parent)
|
||||
RDPlayDeck::~RDPlayDeck()
|
||||
{
|
||||
if(play_state!=RDPlayDeck::Stopped) {
|
||||
play_cae->stopPlayback(play_handle);
|
||||
play_cae->stopPlayback(play_serial);
|
||||
// play_cae->unloadPlay(play_handle);
|
||||
}
|
||||
}
|
||||
@ -257,7 +258,7 @@ RDCut *RDPlayDeck::cut() const
|
||||
|
||||
bool RDPlayDeck::playable() const
|
||||
{
|
||||
if(play_handle<0) {
|
||||
if(play_serial<0) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@ -368,7 +369,7 @@ void RDPlayDeck::reset()
|
||||
switch(play_state) {
|
||||
case RDPlayDeck::Playing:
|
||||
case RDPlayDeck::Stopping:
|
||||
play_cae->stopPlayback(play_handle);
|
||||
play_cae->stopPlayback(play_serial);
|
||||
|
||||
case RDPlayDeck::Paused:
|
||||
// play_cae->unloadPlay(play_handle);
|
||||
@ -451,10 +452,11 @@ void RDPlayDeck::play(unsigned pos,int segue_start,int segue_end,
|
||||
play_duck_up_point=0;
|
||||
else
|
||||
play_ducked=play_duck_gain[0];
|
||||
|
||||
if(play_handle<0) {
|
||||
/*
|
||||
if(play_serial<0) {
|
||||
return;
|
||||
}
|
||||
*/
|
||||
if(segue_start>=0) {
|
||||
play_point_value[RDPlayDeck::Segue][0]=segue_start;
|
||||
}
|
||||
@ -466,9 +468,9 @@ void RDPlayDeck::play(unsigned pos,int segue_start,int segue_end,
|
||||
play_last_start_position=play_start_position;
|
||||
stop_called=false;
|
||||
pause_called=false;
|
||||
play_cae->positionPlay(play_handle,play_audio_point[0]+pos);
|
||||
play_cae->setPlayPortActive(play_card,play_port,play_stream);
|
||||
play_cae->setOutputVolume(play_card,play_stream,-1,RD_MUTE_DEPTH);
|
||||
// play_cae->positionPlay(play_serial,play_audio_point[0]+pos);
|
||||
// play_cae->setPlayPortActive(play_card,play_port,play_stream);
|
||||
// play_cae->setOutputVolume(play_card,play_stream,-1,RD_MUTE_DEPTH);
|
||||
if((play_fade_point[0]==-1)||(play_fade_point[0]==play_audio_point[0])||
|
||||
((fadeup=play_fade_point[0]-play_audio_point[0]-pos)<=0)||
|
||||
(play_state==RDPlayDeck::Paused)) {
|
||||
@ -518,9 +520,17 @@ void RDPlayDeck::play(unsigned pos,int segue_start,int segue_end,
|
||||
(double)play_timescale_speed),
|
||||
play_timescale_speed,false);
|
||||
*/
|
||||
printf("startPlayback(\"%s\",%d,%d,%d,%d,%d)\n",
|
||||
play_cut->cutName().toUtf8().constData(),play_card,play_port,
|
||||
play_audio_point[0]+pos,
|
||||
play_audio_point[1],play_timescale_speed);
|
||||
play_serial=play_cae->startPlayback(play_cut->cutName(),play_card,play_port,
|
||||
play_audio_point[0]+pos,
|
||||
play_audio_point[1],play_timescale_speed);
|
||||
play_start_time=QTime::currentTime();
|
||||
StartTimers(pos);
|
||||
play_state=RDPlayDeck::Playing;
|
||||
playStartedData(play_serial);
|
||||
}
|
||||
|
||||
|
||||
@ -551,6 +561,7 @@ void RDPlayDeck::stop()
|
||||
stop_called=true;
|
||||
play_state=RDPlayDeck::Stopping;
|
||||
// play_cae->stopPlay(play_handle);
|
||||
play_cae->stopPlayback(play_serial);
|
||||
}
|
||||
}
|
||||
|
||||
@ -627,9 +638,9 @@ void RDPlayDeck::duckVolume(int level,int fade)
|
||||
}
|
||||
|
||||
|
||||
void RDPlayDeck::playingData(int handle)
|
||||
void RDPlayDeck::playStartedData(int serial)
|
||||
{
|
||||
if(handle!=play_handle) {
|
||||
if(serial!=play_serial) {
|
||||
return;
|
||||
}
|
||||
play_position_timer->start(POSITION_INTERVAL);
|
||||
@ -637,9 +648,9 @@ void RDPlayDeck::playingData(int handle)
|
||||
}
|
||||
|
||||
|
||||
void RDPlayDeck::playStoppedData(int handle)
|
||||
void RDPlayDeck::playbackStoppedData(int serial)
|
||||
{
|
||||
if(handle!=play_handle) {
|
||||
if(serial!=play_serial) {
|
||||
return;
|
||||
}
|
||||
play_position_timer->stop();
|
||||
@ -652,7 +663,7 @@ void RDPlayDeck::playStoppedData(int handle)
|
||||
else {
|
||||
// play_cae->unloadPlay(play_handle);
|
||||
|
||||
play_handle=-1;
|
||||
play_serial=-1;
|
||||
play_state=RDPlayDeck::Stopped;
|
||||
play_current_position=0;
|
||||
play_duck_down_state=false;
|
||||
|
@ -86,8 +86,8 @@ class RDPlayDeck : public QObject
|
||||
void talkEnd(int id);
|
||||
|
||||
private slots:
|
||||
void playingData(int handle);
|
||||
void playStoppedData(int handle);
|
||||
void playStartedData(int serial);
|
||||
void playbackStoppedData(int serial);
|
||||
void pointTimerData(int);
|
||||
void positionTimerData();
|
||||
void fadeTimerData();
|
||||
@ -127,7 +127,8 @@ class RDPlayDeck : public QObject
|
||||
int play_stream;
|
||||
int play_port;
|
||||
int play_channel;
|
||||
int play_handle;
|
||||
// int play_handle;
|
||||
int play_serial;
|
||||
unsigned play_forced_length;
|
||||
bool play_hook_mode;
|
||||
QTime play_start_time;
|
||||
|
@ -59,11 +59,9 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent)
|
||||
applicationIcon(RDIconEngine::RdCartSlots,22));
|
||||
|
||||
//
|
||||
// CAE Connection
|
||||
// Start Meters
|
||||
//
|
||||
connect(rda->cae(),SIGNAL(isConnected(bool)),
|
||||
this,SLOT(caeConnectedData(bool)));
|
||||
rda->cae()->connectToHost();
|
||||
EnableMetering();
|
||||
|
||||
//
|
||||
// RIPC Connection
|
||||
@ -137,22 +135,6 @@ QSize MainWidget::sizeHint() const
|
||||
}
|
||||
|
||||
|
||||
void MainWidget::caeConnectedData(bool state)
|
||||
{
|
||||
QList<int> cards;
|
||||
|
||||
QString sql=QString("select `CARD` from `CARTSLOTS` where ")+
|
||||
"`STATION_NAME`='"+RDEscapeString(rda->config()->stationName())+"'";
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
while(q->next()) {
|
||||
cards.push_back(q->value(0).toInt());
|
||||
}
|
||||
delete q;
|
||||
|
||||
rda->cae()->enableMetering(&cards);
|
||||
}
|
||||
|
||||
|
||||
void MainWidget::rmlReceivedData(RDMacro *rml)
|
||||
{
|
||||
RunLocalMacros(rml);
|
||||
@ -198,6 +180,22 @@ void MainWidget::closeEvent(QCloseEvent *e)
|
||||
}
|
||||
|
||||
|
||||
void MainWidget::EnableMetering()
|
||||
{
|
||||
QList<int> cards;
|
||||
|
||||
QString sql=QString("select `CARD` from `CARTSLOTS` where ")+
|
||||
"`STATION_NAME`='"+RDEscapeString(rda->config()->stationName())+"'";
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
while(q->next()) {
|
||||
cards.push_back(q->value(0).toInt());
|
||||
}
|
||||
delete q;
|
||||
|
||||
rda->cae()->enableMetering(&cards);
|
||||
}
|
||||
|
||||
|
||||
void MainWidget::SetCaption()
|
||||
{
|
||||
QString service=tr("[None]");
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// A Dedicated Cart Slot Utility for Rivendell.
|
||||
//
|
||||
// (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
|
||||
// it under the terms of the GNU General Public License version 2 as
|
||||
@ -41,7 +41,6 @@ class MainWidget : public RDMainWindow
|
||||
QSizePolicy sizePolicy() const;
|
||||
|
||||
private slots:
|
||||
void caeConnectedData(bool state);
|
||||
void userData();
|
||||
void rmlReceivedData(RDMacro *rml);
|
||||
|
||||
@ -50,6 +49,7 @@ class MainWidget : public RDMainWindow
|
||||
void closeEvent(QCloseEvent *e);
|
||||
|
||||
private:
|
||||
void EnableMetering();
|
||||
void RunLocalMacros(RDMacro *rml);
|
||||
void SetCaption();
|
||||
RDEventPlayer *panel_player;
|
||||
|
Loading…
x
Reference in New Issue
Block a user