// Copyright (C) 2003 David Griffiths // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include #include "PortAudioClient.h" PortAudioClient* PortAudioClient::m_Singleton = NULL; bool PortAudioClient::m_Attached = false; long unsigned int PortAudioClient::m_BufferSize = 0; long unsigned int PortAudioClient::m_SampleRate = 44100; void (*PortAudioClient::RunCallback)(void*, unsigned int BufSize)=NULL; void *PortAudioClient::RunContext = NULL; PortAudioStream *PortAudioClient::m_Client = NULL; float *PortAudioClient::m_RightData=NULL; float *PortAudioClient::m_LeftData=NULL; float *PortAudioClient::m_RightInData=NULL; float *PortAudioClient::m_LeftInData=NULL; /////////////////////////////////////////////////////// PortAudioClient::PortAudioClient() { } ///////////////////////////////////////////////////////////////////////////////////////////// PortAudioClient::~PortAudioClient() { Detach(); } ///////////////////////////////////////////////////////////////////////////////////////////// bool PortAudioClient::Attach(const string &ClientName, const DeviceOptions &dopt) { if (m_Attached) return true; m_SampleRate=dopt.Samplerate; PaError err; int i; int totalSamps; err = Pa_Initialize(); if( err != paNoError ) { cerr<<"Could not init PortAudioClient"<