restyled code after stereo added

This commit is contained in:
Harry van Haaren 2017-03-27 21:04:30 +01:00
parent ed72627245
commit 08bdc1ff09
6 changed files with 128 additions and 133 deletions

View file

@ -327,8 +327,7 @@ int DiskWriter::writeAudioBuffer(int track, int scene, AudioBuffer* ab,
frameBuf[1] = ab->getDataR()[i];
outfile.writef( frameBuf, 1);
}
}
else {
} else {
LUPPP_WARN("%s","Sample has zero samples");
}

View file

@ -101,8 +101,9 @@ void AudioEditor::show( AudioBuffer* buf, bool modal )
if ( !ab ) {
LUPPP_WARN("called with ab == 0");
} else {
// TODO right (stereo)
return;
}
std::vector<float>& tmp = ab->getDataL();
int size = tmp.size();
waveform->setData( &tmp[0], size );
@ -115,12 +116,9 @@ void AudioEditor::show( AudioBuffer* buf, bool modal )
// figure out BPM values from size
for( int i = 0; i < 7; i++ ) {
int beat = beats[i];
int fpb = size / beat;
int bpm = (gui->samplerate / fpb) * 60;
if ( bpm < 60 || bpm > 220 ) {
// disable option: not valid
beatButtons[i]->setGreyOut( true );
@ -167,8 +165,6 @@ void AudioEditor::show( AudioBuffer* buf, bool modal )
// no valid BPM range..?
}
}
window->set_modal();
window->show();
}