Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
5a9c811
Ring buffer for recording first implementation
steven-jaro May 23, 2025
c6f8047
Fixed ring buffer implementation approach to make it more stable and …
steven-jaro May 25, 2025
2fc50ec
Better approach for no audio saturation, code optimization, no segfau…
steven-jaro May 25, 2025
2c43aa8
Removed resize and reserve from any real time context
steven-jaro May 29, 2025
aa33e45
Fixed spaces instead of tabs size 4 and Johannes requests
steven-jaro May 30, 2025
8541272
Changed DEFAULT_BUFFER_SIZE to 100
steven-jaro May 30, 2025
dad148e
Update src/core/AudioEngine.cpp
steven-jaro May 31, 2025
e6c1097
Update include/AudioEngine.h
steven-jaro May 31, 2025
e25a58e
Update src/core/AudioEngine.cpp
steven-jaro May 31, 2025
bb00189
Update src/core/AudioEngine.cpp
steven-jaro May 31, 2025
264d15b
Update src/core/AudioEngine.cpp
steven-jaro May 31, 2025
3d02d41
Update src/core/AudioEngine.cpp
steven-jaro Jun 1, 2025
6b4d07d
Update src/core/AudioEngine.cpp
steven-jaro Jun 1, 2025
69734f9
Update src/core/AudioEngine.cpp
steven-jaro Jun 1, 2025
1dae270
Update src/core/AudioEngine.cpp
steven-jaro Jun 1, 2025
d9a22b2
Update src/core/AudioEngine.cpp
steven-jaro Jun 1, 2025
cae9d61
Update src/core/AudioEngine.cpp
steven-jaro Jun 1, 2025
00ab49d
Update src/core/AudioEngine.cpp
steven-jaro Jun 1, 2025
d6cbe34
Update src/core/AudioEngine.cpp
steven-jaro Jun 1, 2025
ed4ecb8
Update src/core/AudioEngine.cpp
steven-jaro Jun 1, 2025
2047da5
Update src/core/AudioEngine.cpp
steven-jaro Jun 1, 2025
11432b1
Update src/core/AudioEngine.cpp
steven-jaro Jun 1, 2025
5820a43
Update src/core/AudioEngine.cpp
steven-jaro Jun 1, 2025
52868fd
Fixed unsafe substraction in processBufferedInputFrames
steven-jaro Jun 2, 2025
89f6521
Fixed szeli1 Requested changes includir refator
steven-jaro Dec 4, 2025
45cdb83
Update src/core/AudioEngine.cpp
steven-jaro Dec 9, 2025
95bbfd6
Update src/core/AudioEngine.cpp
steven-jaro Dec 9, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions include/AudioDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ class AudioDevice

virtual void stopProcessing();

virtual bool isProcessing()
{
return m_inProcess;
}

protected:
// subclasses can re-implement this for being used in conjunction with
// processNextBuffer()
Expand Down
15 changes: 10 additions & 5 deletions include/AudioEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
#include "AudioEngineProfiler.h"
#include "PlayHandle.h"

#include "LocklessRingBuffer.h"


namespace lmms
{
Expand Down Expand Up @@ -286,14 +288,16 @@ class LMMS_EXPORT AudioEngine : public QObject

void pushInputFrames( SampleFrame* _ab, const f_cnt_t _frames );

void processBufferedInputFrames();

inline const SampleFrame* inputBuffer()
{
return m_inputBuffer[ m_inputBufferRead ];
return m_inputBuffer[m_inputBufferRead].data();
}

inline f_cnt_t inputBufferFrames() const
{
return m_inputBufferFrames[ m_inputBufferRead ];
return m_inputBuffer[m_inputBufferRead].size();
}

inline const SampleFrame* nextBuffer()
Expand Down Expand Up @@ -371,9 +375,7 @@ class LMMS_EXPORT AudioEngine : public QObject

fpp_t m_framesPerPeriod;

SampleFrame* m_inputBuffer[2];
f_cnt_t m_inputBufferFrames[2];
f_cnt_t m_inputBufferSize[2];
std::array<std::vector<SampleFrame>, 2> m_inputBuffer;
sample_rate_t m_baseSampleRate;
int m_inputBufferRead;
int m_inputBufferWrite;
Expand Down Expand Up @@ -419,6 +421,9 @@ class LMMS_EXPORT AudioEngine : public QObject
friend class Engine;
friend class AudioEngineWorkerThread;
friend class ProjectRenderer;

std::unique_ptr<LocklessRingBuffer<SampleFrame>> m_inputAudioRingBuffer;
std::unique_ptr<LocklessRingBufferReader<SampleFrame>> m_inputAudioRingBufferReader;
} ;

} // namespace lmms
Expand Down
Loading