00001 /* 00002 00003 This file is part of la Marmite. 00004 Copyright (C) 2005 Nicolas Falquet. 00005 00006 La Marmite is free software ; you can redistribute it and/or 00007 modify it under the terms of the GNU General Public License as 00008 published by the Free Software Foundation ; either version 2 of 00009 the License, or (at your option) any later version. 00010 00011 La Marmite is distributed in the hope that it will be useful, but 00012 WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with la Marmite ; if not, write to the Free Software 00018 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 00019 02111-1307 USA 00020 00021 */ 00022 00023 #ifndef M_SUPERVISOR 00024 #define M_SUPERVISOR 00025 00026 #include "MClient.h" 00027 00028 class MPlugin; 00029 00056 class MSupervisor /* singleton */ : public MClient 00057 { 00058 00059 public : 00060 00061 // functions 00062 00066 static MSupervisor * Supervisor ( ); 00067 00076 static void NotifyClientCreation ( MClient * client ); 00077 00086 static void NotifyClientDestruction ( MClient * client ); 00087 00091 unsigned long SampleRate ( ); 00092 00096 unsigned int BufferSize ( ); 00097 00098 // methods 00099 00103 virtual void Run ( const unsigned int n ); 00104 00115 static void RegisterPlugin ( MPlugin * plugin ); 00116 00121 static void UnregisterPlugin ( MPlugin * plugin ); 00122 00123 // destructor 00124 00125 virtual ~ MSupervisor ( ) { 00126 00127 } 00128 00129 protected : 00130 00131 // protected constructor 00132 00133 MSupervisor ( jack_client_t * jackClient ); 00134 00135 // methods 00136 00140 void createPhysicalPorts ( ); 00141 00150 virtual void addExternalAudioInput ( const string & fullName ); 00151 00160 virtual void addExternalAudioOutput ( const string & fullName ); 00161 00162 static void chooseAssignedClient ( ); 00163 00164 // attributes 00165 00167 static vector < MPlugin * > _registeredPlugin; 00168 00169 // singleton 00170 00172 static MSupervisor * _singleton; 00173 00176 static jack_client_t * _assignedClient; 00177 00179 static jack_client_t * _standaloneSupervisor; 00180 00182 static vector < MClient * > _existingClient; 00183 00184 }; 00185 00186 MSupervisor * Supervisor ( ); 00187 00188 unsigned long SampleRate ( ); 00189 00190 unsigned int BufferSize ( ); 00191 00192 #endif // M_SUPERVISOR