Skip to content

Commit

Permalink
Remove old SampleBuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
sakertooth committed Aug 28, 2023
1 parent 0017f66 commit 53728ce
Show file tree
Hide file tree
Showing 29 changed files with 201 additions and 2,150 deletions.
4 changes: 2 additions & 2 deletions include/AudioSampleRecorder.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
namespace lmms
{

class SampleBuffer2;
class SampleBuffer;


class AudioSampleRecorder : public AudioDevice
Expand All @@ -44,7 +44,7 @@ class AudioSampleRecorder : public AudioDevice
~AudioSampleRecorder() override;

f_cnt_t framesRecorded() const;
void createSampleBuffer(SampleBuffer2** sampleBuffer);
void createSampleBuffer(SampleBuffer** sampleBuffer);


private:
Expand Down
2 changes: 1 addition & 1 deletion include/EnvelopeAndLfoParameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public slots:
sample_t * m_lfoShapeData;
sample_t m_random;
bool m_bad_lfoShapeData;
SampleBuffer m_userWave;
std::shared_ptr<const SampleBuffer> m_userWave;

enum class LfoShape
{
Expand Down
2 changes: 1 addition & 1 deletion include/LfoController.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public slots:
sample_t (*m_sampleFunction)( const float );

private:
std::shared_ptr<const SampleBuffer2> m_userDefSampleBuffer;
std::shared_ptr<const SampleBuffer> m_userDefSampleBuffer;

protected slots:
void updatePhase();
Expand Down
10 changes: 5 additions & 5 deletions include/Oscillator.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include "lmmsconfig.h"
#include "AudioEngine.h"
#include "OscillatorConstants.h"
#include "SampleBuffer2.h"
#include "SampleBuffer.h"

namespace lmms
{
Expand Down Expand Up @@ -91,14 +91,14 @@ class LMMS_EXPORT Oscillator

static void waveTableInit();
static void destroyFFTPlans();
static std::unique_ptr<OscillatorConstants::waveform_t> generateAntiAliasUserWaveTable(const SampleBuffer2 *sampleBuffer);
static std::unique_ptr<OscillatorConstants::waveform_t> generateAntiAliasUserWaveTable(const SampleBuffer *sampleBuffer);

inline void setUseWaveTable(bool n)
{
m_useWaveTable = n;
}

inline void setUserWave(std::shared_ptr<const SampleBuffer2> _wave)
inline void setUserWave(std::shared_ptr<const SampleBuffer> _wave)
{
m_userWave = _wave;
}
Expand Down Expand Up @@ -164,7 +164,7 @@ class LMMS_EXPORT Oscillator
return 1.0f - fast_rand() * 2.0f / FAST_RAND_MAX;
}

static inline sample_t userWaveSample(const SampleBuffer2* buffer, const float sample)
static inline sample_t userWaveSample(const SampleBuffer* buffer, const float sample)
{
if (buffer == nullptr || buffer->size() == 0) { return 0; }
const auto frames = buffer->size();
Expand Down Expand Up @@ -256,7 +256,7 @@ class LMMS_EXPORT Oscillator
Oscillator * m_subOsc;
float m_phaseOffset;
float m_phase;
std::shared_ptr<const SampleBuffer2> m_userWave;
std::shared_ptr<const SampleBuffer> m_userWave;
std::shared_ptr<const OscillatorConstants::waveform_t> m_userAntiAliasWaveTable;
bool m_useWaveTable;
// There are many update*() variants; the modulator flag is stored as a member variable to avoid
Expand Down
10 changes: 5 additions & 5 deletions include/Sample.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Sample.h - State for container-class SampleBuffer2
* Sample.h - State for container-class SampleBuffer
*
* Copyright (c) 2023 saker <sakertooth@gmail.com>
*
Expand Down Expand Up @@ -29,7 +29,7 @@
#include <memory>

#include "Note.h"
#include "SampleBuffer2.h"
#include "SampleBuffer.h"
#include "lmms_export.h"

#ifdef __MINGW32__
Expand Down Expand Up @@ -88,7 +88,7 @@ class LMMS_EXPORT Sample
Sample(const QString& audioFile);
Sample(const QByteArray& base64, int sampleRate = Engine::audioEngine()->processingSampleRate());
Sample(const sampleFrame* data, int numFrames, int sampleRate = Engine::audioEngine()->processingSampleRate());
Sample(std::shared_ptr<const SampleBuffer2> buffer);
Sample(std::shared_ptr<const SampleBuffer> buffer);
Sample(const Sample& other);
Sample(Sample&& other) noexcept;

Expand All @@ -107,7 +107,7 @@ class LMMS_EXPORT Sample

auto toBase64() const -> QString;

auto buffer() const -> std::shared_ptr<const SampleBuffer2>;
auto buffer() const -> std::shared_ptr<const SampleBuffer>;
auto startFrame() const -> int;
auto endFrame() const -> int;
auto loopStartFrame() const -> int;
Expand Down Expand Up @@ -144,7 +144,7 @@ class LMMS_EXPORT Sample
auto amplifySampleRange(sampleFrame* src, int numFrames) const -> void;

private:
std::shared_ptr<const SampleBuffer2> m_buffer = std::make_shared<SampleBuffer2>();
std::shared_ptr<const SampleBuffer> m_buffer = std::make_shared<SampleBuffer>();
int m_startFrame = 0;
int m_endFrame = 0;
int m_loopStartFrame = 0;
Expand Down
Loading

0 comments on commit 53728ce

Please sign in to comment.