2023-10-14 Fred Gleason <fredg@paravelsystems.com>

* Fixed a regression in rdcatch(1) that broke audio audition
	play-out.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason 2023-10-14 11:47:53 -04:00
parent 7242a00758
commit e9f4b91a5d
5 changed files with 72 additions and 98 deletions

View File

@ -24450,3 +24450,6 @@
use serial numbers rather than card/stream numbers. use serial numbers rather than card/stream numbers.
* Fixed a regression in rdcartslots(1) that broke audio level * Fixed a regression in rdcartslots(1) that broke audio level
metering. metering.
2023-10-14 Fred Gleason <fredg@paravelsystems.com>
* Fixed a regression in rdcatch(1) that broke audio audition
play-out.

View File

@ -135,10 +135,7 @@ 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<int,__RDCaeMeterPoint *> cae_stream_output_levels; QMap<int,__RDCaeMeterPoint *> cae_stream_output_levels;
unsigned cae_output_positions[RD_MAX_CARDS][RD_MAX_STREAMS]; unsigned cae_output_positions[RD_MAX_CARDS][RD_MAX_STREAMS];
bool cae_output_status_flags[RD_MAX_CARDS][RD_MAX_PORTS][RD_MAX_STREAMS]; bool cae_output_status_flags[RD_MAX_CARDS][RD_MAX_PORTS][RD_MAX_STREAMS];
std::vector<RDCmdCache> delayed_cmds; std::vector<RDCmdCache> delayed_cmds;

View File

