Commit b63069e0 authored by sletz's avatar sletz
Browse files

John Emmas second auto-launch server on Windows patch.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4578 0c269be4-1314-0410-8aa9-9f06e86f4224
parent f7bcd227
......@@ -38,7 +38,8 @@ John Emmas
2011-11-07 Stephane Letz <letz@grame.fr>
* 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 <letz@grame.fr>
......
......@@ -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);
}
......
......@@ -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 <windows.h>
#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 <stdint.h>
#include <sys/types.h>
#else /* other compilers ...*/
#include <inttypes.h>
#include <pthread.h>
#include <sys/types.h>
#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 <inttypes.h>
#include <pthread.h>
#include <sys/types.h>
#else
#ifdef PTHREAD_WIN32 // Added by JE - 10-10-2011
#include <ptw32/pthread.h> // 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 <stdint.h>
#endif
#include <inttypes.h>
#include <pthread.h>
#include <sys/types.h>
......
......@@ -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__
......@@ -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;
......
/*
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 <windows.h>
#ifndef PATH_MAX
#define PATH_MAX 512
#endif
#if defined(__CYGWIN__)
#include <inttypes.h>
#include <sys/types.h>
#include <signal.h>
#include <dlfcn.h>
#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 <windows.h>
#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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment