1 /*
2  * Copyright (C) 2002 - David W. Durham
3  *
4  * This file is part of ReZound, an audio editing application.
5  *
6  * ReZound is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published
8  * by the Free Software Foundation; either version 2 of the License,
9  * or (at your option) any later version.
10  *
11  * ReZound is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
19  */
20 
21 #ifndef __CPortAudioSoundPlayer_H__
22 #define __CPortAudioSoundPlayer_H__
23 
24 #include "../../config/common.h"
25 
26 #ifdef ENABLE_PORTAUDIO
27 
28 #include "ASoundPlayer.h"
29 
30 #include <portaudio.h>
31 
32 class CPortAudioSoundPlayer : public ASoundPlayer
33 {
34 public:
35 
36 	CPortAudioSoundPlayer();
37 	virtual ~CPortAudioSoundPlayer();
38 
39 	void initialize();
40 	void deinitialize();
41 	bool isInitialized() const;
42 
43 	void aboutToRecord();
44 	void doneRecording();
45 
46 private:
47 	bool initialized;
48 	PaStream *stream;
49 	bool supportsFullDuplex;
50 
51 #ifdef ENABLE_PORTAUDIO_V19
52 	static int PortAudioCallback(const void *inputBuffer,void *outputBuffer,unsigned long framesPerBuffer,const PaStreamCallbackTimeInfo* outTime, PaStreamCallbackFlags statusFlags, void *userData);
53 #else
54 	static int PortAudioCallback(void *inputBuffer,void *outputBuffer,unsigned long framesPerBuffer,PaTimestamp outTime,void *userData);
55 #endif
56 
57 };
58 
59 #endif // ENABLE_PORTAUDIO
60 
61 #endif
62