JackGlobalsServer.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 #ifdef WIN32 
00021 #pragma warning (disable : 4786)
00022 #endif
00023 
00024 #include "JackGlobals.h"
00025 
00026 // OSX
00027 #if defined(__APPLE__)
00028 #include "JackCoreAudioDriver.h"
00029 #include "JackMachServerNotifyChannel.h"
00030 #include "JackMachNotifyChannel.h"
00031 #include "JackMachServerChannel.h"
00032 #include "JackMachClientChannel.h"
00033 #include "JackMachThread.h"
00034 #include "JackMachSemaphore.h"
00035 #include "JackProcessSync.h"
00036 
00037 #include "JackSocketServerNotifyChannel.h"
00038 #include "JackSocketNotifyChannel.h"
00039 #include "JackSocketServerChannel.h"
00040 #include "JackSocketClientChannel.h"
00041 #include "JackPosixThread.h"
00042 #include "JackPosixSemaphore.h"
00043 #include "JackFifo.h"
00044 #endif
00045 
00046 // WINDOWS
00047 #ifdef WIN32
00048 #include "JackWinProcessSync.h"
00049 #include "JackWinNamedPipeServerNotifyChannel.h"
00050 #include "JackWinNamedPipeNotifyChannel.h"
00051 #include "JackWinNamedPipeServerChannel.h"
00052 #include "JackWinNamedPipeClientChannel.h"
00053 #include "JackWinEvent.h"
00054 #include "JackWinSemaphore.h"
00055 #include "JackWinThread.h"
00056 #endif
00057 
00058 // LINUX
00059 #ifdef __linux__
00060 #include "linux/alsa/JackAlsaDriver.h"
00061 #include "JackProcessSync.h"
00062 #include "JackSocketServerNotifyChannel.h"
00063 #include "JackSocketNotifyChannel.h"
00064 #include "JackSocketServerChannel.h"
00065 #include "JackSocketClientChannel.h"
00066 #include "JackPosixThread.h"
00067 #include "JackPosixSemaphore.h"
00068 #include "JackFifo.h"
00069 #endif
00070 
00071 // COMMON
00072 #include "JackDummyDriver.h"
00073 #include "JackAudioDriver.h"
00074 
00075 using namespace std;
00076 
00077 namespace Jack
00078 {
00079 
00080 #ifdef WIN32
00081 JackSynchro* JackFactoryWindowsServer::MakeSynchro()
00082 {
00083         return new JackWinSemaphore();
00084 }
00085 
00086 JackServerNotifyChannelInterface* JackFactoryWindowsServer::MakeServerNotifyChannel()
00087 {
00088     return new JackWinNamedPipeServerNotifyChannel();
00089 }
00090 
00091 JackClientChannelInterface* JackFactoryWindowsServer::MakeClientChannel()
00092 {
00093     return NULL;
00094 } // Not used
00095 
00096 JackNotifyChannelInterface* JackFactoryWindowsServer::MakeNotifyChannel()
00097 {
00098     return new JackWinNamedPipeNotifyChannel();
00099 }
00100 
00101 JackServerChannelInterface* JackFactoryWindowsServer::MakeServerChannel()
00102 {
00103     return new JackWinNamedPipeServerChannel();
00104 }
00105 
00106 JackSyncInterface* JackFactoryWindowsServer::MakeInterProcessSync()
00107 {
00108     return new JackWinProcessSync();
00109 }
00110 
00111 JackThread* JackFactoryWindowsServer::MakeThread(JackRunnableInterface* runnable)
00112 {
00113     return new JackWinThread(runnable);
00114 }
00115 #endif
00116 
00117 #ifdef __linux__
00118 
00119 #if defined(SOCKET_RPC_POSIX_SEMA)
00120 JackSynchro* JackFactoryLinuxServer::MakeSynchro()
00121 {
00122     return new JackPosixSemaphore();
00123 }
00124 
00125 JackServerNotifyChannelInterface* JackFactoryLinuxServer::MakeServerNotifyChannel()
00126 {
00127     return new JackSocketServerNotifyChannel();
00128 }
00129 
00130 JackClientChannelInterface* JackFactoryLinuxServer::MakeClientChannel()
00131 {
00132     return NULL;
00133 } // Not used
00134 
00135 JackNotifyChannelInterface* JackFactoryLinuxServer::MakeNotifyChannel()
00136 {
00137     return new JackSocketNotifyChannel();
00138 }
00139 
00140 JackServerChannelInterface* JackFactoryLinuxServer::MakeServerChannel()
00141 {
00142     return new JackSocketServerChannel();
00143 }
00144 
00145 JackSyncInterface* JackFactoryLinuxServer::MakeInterProcessSync()
00146 {
00147     return new JackProcessSync();
00148 }
00149 
00150 JackThread* JackFactoryLinuxServer::MakeThread(JackRunnableInterface* runnable)
00151 {
00152     return new JackPosixThread(runnable, PTHREAD_CANCEL_ASYNCHRONOUS);
00153 }
00154 #endif
00155 
00156 #if defined(SOCKET_RPC_FIFO_SEMA)
00157 JackSynchro* JackFactoryLinuxServer::MakeSynchro()
00158 {
00159     return new JackFifo();
00160 }
00161 
00162 JackServerNotifyChannelInterface* JackFactoryLinuxServer::MakeServerNotifyChannel()
00163 {
00164     return new JackSocketServerNotifyChannel();
00165 }
00166 
00167 JackClientChannelInterface* JackFactoryLinuxServer::MakeClientChannel()
00168 {
00169     return NULL;
00170 } // Not used
00171 
00172 JackNotifyChannelInterface* JackFactoryLinuxServer::MakeNotifyChannel()
00173 {
00174     return new JackSocketNotifyChannel();
00175 }
00176 
00177 JackServerChannelInterface* JackFactoryLinuxServer::MakeServerChannel()
00178 {
00179     return new JackSocketServerChannel();
00180 }
00181 
00182 JackSyncInterface* JackFactoryLinuxServer::MakeInterProcessSync()
00183 {
00184     return new JackProcessSync();
00185 }
00186 
00187 JackThread* JackFactoryLinuxServer::MakeThread(JackRunnableInterface* runnable)
00188 {
00189     return new JackPosixThread(runnable, PTHREAD_CANCEL_ASYNCHRONOUS);
00190 }
00191 #endif
00192 
00193 #if defined(SOCKET_RPC_FIFO_SEMA_DUMMY)
00194 JackSynchro* JackFactoryLinuxServer::MakeSynchro()
00195 {
00196     return new JackFifo();
00197 }
00198 
00199 JackServerNotifyChannelInterface* JackFactoryLinuxServer::MakeServerNotifyChannel()
00200 {
00201     return new JackSocketServerNotifyChannel();
00202 }
00203 
00204 JackClientChannelInterface* JackFactoryLinuxServer::MakeClientChannel()
00205 {
00206     return NULL;
00207 } // Not used
00208 
00209 JackNotifyChannelInterface* JackFactoryLinuxServer::MakeNotifyChannel()
00210 {
00211     return new JackSocketNotifyChannel();
00212 }
00213 
00214 JackServerChannelInterface* JackFactoryLinuxServer::MakeServerChannel()
00215 {
00216     return new JackSocketServerChannel();
00217 }
00218 
00219 JackSyncInterface* JackFactoryLinuxServer::MakeInterProcessSync()
00220 {
00221     return new JackProcessSync();
00222 }
00223 
00224 JackThread* JackFactoryLinuxServer::MakeThread(JackRunnableInterface* runnable)
00225 {
00226     return new JackPosixThread(runnable, PTHREAD_CANCEL_ASYNCHRONOUS);
00227 }
00228 #endif
00229 
00230 #endif
00231 
00232 #if defined(__APPLE__)
00233 
00234 #if defined(MACH_RPC_MACH_SEMA) 
00235 // Mach RPC + Mach Semaphore
00236 JackSynchro* JackFactoryOSXServer::MakeSynchro()
00237 {
00238     return new JackMachSemaphore();
00239 }
00240 
00241 JackServerNotifyChannelInterface* JackFactoryOSXServer::MakeServerNotifyChannel()
00242 {
00243     return new JackMachServerNotifyChannel();
00244 }
00245 
00246 JackClientChannelInterface* JackFactoryOSXServer::MakeClientChannel()
00247 {
00248     return NULL;
00249 } // Not used
00250 
00251 JackNotifyChannelInterface* JackFactoryOSXServer::MakeNotifyChannel()
00252 {
00253     return new JackMachNotifyChannel();
00254 }
00255 
00256 JackServerChannelInterface* JackFactoryOSXServer::MakeServerChannel()
00257 {
00258     return new JackMachServerChannel();
00259 }
00260 
00261 JackSyncInterface* JackFactoryOSXServer::MakeInterProcessSync()
00262 {
00263     return new JackProcessSync();
00264 }
00265 
00266 JackThread* JackFactoryOSXServer::MakeThread(JackRunnableInterface* runnable)
00267 {
00268     return new JackMachThread(runnable, PTHREAD_CANCEL_ASYNCHRONOUS);
00269 }
00270 #endif
00271 
00272 #if defined(SOCKET_RPC_POSIX_SEMA) 
00273 // Socket RPC + Posix Semaphore
00274 JackSynchro* JackFactoryOSXServer::MakeSynchro()
00275 {
00276     return new JackPosixSemaphore();
00277 }
00278 
00279 JackServerNotifyChannelInterface* JackFactoryOSXServer::MakeServerNotifyChannel()
00280 {
00281     return new JackSocketServerNotifyChannel();
00282 }
00283 
00284 JackClientChannelInterface* JackFactoryOSXServer::MakeClientChannel()
00285 {
00286     return NULL;
00287 } // Not used
00288 
00289 JackNotifyChannelInterface* JackFactoryOSXServer::MakeNotifyChannel()
00290 {
00291     return new JackSocketNotifyChannel();
00292 }
00293 
00294 JackServerChannelInterface* JackFactoryOSXServer::MakeServerChannel()
00295 {
00296     return new JackSocketServerChannel();
00297 }
00298 
00299 JackSyncInterface* JackFactoryOSXServer::MakeInterProcessSync()
00300 {
00301     return new JackProcessSync();
00302 }
00303 
00304 JackThread* JackFactoryOSXServer::MakeThread(JackRunnableInterface* runnable)
00305 {
00306     return new JackMachThread(runnable, PTHREAD_CANCEL_ASYNCHRONOUS);
00307 }
00308 #endif
00309 
00310 #if defined(SOCKET_RPC_FIFO_SEMA) 
00311 // Socket RPC + Fifo Semaphore
00312 JackSynchro* JackFactoryOSXServer::MakeSynchro()
00313 {
00314     return new JackFifo();
00315 }
00316 
00317 JackServerNotifyChannelInterface* JackFactoryOSXServer::MakeServerNotifyChannel()
00318 {
00319     return new JackSocketServerNotifyChannel();
00320 }
00321 
00322 JackClientChannelInterface* JackFactoryOSXServer::MakeClientChannel()
00323 {
00324     return NULL;
00325 } // Not used
00326 
00327 JackNotifyChannelInterface* JackFactoryOSXServer::MakeNotifyChannel()
00328 {
00329     return new JackSocketNotifyChannel();
00330 }
00331 
00332 JackServerChannelInterface* JackFactoryOSXServer::MakeServerChannel()
00333 {
00334     return new JackSocketServerChannel();
00335 }
00336 
00337 JackSyncInterface* JackFactoryOSXServer::MakeInterProcessSync()
00338 {
00339     return new JackProcessSync();
00340 }
00341 
00342 JackThread* JackFactoryOSXServer::MakeThread(JackRunnableInterface* runnable)
00343 {
00344     return new JackMachThread(runnable, PTHREAD_CANCEL_ASYNCHRONOUS);
00345 }
00346 #endif
00347 
00348 #if defined(MACH_RPC_FIFO_SEMA) 
00349 // Mach RPC + Fifo Semaphore
00350 JackSynchro* JackFactoryOSXServer::MakeSynchro()
00351 {
00352     return new JackFifo();
00353 }
00354 
00355 JackServerNotifyChannelInterface* JackFactoryOSXServer::MakeServerNotifyChannel()
00356 {
00357     return new JackMachServerNotifyChannel();
00358 }
00359 
00360 JackClientChannelInterface* JackFactoryOSXServer::MakeClientChannel()
00361 {
00362     return NULL;
00363 } // Not used
00364 
00365 JackNotifyChannelInterface* JackFactoryOSXServer::MakeNotifyChannel()
00366 {
00367     return new JackMachNotifyChannel();
00368 }
00369 
00370 JackServerChannelInterface* JackFactoryOSXServer::MakeServerChannel()
00371 {
00372     return new JackMachServerChannel();
00373 }
00374 
00375 JackSyncInterface* JackFactoryOSXServer::MakeInterProcessSync()
00376 {
00377     return new JackProcessSync();
00378 }
00379 
00380 JackThread* JackFactoryOSXServer::MakeThread(JackRunnableInterface* runnable)
00381 {
00382     return new JackMachThread(runnable, PTHREAD_CANCEL_ASYNCHRONOUS);
00383 }
00384 #endif
00385 
00386 #if defined(MACH_RPC_POSIX_SEMA) 
00387 // Mach RPC + Posix Semaphore
00388 JackSynchro* JackFactoryOSXServer::MakeSynchro()
00389 {
00390     return new JackPosixSemaphore();
00391 }
00392 
00393 JackServerNotifyChannelInterface* JackFactoryOSXServer::MakeServerNotifyChannel()
00394 {
00395     return new JackMachServerNotifyChannel();
00396 }
00397 
00398 JackClientChannelInterface* JackFactoryOSXServer::MakeClientChannel()
00399 {
00400     return NULL;
00401 } // Not used
00402 
00403 JackNotifyChannelInterface* JackFactoryOSXServer::MakeNotifyChannel()
00404 {
00405     return new JackMachNotifyChannel();
00406 }
00407 
00408 JackServerChannelInterface* JackFactoryOSXServer::MakeServerChannel()
00409 {
00410     return new JackMachServerChannel();
00411 }
00412 
00413 JackSyncInterface* JackFactoryOSXServer::MakeInterProcessSync()
00414 {
00415     return new JackProcessSync();
00416 }
00417 
00418 JackThread* JackFactoryOSXServer::MakeThread(JackRunnableInterface* runnable)
00419 {
00420     return new JackMachThread(runnable, PTHREAD_CANCEL_ASYNCHRONOUS);
00421 }
00422 #endif
00423 
00424 #if defined(SOCKET_RPC_MACH_SEMA) 
00425 // Socket RPC + Mac Semaphore
00426 JackSynchro* JackFactoryOSXServer::MakeSynchro()
00427 {
00428     return new JackMachSemaphore();
00429 }
00430 
00431 JackServerNotifyChannelInterface* JackFactoryOSXServer::MakeServerNotifyChannel()
00432 {
00433     return new JackSocketServerNotifyChannel();
00434 }
00435 
00436 JackClientChannelInterface* JackFactoryOSXServer::MakeClientChannel()
00437 {
00438     return NULL;
00439 } // Not used
00440 
00441 JackNotifyChannelInterface* JackFactoryOSXServer::MakeNotifyChannel()
00442 {
00443     return new JackSocketNotifyChannel();
00444 }
00445 
00446 JackServerChannelInterface* JackFactoryOSXServer::MakeServerChannel()
00447 {
00448     return new JackSocketServerChannel();
00449 }
00450 
00451 JackSyncInterface* JackFactoryOSXServer::MakeInterProcessSync()
00452 {
00453     return new JackProcessSync();
00454 }
00455 
00456 JackThread* JackFactoryOSXServer::MakeThread(JackRunnableInterface* runnable)
00457 {
00458     return new JackMachThread(runnable, PTHREAD_CANCEL_ASYNCHRONOUS);
00459 }
00460 #endif
00461 
00462 #endif
00463 
00464 } // end of namespace

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