Fix build under mixed mode
[jack2.git] / common / JackTimedDriver.h
blob0a594e756d2debdd072a671e001ef1b23b4621cc
1 /*
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 __JackTimedDriver__
22 #define __JackTimedDriver__
24 #include "JackAudioDriver.h"
26 namespace Jack
29 /*!
30 \brief The timed driver.
33 class SERVER_EXPORT JackTimedDriver : public JackAudioDriver
35 protected:
37 int fCycleCount;
38 jack_time_t fAnchorTimeUsec;
40 int FirstCycle(jack_time_t cur_time);
41 int CurrentCycle(jack_time_t cur_time);
43 void ProcessWait();
45 public:
47 JackTimedDriver(const char* name, const char* alias, JackLockedEngine* engine, JackSynchro* table)
48 : JackAudioDriver(name, alias, engine, table), fCycleCount(0), fAnchorTimeUsec(0)
50 virtual ~JackTimedDriver()
53 // BufferSize can be changed
54 bool IsFixedBufferSize()
56 return false;
59 int Start();
63 class SERVER_EXPORT JackWaiterDriver : public JackTimedDriver
66 public:
68 JackWaiterDriver(const char* name, const char* alias, JackLockedEngine* engine, JackSynchro* table)
69 : JackTimedDriver(name, alias, engine, table)
71 virtual ~JackWaiterDriver()
74 virtual int ProcessNull();
78 /*!
79 \brief A restartable driver.
81 When wrapped into a JackWaitCallbackDriver, this driver can restart the
82 wrapper thread which will wait again for the Initialize method to return.
84 class SERVER_EXPORT JackRestarterDriver : public JackWaiterDriver
87 private:
89 JackDriver* fRestartDriver; /*!< The wrapper driver */
91 public:
93 JackRestarterDriver(const char* name, const char* alias, JackLockedEngine* engine, JackSynchro* table)
94 : JackWaiterDriver(name, alias, engine, table), fRestartDriver(NULL)
96 virtual ~JackRestarterDriver()
99 void SetRestartDriver(JackDriver* driver); /*!< Let the wrapper register itself */
100 int RestartWait(); /*!< Restart the wrapper thread */
104 } // end of namespace
106 #endif