2024-05-25 Fred Gleason <fredg@paravelsystems.com>

* Added an 'RDWaveData::dump()' static method.
	* Fixed a regression in the audio importation system that could
	cause the detected length of an MPEG file to be '0'.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason 2024-05-25 11:05:11 -04:00
parent 392dd62359
commit 4b16443640
5 changed files with 29 additions and 3 deletions

View File

@ -24771,3 +24771,7 @@
method.
2024-05-19 Fred Gleason <fredg@paravelsystems.com>
* Added a 'Debian 12 "Bookworm"' section to the 'INSTALL' file.
2024-05-25 Fred Gleason <fredg@paravelsystems.com>
* Added an 'RDWaveData::dump()' static method.
* Fixed a regression in the audio importation system that could
cause the detected length of an MPEG file to be '0'.

View File

@ -1120,7 +1120,12 @@ void RDCut::setMetadata(RDWaveData *data) const
sql+=QString::asprintf("`START_POINT`=%d,",data->startPos());
}
if(data->endPos()>=0) {
sql+=QString::asprintf("`END_POINT`=%d,",data->endPos());
if(data->endPos()>length()) {
sql+=QString::asprintf("`END_POINT`=%d,",length());
}
else {
sql+=QString::asprintf("`END_POINT`=%d,",data->endPos());
}
}
if((data->talkStartPos()==data->startPos())&&
(data->talkEndPos()==data->endPos())) {

View File

@ -2,7 +2,7 @@
//
// A Container Class for Audio Meta Data.
//
// (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2002-2024 Fred Gleason <fredg@paravelsystems.com>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU Library General Public License
@ -1432,3 +1432,18 @@ QString RDWaveData::usageText(UsageCode code)
return ret;
}
QString RDWaveData::dump(const QString &label,RDWaveData *data)
{
QString ret=label+": ";
if(data==NULL) {
ret+="[NULL]";
}
else {
ret+=data->dump();
}
return ret;
}

View File

@ -2,7 +2,7 @@
//
// A Container Class for Audio Meta Data.
//
// (C) Copyright 2002-2020 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2002-2024 Fred Gleason <fredg@paravelsystems.com>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU Library General Public License
@ -202,6 +202,7 @@ class RDWaveData
static QString endTypeText(EndType type);
static QString cartTypeText(CartType type);
static QString usageText(UsageCode code);
static QString dump(const QString &label,RDWaveData *data);
private:
bool data_metadata_found;

View File

@ -316,6 +316,7 @@ bool RDWaveFile::openWave(RDWaveData *data)
}
data_start=id3v2_offset[0];
sample_length=1152*(data_length/mpeg_frame_size);
ext_time_length=1000*((uint64_t)sample_length)/((uint64_t)samples_per_sec);
data_chunk=true;
lseek(wave_file.handle(),data_start,SEEK_SET);
format_chunk=true;