1 /************************************************************************
2 	IMPORTANT NOTE : this file contains two clearly delimited sections :
3 	the ARCHITECTURE section (in two parts) and the USER section. Each section
4 	is governed by its own copyright and license. Please check individually
5 	each section for license and copyright information.
6 *************************************************************************/
7 
8 /*******************BEGIN ARCHITECTURE SECTION (part 1/2)****************/
9 
10 /************************************************************************
11     FAUST Architecture File
12     Copyright (C) 2003-2011 GRAME, Centre National de Creation Musicale
13     ---------------------------------------------------------------------
14     This Architecture section is free software; you can redistribute it
15     and/or modify it under the terms of the GNU General Public License
16     as published by the Free Software Foundation; either version 3 of
17     the License, or (at your option) any later version.
18 
19     This program is distributed in the hope that it will be useful,
20     but WITHOUT ANY WARRANTY; without even the implied warranty of
21     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22     GNU General Public License for more details.
23 
24     You should have received a copy of the GNU General Public License
25     along with this program; If not, see <http://www.gnu.org/licenses/>.
26 
27     EXCEPTION : As a special exception, you may create a larger work
28     that contains this FAUST architecture section and distribute
29     that work under terms of your choice, so long as this FAUST
30     architecture section is not modified.
31 
32 
33  ************************************************************************
34  ************************************************************************/
35 
36 /******************************************************************************
37 *******************************************************************************
38 
39 						An abstraction layer over audio layer
40 
41 *******************************************************************************
42 *******************************************************************************/
43 
44 #ifndef __audio__
45 #define __audio__
46 
47 class dsp;
48 
49 typedef void (* shutdown_callback)(const char* message, void* arg);
50 
51 class audio {
52 
53  public:
54 			 audio() {}
55 	virtual ~audio() {}
56 
57 	virtual bool init(const char* name, dsp*)               = 0;
58 	virtual bool start()                                    = 0;
59 	virtual void stop()                                     = 0;
60     virtual void shutdown(shutdown_callback cb, void* arg)  {}
61 
62     virtual int get_buffer_size() = 0;
63     virtual int get_sample_rate() = 0;
64 
65     virtual int get_num_inputs() { return -1; }
66     virtual int get_num_outputs() { return -1; }
67 
68     virtual float get_cpu_load() { return 0.f; }
69 };
70 
71 #endif
72