mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-05-28 14:42:34 +02:00
2023-10-09 Fred Gleason <fredg@paravelsystems.com>
* Fixed regressions in rdlibrary(1)'s 'Cut Info/Record' and 'Edit 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. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
parent
8f94026e36
commit
4c7e11116e
@ -24434,3 +24434,8 @@
|
||||
2023-10-09 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Fixed a regression in rdlibrary(1) that broke the audio audition
|
||||
button on the main window.
|
||||
2023-10-09 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Fixed regressions in rdlibrary(1)'s 'Cut Info/Record' and 'Edit
|
||||
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.
|
||||
|
@ -1300,11 +1300,14 @@ void MainObject::connectionClosedData(const SessionId &sid)
|
||||
|
||||
void MainObject::statePlayUpdate(int card,int stream,int state)
|
||||
{
|
||||
Driver *dvr=GetDriver(card);
|
||||
|
||||
if(state==0) { // Stopped
|
||||
for(QMap<SessionId,Session *>::iterator it=cae_play_sessions.begin();
|
||||
it!=cae_play_sessions.end();it++) {
|
||||
if((it.value()->cardNumber()==card)&&
|
||||
(it.value()->streamNumber()==stream)) {
|
||||
dvr->unloadPlayback(card,stream);
|
||||
cae_server->
|
||||
sendCommand(it.key(),QString::asprintf("SP %d",
|
||||
it.key().serialNumber()));
|
||||
|
@ -39,8 +39,6 @@ RDMarkerPlayer::RDMarkerPlayer(int card,int port,QWidget *parent)
|
||||
rda->cae()->enableMetering(&d_cards);
|
||||
connect(rda->cae(),SIGNAL(playbackStopped(int)),
|
||||
this,SLOT(playbackStoppedData(int)));
|
||||
// connect(rda->cae(),SIGNAL(playPositionChanged(int,unsigned)),
|
||||
// this,SLOT(caePositionData(int,unsigned)));
|
||||
|
||||
//
|
||||
// Marker Readouts
|
||||
@ -536,70 +534,31 @@ void RDMarkerPlayer::meterData()
|
||||
d_meter->setRightPeakBar(lvls[1]);
|
||||
}
|
||||
|
||||
/*
|
||||
void RDMarkerPlayer::caePlayedData(int serial)
|
||||
{
|
||||
printf("d_cae_serial2: %d serial: %d\n",d_cae_serial,serial);
|
||||
printf("HERE10\n");
|
||||
if(serial==d_cae_serial) {
|
||||
printf("HERE11\n");
|
||||
if(!d_is_playing) {
|
||||
printf("HERE12\n");
|
||||
d_active_play_button->setState(RDTransportButton::On);
|
||||
d_stop_button->setState(RDTransportButton::Off);
|
||||
d_is_playing=true;
|
||||
if(!d_position_timer->isActive()) {
|
||||
printf("HERE13\n");
|
||||
d_position_timer->start(RDMARKERPLAYER_POSITION_INTERVAL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
void RDMarkerPlayer::playbackStoppedData(int serial)
|
||||
{
|
||||
if(serial==d_cae_serial) {
|
||||
if(d_is_playing) {
|
||||
if(d_looping) {
|
||||
rda->cae()->startPlayback(RDCut::cutName(d_cart_number,d_cut_number),
|
||||
d_cards.first(),d_port,
|
||||
d_loop_start_msec,
|
||||
d_loop_start_msec+d_loop_start_length,
|
||||
RD_TIMESCALE_DIVISOR);
|
||||
Play();
|
||||
rda->cae()->setPlayPortActive(d_cards.first(),d_port,d_cae_stream);
|
||||
if(d_meter_timer->isActive()) {
|
||||
d_meter_timer->stop();
|
||||
d_meter->setLeftPeakBar(-10000);
|
||||
d_meter->setRightPeakBar(-10000);
|
||||
}
|
||||
else {
|
||||
if(d_meter_timer->isActive()) {
|
||||
d_meter_timer->stop();
|
||||
d_meter->setLeftPeakBar(-10000);
|
||||
d_meter->setRightPeakBar(-10000);
|
||||
}
|
||||
d_play_from_button->setState(RDTransportButton::Off);
|
||||
d_play_button->setState(RDTransportButton::Off);
|
||||
d_play_to_button->setState(RDTransportButton::Off);
|
||||
d_stop_button->setState(RDTransportButton::On);
|
||||
d_is_playing=false;
|
||||
d_position_timer->stop();
|
||||
d_play_from_button->setState(RDTransportButton::Off);
|
||||
d_play_button->setState(RDTransportButton::Off);
|
||||
d_play_to_button->setState(RDTransportButton::Off);
|
||||
d_stop_button->setState(RDTransportButton::On);
|
||||
d_is_playing=false;
|
||||
d_position_timer->stop();
|
||||
|
||||
if(d_looping) {
|
||||
buttonPlayFromData();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void RDMarkerPlayer::caePositionData(int serial,unsigned msec)
|
||||
{
|
||||
/*
|
||||
if(serial==d_cae_serial) {
|
||||
d_position_edit->setText(RDGetTimeLength(msec-d_pointers[RDMarkerHandle::CutStart],true,true));
|
||||
d_cursor_position=msec;
|
||||
emit cursorPositionChanged(msec);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
void RDMarkerPlayer::trimThresholdChanged(int dbfs)
|
||||
{
|
||||
d_trim_start_button->setDisabled(dbfs==0);
|
||||
@ -612,7 +571,6 @@ void RDMarkerPlayer::positionTimeoutData()
|
||||
d_cursor_position+=RDMARKERPLAYER_POSITION_INTERVAL;
|
||||
d_position_edit->setText(RDGetTimeLength(d_cursor_position-d_pointers[RDMarkerHandle::CutStart],true,true));
|
||||
emit cursorPositionChanged(d_cursor_position);
|
||||
printf("d_cursor_position: %d\n",d_cursor_position);
|
||||
}
|
||||
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Audio player for RDMarkerDialog
|
||||
//
|
||||
// (C) Copyright 2021 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2021-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
|
||||
@ -82,7 +82,6 @@ class RDMarkerPlayer : public RDWidget
|
||||
void readoutClickedData(int role);
|
||||
void meterData();
|
||||
void playbackStoppedData(int serial);
|
||||
void caePositionData(int handle,unsigned pos);
|
||||
void trimThresholdChanged(int dbfs);
|
||||
void positionTimeoutData();
|
||||
|
||||
|
@ -61,11 +61,9 @@ RecordCut::RecordCut(RDCart *cart,QString cut,bool use_weight,QWidget *parent)
|
||||
//
|
||||
// CAE Connection
|
||||
//
|
||||
connect(rda->cae(),SIGNAL(isConnected(bool)),this,SLOT(initData(bool)));
|
||||
connect(rda->cae(),SIGNAL(playStarted(int)),this,SLOT(playStartedData(int)));
|
||||
connect(rda->cae(),SIGNAL(playStopped(int)),this,SLOT(playStoppedData(int)));
|
||||
// connect(rda->cae(),SIGNAL(playing(int)),this,SLOT(playedData(int)));
|
||||
// connect(rda->cae(),SIGNAL(playStopped(int)),this,SLOT(playStoppedData(int)));
|
||||
connect(rda->cae(),SIGNAL(playbackStopped(int)),
|
||||
this,SLOT(playStoppedData(int)));
|
||||
connect(rda->cae(),SIGNAL(recordLoaded(int,int)),
|
||||
this,SLOT(recordLoadedData(int,int)));
|
||||
connect(rda->cae(),SIGNAL(recordUnloaded(int,int,unsigned)),
|
||||
@ -584,8 +582,6 @@ void RecordCut::channelsData(int id)
|
||||
|
||||
void RecordCut::recordData()
|
||||
{
|
||||
// QString filename;
|
||||
|
||||
if((!is_ready)&&(!is_recording)&&(!is_playing)) {
|
||||
if(rec_cut->length()>0) {
|
||||
if(QMessageBox::warning(this,tr("Audio Exists"),
|
||||
@ -655,19 +651,11 @@ void RecordCut::playData()
|
||||
int end=rec_cut->endPoint(true);
|
||||
|
||||
if((!is_recording)&&(!is_playing)&&(!is_ready)) { // Start Play
|
||||
// rda->cae()->loadPlay(rec_card_no[1],rec_cut->cutName(),
|
||||
// &rec_stream_no[1],&rec_play_handle);
|
||||
// rda->cae()->setOutputPort(rec_card_no[1],rec_stream_no[1],rec_port_no[1]);
|
||||
// rda->cae()->positionPlay(rec_play_handle,start);
|
||||
// rda->cae()->setPlayPortActive(rec_card_no[1],rec_port_no[1],rec_stream_no[1]);
|
||||
// rda->cae()->setOutputVolume(rec_card_no[1],rec_stream_no[1],rec_port_no[1],
|
||||
// 0+rec_cut->playGain());
|
||||
|
||||
rec_play_serial=
|
||||
rda->cae()->startPlayback(rec_cut->cutName(),
|
||||
rec_card_no[1],rec_port_no[1],
|
||||
start,end,RD_TIMESCALE_DIVISOR);
|
||||
// rda->cae()->play(rec_play_handle,end-start,RD_TIMESCALE_DIVISOR,false);
|
||||
// rda->cae()->setPlayPortActive(rec_card_no[1],rec_port_no[1],rec_stream_no[1]);
|
||||
}
|
||||
if(is_ready&&(!is_recording)) {
|
||||
if(rec_mode_box->currentIndex()==1) {
|
||||
@ -752,36 +740,6 @@ void RecordCut::playStoppedData(int serial)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
void RecordCut::playedData(int handle)
|
||||
{
|
||||
rec_play_button->on();
|
||||
rec_stop_button->off();
|
||||
rec_timer_value=-1;
|
||||
recTimerData();
|
||||
rec_timer->start(RECORD_CUT_TIMER_INTERVAL);
|
||||
is_playing=true;
|
||||
is_recording=false;
|
||||
}
|
||||
|
||||
|
||||
void RecordCut::playStoppedData(int handle)
|
||||
{
|
||||
// rda->cae()->unloadPlay(rec_play_handle);
|
||||
rec_timer->stop();
|
||||
rec_play_button->off();
|
||||
rec_stop_button->on();
|
||||
rec_meter->resetClipLight();
|
||||
is_playing=false;
|
||||
is_recording=false;
|
||||
rec_meter->setLeftSolidBar(-10000);
|
||||
rec_meter->setRightSolidBar(-10000);
|
||||
if(is_closing) {
|
||||
is_closing=false;
|
||||
closeData();
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
void RecordCut::recordStoppedData(int card,int stream)
|
||||
{
|
||||
@ -942,16 +900,6 @@ void RecordCut::closeData()
|
||||
}
|
||||
|
||||
|
||||
void RecordCut::initData(bool state)
|
||||
{
|
||||
if(!state) {
|
||||
QMessageBox::warning(this,tr("Can't Connect"),
|
||||
tr("Unable to connect to Core AudioEngine"));
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void RecordCut::recTimerData()
|
||||
{
|
||||
rec_timer_value+=RECORD_CUT_TIMER_INTERVAL;
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Record a Rivendell cut.
|
||||
//
|
||||
// (C) Copyright 2002-2021 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
|
||||
// it under the terms of the GNU General Public License version 2 as
|
||||
@ -64,10 +64,7 @@ class RecordCut : public RDDialog
|
||||
void recordUnloadedData(int,int,unsigned);
|
||||
void playStartedData(int serial);
|
||||
void playStoppedData(int serial);
|
||||
// void playedData(int);
|
||||
// void playStoppedData(int);
|
||||
void closeData();
|
||||
void initData(bool);
|
||||
void recTimerData();
|
||||
void aesAlarmData(int,int,bool);
|
||||
void meterData();
|
||||
@ -108,12 +105,8 @@ class RecordCut : public RDDialog
|
||||
QLabel *cut_startdatetime_label;
|
||||
QGroupBox *cut_startdatetime_groupbox;
|
||||
RDDateTimeEdit *cut_startdatetime_edit;
|
||||
// RDDateEdit *cut_startdate_edit;
|
||||
// RDTimeEdit *cut_starttime_edit;
|
||||
QLabel *cut_enddatetime_label;
|
||||
RDDateTimeEdit *cut_enddatetime_edit;
|
||||
// RDDateEdit *cut_enddate_edit;
|
||||
// RDTimeEdit *cut_endtime_edit;
|
||||
QGroupBox *cut_daypart_groupbox;
|
||||
QButtonGroup *cut_daypart_group;
|
||||
QRadioButton *cut_startdaypart_enable_button;
|
||||
@ -147,7 +140,6 @@ class RecordCut : public RDDialog
|
||||
int rec_card_no[2];
|
||||
int rec_stream_no[2];
|
||||
int rec_port_no[2];
|
||||
// int rec_play_handle;
|
||||
int rec_play_serial;
|
||||
RDCae::AudioCoding rec_format;
|
||||
unsigned rec_channels;
|
||||
@ -163,5 +155,4 @@ class RecordCut : public RDDialog
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#endif // RECORD_CUT_H
|
||||
|
Loading…
x
Reference in New Issue
Block a user