@ -58,8 +58,6 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent)
QString err_msg; QString err_msg;
catch_host_warnings=false; catch_host_warnings=false;
catch_audition_stream=-1;
catch_scroll=false; catch_scroll=false;
// //
@ -90,8 +88,7 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent)
// //
// Fix the Window Size // Fix the Window Size
// //
setMinimumWidth(sizeHint().width()); setMinimumSize(sizeHint());
setMinimumHeight(sizeHint().height());
setWindowIcon(rda->iconEngine()->applicationIcon(RDIconEngine::RdCatch,22)); setWindowIcon(rda->iconEngine()->applicationIcon(RDIconEngine::RdCatch,22));
// //
@ -110,7 +107,8 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent)
BUTTON_ACTIVE_BACKGROUND_COLOR); BUTTON_ACTIVE_BACKGROUND_COLOR);
catch_scroll_color[0].setColor(QPalette::Inactive,QPalette::Background, catch_scroll_color[0].setColor(QPalette::Inactive,QPalette::Background,
palette().color(QPalette::Background)); palette().color(QPalette::Background));
catch_scroll_color[1]=QPalette(palette().color(QPalette::Background),palette().color(QPalette::Background)); catch_scroll_color[1]=QPalette(palette().color(QPalette::Background),
palette().color(QPalette::Background));
str=QString("RDCatch")+" v"+VERSION+" - "+tr("Host")+":"; str=QString("RDCatch")+" v"+VERSION+" - "+tr("Host")+":";
setWindowTitle(str+" "+rda->config()->stationName()); setWindowTitle(str+" "+rda->config()->stationName());
@ -145,11 +143,12 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent)
// //
// CAE Connection // CAE Connection
// //
connect(rda->cae(),SIGNAL(isConnected(bool)),this,SLOT(initData(bool))); connect(rda->cae(),SIGNAL(playbackStopped(int)),
connect(rda->cae(),SIGNAL(playing(int)),this,SLOT(playedData(int)));
connect(rda->cae(),SIGNAL(playStopped(int)),
this,SLOT(playStoppedData(int))); this,SLOT(playStoppedData(int)));
rda->cae()->connectToHost(); rda->cae()->connectToHost();
QList<int> cards;
cards.push_back(rda->station()->cueCard());
rda->cae()->enableMetering(&cards);
// //
// Deck Monitors // Deck Monitors
@ -388,6 +387,13 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent)
catch_tail_button->setDisabled(true); catch_tail_button->setDisabled(true);
connect(catch_tail_button,SIGNAL(clicked()),this,SLOT(tailButtonData())); connect(catch_tail_button,SIGNAL(clicked()),this,SLOT(tailButtonData()));
//
// Stop Timer
//
catch_stop_timer=new QTimer(this);
catch_stop_timer->setSingleShot(true);
connect(catch_stop_timer,SIGNAL(timeout()),this,SLOT(stopButtonData()));
// //
// Play Stop Button // Play Stop Button
// //
@ -697,120 +703,88 @@ void MainWidget::reportsButtonData()
void MainWidget::headButtonData() void MainWidget::headButtonData()
{ {
/*
QModelIndexList rows=catch_recordings_view->selectionModel()->selectedRows(); QModelIndexList rows=catch_recordings_view->selectionModel()->selectedRows();
if(rows.size()!=1) { if(rows.size()!=1) {
return; return;
} }
EnableScroll(false); EnableScroll(false);
if((!head_playing)&&(!tail_playing)) { // Start Head Play if(head_playing||tail_playing) {
RDCut *cut=new RDCut(catch_recordings_model->cutName(rows.first())); stopButtonData();
rda->cae()->loadPlay(catch_audition_card,cut->cutName(),
&catch_audition_stream,&catch_play_handle);
if(catch_audition_stream<0) {
return;
}
rda->cae()->setOutputPort(catch_audition_card,catch_audition_stream,
catch_audition_port);
rda->cae()->positionPlay(catch_play_handle,cut->startPoint());
rda->cae()->setPlayPortActive(catch_audition_card,catch_audition_port,
catch_audition_stream);
rda->cae()->setOutputVolume(catch_audition_card,catch_audition_stream,
catch_audition_port,
0+cut->playGain());
rda->cae()->play(catch_play_handle,RDCATCH_AUDITION_LENGTH,
RD_TIMESCALE_DIVISOR,false);
head_playing=true;
delete cut;
} }
*/ RDCut *cut=new RDCut(catch_recordings_model->cutName(rows.first()));
// rda->cae()->setPlayPortActive(catch_audition_card,catch_audition_port,
// catch_audition_stream);
// rda->cae()->setOutputVolume(catch_audition_card,catch_audition_stream,
// catch_audition_port,
// 0+cut->playGain());
catch_play_serial=
rda->cae()->startPlayback(cut->cutName(),
catch_audition_card,catch_audition_port,
cut->startPoint(),
cut->startPoint()+RDCATCH_AUDITION_LENGTH,
RD_TIMESCALE_DIVISOR);
catch_stop_timer->start(RDCATCH_AUDITION_LENGTH);
head_playing=true;
delete cut;
catch_head_button->on();
catch_stop_button->off();
} }
void MainWidget::tailButtonData() void MainWidget::tailButtonData()
{ {
/*
QModelIndexList rows=catch_recordings_view->selectionModel()->selectedRows(); QModelIndexList rows=catch_recordings_view->selectionModel()->selectedRows();
int start_pos=0;
if(rows.size()!=1) { if(rows.size()!=1) {
return; return;
} }
EnableScroll(false); EnableScroll(false);
if((!head_playing)&&(!tail_playing)) { // Start Tail Play if(head_playing||tail_playing) {
RDCut *cut=new RDCut(catch_recordings_model->cutName(rows.first())); stopButtonData();
rda->cae()->loadPlay(catch_audition_card,cut->cutName(),
&catch_audition_stream,&catch_play_handle);
if(catch_audition_stream<0) {
return;
}
rda->cae()->setOutputPort(catch_audition_card,catch_audition_stream,
catch_audition_port);
if((cut->endPoint()-cut->startPoint()-RDCATCH_AUDITION_LENGTH)>0) {
rda->cae()->positionPlay(catch_play_handle,
cut->endPoint()-RDCATCH_AUDITION_LENGTH);
}
else {
rda->cae()->positionPlay(catch_play_handle,cut->startPoint());
}
rda->cae()->setPlayPortActive(catch_audition_card,catch_audition_port,catch_audition_stream);
rda->cae()->setOutputVolume(catch_audition_card,catch_audition_stream,catch_audition_port,
0+cut->playGain());
rda->cae()->play(catch_play_handle,RDCATCH_AUDITION_LENGTH,
RD_TIMESCALE_DIVISOR,false);
tail_playing=true;
delete cut;
} }
*/ RDCut *cut=new RDCut(catch_recordings_model->cutName(rows.first()));
if((cut->endPoint()-cut->startPoint()-RDCATCH_AUDITION_LENGTH)>0) {
start_pos=cut->endPoint()-RDCATCH_AUDITION_LENGTH;
}
else {
start_pos=cut->startPoint();
}
// rda->cae()->setPlayPortActive(catch_audition_card,catch_audition_port,catch_audition_stream);
// rda->cae()->setOutputVolume(catch_audition_card,catch_audition_stream,catch_audition_port,
// 0+cut->playGain());
catch_play_serial=
rda->cae()->startPlayback(cut->cutName(),
catch_audition_card,catch_audition_port,
start_pos,cut->endPoint(),
RD_TIMESCALE_DIVISOR);
catch_stop_timer->start(RDCATCH_AUDITION_LENGTH);
tail_playing=true;
delete cut;
catch_tail_button->on();
catch_stop_button->off();
} }
void MainWidget::stopButtonData() void MainWidget::stopButtonData()
{ {
/* if(head_playing||tail_playing) {
if(head_playing||tail_playing) { // Stop Play rda->cae()->stopPlayback(catch_play_serial);
rda->cae()->stopPlay(catch_play_handle); catch_stop_timer->stop();
rda->cae()->unloadPlay(catch_play_handle);
}
*/
}
void MainWidget::initData(bool state)
{
if(state) {
QList<int> cards;
cards.push_back(rda->station()->cueCard());
rda->cae()->enableMetering(&cards);
}
else {
QMessageBox::warning(this,tr("Can't Connect"),
tr("Unable to connect to Core AudioEngine"));
exit(1);
} }
} }
void MainWidget::playedData(int handle) void MainWidget::playStoppedData(int serial)
{
if(head_playing) {
catch_head_button->on();
}
if(tail_playing) {
catch_tail_button->on();
}
catch_stop_button->off();
}
void MainWidget::playStoppedData(int handle)
{ {
head_playing=false; head_playing=false;
tail_playing=false; tail_playing=false;
catch_head_button->off(); catch_head_button->off();
catch_tail_button->off(); catch_tail_button->off();
catch_stop_button->on(); catch_stop_button->on();
// rda->cae()->unloadPlay(catch_play_handle); catch_stop_timer->stop();
} }
@ -819,6 +793,7 @@ void MainWidget::selectionChangedData(const QItemSelection &before,
{ {
QModelIndexList rows=catch_recordings_view->selectionModel()->selectedRows(); QModelIndexList rows=catch_recordings_view->selectionModel()->selectedRows();
stopButtonData();
if(rows.size()!=1) { if(rows.size()!=1) {
catch_head_button->setDisabled(true); catch_head_button->setDisabled(true);
catch_tail_button->setDisabled(true); catch_tail_button->setDisabled(true);

View File

@ -2,7 +2,7 @@
// //
// The Event Schedule Manager for Rivendell. // The Event Schedule Manager for Rivendell.
// //
// (C) Copyright 2002-2022 Fred Gleason <fredg@paravelsystems.com> // (C) Copyright 2002-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
@ -25,6 +25,7 @@
#include <QComboBox> #include <QComboBox>
#include <QList> #include <QList>
#include <QScrollArea> #include <QScrollArea>
#include <QTimer>
#include <rdcart_dialog.h> #include <rdcart_dialog.h>
#include <rdcut_dialog.h> #include <rdcut_dialog.h>
@ -68,9 +69,7 @@ class MainWidget : public RDMainWindow
void headButtonData(); void headButtonData();
void tailButtonData(); void tailButtonData();
void stopButtonData(); void stopButtonData();
void initData(bool); void playStoppedData(int serial);
void playedData(int);
void playStoppedData(int);
void selectionChangedData(const QItemSelection &before, void selectionChangedData(const QItemSelection &before,
const QItemSelection &after); const QItemSelection &after);
void doubleClickedData(const QModelIndex &index); void doubleClickedData(const QModelIndex &index);
@ -94,8 +93,7 @@ class MainWidget : public RDMainWindow
QScrollArea *catch_monitor_area; QScrollArea *catch_monitor_area;
VBox *catch_monitor_vbox; VBox *catch_monitor_vbox;
QSqlDatabase *catch_db; QSqlDatabase *catch_db;
int catch_audition_stream; int catch_play_serial;
int catch_play_handle;
CatchTableView *catch_recordings_view; CatchTableView *catch_recordings_view;
RecordListModel *catch_recordings_model; RecordListModel *catch_recordings_model;
RDTransportButton *catch_head_button; RDTransportButton *catch_head_button;
@ -109,6 +107,7 @@ class MainWidget : public RDMainWindow
QPushButton *catch_reports_button; QPushButton *catch_reports_button;
bool head_playing; bool head_playing;
bool tail_playing; bool tail_playing;
QTimer *catch_stop_timer;
QString catch_filter; QString catch_filter;
QString catch_group; QString catch_group;
QString catch_schedcode; QString catch_schedcode;

View File

@ -43,7 +43,7 @@
#define FRAGMENT_TIME 50 #define FRAGMENT_TIME 50
#define TIMESCALE_LOW_LIMIT 83300 #define TIMESCALE_LOW_LIMIT 83300
#define TIMESCALE_HIGH_LIMIT 125000 #define TIMESCALE_HIGH_LIMIT 125000
//#define RPLAYSTREAM_SHOW_SLOTS yes #define RPLAYSTREAM_SHOW_SLOTS yes
class RDHPIPlayStream : public QObject,public RDWaveFile class RDHPIPlayStream : public QObject,public RDWaveFile
{ {