Remove SampleLoader (#8186)
Removes `SampleLoader`. File dialog functions were moved into `FileDialog`. Creation functions were moved into `SampleBuffer`. --------- Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>
This commit is contained in:
@@ -27,7 +27,6 @@
|
||||
|
||||
#include "InstrumentTrack.h"
|
||||
#include "PathUtil.h"
|
||||
#include "SampleLoader.h"
|
||||
#include "Song.h"
|
||||
|
||||
#include "LmmsTypes.h"
|
||||
@@ -225,7 +224,7 @@ void AudioFileProcessor::loadSettings(const QDomElement& elem)
|
||||
}
|
||||
else if (auto sampleData = elem.attribute("sampledata"); !sampleData.isEmpty())
|
||||
{
|
||||
m_sample = Sample(gui::SampleLoader::createBufferFromBase64(sampleData));
|
||||
m_sample = Sample(SampleBuffer::fromBase64(sampleData));
|
||||
}
|
||||
|
||||
m_loopModel.loadSettings(elem, "looped");
|
||||
@@ -319,7 +318,7 @@ void AudioFileProcessor::setAudioFile(const QString& _audio_file, bool _rename)
|
||||
}
|
||||
// else we don't touch the track-name, because the user named it self
|
||||
|
||||
m_sample = Sample(gui::SampleLoader::createBufferFromFile(_audio_file));
|
||||
m_sample = Sample(SampleBuffer::fromFile(_audio_file));
|
||||
loopPointChanged();
|
||||
reverseModelChanged();
|
||||
emit sampleUpdated();
|
||||
|
||||
@@ -31,9 +31,9 @@
|
||||
|
||||
#include "ComboBox.h"
|
||||
#include "DataFile.h"
|
||||
#include "FileDialog.h"
|
||||
#include "FontHelper.h"
|
||||
#include "PixmapButton.h"
|
||||
#include "SampleLoader.h"
|
||||
#include "Song.h"
|
||||
#include "StringPairDrag.h"
|
||||
#include "Track.h"
|
||||
@@ -257,7 +257,7 @@ void AudioFileProcessorView::sampleUpdated()
|
||||
|
||||
void AudioFileProcessorView::openAudioFile()
|
||||
{
|
||||
QString af = SampleLoader::openAudioFile();
|
||||
QString af = FileDialog::openAudioFile();
|
||||
if (af.isEmpty()) { return; }
|
||||
|
||||
castModel<AudioFileProcessor>()->setAudioFile(af);
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
#include "Engine.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "PathUtil.h"
|
||||
#include "SampleLoader.h"
|
||||
#include "SlicerTView.h"
|
||||
#include "Song.h"
|
||||
#include "embed.h"
|
||||
@@ -307,7 +306,7 @@ std::vector<Note> SlicerT::getMidi()
|
||||
|
||||
void SlicerT::updateFile(QString file)
|
||||
{
|
||||
if (auto buffer = gui::SampleLoader::createBufferFromFile(file)) { m_originalSample = Sample(std::move(buffer)); }
|
||||
if (auto buffer = SampleBuffer::fromFile(file)) { m_originalSample = Sample(std::move(buffer)); }
|
||||
|
||||
findBPM();
|
||||
findSlices();
|
||||
@@ -352,7 +351,7 @@ void SlicerT::loadSettings(const QDomElement& element)
|
||||
{
|
||||
if (QFileInfo(PathUtil::toAbsolute(srcFile)).exists())
|
||||
{
|
||||
auto buffer = gui::SampleLoader::createBufferFromFile(srcFile);
|
||||
auto buffer = SampleBuffer::fromFile(srcFile);
|
||||
m_originalSample = Sample(std::move(buffer));
|
||||
}
|
||||
else
|
||||
@@ -363,7 +362,7 @@ void SlicerT::loadSettings(const QDomElement& element)
|
||||
}
|
||||
else if (auto sampleData = element.attribute("sampledata"); !sampleData.isEmpty())
|
||||
{
|
||||
auto buffer = gui::SampleLoader::createBufferFromBase64(sampleData);
|
||||
auto buffer = SampleBuffer::fromBase64(sampleData);
|
||||
m_originalSample = Sample(std::move(buffer));
|
||||
}
|
||||
|
||||
|
||||
@@ -31,11 +31,11 @@
|
||||
#include "Clipboard.h"
|
||||
#include "ComboBox.h"
|
||||
#include "DataFile.h"
|
||||
#include "FileDialog.h"
|
||||
#include "InstrumentView.h"
|
||||
#include "Knob.h"
|
||||
#include "LcdSpinBox.h"
|
||||
#include "PixmapButton.h"
|
||||
#include "SampleLoader.h"
|
||||
#include "SlicerT.h"
|
||||
#include "SlicerTWaveform.h"
|
||||
#include "StringPairDrag.h"
|
||||
@@ -158,7 +158,7 @@ void SlicerTView::exportMidi()
|
||||
|
||||
void SlicerTView::openFiles()
|
||||
{
|
||||
const auto audioFile = SampleLoader::openAudioFile();
|
||||
const auto audioFile = FileDialog::openAudioFile();
|
||||
if (audioFile.isEmpty()) { return; }
|
||||
m_slicerTParent->updateFile(audioFile);
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "AudioEngine.h"
|
||||
#include "AutomatableButton.h"
|
||||
#include "Engine.h"
|
||||
#include "FileDialog.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "Knob.h"
|
||||
#include "NotePlayHandle.h"
|
||||
@@ -37,7 +38,6 @@
|
||||
#include "PathUtil.h"
|
||||
#include "PixmapButton.h"
|
||||
#include "SampleBuffer.h"
|
||||
#include "SampleLoader.h"
|
||||
#include "Song.h"
|
||||
#include "embed.h"
|
||||
#include "plugin_export.h"
|
||||
@@ -136,10 +136,10 @@ OscillatorObject::OscillatorObject( Model * _parent, int _idx ) :
|
||||
|
||||
void OscillatorObject::oscUserDefWaveDblClick()
|
||||
{
|
||||
auto af = gui::SampleLoader::openWaveformFile();
|
||||
auto af = gui::FileDialog::openWaveformFile();
|
||||
if( af != "" )
|
||||
{
|
||||
m_sampleBuffer = gui::SampleLoader::createBufferFromFile(af);
|
||||
m_sampleBuffer = SampleBuffer::fromFile(af);
|
||||
m_userAntiAliasWaveTable = Oscillator::generateAntiAliasUserWaveTable(m_sampleBuffer.get());
|
||||
// TODO:
|
||||
//m_usrWaveBtn->setToolTip(m_sampleBuffer->audioFile());
|
||||
@@ -284,7 +284,7 @@ void TripleOscillator::loadSettings( const QDomElement & _this )
|
||||
{
|
||||
if (QFileInfo(PathUtil::toAbsolute(userWaveFile)).exists())
|
||||
{
|
||||
m_osc[i]->m_sampleBuffer = gui::SampleLoader::createBufferFromFile(userWaveFile);
|
||||
m_osc[i]->m_sampleBuffer = SampleBuffer::fromFile(userWaveFile);
|
||||
m_osc[i]->m_userAntiAliasWaveTable = Oscillator::generateAntiAliasUserWaveTable(m_osc[i]->m_sampleBuffer.get());
|
||||
}
|
||||
else { Engine::getSong()->collectError(QString("%1: %2").arg(tr("Sample not found"), userWaveFile)); }
|
||||
|
||||
Reference in New Issue
Block a user