/* Copyright (C) 2014 Cédric Schieli 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef __JackProxyDriver__ #define __JackProxyDriver__ #include "JackTimedDriver.h" #define DEFAULT_UPSTREAM "default" /*!< Default upstream Jack server to connect to */ #define DEFAULT_CLIENT_NAME "proxy" /*!< Default client name to use when connecting to upstream Jack server */ #ifdef __APPLE__ #define JACK_PROXY_CLIENT_LIB "libjack.0.dylib" #elif defined(WIN32) #ifdef _WIN64 #define JACK_PROXY_CLIENT_LIB "libjack64.dll" #else #define JACK_PROXY_CLIENT_LIB "libjack.dll" #endif #else #define JACK_PROXY_CLIENT_LIB "libjack.so.0" #endif #define PROXY_DEF_SYMBOL(ret,name,...) ret (*name) (__VA_ARGS__) #define PROXY_LOAD_SYMBOL(ret,name,...) name = (ret (*) (__VA_ARGS__)) GetJackProc(fHandle, #name); assert(name) namespace Jack { /*! \Brief This class describes the Proxy Backend It uses plain Jack API to connect to an upstream server. The latter is either running as the same user, or is running in promiscuous mode. The main use case is the multi-user, multi-session, shared workstation: - a classic server with hw driver is launched system-wide at boot time, in promiscuous mode, optionally restricted to the audio group - in each user session, a jackdbus server is automatically started with JackProxyDriver as master driver, automatically connected to the system-wide one - optionally, each user run PulseAudio with a pulse-jack bridge */ class JackProxyDriver : public JackRestarterDriver { private: char fUpstream[JACK_CLIENT_NAME_SIZE+1]; /*