Skip to content

Commit

Permalink
unused member pcmBuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
labkey-matthewb committed May 16, 2018
1 parent d157822 commit 681b23d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/projectM-sdl/pmSDL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,11 @@ int projectMSDL::openAudioInput() {
void projectMSDL::beginAudioCapture() {
// allocate a buffer to store PCM data for feeding in
unsigned int maxSamples = audioChannelsCount * audioSampleCount;
pcmBuffer = (unsigned char *) malloc(maxSamples);
SDL_PauseAudioDevice(audioDeviceID, false);
pcm()->initPCM(2048);
}

void projectMSDL::endAudioCapture() {
free(pcmBuffer);
SDL_PauseAudioDevice(audioDeviceID, true);
}

Expand Down Expand Up @@ -236,3 +234,9 @@ void projectMSDL::init(SDL_Window *window, SDL_Renderer *renderer) {
selectRandom(true);
projectM_resetGL(width, height);
}


std::string projectMSDL::getActivePresetName()
{
return std::string("hey");
}
3 changes: 1 addition & 2 deletions src/projectM-sdl/pmSDL.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class projectMSDL : projectM {
void renderFrame();
void pollEvent();
void maximize();
std::string getActivePresetName();

private:
SDL_Window *win;
Expand All @@ -59,12 +60,10 @@ class projectMSDL : projectM {
unsigned short audioSampleCount;
SDL_AudioFormat audioFormat;
SDL_AudioDeviceID audioDeviceID;
unsigned char *pcmBuffer; // pre-allocated buffer for audioInputCallback

static void audioInputCallbackF32(void *userdata, unsigned char *stream, int len);
static void audioInputCallbackS16(void *userdata, unsigned char *stream, int len);


void addFakePCM();
void keyHandler(SDL_Event *);
SDL_AudioDeviceID selectAudioInput(int count);
Expand Down

0 comments on commit 681b23d

Please sign in to comment.