Add Pieter Palmers FreeBob driver.
[jack2.git] / common / JackSynchro.h
blobd067ecad62356ca33997b49383a0626866b2a2b4
1 /*
2 Copyright (C) 2004-2006 Grame
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef __JackSynchro__
21 #define __JackSynchro__
23 #include "JackError.h"
25 #define SYNC_MAX_NAME_SIZE 256
27 namespace Jack
30 /*!
31 \brief An inter process synchronization primitive.
34 class JackSynchro
37 protected:
39 char fName[SYNC_MAX_NAME_SIZE];
40 bool fFlush; // If true, signal are "flushed" : used for drivers that do no consume the signal
42 virtual void BuildName(const char* name, char* res)
45 public:
47 JackSynchro(): fFlush(false)
49 virtual ~JackSynchro()
52 virtual bool Signal()
54 return true;
56 virtual bool SignalAll()
58 return true;
60 virtual bool Wait()
62 return true;
64 virtual bool TimedWait(long usec)
66 return true;
68 virtual bool Allocate(const char* name, int value)
70 return true;
72 virtual bool Connect(const char* name)
74 return true;
76 virtual bool ConnectInput(const char* name)
78 return true;
80 virtual bool ConnectOutput(const char* name)
82 return true;
84 virtual bool Disconnect()
86 return true;
88 virtual void Destroy()
91 void SetFlush(bool mode)
93 fFlush = mode;
99 } // end of namespace
101 #endif