Make install.
[Faustine.git] / interpretor / preprocessor / faust-0.9.47mr3 / architecture / osclib / faust / include / OSCIO.h
1 /*
2
3 Copyright (C) 2011 Grame
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
19 Grame Research Laboratory, 9 rue du Garet, 69001 Lyon - France
20 research@grame.fr
21
22 */
23
24
25 #ifndef __OSCIO__
26 #define __OSCIO__
27
28 #include <string>
29
30 namespace oscfaust
31 {
32
33 //--------------------------------------------------------------------------
34 // build in support
35 //--------------------------------------------------------------------------
36 //--------------------------------------------------------------------------
37 /*!
38 \brief build in support for osc audio input / output
39 */
40 class OSCIO
41 {
42 std::string fDest; // the output destination osc address
43 public:
44 OSCIO(const char *dst) : fDest(dst) {}
45 virtual ~OSCIO() {}
46
47 virtual void receive( int nframes, float * val ) = 0;
48 virtual int numOutputs() const = 0;
49 virtual int numInputs() const = 0;
50
51 /*!
52 \brief send audio frames on osc out
53 \param nframes the frames count
54 \param val a pointer to the frames values
55 \param chan the current channel number (used as part of the dest osc address)
56 */
57 virtual void send ( int nframes, float * val, int chan ) const;
58 const char* dest () const { return fDest.c_str(); }
59 void setDest (const char *dst) { fDest = dst; }
60 };
61
62 } // end namespoace
63
64 #endif