2 Copyright (C) 2001 Paul Davis
3 Copyright (C) 2004-2008 Grame
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program 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
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #ifndef __JackThreadedDriver__
22 #define __JackThreadedDriver__
24 #include "JackDriver.h"
25 #include "JackPlatformPlug.h"
31 \brief The base class for threaded drivers using a "decorator" pattern. Threaded drivers are used with blocking devices.
34 class SERVER_EXPORT JackThreadedDriver
: public JackDriverClientInterface
, public JackRunnableInterface
46 JackThreadedDriver(JackDriver
* driver
);
47 virtual ~JackThreadedDriver();
50 virtual int Open(jack_nframes_t buffer_size
,
51 jack_nframes_t samplerate
,
57 const char* capture_driver_name
,
58 const char* playback_driver_name
,
59 jack_nframes_t capture_latency
,
60 jack_nframes_t playback_latency
);
63 virtual int Process();
74 virtual bool IsFixedBufferSize();
75 virtual int SetBufferSize(jack_nframes_t buffer_size
);
76 virtual int SetSampleRate(jack_nframes_t sample_rate
);
78 virtual void SetMaster(bool onoff
);
79 virtual bool GetMaster();
81 virtual void AddSlave(JackDriverInterface
* slave
);
82 virtual void RemoveSlave(JackDriverInterface
* slave
);
84 virtual std::list
<JackDriverInterface
*> GetSlaves();
86 virtual int ProcessReadSlaves();
87 virtual int ProcessWriteSlaves();
89 virtual int ProcessRead();
90 virtual int ProcessWrite();
92 virtual int ProcessReadSync();
93 virtual int ProcessWriteSync();
95 virtual int ProcessReadAsync();
96 virtual int ProcessWriteAsync();
98 virtual int ClientNotify(int refnum
, const char* name
, int notify
, int sync
, const char* message
, int value1
, int value2
);
99 virtual JackClientControl
* GetClientControl() const;
100 virtual bool IsRealTime() const;
101 virtual bool IsRunning() const;
103 // JackRunnableInterface interface
104 virtual bool Execute();
109 } // end of namespace