JackGlobalsClient.cpp

00001 /*
00002 Copyright (C) 2004-2008 Grame  
00003 
00004 This program is free software; you can redistribute it and/or modify
00005 it under the terms of the GNU General Public License as published by
00006 the Free Software Foundation; either version 2 of the License, or
00007 (at your option) any later version.
00008 
00009 This program is distributed in the hope that it will be useful,
00010 but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 GNU General Public License for more details.
00013 
00014 You should have received a copy of the GNU General Public License
00015 along with this program; if not, write to the Free Software
00016 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00017 
00018 */
00019 
00020 #include "JackGlobals.h"
00021 
00022 // OSX
00023 #if defined(__APPLE__)
00024 #include "JackCoreAudioDriver.h"
00025 #include "JackMachServerNotifyChannel.h"
00026 #include "JackMachNotifyChannel.h"
00027 #include "JackMachServerChannel.h"
00028 #include "JackMachClientChannel.h"
00029 #include "JackMachThread.h"
00030 #include "JackMachSemaphore.h"
00031 #include "JackProcessSync.h"
00032 #include "JackSocketServerNotifyChannel.h"
00033 #include "JackSocketNotifyChannel.h"
00034 #include "JackSocketServerChannel.h"
00035 #include "JackSocketClientChannel.h"
00036 #include "JackPosixThread.h"
00037 #include "JackPosixSemaphore.h"
00038 #include "JackFifo.h"
00039 #endif
00040 
00041 // WINDOWS
00042 #ifdef WIN32
00043 #include "JackWinProcessSync.h"
00044 #include "JackWinNamedPipeClientChannel.h"
00045 #include "JackWinEvent.h"
00046 #include "JackWinSemaphore.h"
00047 #include "JackWinThread.h"
00048 #endif
00049 
00050 // LINUX
00051 #ifdef __linux__
00052 #include "linux/alsa/JackAlsaDriver.h"
00053 #include "JackProcessSync.h"
00054 #include "JackSocketServerNotifyChannel.h"
00055 #include "JackSocketNotifyChannel.h"
00056 #include "JackSocketServerChannel.h"
00057 #include "JackSocketClientChannel.h"
00058 #include "JackPosixThread.h"
00059 #include "JackPosixSemaphore.h"
00060 #include "JackFifo.h"
00061 #endif
00062 
00063 
00064 using namespace std;
00065 
00066 namespace Jack
00067 {
00068 
00069 #ifdef WIN32
00070 
00071 JackSynchro* JackFactoryWindowsClient::MakeSynchro()
00072 {
00073         return new JackWinSemaphore();
00074 }
00075 
00076 JackServerNotifyChannelInterface* JackFactoryWindowsClient::MakeServerNotifyChannel()
00077 {
00078     return NULL;
00079 }
00080 // Not used
00081 JackClientChannelInterface* JackFactoryWindowsClient::MakeClientChannel()
00082 {
00083     return new JackWinNamedPipeClientChannel();
00084 }
00085 
00086 JackNotifyChannelInterface* JackFactoryWindowsClient::MakeNotifyChannel()
00087 {
00088     return NULL;
00089 }
00090 // Not used
00091 JackServerChannelInterface* JackFactoryWindowsClient::MakeServerChannel()
00092 {
00093     return NULL;
00094 }
00095 // Not used
00096 JackSyncInterface* JackFactoryWindowsClient::MakeInterProcessSync()
00097 {
00098     return new JackWinProcessSync();
00099 }
00100 
00101 JackThread* JackFactoryWindowsClient::MakeThread(JackRunnableInterface* runnable)
00102 {
00103     return new JackWinThread(runnable);
00104 }
00105 #endif
00106 
00107 #ifdef __linux__
00108 
00109 #if defined(SOCKET_RPC_POSIX_SEMA)
00110 JackSynchro* JackFactoryLinuxClient::MakeSynchro()
00111 {
00112     return new JackPosixSemaphore();
00113 }
00114 
00115 JackServerNotifyChannelInterface* JackFactoryLinuxClient::MakeServerNotifyChannel()
00116 {
00117     return NULL;
00118 }
00119 // Not used
00120 JackClientChannelInterface* JackFactoryLinuxClient::MakeClientChannel()
00121 {
00122     return new JackSocketClientChannel();
00123 }
00124 
00125 JackNotifyChannelInterface* JackFactoryLinuxClient::MakeNotifyChannel()
00126 {
00127     return NULL;
00128 }
00129 // Not used
00130 JackServerChannelInterface* JackFactoryLinuxClient::MakeServerChannel()
00131 {
00132     return NULL;
00133 }
00134 // Not used
00135 JackSyncInterface* JackFactoryLinuxClient::MakeInterProcessSync()
00136 {
00137     return new JackProcessSync();
00138 }
00139 
00140 JackThread* JackFactoryLinuxClient::MakeThread(JackRunnableInterface* runnable)
00141 {
00142     return new JackPosixThread(runnable, PTHREAD_CANCEL_ASYNCHRONOUS);
00143 }
00144 #endif
00145 
00146 #if defined(SOCKET_RPC_FIFO_SEMA)
00147 JackSynchro* JackFactoryLinuxClient::MakeSynchro()
00148 {
00149     return new JackFifo();
00150 }
00151 
00152 JackServerNotifyChannelInterface* JackFactoryLinuxClient::MakeServerNotifyChannel()
00153 {
00154     return NULL;
00155 }
00156 // Not used
00157 JackClientChannelInterface* JackFactoryLinuxClient::MakeClientChannel()
00158 {
00159     return new JackSocketClientChannel();
00160 }
00161 
00162 JackNotifyChannelInterface* JackFactoryLinuxClient::MakeNotifyChannel()
00163 {
00164     return NULL;
00165 }
00166 // Not used
00167 JackServerChannelInterface* JackFactoryLinuxClient::MakeServerChannel()
00168 {
00169     return NULL;
00170 }
00171 // Not used
00172 JackSyncInterface* JackFactoryLinuxClient::MakeInterProcessSync()
00173 {
00174     return new JackProcessSync();
00175 }
00176 
00177 JackThread* JackFactoryLinuxClient::MakeThread(JackRunnableInterface* runnable)
00178 {
00179     return new JackPosixThread(runnable, PTHREAD_CANCEL_ASYNCHRONOUS);
00180 }
00181 #endif
00182 
00183 #if defined(SOCKET_RPC_FIFO_SEMA_DUMMY)
00184 JackSynchro* JackFactoryLinuxClient::MakeSynchro()
00185 {
00186     return new JackFifo();
00187 }
00188 
00189 JackServerNotifyChannelInterface* JackFactoryLinuxClient::MakeServerNotifyChannel()
00190 {
00191     return NULL;
00192 }
00193 // Not used
00194 JackClientChannelInterface* JackFactoryLinuxClient::MakeClientChannel()
00195 {
00196     return new JackSocketClientChannel();
00197 }
00198 
00199 JackNotifyChannelInterface* JackFactoryLinuxClient::MakeNotifyChannel()
00200 {
00201     return NULL;
00202 }
00203 // Not used
00204 JackServerChannelInterface* JackFactoryLinuxClient::MakeServerChannel()
00205 {
00206     return NULL;
00207 }
00208 // Not used
00209 JackSyncInterface* JackFactoryLinuxClient::MakeInterProcessSync()
00210 {
00211     return new JackProcessSync();
00212 }
00213 
00214 JackThread* JackFactoryLinuxClient::MakeThread(JackRunnableInterface* runnable)
00215 {
00216     return new JackPosixThread(runnable, PTHREAD_CANCEL_ASYNCHRONOUS);
00217 }
00218 #endif
00219 
00220 #endif
00221 
00222 #if defined(__APPLE__)
00223 
00224 #if defined(MACH_RPC_MACH_SEMA) 
00225 // Mach RPC + Mach Semaphore
00226 JackSynchro* JackFactoryOSXClient::MakeSynchro()
00227 {
00228     return new JackMachSemaphore();
00229 }
00230 
00231 JackServerNotifyChannelInterface* JackFactoryOSXClient::MakeServerNotifyChannel()
00232 {
00233     return NULL;
00234 }
00235 // Not used
00236 JackClientChannelInterface* JackFactoryOSXClient::MakeClientChannel()
00237 {
00238     return new JackMachClientChannel();
00239 }
00240 
00241 JackNotifyChannelInterface* JackFactoryOSXClient::MakeNotifyChannel()
00242 {
00243     return NULL;
00244 }
00245 // Not used
00246 JackServerChannelInterface* JackFactoryOSXClient::MakeServerChannel()
00247 {
00248     return NULL;
00249 } // Not used
00250 
00251 JackSyncInterface* JackFactoryOSXClient::MakeInterProcessSync()
00252 {
00253     return new JackProcessSync();
00254 }
00255 
00256 JackThread* JackFactoryOSXClient::MakeThread(JackRunnableInterface* runnable)
00257 {
00258     return new JackMachThread(runnable, PTHREAD_CANCEL_ASYNCHRONOUS);
00259 }
00260 #endif
00261 
00262 #if defined(SOCKET_RPC_POSIX_SEMA) 
00263 // Socket RPC + Posix Semaphore
00264 JackSynchro* JackFactoryOSXClient::MakeSynchro()
00265 {
00266     return new JackPosixSemaphore();
00267 }
00268 
00269 JackServerNotifyChannelInterface* JackFactoryOSXClient::MakeServerNotifyChannel()
00270 {
00271     return NULL;
00272 }
00273 // Not used
00274 JackClientChannelInterface* JackFactoryOSXClient::MakeClientChannel()
00275 {
00276     return new JackSocketClientChannel();
00277 }
00278 
00279 JackNotifyChannelInterface* JackFactoryOSXClient::MakeNotifyChannel()
00280 {
00281     return NULL;
00282 }
00283 // Not used
00284 JackServerChannelInterface* JackFactoryOSXClient::MakeServerChannel()
00285 {
00286     return NULL;
00287 }
00288 // Not used
00289 JackSyncInterface* JackFactoryOSXClient::MakeInterProcessSync()
00290 {
00291     return new JackProcessSync();
00292 }
00293 
00294 JackThread* JackFactoryOSXClient::MakeThread(JackRunnableInterface* runnable)
00295 {
00296     return new JackMachThread(runnable, PTHREAD_CANCEL_ASYNCHRONOUS);
00297 }
00298 #endif
00299 
00300 #if defined(SOCKET_RPC_FIFO_SEMA) 
00301 // Socket RPC + Fifo Semaphore
00302 JackSynchro* JackFactoryOSXClient::MakeSynchro()
00303 {
00304     return new JackFifo();
00305 }
00306 
00307 JackServerNotifyChannelInterface* JackFactoryOSXClient::MakeServerNotifyChannel()
00308 {
00309     return NULL;
00310 }
00311 // Not used
00312 JackClientChannelInterface* JackFactoryOSXClient::MakeClientChannel()
00313 {
00314     return new JackSocketClientChannel();
00315 }
00316 
00317 JackNotifyChannelInterface* JackFactoryOSXClient::MakeNotifyChannel()
00318 {
00319     return NULL;
00320 }
00321 // Not used
00322 JackServerChannelInterface* JackFactoryOSXClient::MakeServerChannel()
00323 {
00324     return NULL;
00325 }
00326 // Not used
00327 JackSyncInterface* JackFactoryOSXClient::MakeInterProcessSync()
00328 {
00329     return new JackProcessSync();
00330 }
00331 
00332 JackThread* JackFactoryOSXClient::MakeThread(JackRunnableInterface* runnable)
00333 {
00334     return new JackMachThread(runnable, PTHREAD_CANCEL_ASYNCHRONOUS);
00335 }
00336 
00337 #endif
00338 
00339 #if defined(MACH_RPC_FIFO_SEMA) 
00340 // Mach RPC + Fifo Semaphore
00341 JackSynchro* JackFactoryOSXClient::MakeSynchro()
00342 {
00343     return new JackFifo();
00344 }
00345 
00346 JackServerNotifyChannelInterface* JackFactoryOSXClient::MakeServerNotifyChannel()
00347 {
00348     return NULL;
00349 }
00350 // Not used
00351 JackClientChannelInterface* JackFactoryOSXClient::MakeClientChannel()
00352 {
00353     return new JackMachClientChannel();
00354 }
00355 
00356 JackNotifyChannelInterface* JackFactoryOSXClient::MakeNotifyChannel()
00357 {
00358     return NULL;
00359 }
00360 // Not used
00361 JackServerChannelInterface* JackFactoryOSXClient::MakeServerChannel()
00362 {
00363     return NULL;
00364 }
00365 // Not used
00366 JackSyncInterface* JackFactoryOSXClient::MakeInterProcessSync()
00367 {
00368     return new JackProcessSync();
00369 }
00370 
00371 JackThread* JackFactoryOSXClient::MakeThread(JackRunnableInterface* runnable)
00372 {
00373     return new JackMachThread(runnable, PTHREAD_CANCEL_ASYNCHRONOUS);
00374 }
00375 #endif
00376 
00377 #if defined(MACH_RPC_POSIX_SEMA) 
00378 // Mach RPC + Posix Semaphore
00379 JackSynchro* JackFactoryOSXClient::MakeSynchro()
00380 {
00381     return new JackPosixSemaphore();
00382 }
00383 
00384 JackServerNotifyChannelInterface* JackFactoryOSXClient::MakeServerNotifyChannel()
00385 {
00386     return NULL;
00387 }
00388 // Not used
00389 JackClientChannelInterface* JackFactoryOSXClient::MakeClientChannel()
00390 {
00391     return new JackMachClientChannel();
00392 }
00393 
00394 JackNotifyChannelInterface* JackFactoryOSXClient::MakeNotifyChannel()
00395 {
00396     return NULL;
00397 }
00398 // Not used
00399 JackServerChannelInterface* JackFactoryOSXClient::MakeServerChannel()
00400 {
00401     return NULL;
00402 }
00403 // Not used
00404 JackSyncInterface* JackFactoryOSXClient::MakeInterProcessSync()
00405 {
00406     return new JackProcessSync();
00407 }
00408 
00409 JackThread* JackFactoryOSXClient::MakeThread(JackRunnableInterface* runnable)
00410 {
00411     return new JackMachThread(runnable, PTHREAD_CANCEL_ASYNCHRONOUS);
00412 }
00413 #endif
00414 
00415 #if defined SOCKET_RPC_MACH_SEMA 
00416 // Socket RPC + Mach Semaphore
00417 JackSynchro* JackFactoryOSXClient::MakeSynchro()
00418 {
00419     return new JackMachSemaphore();
00420 }
00421 
00422 JackServerNotifyChannelInterface* JackFactoryOSXClient::MakeServerNotifyChannel()
00423 {
00424     return NULL;
00425 }
00426 // Not used
00427 JackClientChannelInterface* JackFactoryOSXClient::MakeClientChannel()
00428 {
00429     return new JackSocketClientChannel();
00430 }
00431 
00432 JackNotifyChannelInterface* JackFactoryOSXClient::MakeNotifyChannel()
00433 {
00434     return NULL;
00435 }
00436 // Not used
00437 JackServerChannelInterface* JackFactoryOSXClient::MakeServerChannel()
00438 {
00439     return NULL;
00440 }
00441 // Not used
00442 JackSyncInterface* JackFactoryOSXClient::MakeInterProcessSync()
00443 {
00444     return new JackProcessSync();
00445 }
00446 
00447 JackThread* JackFactoryOSXClient::MakeThread(JackRunnableInterface* runnable)
00448 {
00449     return new JackMachThread(runnable, PTHREAD_CANCEL_ASYNCHRONOUS);
00450 }
00451 #endif
00452 
00453 #endif
00454 
00455 } // end of namespace
00456 
00457 

Generated on Thu Feb 14 11:16:01 2008 for Jackdmp by  doxygen 1.5.1