1 /*----------------------------------------------------------------------------
2 ChucK Concurrent, On-the-fly Audio Programming Language
3 Compiler and Virtual Machine
5 Copyright (c) 2004 Ge Wang and Perry R. Cook. All rights reserved.
6 http://chuck.cs.princeton.edu/
7 http://soundlab.cs.princeton.edu/
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
23 -----------------------------------------------------------------------------*/
25 //-----------------------------------------------------------------------------
29 // author: Ge Wang (gewang@cs.princeton.edu)
30 // Perry R. Cook (prc@cs.princeton.edu)
31 //-----------------------------------------------------------------------------
32 #ifndef __CHUCK_BBQ_H__
33 #define __CHUCK_BBQ_H__
35 // currently ChucK uses RtAudio | __CHUCK_NATIVE_AUDIO__ not in use
36 #if defined(__CHUCK_NATIVE_AUDIO__)
37 #if defined(__LINUX_ALSA__)
38 #include "digiio_alsa.h"
39 #include "midiio_alsa.h"
40 #elif defined(__LINUX_JACK__)
41 #include "digiio_jack.h"
42 #include "midiio_alsa.h"
43 #elif defined(__LINUX_OSS__)
44 #include "digiio_oss.h"
45 #include "midiio_oss.h"
46 #elif defined(__MACOSX_CORE__)
47 #include "digiio_osx.h"
48 #include "midiio_osx.h"
49 #elif defined(__WINDOWS_DS__)
50 #include "digiio_win32.h"
51 #include "midiio_win32.h"
53 #error "must define one:\
54 __LINUX_ALSA__ __LINUX_JACK__ __LINUX_OSS__ __MACOSX_CORE__ __WINDOWS_DS__"
57 #include "digiio_rtaudio.h"
58 #if defined(__LINUX_ALSA__)
59 #include "midiio_alsa.h"
60 #elif defined(__LINUX_JACK__)
61 #include "midiio_alsa.h"
62 #elif defined(__LINUX_OSS__)
63 #include "midiio_oss.h"
64 #elif defined(__MACOSX_CORE__)
65 #include "midiio_osx.h"
66 #elif defined(__WINDOWS_DS__)
67 #include "midiio_win32.h"
69 #error "must define one:\
70 __LINUX_ALSA__ __LINUX_JACK__ __LINUX_OSS__ __MACOSX_CORE__ __WINDOWS_DS__"
80 //-----------------------------------------------------------------------------
83 //-----------------------------------------------------------------------------
91 BOOL__
initialize( DWORD__ num_channels
, DWORD__ sampling_rate
,
93 DWORD__ buffer_size
= BUFFER_SIZE_DEFAULT
,
94 DWORD__ num_buffers
= NUM_BUFFERS_DEFAULT
,
97 void set_srate( DWORD__ srate
);
98 void set_bufsize( DWORD__ bufsize
);
102 DigitalOut
* digi_out();
103 DigitalIn
* digi_in();
104 MidiOut
* midi_out( DWORD__ index
= 0 );
105 MidiIn
* midi_in( DWORD__ index
= 0 );
108 DWORD__
in_count( DWORD__ index
= 0 )
109 { return index
< m_max_midi_device
? m_in_count
[index
] : 0; }
110 DWORD__
out_count( DWORD__ index
= 0 )
111 { return index
< m_max_midi_device
? m_out_count
[index
] : 0; }
114 DigitalOut
* m_digi_out
;
115 DigitalIn
* m_digi_in
;
116 MidiOut
** m_midi_out
;
118 DWORD__
* m_in_count
;
119 DWORD__
* m_out_count
;
120 DWORD__ m_max_midi_device
;
126 //-----------------------------------------------------------------------------
127 // name: class RangeMapper
129 //-----------------------------------------------------------------------------
133 RangeMapper( SAMPLE low_l
, SAMPLE high_l
, SAMPLE low_r
, SAMPLE high_r
);
136 virtual SAMPLE
map( SAMPLE in
);