Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into cleanup-portaudio…
Browse files Browse the repository at this point in the history
…-backend
  • Loading branch information
sakertooth committed Aug 12, 2024
2 parents 9952bf8 + d8e4d8c commit 849667d
Show file tree
Hide file tree
Showing 9 changed files with 129 additions and 147 deletions.
27 changes: 2 additions & 25 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -338,37 +338,14 @@ IF(WANT_SDL)
FIND_PACKAGE(SDL2)
IF(SDL2_FOUND)
SET(LMMS_HAVE_SDL TRUE)
SET(LMMS_HAVE_SDL2 TRUE)
SET(STATUS_SDL "OK, using SDL2")
SET(STATUS_SDL "OK")
SET(SDL2_LIBRARY "SDL2::SDL2")
SET(SDL_INCLUDE_DIR "")
SET(SDL_LIBRARY "")
ELSE()
SET(STATUS_SDL "not found, please install libsdl2-dev (or similar) if you require SDL support")
SET(SDL2_LIBRARY "")
ENDIF()
ENDIF()

# fallback to SDL1
IF(WANT_SDL AND NOT LMMS_HAVE_SDL2)
# Fallback to SDL1.2
SET(SDL_BUILDING_LIBRARY TRUE)
FIND_PACKAGE(SDL)
IF(SDL_FOUND)
SET(LMMS_HAVE_SDL TRUE)
SET(STATUS_SDL "OK, using SDL1.2")
# fix mingw since 53abd65
IF(NOT SDL_INCLUDE_DIR)
SET(SDL_INCLUDE_DIR "${CMAKE_FIND_ROOT_PATH}/include")
ENDIF()

ELSE()
SET(STATUS_SDL "not found, please install libsdl2-dev (or similar) "
"if you require SDL support")
SET(SDL_INCLUDE_DIR "")
SET(SDL_LIBRARY "")
ENDIF()
ENDIF()

# check for Sid
if(WANT_SID)
if(PERL_FOUND)
Expand Down
28 changes: 8 additions & 20 deletions include/AudioSdl.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,12 @@

#ifdef LMMS_HAVE_SDL

#ifdef LMMS_HAVE_SDL2
#include <SDL2/SDL_audio.h>
#else
#include <SDL/SDL.h>
#include <SDL/SDL_audio.h>
#endif

#include "AudioDevice.h"
#include "AudioDeviceSetupWidget.h"

class QLineEdit;
class QComboBox;

namespace lmms
{
Expand All @@ -64,10 +59,16 @@ class AudioSdl : public AudioDevice
~setupWidget() override = default;

void saveSettings() override;

private:
void populatePlaybackDeviceComboBox();
void populateInputDeviceComboBox();

private:
QLineEdit * m_device;
QComboBox* m_playbackDeviceComboBox = nullptr;
QComboBox* m_inputDeviceComboBox = nullptr;

static QString s_systemDefaultDevice;
} ;


Expand All @@ -78,35 +79,22 @@ class AudioSdl : public AudioDevice
static void sdlAudioCallback( void * _udata, Uint8 * _buf, int _len );
void sdlAudioCallback( Uint8 * _buf, int _len );

#ifdef LMMS_HAVE_SDL2
static void sdlInputAudioCallback( void * _udata, Uint8 * _buf, int _len );
void sdlInputAudioCallback( Uint8 * _buf, int _len );
#endif

SDL_AudioSpec m_audioHandle;

SampleFrame* m_outBuf;

#ifdef LMMS_HAVE_SDL2
size_t m_currentBufferFramePos;
size_t m_currentBufferFramesCount;
#else
Uint8 * m_convertedBuf;
int m_convertedBufPos;
int m_convertedBufSize;
bool m_outConvertEndian;
#endif


bool m_stopped;

#ifdef LMMS_HAVE_SDL2
SDL_AudioDeviceID m_outputDevice;

SDL_AudioSpec m_inputAudioHandle;
SDL_AudioDeviceID m_inputDevice;
#endif

} ;


Expand Down
2 changes: 2 additions & 0 deletions include/EffectRackView.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ private slots:

private:
void modelChanged() override;
QSize sizeHint() const override;
QSize minimumSizeHint() const override { return sizeHint(); }

inline EffectChain* fxChain()
{
Expand Down
4 changes: 0 additions & 4 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ include_directories(SYSTEM
${FFTW3F_INCLUDE_DIRS}
)

IF(NOT LMMS_HAVE_SDL2 AND NOT ("${SDL_INCLUDE_DIR}" STREQUAL ""))
include_directories(SYSTEM "${SDL_INCLUDE_DIR}")
ENDIF()

IF(NOT ("${PULSEAUDIO_INCLUDE_DIR}" STREQUAL ""))
include_directories(SYSTEM "${PULSEAUDIO_INCLUDE_DIR}")
ENDIF()
Expand Down
Loading

0 comments on commit 849667d

Please sign in to comment.