Jack2 1.9.6

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     public:
00043 
00044         JackThreadedDriver(JackDriver* driver);
00045         virtual ~JackThreadedDriver();
00046 
00047         virtual int Open();
00048         
00049         virtual int Open (bool capturing,
00050                      bool playing,
00051                      int inchannels,
00052                      int outchannels,
00053                      bool monitor,
00054                      const char* capture_driver_name,
00055                      const char* playback_driver_name,
00056                      jack_nframes_t capture_latency,
00057                      jack_nframes_t playback_latency) 
00058         {
00059             return -1;
00060         }
00061         virtual int Open(jack_nframes_t buffer_size,
00062                          jack_nframes_t samplerate,
00063                          bool capturing,
00064                          bool playing,
00065                          int inchannels,
00066                          int outchannels,
00067                          bool monitor,
00068                          const char* capture_driver_name,
00069                          const char* playback_driver_name,
00070                          jack_nframes_t capture_latency,
00071                          jack_nframes_t playback_latency);
00072         virtual int Close();
00073   
00074         virtual int Process();
00075         virtual int ProcessNull();
00076     
00077         virtual int Attach();
00078         virtual int Detach();
00079      
00080         virtual int Read();
00081         virtual int Write();
00082     
00083         virtual int Start();
00084         virtual int Stop();
00085 
00086         virtual bool IsFixedBufferSize();
00087         virtual int SetBufferSize(jack_nframes_t buffer_size);
00088         virtual int SetSampleRate(jack_nframes_t sample_rate);
00089      
00090         virtual void SetMaster(bool onoff);
00091         virtual bool GetMaster();
00092         virtual void AddSlave(JackDriverInterface* slave);
00093         virtual void RemoveSlave(JackDriverInterface* slave);
00094         virtual std::list<JackDriverInterface*> GetSlaves();
00095         virtual int ProcessSlaves();
00096         
00097         virtual int ClientNotify(int refnum, const char* name, int notify, int sync, const char* message, int value1, int value2);
00098         virtual JackClientControl* GetClientControl() const;
00099         virtual bool IsRealTime() const;
00100    
00101         // JackRunnableInterface interface
00102         virtual bool Execute();
00103         virtual bool Init();
00104 
00105 };
00106 
00107 } // end of namespace
00108 
00109 
00110 #endif