From f73c7e5d4c379e2bcf0943a4fbabf71a5bfd16b9 Mon Sep 17 00:00:00 2001 From: Fred Gleason Date: Mon, 18 Dec 2023 12:23:24 -0500 Subject: [PATCH] 2023-12-18 Fred Gleason * Fixed regressions in 'RDCae' and the HPI driver in caed(8) that caused the length of audio captures to be reported incorrectly. Signed-off-by: Fred Gleason --- ChangeLog | 3 +++ cae/driver_hpi.cpp | 4 ++-- cae/driver_hpi.h | 2 +- lib/rdcae.cpp | 2 +- rdhpi/rdhpirecordstream.cpp | 5 ++++- rdhpi/rdhpirecordstream.h | 3 ++- 6 files changed, 13 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 97b78075..22eade3e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -24567,3 +24567,6 @@ head and tail audition buttons. 2023-12-15 Fred Gleason * Fixed a regression in rdcatchd(8) that broke play-out events. +2023-12-18 Fred Gleason + * Fixed regressions in 'RDCae' and the HPI driver in caed(8) + that caused the length of audio captures to be reported incorrectly. diff --git a/cae/driver_hpi.cpp b/cae/driver_hpi.cpp index c3a68df0..58345781 100644 --- a/cae/driver_hpi.cpp +++ b/cae/driver_hpi.cpp @@ -282,7 +282,7 @@ bool DriverHpi::loadRecord(int card,int port,int coding,int chans,int samprate, } -bool DriverHpi::unloadRecord(int card,int port,unsigned *len) +bool DriverHpi::unloadRecord(int card,int port,unsigned *len_frames) { #ifdef HPI if(d_record_streams[card][port]==NULL) { @@ -292,7 +292,7 @@ bool DriverHpi::unloadRecord(int card,int port,unsigned *len) d_record_streams[card][port]->pause(); } d_record_streams[card][port]->disconnect(); - *len=d_record_streams[card][port]->samplesRecorded(); + *len_frames=d_record_streams[card][port]->samplesRecorded(); d_record_streams[card][port]->closeWave(); delete d_record_streams[card][port]; d_record_streams[card][port]=NULL; diff --git a/cae/driver_hpi.h b/cae/driver_hpi.h index 00e3b4ab..f24a6c71 100644 --- a/cae/driver_hpi.h +++ b/cae/driver_hpi.h @@ -51,7 +51,7 @@ class DriverHpi : public Driver bool timescaleSupported(int card); bool loadRecord(int card,int port,int coding,int chans,int samprate, int bitrate,QString wavename); - bool unloadRecord(int card,int port,unsigned *len); + bool unloadRecord(int card,int port,unsigned *len_frames); bool record(int card,int port,int length,int thres); bool stopRecord(int card,int port); bool setClockSource(int card,int src); diff --git a/lib/rdcae.cpp b/lib/rdcae.cpp index 2dd4c94f..f00a82e4 100644 --- a/lib/rdcae.cpp +++ b/lib/rdcae.cpp @@ -589,7 +589,7 @@ void RDCae::DispatchCommand(const QString &cmd) } if((cmds.at(0)=="UR")&&(cmds.size()==5)) { // Unload Record - if(cmds.at(3)=='+') { + if(cmds.at(4)=='+') { int card=cmds.at(1).toInt(&ok); if(ok&&(card>=0)&&(cardstop(); + samples_captured=samples_recorded; is_recording=false; is_paused=false; is_ready=false; diff --git a/rdhpi/rdhpirecordstream.h b/rdhpi/rdhpirecordstream.h index 0c5efa33..c50d6013 100644 --- a/rdhpi/rdhpirecordstream.h +++ b/rdhpi/rdhpirecordstream.h @@ -2,7 +2,7 @@ // // A class for recording Microsoft WAV files. // -// (C) Copyright 2002-2015 Fred Gleason +// (C) Copyright 2002-2023 Fred Gleason // // 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 @@ -116,6 +116,7 @@ class RDHPIRecordStream : public QObject,public RDWaveFile uint32_t buffer_size; uint32_t data_recorded; uint32_t samples_recorded; + uint32_t samples_captured; uint32_t reserved; uint32_t fragment_size; int fragment_time;