Jack2
1.9.10
|
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 __JackServer__ 00022 #define __JackServer__ 00023 00024 #include "JackCompilerDeps.h" 00025 #include "driver_interface.h" 00026 #include "JackDriverLoader.h" 00027 #include "JackDriverInfo.h" 00028 #include "JackConnectionManager.h" 00029 #include "JackGlobals.h" 00030 #include "JackPlatformPlug.h" 00031 #include "jslist.h" 00032 00033 namespace Jack 00034 { 00035 00036 class JackGraphManager; 00037 class JackDriverClientInterface; 00038 struct JackEngineControl; 00039 class JackLockedEngine; 00040 class JackLoadableInternalClient; 00041 00046 class SERVER_EXPORT JackServer 00047 { 00048 00049 private: 00050 00051 JackDriverInfo* fDriverInfo; 00052 JackDriverClientInterface* fAudioDriver; 00053 JackDriverClientInterface* fFreewheelDriver; 00054 JackDriverClientInterface* fThreadedFreewheelDriver; 00055 JackLockedEngine* fEngine; 00056 JackEngineControl* fEngineControl; 00057 JackGraphManager* fGraphManager; 00058 JackServerChannel fRequestChannel; 00059 JackConnectionManager fConnectionState; 00060 JackSynchro fSynchroTable[CLIENT_NUM]; 00061 bool fFreewheel; 00062 00063 int InternalClientLoadAux(JackLoadableInternalClient* client, const char* so_name, const char* client_name, int options, int* int_ref, int uuid, int* status); 00064 00065 public: 00066 00067 JackServer(bool sync, bool temporary, int timeout, bool rt, int priority, int port_max, bool verbose, jack_timer_type_t clock, char self_connect_mode, const char* server_name); 00068 ~JackServer(); 00069 00070 // Server control 00071 int Open(jack_driver_desc_t* driver_desc, JSList* driver_params); 00072 int Close(); 00073 00074 int Start(); 00075 int Stop(); 00076 00077 bool IsRunning(); 00078 00079 // RT thread 00080 void Notify(int refnum, int notify, int value); 00081 00082 // From request thread : API 00083 int SetBufferSize(jack_nframes_t buffer_size); 00084 int SetFreewheel(bool onoff); 00085 00086 // Internals clients 00087 int InternalClientLoad1(const char* client_name, const char* so_name, const char* objet_data, int options, int* int_ref, int uuid, int* status); 00088 int InternalClientLoad2(const char* client_name, const char* so_name, const JSList * parameters, int options, int* int_ref, int uuid, int* status); 00089 00090 // Transport management 00091 int ReleaseTimebase(int refnum); 00092 int SetTimebaseCallback(int refnum, int conditional); 00093 00094 // Backend management 00095 JackDriverInfo* AddSlave(jack_driver_desc_t* driver_desc, JSList* driver_params); 00096 void RemoveSlave(JackDriverInfo* info); 00097 int SwitchMaster(jack_driver_desc_t* driver_desc, JSList* driver_params); 00098 00099 // Object access 00100 JackLockedEngine* GetEngine(); 00101 JackEngineControl* GetEngineControl(); 00102 JackSynchro* GetSynchroTable(); 00103 JackGraphManager* GetGraphManager(); 00104 00105 }; 00106 00107 } // end of namespace 00108 00109 00110 #endif