Integrate changes into Graph
This commit is contained in:
@@ -26,8 +26,9 @@
|
||||
#include <QPainter>
|
||||
|
||||
#include "Graph.h"
|
||||
#include "SampleLoader.h"
|
||||
#include "StringPairDrag.h"
|
||||
#include "SampleBuffer.h"
|
||||
#include "SampleBuffer2.h"
|
||||
#include "Oscillator.h"
|
||||
|
||||
namespace lmms
|
||||
@@ -588,21 +589,16 @@ void graphModel::setWaveToNoise()
|
||||
|
||||
QString graphModel::setWaveToUser()
|
||||
{
|
||||
auto sampleBuffer = new SampleBuffer;
|
||||
QString fileName = sampleBuffer->openAndSetWaveformFile();
|
||||
QString fileName = gui::SampleLoader::openWaveformFile();
|
||||
if( fileName.isEmpty() == false )
|
||||
{
|
||||
sampleBuffer->dataReadLock();
|
||||
auto sampleBuffer = gui::SampleLoader::createBufferFromFile(fileName);
|
||||
for( int i = 0; i < length(); i++ )
|
||||
{
|
||||
m_samples[i] = sampleBuffer->userWaveSample(
|
||||
i / static_cast<float>( length() ) );
|
||||
m_samples[i] = Oscillator::userWaveSample(sampleBuffer.get(), i / static_cast<float>(length()));
|
||||
}
|
||||
sampleBuffer->dataUnlock();
|
||||
}
|
||||
|
||||
sharedObject::unref( sampleBuffer );
|
||||
|
||||
emit samplesChanged( 0, length() - 1 );
|
||||
return fileName;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user