Add ability to change sample rate in the settings menu (#7719)

Add a slider in the audio settings menu to allow users to select a few standard sample rates, those being 44100, 48000, 88200, 96000, and 192000.
This commit is contained in:
Sotonye Atemie
2025-03-25 16:27:00 -04:00
committed by GitHub
parent 498315ef48
commit 1d5f2c0050
6 changed files with 58 additions and 33 deletions

View File

@@ -50,7 +50,6 @@ class MidiClient;
class AudioBusHandle;
class AudioEngineWorkerThread;
constexpr fpp_t MINIMUM_BUFFER_SIZE = 32;
constexpr fpp_t DEFAULT_BUFFER_SIZE = 256;
constexpr fpp_t MAXIMUM_BUFFER_SIZE = 4096;
@@ -61,6 +60,8 @@ constexpr int BYTES_PER_FRAME = sizeof(SampleFrame);
constexpr float OUTPUT_SAMPLE_MULTIPLIER = 32767.0f;
constexpr auto SUPPORTED_SAMPLERATES = std::array{44100, 48000, 88200, 96000, 192000};
class LMMS_EXPORT AudioEngine : public QObject
{
Q_OBJECT

View File

@@ -182,6 +182,8 @@ private:
QSlider * m_bufferSizeSlider;
QLabel * m_bufferSizeLbl;
QLabel * m_bufferSizeWarnLbl;
int m_sampleRate;
QSlider* m_sampleRateSlider;
// MIDI settings widgets.
QComboBox * m_midiInterfaces;