mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-11-25 23:00:21 +01:00
2015-08-30 Fred Gleason <fredg@paravelsystems.com>
* Added a --frames=' parameter in 'tests/audio_peaks_test.cpp'. * Fixed a benchpost bug in generating peak energy data in 'lib/rdwavefile.cpp'.
This commit is contained in:
@@ -33,6 +33,9 @@ MainObject::MainObject(QObject *parent)
|
||||
:QObject(parent)
|
||||
{
|
||||
QString filename;
|
||||
unsigned frame=0;
|
||||
bool frame_used=false;
|
||||
bool ok=false;
|
||||
|
||||
//
|
||||
// Read Command Options
|
||||
@@ -45,6 +48,15 @@ MainObject::MainObject(QObject *parent)
|
||||
filename=cmd->value(i);
|
||||
cmd->setProcessed(i,true);
|
||||
}
|
||||
if(cmd->key(i)=="--frame") {
|
||||
frame=cmd->value(i).toUInt(&ok);
|
||||
if(!ok) {
|
||||
fprintf(stderr,"audio_peaks_test: invalid --frame arguument\n");
|
||||
exit(256);
|
||||
}
|
||||
frame_used=true;
|
||||
cmd->setProcessed(i,true);
|
||||
}
|
||||
if(!cmd->processed(i)) {
|
||||
fprintf(stderr,"audio_peaks_test: unknown option \"%s\"\n",
|
||||
(const char *)cmd->value(i));
|
||||
@@ -66,6 +78,16 @@ MainObject::MainObject(QObject *parent)
|
||||
if(wave->hasEnergy()) {
|
||||
printf("\"%s\" has energy, size: %u\n",(const char *)filename,
|
||||
wave->energySize());
|
||||
if(frame_used) {
|
||||
if(wave->getChannels()==1) {
|
||||
printf("frame: %u: %d\n",frame,0xFFFF&wave->energy(frame));
|
||||
}
|
||||
else {
|
||||
printf("frame %u: left: %d right: %d\n",frame,
|
||||
0xFFFF&wave->energy(2*frame),
|
||||
0xFFFF&wave->energy(2*frame+1));
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
printf("\"%s\" does NOT have energy\n",(const char *)filename);
|
||||
|
||||
Reference in New Issue
Block a user