2013-10-12 00:21:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
#include "gaudioeditor.hxx"
|
|
|
|
|
|
|
|
#include "config.hxx"
|
|
|
|
|
|
|
|
#include "audiobuffer.hxx"
|
|
|
|
|
2013-10-12 01:06:15 +02:00
|
|
|
#include "avtk/waveform.h"
|
2013-10-12 00:21:56 +02:00
|
|
|
#include "avtk/avtk_button.h"
|
|
|
|
|
2013-10-12 01:06:15 +02:00
|
|
|
|
2013-10-12 00:21:56 +02:00
|
|
|
AudioEditor::AudioEditor()
|
|
|
|
{
|
|
|
|
window = new Fl_Double_Window(500,230,"Audio Editor");
|
2013-10-12 01:06:15 +02:00
|
|
|
waveform = new Avtk::Waveform(5, 5, 450, 150, "Waveform");
|
2013-10-12 00:21:56 +02:00
|
|
|
window->end();
|
|
|
|
}
|
|
|
|
|
2013-10-12 01:06:15 +02:00
|
|
|
void AudioEditor::show( AudioBuffer* buf, bool modal )
|
2013-10-12 00:21:56 +02:00
|
|
|
{
|
2013-10-12 01:06:15 +02:00
|
|
|
|
|
|
|
|
2013-10-12 00:21:56 +02:00
|
|
|
ab = buf;
|
|
|
|
|
|
|
|
if ( !ab )
|
|
|
|
{
|
|
|
|
LUPPP_WARN("called with ab == 0");
|
2013-10-12 01:06:15 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
std::vector<float>& tmp = ab->getData();
|
|
|
|
waveform->setData( &tmp[0], tmp.size() );
|
2013-10-12 00:21:56 +02:00
|
|
|
}
|
|
|
|
|
2013-10-12 01:06:15 +02:00
|
|
|
|
|
|
|
window->set_modal();
|
|
|
|
|
2013-10-12 00:21:56 +02:00
|
|
|
window->show();
|
|
|
|
}
|
|
|
|
|
2013-10-12 01:06:15 +02:00
|
|
|
bool AudioEditor::shown()
|
|
|
|
{
|
|
|
|
return window->shown();
|
|
|
|
}
|
2013-10-12 00:21:56 +02:00
|
|
|
|
|
|
|
AudioEditor::~AudioEditor()
|
|
|
|
{
|
|
|
|
delete window;
|
|
|
|
}
|