Pd++  0.01
A pure C++ implementation of Pure Data objects
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
paRender++.h
1 /*
2  * $Id: portaudio.h 1859 2012-09-01 00:10:13Z philburk $
3  * PortAudio Portable Real-Time Audio Library
4  * PortAudio API Header File
5  * Latest version available at: http://www.portaudio.com/
6  *
7  * Copyright (c) 1999-2002 Ross Bencina and Phil Burk
8  *
9  * Permission is hereby granted, free of charge, to any person obtaining
10  * a copy of this software and associated documentation files
11  * (the "Software"), to deal in the Software without restriction,
12  * including without limitation the rights to use, copy, modify, merge,
13  * publish, distribute, sublicense, and/or sell copies of the Software,
14  * and to permit persons to whom the Software is furnished to do so,
15  * subject to the following conditions:
16  *
17  * The above copyright notice and this permission notice shall be
18  * included in all copies or substantial portions of the Software.
19  *
20  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
24  * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
25  * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
26  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27  */
28 
29 /*
30  * The text above constitutes the entire PortAudio license; however,
31  * the PortAudio community also makes the following non-binding requests:
32  *
33  * Any person wishing to distribute modifications to the Software is
34  * requested to send the modifications to the original developer so that
35  * they can be incorporated into the canonical version. It is also
36  * requested that these non-binding requests be included along with the
37  * license above.
38  */
39 
40 
41 #ifndef __Pd____paRender____
42 #define __Pd____paRender____
43 
44 #include <iostream>
45 #include <stdio.h>
46 #include <math.h>
47 #include "portaudio.h"
48 #include "PdMaster.h"
49 #include "PdAlgorithm.h"
50 
51 /*! \brief A portaudio wrapper class, based on portaudio's example.*/
52 class paRender : public PdMaster {
53 
54 private:
55  PaStream *stream;
57  int err;
58  char message[20];
59  Buffer theBuffer;
60  unsigned long framesPerBuffer = 64;
61 
62  /* The instance callback, where we have access to every method/variable in
63  object of class PdAlgorithm */
64  int paCallbackMethod(const void *inputBuffer, void *outputBuffer,
65  unsigned long framesPerBuffer,
66  const PaStreamCallbackTimeInfo* timeInfo,
67  PaStreamCallbackFlags statusFlags);
68 
69 
70  static int paCallback( const void *inputBuffer, void *outputBuffer,
71  unsigned long framesPerBuffer,
72  const PaStreamCallbackTimeInfo* timeInfo,
73  PaStreamCallbackFlags statusFlags,
74  void *userData );
75 
76 
77  static void paStreamFinished(void* userData);
78 
79 public:
80  paRender();
81  ~paRender();
82  bool open(PaDeviceIndex index, PaDeviceIndex input);
83  bool close();
84  bool start();
85  bool stop();
86  void paStreamFinishedMethod();
87  void sendError(int);
88 
89 
90 
91 };
92 
93 #endif /* defined(__Pd____paRender____) */
This class is where you put all your audio routines, etc.
Definition: PdAlgorithm.h:29
The Pd++ namespace.
Definition: BandPass.cpp:14
void PaStream
Definition: portaudio.h:584
A super class inherited by all Pd++ objects.
Definition: PdMaster.h:62
Input and output struct for PdAlgorithm.
Definition: PdMaster.h:46
Definition: portaudio.h:648
int PaDeviceIndex
Definition: portaudio.h:161
The portable PortAudio API.
unsigned long PaStreamCallbackFlags
Definition: portaudio.h:661
A portaudio wrapper class, based on portaudio's example.
Definition: paRender++.h:52