JackThreadedDriver.h

00001 /*
00002  Copyright (C) 2001 Paul Davis 
00003  Copyright (C) 2004-2008 Grame
00004 
00005  This program is free software; you can redistribute it and/or modify
00006  it under the terms of the GNU General Public License as published by
00007  the Free Software Foundation; either version 2 of the License, or
00008  (at your option) any later version.
00009 
00010  This program is distributed in the hope that it will be useful,
00011  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  GNU General Public License for more details.
00014 
00015  You should have received a copy of the GNU General Public License
00016  along with this program; if not, write to the Free Software
00017  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018 
00019 */
00020 
00021 #ifndef __JackThreadedDriver__
00022 #define __JackThreadedDriver__
00023 
00024 #include "JackDriver.h"
00025 #include "JackThread.h"
00026 
00027 namespace Jack
00028 {
00029 
00034 class JackThreadedDriver : public JackDriverClientInterface, public JackRunnableInterface
00035 {
00036 
00037     private:
00038 
00039         JackThread* fThread;
00040         JackDriverClient* fDriver;
00041 
00042     public:
00043 
00044         JackThreadedDriver(JackDriverClient* driver);
00045         virtual ~JackThreadedDriver();
00046 
00047         virtual int Open()
00048         {
00049             return fDriver->Open();
00050         }
00051 
00052         virtual int Open(jack_nframes_t nframes,
00053                          jack_nframes_t samplerate,
00054                          bool capturing,
00055                          bool playing,
00056                          int inchannels,
00057                          int outchannels,
00058                          bool monitor,
00059                          const char* capture_driver_name,
00060                          const char* playback_driver_name,
00061                          jack_nframes_t capture_latency,
00062                          jack_nframes_t playback_latency)
00063         {
00064             return fDriver->Open(nframes, samplerate, capturing, playing, inchannels, outchannels, monitor, capture_driver_name, playback_driver_name, capture_latency, playback_latency);
00065         }
00066 
00067         virtual int Close()
00068         {
00069             return fDriver->Close();
00070         }
00071 
00072         virtual int Process()
00073         {
00074             return fDriver->Process();
00075         }
00076 
00077         virtual int Attach()
00078         {
00079             return fDriver->Attach();
00080         }
00081         virtual int Detach()
00082         {
00083             return fDriver->Detach();
00084         }
00085                 
00086                 virtual int Read()
00087         {
00088             return fDriver->Read();
00089         }
00090         virtual int Write()
00091         {
00092             return fDriver->Write();
00093         }
00094 
00095         virtual int Start();
00096         virtual int Stop();
00097 
00098         virtual int SetBufferSize(jack_nframes_t buffer_size)
00099         {
00100             return fDriver->SetBufferSize(buffer_size);
00101         }
00102                 
00103                 virtual int SetSampleRate(jack_nframes_t sample_rate)
00104         {
00105             return fDriver->SetSampleRate(sample_rate);
00106         }
00107 
00108         virtual void SetMaster(bool onoff)
00109         {
00110             fDriver->SetMaster(onoff);
00111         }
00112         virtual bool GetMaster()
00113         {
00114             return fDriver->GetMaster();
00115         }
00116 
00117         virtual void AddSlave(JackDriverInterface* slave)
00118         {
00119             fDriver->AddSlave(slave);
00120         }
00121         virtual void RemoveSlave(JackDriverInterface* slave)
00122         {
00123             fDriver->RemoveSlave(slave);
00124         }
00125         virtual int ProcessSlaves()
00126         {
00127             return fDriver->ProcessSlaves();
00128         }
00129 
00130         virtual int ClientNotify(int refnum, const char* name, int notify, int sync, int value1, int value2)
00131         {
00132             return fDriver->ClientNotify(refnum, name, notify, sync, value1, value2);
00133         }
00134 
00135         virtual JackClientControl* GetClientControl() const
00136         {
00137             return fDriver->GetClientControl();
00138         }
00139 
00140         virtual bool IsRealTime()
00141         {
00142             return fDriver->IsRealTime();
00143         }
00144 
00145         // JackRunnableInterface interface
00146 
00147         virtual bool Execute();
00148 
00149 };
00150 
00151 } // end of namespace
00152 
00153 
00154 #endif

Generated on Thu Feb 14 11:16:02 2008 for Jackdmp by  doxygen 1.5.1