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