diff --git a/ChangeLog b/ChangeLog index e63cb1ab..41ef4208 100644 --- a/ChangeLog +++ b/ChangeLog @@ -38,7 +38,8 @@ John Emmas 2011-11-07 Stephane Letz - * John Emmas auto-launch server on WIndows patch. + * John Emmas first auto-launch server on Windows patch. + * John Emmas second auto-launch server on Windows patch. 2011-11-06 Stephane Letz diff --git a/common/JackDebugClient.cpp b/common/JackDebugClient.cpp index a1a2fe69..6426c0d7 100644 --- a/common/JackDebugClient.cpp +++ b/common/JackDebugClient.cpp @@ -17,6 +17,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#if defined(__CYGWIN__) && !defined(CYGWIN_USE_PIPES) +#undef WIN32 // Avoids "unqualified id" problem with std::max() etc +#endif + #include "JackDebugClient.h" #include "JackEngineControl.h" #include "JackException.h" @@ -333,7 +337,7 @@ int JackDebugClient::SetFreeWheel(int onoff) *fStream << "!!! ERROR !!! : Freewheel setup seems incorrect : set = ON while FW is already ON " << endl; if (!onoff && !fFreewheel) *fStream << "!!! ERROR !!! : Freewheel setup seems incorrect : set = OFF while FW is already OFF " << endl; - fFreewheel = onoff; + fFreewheel = onoff ? true : false; return fClient->SetFreeWheel(onoff); } diff --git a/common/jack/systemdeps.h b/common/jack/systemdeps.h index ee79ad3f..6b1b8a7f 100644 --- a/common/jack/systemdeps.h +++ b/common/jack/systemdeps.h @@ -20,13 +20,14 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. #ifndef __jack_systemdeps_h__ #define __jack_systemdeps_h__ -#ifdef WIN32 +#if defined(WIN32) && !defined(__CYGWIN__) && !defined(GNU_WIN32) #include #ifdef _MSC_VER /* Microsoft compiler */ #define __inline__ inline - #ifndef int8_t + #if (!defined(int8_t) && !defined(_STDINT_H)) + #define __int8_t_defined typedef char int8_t; typedef unsigned char uint8_t; typedef short int16_t; @@ -36,28 +37,39 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. typedef LONGLONG int64_t; typedef ULONGLONG uint64_t; #endif - /** - * to make jack API independent of different thread implementations, - * we define jack_native_thread_t to HANDLE here. - */ - typedef HANDLE jack_native_thread_t; #elif __MINGW32__ /* MINGW */ #include #include +#else /* other compilers ...*/ + #include + #include + #include +#endif + +#if !defined(_PTHREAD_H) && !defined(PTHREAD_WIN32) /** * to make jack API independent of different thread implementations, * we define jack_native_thread_t to HANDLE here. */ typedef HANDLE jack_native_thread_t; -#else /* other compilers ...*/ - #include - #include - #include +#else + #ifdef PTHREAD_WIN32 // Added by JE - 10-10-2011 + #include // Makes sure we #include the ptw32 version ! + #endif + /** + * to make jack API independent of different thread implementations, + * we define jack_native_thread_t to pthread_t here. + */ + typedef pthread_t jack_native_thread_t; #endif -#endif /* WIN32 */ +#endif // WIN32 && !__CYGWIN__ && !GNU_WIN32 */ -#if defined(__APPLE__) || defined(__linux__) || defined(__sun__) || defined(sun) || defined(__unix__) +#if defined(__APPLE__) || defined(__linux__) || defined(__sun__) || defined(sun) || defined(__unix__) || defined(__CYGWIN__) || defined(GNU_WIN32) + +#if defined(__CYGWIN__) || defined(GNU_WIN32) + #include +#endif #include #include #include diff --git a/posix/JackPosixServerLaunch.cpp b/posix/JackPosixServerLaunch.cpp index 855a2c59..2a774626 100644 --- a/posix/JackPosixServerLaunch.cpp +++ b/posix/JackPosixServerLaunch.cpp @@ -13,11 +13,13 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License -along with this program; if not, write to the Free Software +along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#if !defined(WIN32) || defined(__CYGWIN__) + #include "JackConstants.h" #include "JackChannel.h" #include "JackLibGlobals.h" @@ -116,8 +118,13 @@ static void start_server_classic_aux(const char* server_name) } if (!good) { - command = (char*)(JACK_LOCATION "/jackd"); - strncpy(arguments, JACK_LOCATION "/jackd -T -d "JACK_DEFAULT_DRIVER, 255); +#if defined(__CYGWIN__) + command = (char*)("/usr/bin/jackd.exe"); + strncpy(arguments, "jackd.exe -S -R -d JACK_DEFAULT_DRIVER", 255); +#else + command = (char*)("/usr/bin/jackd"); + strncpy(arguments, "/jackd -R -d "JACK_DEFAULT_DRIVER, 255); +#endif } else { result = strcspn(arguments, " "); command = (char*)malloc(result + 1); @@ -209,6 +216,8 @@ static int server_connect(char* server_name) JackClientChannel channel; int res = channel.ServerCheck(server_name); channel.Close(); + JackSleep(2000); // Added by JE - 02-01-2009 (gives + // the channel some time to close) return res; } @@ -236,3 +245,5 @@ int try_start_server(jack_varargs_t* va, jack_options_t options, jack_status_t* return 0; } + +#endif // !WIN32 || __CYGWIN__ diff --git a/windows/JackPlatformPlug_os.h b/windows/JackPlatformPlug_os.h index e2af7b45..b89472e2 100644 --- a/windows/JackPlatformPlug_os.h +++ b/windows/JackPlatformPlug_os.h @@ -23,10 +23,13 @@ #define jack_server_dir "server" #define jack_client_dir "client" -#define ADDON_DIR "jack" #define JACK_DEFAULT_DRIVER "portaudio" #define JACK_LOCATION "C:\Program Files\Jack" +#ifndef ADDON_DIR + #define ADDON_DIR "jack" +#endif + namespace Jack { struct JackRequest; diff --git a/windows/JackSystemDeps_os.h b/windows/JackSystemDeps_os.h index c74830d0..34a259c6 100644 --- a/windows/JackSystemDeps_os.h +++ b/windows/JackSystemDeps_os.h @@ -1,42 +1,80 @@ /* Copyright (C) 2004-2008 Grame - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - + You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - + */ #ifndef __JackSystemDeps_WIN32__ #define __JackSystemDeps_WIN32__ -#include +#ifndef PATH_MAX +#define PATH_MAX 512 +#endif + +#if defined(__CYGWIN__) + + #include + #include + #include + #include + + #ifndef UINT32_MAX + #define UINT32_MAX 4294967295U + #endif -#define UINT32_MAX 4294967295U + #define DRIVER_HANDLE void* + #define LoadDriverModule(name) dlopen((name), RTLD_NOW | RTLD_GLOBAL) + #define UnloadDriverModule(handle) dlclose((handle)) + #define GetDriverProc(handle, name) dlsym((handle), (name)) -#define DRIVER_HANDLE HINSTANCE -#define LoadDriverModule(name) LoadLibrary((name)) -#define UnloadDriverModule(handle) (FreeLibrary(((HMODULE)handle))) -#define GetDriverProc(handle, name) GetProcAddress(((HMODULE)handle), (name)) + #define JACK_HANDLE void* + #define LoadJackModule(name) dlopen((name), RTLD_NOW | RTLD_LOCAL); + #define UnloadJackModule(handle) dlclose((handle)); + #define GetJackProc(handle, name) dlsym((handle), (name)); -#define JACK_HANDLE HINSTANCE -#define LoadJackModule(name) LoadLibrary((name)); -#define UnloadJackModule(handle) FreeLibrary((handle)); -#define GetJackProc(handle, name) GetProcAddress((handle), (name)); + #define JACK_DEBUG (getenv("JACK_CLIENT_DEBUG") && strcmp(getenv("JACK_CLIENT_DEBUG"), "on") == 0) -#define ENOBUFS 55 -#define JACK_DEBUG false +#else + + #include + + #define UINT32_MAX 4294967295U + + #define DRIVER_HANDLE HINSTANCE + #define LoadDriverModule(name) LoadLibrary((name)) + #define UnloadDriverModule(handle) (FreeLibrary(((HMODULE)handle))) + #define GetDriverProc(handle, name) GetProcAddress(((HMODULE)handle), (name)) + + #define JACK_HANDLE HINSTANCE + #define LoadJackModule(name) LoadLibrary((name)); + #define UnloadJackModule(handle) FreeLibrary((handle)); + #define GetJackProc(handle, name) GetProcAddress((handle), (name)); + + #ifndef ENOBUFS + #define ENOBUFS 55 + #endif + + #ifdef _DEBUG + #define JACK_DEBUG true + #else + #define JACK_DEBUG false + #endif + +#endif #endif