Version 0.62
[jack2.git] / windows / JackASIODriver.h
blob794971a99e2752c1b67b5e6835417aefa4661579
1 /*
2 Copyright (C) 2006 Grame
4 Portable Audio I/O Library for ASIO Drivers
5 Author: Stephane Letz
6 Based on the Open Source API proposed by Ross Bencina
7 Copyright (c) 2000-2002 Stephane Letz, Phil Burk, Ross Bencina
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., 675 Mass Ave, Cambridge, MA 02139, USA.
25 #ifndef __JackASIODriver__
26 #define __JackASIODriver__
28 #include "JackAudioDriver.h"
29 #include "portaudio.h"
31 namespace Jack
34 /*!
35 \brief The ASIO driver.
38 class JackASIODriver : public JackAudioDriver
41 private:
43 PaStream* fStream;
44 float** fInputBuffer;
45 float** fOutputBuffer;
46 PaDeviceIndex fInputDevice;
47 PaDeviceIndex fOutputDevice;
49 static int Render(const void* inputBuffer, void* outputBuffer,
50 unsigned long framesPerBuffer,
51 const PaStreamCallbackTimeInfo* timeInfo,
52 PaStreamCallbackFlags statusFlags,
53 void* userData);
55 public:
57 JackASIODriver(const char* name, JackEngine* engine, JackSynchro** table)
58 : JackAudioDriver(name, engine, table), fStream(NULL), fInputBuffer(NULL), fOutputBuffer(NULL),
59 fInputDevice(paNoDevice), fOutputDevice(paNoDevice)
62 virtual ~JackASIODriver()
65 int Open(jack_nframes_t frames_per_cycle,
66 jack_nframes_t rate,
67 int capturing,
68 int playing,
69 int chan_in,
70 int chan_out,
71 bool monitor,
72 const char* capture_driver_name,
73 const char* playback_driver_name,
74 jack_nframes_t capture_latency,
75 jack_nframes_t playback_latency);
77 int Close();
79 int Start();
80 int Stop();
82 int Read();
83 int Write();
85 int SetBufferSize(jack_nframes_t nframes);
87 void PrintState();
90 } // end of namespace
92 #endif