Remove non-jackdbus man pages
[jackdbus.git] / solaris / oss / JackBoomerDriver.h
blob79103b30b8c4880e1ae484b8067bf53c84750c3a
1 /*
2 Copyright (C) 2009 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 __JackBoomerDriver__
21 #define __JackBoomerDriver__
23 #include "JackAudioDriver.h"
24 #include "JackPlatformPlug.h"
25 #include "ringbuffer.h"
26 #include <semaphore.h>
28 namespace Jack
31 typedef jack_default_audio_sample_t jack_sample_t;
33 #define OSS_DRIVER_DEF_DEV "/dev/dsp"
34 #define OSS_DRIVER_DEF_FS 48000
35 #define OSS_DRIVER_DEF_BLKSIZE 1024
36 #define OSS_DRIVER_DEF_NPERIODS 1
37 #define OSS_DRIVER_DEF_BITS 16
38 #define OSS_DRIVER_DEF_INS 2
39 #define OSS_DRIVER_DEF_OUTS 2
41 /*!
42 \brief The Boomer driver.
45 class JackBoomerDriver : public JackAudioDriver
48 enum { kRead = 1, kWrite = 2, kReadWrite = 3 };
50 private:
52 class JackBoomerDriverInput : public JackRunnableInterface {
54 private:
56 JackBoomerDriver* fDriver;
58 public:
60 JackBoomerDriverInput(JackBoomerDriver* driver): fDriver(driver)
62 ~JackBoomerDriverInput()
65 bool Init();
66 bool Execute();
69 class JackBoomerDriverOutput : public JackRunnableInterface {
71 private:
73 JackBoomerDriver* fDriver;
75 public:
77 JackBoomerDriverOutput(JackBoomerDriver* driver): fDriver(driver)
79 ~JackBoomerDriverOutput()
82 bool Init();
83 bool Execute();
86 int fInFD;
87 int fOutFD;
89 int fBits;
90 int fSampleFormat;
91 int fNperiods;
92 unsigned int fSampleSize;
93 unsigned int fFragmentSize;
94 int fRWMode;
95 bool fExcl;
96 bool fSyncIO;
98 unsigned int fInputBufferSize;
99 unsigned int fOutputBufferSize;
101 void* fInputBuffer;
102 void* fOutputBuffer;
104 sem_t fReadSema;
105 sem_t fWriteSema;
107 JackThread fInputThread;
108 JackThread fOutputThread;
110 JackBoomerDriverInput fInputHandler;
111 JackBoomerDriverOutput fOutputHandler;
113 int OpenInput();
114 int OpenOutput();
115 int OpenAux();
116 void CloseAux();
117 void SetSampleFormat();
118 void DisplayDeviceInfo();
119 void SynchronizeRead();
120 void SynchronizeWrite();
122 public:
124 JackBoomerDriver(const char* name, const char* alias, JackLockedEngine* engine, JackSynchro* table);
125 virtual ~JackBoomerDriver();
127 int Open(jack_nframes_t frames_per_cycle,
128 int user_nperiods,
129 jack_nframes_t rate,
130 bool capturing,
131 bool playing,
132 int chan_in,
133 int chan_out,
134 bool excl,
135 bool monitor,
136 const char* capture_driver_name,
137 const char* playback_driver_name,
138 jack_nframes_t capture_latency,
139 jack_nframes_t playback_latency,
140 int bits, bool syncio);
142 int Close();
144 int Start();
145 int Stop();
147 // BufferSize can be changed
148 bool IsFixedBufferSize()
150 return false;
153 int SetBufferSize(jack_nframes_t buffer_size);
157 } // end of namespace
159 #endif