1 |
schoenebeck |
31 |
/*************************************************************************** |
2 |
|
|
* * |
3 |
|
|
* LinuxSampler - modular, streaming capable sampler * |
4 |
|
|
* * |
5 |
|
|
* Copyright (C) 2003 by Benno Senoner and Christian Schoenebeck * |
6 |
|
|
* * |
7 |
|
|
* This program is free software; you can redistribute it and/or modify * |
8 |
|
|
* it under the terms of the GNU General Public License as published by * |
9 |
|
|
* the Free Software Foundation; either version 2 of the License, or * |
10 |
|
|
* (at your option) any later version. * |
11 |
|
|
* * |
12 |
|
|
* This program is distributed in the hope that it will be useful, * |
13 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
14 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
15 |
|
|
* GNU General Public License for more details. * |
16 |
|
|
* * |
17 |
|
|
* You should have received a copy of the GNU General Public License * |
18 |
|
|
* along with this program; if not, write to the Free Software * |
19 |
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, * |
20 |
|
|
* MA 02111-1307 USA * |
21 |
|
|
***************************************************************************/ |
22 |
|
|
|
23 |
|
|
#ifndef __JACKIO_H__ |
24 |
|
|
#define __JACKIO_H__ |
25 |
|
|
|
26 |
|
|
#include "global.h" |
27 |
|
|
#include "audioio.h" |
28 |
|
|
#include "audiothread.h" |
29 |
|
|
|
30 |
|
|
#if HAVE_JACK |
31 |
|
|
|
32 |
|
|
#include <jack/jack.h> |
33 |
|
|
|
34 |
|
|
//TODO: only stereo (2 ports / channels) at the moment |
35 |
|
|
|
36 |
|
|
// Callback functions for the libjack API |
37 |
|
|
int __libjack_process_callback(jack_nframes_t nframes, void* arg); |
38 |
|
|
void __libjack_shutdown_callback(void* arg); |
39 |
|
|
|
40 |
|
|
class JackIO : public AudioIO { |
41 |
|
|
public: |
42 |
|
|
JackIO(); |
43 |
schoenebeck |
33 |
int Initialize(uint Channels, String OutputPorts[2]); |
44 |
schoenebeck |
31 |
void Activate(); |
45 |
|
|
void Close(); |
46 |
|
|
void* GetInterleavedOutputBuffer(); |
47 |
|
|
void* GetChannelOutputBufer(uint Channel); |
48 |
|
|
int Process(uint Samples); // FIXME: should be private |
49 |
|
|
private: |
50 |
|
|
jack_client_t* Client; |
51 |
|
|
jack_port_t* Ports[2]; |
52 |
schoenebeck |
33 |
jack_port_t* playback_port[2]; |
53 |
schoenebeck |
31 |
uint PendingSamples; |
54 |
|
|
}; |
55 |
|
|
|
56 |
|
|
#endif // HAVE_JACK |
57 |
|
|
#endif // __JACKIO_H__ |