Jack2  1.9.8
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 "JackPlatformPlug.h"
00026 
00027 namespace Jack
00028 {
00029 
00034 class SERVER_EXPORT JackThreadedDriver : public JackDriverClientInterface, public JackRunnableInterface
00035 {
00036 
00037     protected:
00038 
00039         JackThread fThread;
00040         JackDriver* fDriver;
00041 
00042         void SetRealTime();
00043 
00044     public:
00045 
00046         JackThreadedDriver(JackDriver* driver);
00047         virtual ~JackThreadedDriver();
00048 
00049         virtual int Open();
00050 
00051         virtual int Open (bool capturing,
00052                          bool playing,
00053                          int inchannels,
00054                          int outchannels,
00055                          bool monitor,
00056                          const char* capture_driver_name,
00057                          const char* playback_driver_name,
00058                          jack_nframes_t capture_latency,
00059                          jack_nframes_t playback_latency)
00060         {
00061             return -1;
00062         }
00063         virtual int Open(jack_nframes_t buffer_size,
00064                          jack_nframes_t samplerate,
00065                          bool capturing,
00066                          bool playing,
00067                          int inchannels,
00068                          int outchannels,
00069                          bool monitor,
00070                          const char* capture_driver_name,
00071                          const char* playback_driver_name,
00072                          jack_nframes_t capture_latency,
00073                          jack_nframes_t playback_latency);
00074         virtual int Close();
00075 
00076         virtual int Process();
00077 
00078         virtual int Attach();
00079         virtual int Detach();
00080 
00081         virtual int Read();
00082         virtual int Write();
00083 
00084         virtual int Start();
00085         virtual int Stop();
00086 
00087         virtual bool IsFixedBufferSize();
00088         virtual int SetBufferSize(jack_nframes_t buffer_size);
00089         virtual int SetSampleRate(jack_nframes_t sample_rate);
00090 
00091         virtual void SetMaster(bool onoff);
00092         virtual bool GetMaster();
00093 
00094         virtual void AddSlave(JackDriverInterface* slave);
00095         virtual void RemoveSlave(JackDriverInterface* slave);
00096 
00097         virtual std::list<JackDriverInterface*> GetSlaves();
00098 
00099         virtual int ProcessReadSlaves();
00100         virtual int ProcessWriteSlaves();
00101 
00102         virtual int ProcessRead();
00103         virtual int ProcessWrite();
00104 
00105         virtual int ProcessReadSync();
00106         virtual int ProcessWriteSync();
00107 
00108         virtual int ProcessReadAsync();
00109         virtual int ProcessWriteAsync();
00110 
00111         virtual int ClientNotify(int refnum, const char* name, int notify, int sync, const char* message, int value1, int value2);
00112         virtual JackClientControl* GetClientControl() const;
00113         virtual bool IsRealTime() const;
00114         virtual bool IsRunning() const;
00115 
00116         // JackRunnableInterface interface
00117         virtual bool Execute();
00118         virtual bool Init();
00119 
00120 };
00121 
00122 } // end of namespace
00123 
00124 
00125 #endif