Jack2 1.9.6

JackInternalClient.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 __JackInternalClient__
00022 #define __JackInternalClient__
00023 
00024 #include "JackClient.h"
00025 #include "JackClientControl.h"
00026 #include "driver_interface.h"
00027 
00028 namespace Jack
00029 {
00030 
00031 struct JackEngineControl;
00032 
00037 class JackInternalClient : public JackClient
00038 {
00039 
00040     private:
00041 
00042         JackClientControl fClientControl;     
00044     public:
00045 
00046         JackInternalClient(JackServer* server, JackSynchro* table);
00047         virtual ~JackInternalClient();
00048 
00049         int Open(const char* server_name, const char* name, jack_options_t options, jack_status_t* status);
00050 
00051         JackGraphManager* GetGraphManager() const;
00052         JackEngineControl* GetEngineControl() const;
00053         JackClientControl* GetClientControl() const;
00054 
00055         static JackGraphManager* fGraphManager;         
00056         static JackEngineControl* fEngineControl;       
00057 };
00058 
00063 typedef int (*InitializeCallback)(jack_client_t*, const char*);
00064 typedef int (*InternalInitializeCallback)(jack_client_t*, const JSList* params);
00065 typedef void (*FinishCallback)(void *);
00066 typedef jack_driver_desc_t * (*JackDriverDescFunction) ();
00067 
00068 class JackLoadableInternalClient : public JackInternalClient
00069 {
00070 
00071     protected:
00072 
00073         JACK_HANDLE fHandle;
00074         FinishCallback fFinish;
00075         JackDriverDescFunction fDescriptor;
00076 
00077     public:
00078 
00079         JackLoadableInternalClient(JackServer* server, JackSynchro* table)
00080             :JackInternalClient(server, table), fHandle(NULL), fFinish(NULL), fDescriptor(NULL)
00081         {}
00082         virtual ~JackLoadableInternalClient();
00083 
00084         virtual int Init(const char* so_name);
00085 
00086 };
00087 
00088 class JackLoadableInternalClient1 : public JackLoadableInternalClient
00089 {
00090 
00091     private:
00092 
00093         InitializeCallback fInitialize;
00094         char fObjectData[JACK_LOAD_INIT_LIMIT];
00095     
00096     public:
00097 
00098         JackLoadableInternalClient1(JackServer* server, JackSynchro* table, const char* object_data);
00099         virtual ~JackLoadableInternalClient1()
00100         {}
00101 
00102         int Init(const char* so_name);
00103         int Open(const char* server_name, const char* name, jack_options_t options, jack_status_t* status);
00104 
00105 };
00106 
00107 class JackLoadableInternalClient2 : public JackLoadableInternalClient
00108 {
00109 
00110     private:
00111 
00112         InternalInitializeCallback fInitialize;
00113         const JSList* fParameters;
00114   
00115     public:
00116 
00117         JackLoadableInternalClient2(JackServer* server, JackSynchro* table, const JSList*  parameters);
00118         virtual ~JackLoadableInternalClient2()
00119         {}
00120 
00121         int Init(const char* so_name);
00122         int Open(const char* server_name, const char* name, jack_options_t options, jack_status_t* status);
00123 
00124 };
00125 
00126 
00127 } // end of namespace
00128 
00129 #endif