AudioSdl: Add support for full SDL2 with float samples and recording

(with backward compatibility for SDL1).

Cherry-picked from dcc442411f
This commit is contained in:
Shmuel H
2017-11-07 12:59:49 +02:00
committed by Lukas W
parent 8165152552
commit ec28a65c89
2 changed files with 148 additions and 9 deletions

View File

@@ -78,17 +78,35 @@ private:
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;
surroundSampleFrame * m_outBuf;
#ifdef LMMS_HAVE_SDL2
uint64_t m_currentBufferFramePos;
uint64_t m_currentBufferFramesCount;
#else
Uint8 * m_convertedBuf;
int m_convertedBufPos;
int m_convertedBufSize;
bool m_outConvertEndian;
#endif
bool m_convertEndian;
bool m_stopped;
#ifdef LMMS_HAVE_SDL2
SDL_AudioDeviceID m_outputDevice;
SDL_AudioSpec m_inputAudioHandle;
SDL_AudioDeviceID m_inputDevice;
#endif
} ;
#endif