git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3566 0c269be4-1314-0410-8aa9-9f06e86f4224tags/v1.9.3
@@ -18,24 +18,24 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||||
*/ | */ | ||||
#ifndef __JackCompilerDeps_WIN32__ | #ifndef __JackCompilerDeps_WIN32__ | ||||
#define __JackCompilerDeps_WIN32__ | |||||
#define __JackCompilerDeps_WIN32__ | |||||
#if __GNUC__ | |||||
#ifndef POST_PACKED_STRUCTURE | |||||
/* POST_PACKED_STRUCTURE needs to be a macro which | |||||
expands into a compiler directive. The directive must | |||||
tell the compiler to arrange the preceding structure | |||||
declaration so that it is packed on byte-boundaries rather | |||||
than use the natural alignment of the processor and/or | |||||
compiler. | |||||
*/ | |||||
#if (__GNUC__< 4) /* Does not seem to work with GCC 3.XX serie */ | |||||
#define POST_PACKED_STRUCTURE | |||||
#elif defined(JACK_32_64) | |||||
#define POST_PACKED_STRUCTURE __attribute__((__packed__)) | |||||
#else | |||||
#define POST_PACKED_STRUCTURE | |||||
#endif | |||||
#if __GNUC__ | |||||
#ifndef POST_PACKED_STRUCTURE | |||||
/* POST_PACKED_STRUCTURE needs to be a macro which | |||||
expands into a compiler directive. The directive must | |||||
tell the compiler to arrange the preceding structure | |||||
declaration so that it is packed on byte-boundaries rather | |||||
than use the natural alignment of the processor and/or | |||||
compiler. | |||||
*/ | |||||
#if (__GNUC__< 4) /* Does not seem to work with GCC 3.XX serie */ | |||||
#define POST_PACKED_STRUCTURE | |||||
#elif defined(JACK_32_64) | |||||
#define POST_PACKED_STRUCTURE __attribute__((__packed__)) | |||||
#else | |||||
#define POST_PACKED_STRUCTURE | |||||
#endif | |||||
#endif | #endif | ||||
#define MEM_ALIGN(x,y) x __attribute__((aligned(y))) | #define MEM_ALIGN(x,y) x __attribute__((aligned(y))) | ||||
#define EXPORT __declspec(dllexport) | #define EXPORT __declspec(dllexport) | ||||
@@ -286,12 +286,12 @@ namespace Jack | |||||
//local loop********************************************************************************************************* | //local loop********************************************************************************************************* | ||||
int JackNetWinSocket::SetLocalLoop() | int JackNetWinSocket::SetLocalLoop() | ||||
{ | { | ||||
//char disable = 0; | |||||
/* | |||||
see http://msdn.microsoft.com/en-us/library/aa916098.aspx | |||||
Default value is TRUE. When TRUE, data that is sent from the local interface to the multicast group to | |||||
which the socket is joined, including data sent from the same socket, will be echoed to its receive buffer. | |||||
*/ | |||||
//char disable = 0; | |||||
/* | |||||
see http://msdn.microsoft.com/en-us/library/aa916098.aspx | |||||
Default value is TRUE. When TRUE, data that is sent from the local interface to the multicast group to | |||||
which the socket is joined, including data sent from the same socket, will be echoed to its receive buffer. | |||||
*/ | |||||
char disable = 1; | char disable = 1; | ||||
return SetOption ( IPPROTO_IP, IP_MULTICAST_LOOP, &disable, sizeof ( disable ) ); | return SetOption ( IPPROTO_IP, IP_MULTICAST_LOOP, &disable, sizeof ( disable ) ); | ||||
} | } | ||||
@@ -20,7 +20,7 @@ | |||||
#ifndef __JackTypes_WIN32__ | #ifndef __JackTypes_WIN32__ | ||||
#define __JackTypes_WIN32__ | #define __JackTypes_WIN32__ | ||||
#include <windows.h> | |||||
#include <windows.h> | |||||
#include "types.h" | #include "types.h" | ||||
typedef ULONGLONG UInt64; | typedef ULONGLONG UInt64; | ||||
@@ -32,7 +32,7 @@ void JackWinProcessSync::LockedSignal() | |||||
{ | { | ||||
WaitForSingleObject(fMutex, INFINITE); | WaitForSingleObject(fMutex, INFINITE); | ||||
SetEvent(fEvent); | SetEvent(fEvent); | ||||
ReleaseMutex(fMutex); | |||||
ReleaseMutex(fMutex); | |||||
} | } | ||||
void JackWinProcessSync::SignalAll() | void JackWinProcessSync::SignalAll() | ||||
@@ -44,71 +44,71 @@ void JackWinProcessSync::LockedSignalAll() | |||||
{ | { | ||||
WaitForSingleObject(fMutex, INFINITE); | WaitForSingleObject(fMutex, INFINITE); | ||||
SetEvent(fEvent); | SetEvent(fEvent); | ||||
ReleaseMutex(fMutex); | |||||
} | |||||
void JackWinProcessSync::Wait() | |||||
{ | |||||
ReleaseMutex(fMutex); | |||||
WaitForSingleObject(fEvent, INFINITE); | |||||
} | |||||
void JackWinProcessSync::LockedWait() | |||||
{ | |||||
/* Does it make sense on Windows, use non-locked version for now... */ | |||||
Wait(); | |||||
} | |||||
bool JackWinProcessSync::TimedWait(long usec) | |||||
{ | |||||
ReleaseMutex(fMutex); | |||||
DWORD res = WaitForSingleObject(fEvent, usec / 1000); | |||||
return (res == WAIT_OBJECT_0); | |||||
} | |||||
bool JackWinProcessSync::LockedTimedWait(long usec) | |||||
{ | |||||
/* Does it make sense on Windows, use non-locked version for now...*/ | |||||
return TimedWait(usec); | |||||
} | |||||
/* | |||||
Code from CAGuard.cpp : does ot sees to work as expected.. | |||||
void JackWinProcessSync::Wait() | |||||
{ | |||||
ReleaseMutex(fMutex); | |||||
HANDLE handles[] = { fMutex, fEvent }; | |||||
DWORD res = WaitForMultipleObjects(2, handles, true, INFINITE); | |||||
if ((res != WAIT_OBJECT_0) && (res != WAIT_TIMEOUT)) | |||||
jack_error("Wait error err = %d", GetLastError()); | |||||
ResetEvent(fEvent); | |||||
} | |||||
ReleaseMutex(fMutex); | |||||
} | |||||
void JackWinProcessSync::Wait() | |||||
{ | |||||
ReleaseMutex(fMutex); | |||||
WaitForSingleObject(fEvent, INFINITE); | |||||
} | |||||
void JackWinProcessSync::LockedWait() | void JackWinProcessSync::LockedWait() | ||||
{ | |||||
WaitForSingleObject(fMutex, INFINITE); | |||||
{ | |||||
/* Does it make sense on Windows, use non-locked version for now... */ | |||||
Wait(); | |||||
} | |||||
bool JackWinProcessSync::TimedWait(long usec) | |||||
{ | |||||
ReleaseMutex(fMutex); | |||||
DWORD res = WaitForSingleObject(fEvent, usec / 1000); | |||||
return (res == WAIT_OBJECT_0); | |||||
} | |||||
bool JackWinProcessSync::LockedTimedWait(long usec) | |||||
{ | |||||
/* Does it make sense on Windows, use non-locked version for now...*/ | |||||
return TimedWait(usec); | |||||
} | |||||
/* | |||||
Code from CAGuard.cpp : does ot sees to work as expected.. | |||||
void JackWinProcessSync::Wait() | |||||
{ | |||||
ReleaseMutex(fMutex); | |||||
HANDLE handles[] = { fMutex, fEvent }; | |||||
DWORD res = WaitForMultipleObjects(2, handles, true, INFINITE); | |||||
if ((res != WAIT_OBJECT_0) && (res != WAIT_TIMEOUT)) | |||||
jack_error("Wait error err = %d", GetLastError()); | |||||
ResetEvent(fEvent); | |||||
} | |||||
void JackWinProcessSync::LockedWait() | |||||
{ | |||||
WaitForSingleObject(fMutex, INFINITE); | |||||
ReleaseMutex(fMutex); | ReleaseMutex(fMutex); | ||||
HANDLE handles[] = { fMutex, fEvent }; | HANDLE handles[] = { fMutex, fEvent }; | ||||
DWORD res = WaitForMultipleObjects(2, handles, true, INFINITE); | DWORD res = WaitForMultipleObjects(2, handles, true, INFINITE); | ||||
if ((res != WAIT_OBJECT_0) && (res != WAIT_TIMEOUT)) | if ((res != WAIT_OBJECT_0) && (res != WAIT_TIMEOUT)) | ||||
jack_error("LockedWait error err = %d", GetLastError()); | jack_error("LockedWait error err = %d", GetLastError()); | ||||
ResetEvent(fEvent); | |||||
ResetEvent(fEvent); | |||||
} | } | ||||
bool JackWinProcessSync::TimedWait(long usec) | |||||
{ | |||||
ReleaseMutex(fMutex); | |||||
HANDLE handles[] = { fMutex, fEvent }; | |||||
DWORD res = WaitForMultipleObjects(2, handles, true, usec / 1000); | |||||
if ((res != WAIT_OBJECT_0) && (res != WAIT_TIMEOUT)) | |||||
jack_error("Wait error err = %d", GetLastError()); | |||||
ResetEvent(fEvent); | |||||
bool JackWinProcessSync::TimedWait(long usec) | |||||
{ | |||||
ReleaseMutex(fMutex); | |||||
HANDLE handles[] = { fMutex, fEvent }; | |||||
DWORD res = WaitForMultipleObjects(2, handles, true, usec / 1000); | |||||
if ((res != WAIT_OBJECT_0) && (res != WAIT_TIMEOUT)) | |||||
jack_error("Wait error err = %d", GetLastError()); | |||||
ResetEvent(fEvent); | |||||
} | } | ||||
bool JackWinProcessSync::LockedTimedWait(long usec) | bool JackWinProcessSync::LockedTimedWait(long usec) | ||||
{ | |||||
WaitForSingleObject(fMutex, INFINITE); | |||||
{ | |||||
WaitForSingleObject(fMutex, INFINITE); | |||||
ReleaseMutex(fMutex); | ReleaseMutex(fMutex); | ||||
HANDLE handles[] = { fMutex, fEvent }; | HANDLE handles[] = { fMutex, fEvent }; | ||||
DWORD res = WaitForMultipleObjects(2, handles, true, usec / 1000); | DWORD res = WaitForMultipleObjects(2, handles, true, usec / 1000); | ||||
@@ -1,26 +1,26 @@ | |||||
/* | |||||
Copyright (C) 2001-2003 Paul Davis | |||||
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. | |||||
*/ | |||||
#include "JackServerLaunch.h" | |||||
int try_start_server(jack_varargs_t* va, jack_options_t options, jack_status_t* status) | |||||
{ | |||||
return 0; | |||||
} | |||||
/* | |||||
Copyright (C) 2001-2003 Paul Davis | |||||
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. | |||||
*/ | |||||
#include "JackServerLaunch.h" | |||||
int try_start_server(jack_varargs_t* va, jack_options_t options, jack_status_t* status) | |||||
{ | |||||
return 0; | |||||
} |
@@ -43,9 +43,9 @@ PortAudioDevices::PortAudioDevices() | |||||
} | } | ||||
PortAudioDevices::~PortAudioDevices() | PortAudioDevices::~PortAudioDevices() | ||||
{ | |||||
{ | |||||
// Desactivate for now: crash the server.. | // Desactivate for now: crash the server.. | ||||
//Pa_Terminate(); | |||||
//Pa_Terminate(); | |||||
delete[] fDeviceInfo; | delete[] fDeviceInfo; | ||||
delete[] fHostName; | delete[] fHostName; | ||||
@@ -1,59 +1,59 @@ | |||||
/* | |||||
Copyright (C) 2008 Romain Moret at Grame | |||||
This program is free software; you can redistribute it and/or modify | |||||
it under the terms of the GNU General Public License as published by | |||||
the Free Software Foundation; either version 2 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 General Public License for more details. | |||||
You should have received a copy of the GNU General Public License | |||||
along with this program; if not, write to the Free Software | |||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||||
*/ | |||||
#ifndef __PortAudioDevices__ | |||||
#define __PortAudioDevices__ | |||||
#include <cstdio> | |||||
#include <string> | |||||
#include "portaudio.h" | |||||
#include "pa_asio.h" | |||||
/*! | |||||
\brief A PortAudio Devices manager. | |||||
*/ | |||||
class PortAudioDevices | |||||
{ | |||||
private: | |||||
PaHostApiIndex fNumHostApi; //number of hosts | |||||
PaDeviceIndex fNumDevice; //number of devices | |||||
PaDeviceInfo** fDeviceInfo; //array of device info | |||||
std::string* fHostName; //array of host names (matched with host id's) | |||||
public: | |||||
PortAudioDevices(); | |||||
~PortAudioDevices(); | |||||
PaDeviceIndex GetNumDevice(); | |||||
PaDeviceInfo* GetDeviceInfo(PaDeviceIndex id); | |||||
std::string GetDeviceName(PaDeviceIndex id); | |||||
std::string GetHostFromDevice(PaDeviceInfo* device); | |||||
std::string GetHostFromDevice(PaDeviceIndex id); | |||||
std::string GetFullName(PaDeviceIndex id); | |||||
std::string GetFullName(std::string hostname, std::string devicename); | |||||
PaDeviceInfo* GetDeviceFromFullName(std::string fullname, PaDeviceIndex& id, bool isInput ); | |||||
void PrintSupportedStandardSampleRates(const PaStreamParameters* inputParameters, const PaStreamParameters* outputParameters); | |||||
int GetInputDeviceFromName(const char* name, PaDeviceIndex& device, int& in_max); | |||||
int GetOutputDeviceFromName(const char* name, PaDeviceIndex& device, int& out_max); | |||||
void DisplayDevicesNames(); | |||||
bool IsDuplex ( PaDeviceIndex id ); | |||||
}; | |||||
#endif | |||||
/* | |||||
Copyright (C) 2008 Romain Moret at Grame | |||||
This program is free software; you can redistribute it and/or modify | |||||
it under the terms of the GNU General Public License as published by | |||||
the Free Software Foundation; either version 2 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 General Public License for more details. | |||||
You should have received a copy of the GNU General Public License | |||||
along with this program; if not, write to the Free Software | |||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||||
*/ | |||||
#ifndef __PortAudioDevices__ | |||||
#define __PortAudioDevices__ | |||||
#include <cstdio> | |||||
#include <string> | |||||
#include "portaudio.h" | |||||
#include "pa_asio.h" | |||||
/*! | |||||
\brief A PortAudio Devices manager. | |||||
*/ | |||||
class PortAudioDevices | |||||
{ | |||||
private: | |||||
PaHostApiIndex fNumHostApi; //number of hosts | |||||
PaDeviceIndex fNumDevice; //number of devices | |||||
PaDeviceInfo** fDeviceInfo; //array of device info | |||||
std::string* fHostName; //array of host names (matched with host id's) | |||||
public: | |||||
PortAudioDevices(); | |||||
~PortAudioDevices(); | |||||
PaDeviceIndex GetNumDevice(); | |||||
PaDeviceInfo* GetDeviceInfo(PaDeviceIndex id); | |||||
std::string GetDeviceName(PaDeviceIndex id); | |||||
std::string GetHostFromDevice(PaDeviceInfo* device); | |||||
std::string GetHostFromDevice(PaDeviceIndex id); | |||||
std::string GetFullName(PaDeviceIndex id); | |||||
std::string GetFullName(std::string hostname, std::string devicename); | |||||
PaDeviceInfo* GetDeviceFromFullName(std::string fullname, PaDeviceIndex& id, bool isInput ); | |||||
void PrintSupportedStandardSampleRates(const PaStreamParameters* inputParameters, const PaStreamParameters* outputParameters); | |||||
int GetInputDeviceFromName(const char* name, PaDeviceIndex& device, int& in_max); | |||||
int GetOutputDeviceFromName(const char* name, PaDeviceIndex& device, int& out_max); | |||||
void DisplayDevicesNames(); | |||||
bool IsDuplex ( PaDeviceIndex id ); | |||||
}; | |||||
#endif |
@@ -1,15 +1,15 @@ | |||||
//{{NO_DEPENDENCIES}} | |||||
// Microsoft Developer Studio generated include file. | |||||
// Used by resource.rc | |||||
// | |||||
// Next default values for new objects | |||||
// | |||||
#ifdef APSTUDIO_INVOKED | |||||
#ifndef APSTUDIO_READONLY_SYMBOLS | |||||
#define _APS_NEXT_RESOURCE_VALUE 102 | |||||
#define _APS_NEXT_COMMAND_VALUE 40001 | |||||
#define _APS_NEXT_CONTROL_VALUE 1000 | |||||
#define _APS_NEXT_SYMED_VALUE 101 | |||||
#endif | |||||
#endif | |||||
//{{NO_DEPENDENCIES}} | |||||
// Microsoft Developer Studio generated include file. | |||||
// Used by resource.rc | |||||
// | |||||
// Next default values for new objects | |||||
// | |||||
#ifdef APSTUDIO_INVOKED | |||||
#ifndef APSTUDIO_READONLY_SYMBOLS | |||||
#define _APS_NEXT_RESOURCE_VALUE 102 | |||||
#define _APS_NEXT_COMMAND_VALUE 40001 | |||||
#define _APS_NEXT_CONTROL_VALUE 1000 | |||||
#define _APS_NEXT_SYMED_VALUE 101 | |||||
#endif | |||||
#endif |