Merge branch 'master' into no-self-connect
[jack2.git] / common / JackServer.h
blob22a21c4e2352f9a31ae96ed630276784213bcee2
1 /*
2 Copyright (C) 2001 Paul Davis
3 Copyright (C) 2004-2008 Grame
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #ifndef __JackServer__
22 #define __JackServer__
24 #include "JackCompilerDeps.h"
25 #include "driver_interface.h"
26 #include "JackDriverLoader.h"
27 #include "JackConnectionManager.h"
28 #include "JackGlobals.h"
29 #include "JackPlatformPlug.h"
30 #include "jslist.h"
32 namespace Jack
35 class JackGraphManager;
36 class JackDriverClientInterface;
37 struct JackEngineControl;
38 class JackLockedEngine;
39 class JackLoadableInternalClient;
41 /*!
42 \brief The Jack server.
45 class SERVER_EXPORT JackServer
48 private:
50 JackDriverInfo* fDriverInfo;
51 JackDriverClientInterface* fAudioDriver;
52 JackDriverClientInterface* fFreewheelDriver;
53 JackLockedEngine* fEngine;
54 JackEngineControl* fEngineControl;
55 JackGraphManager* fGraphManager;
56 JackServerChannel fChannel;
57 JackConnectionManager fConnectionState;
58 JackSynchro fSynchroTable[CLIENT_NUM];
59 bool fFreewheel;
61 int InternalClientLoadAux(JackLoadableInternalClient* client, const char* so_name, const char* client_name, int options, int* int_ref, int* status);
63 public:
65 JackServer(bool sync, bool temporary, long timeout, bool rt, long priority, bool verbose, jack_timer_type_t clock, JackSelfConnectMode self_connect_mode, const char* server_name);
66 ~JackServer();
68 int Open(jack_driver_desc_t* driver_desc, JSList* driver_params);
69 int Close();
71 int Start();
72 int Stop();
74 // RT thread
75 void Notify(int refnum, int notify, int value);
77 // Command thread : API
78 int SetBufferSize(jack_nframes_t buffer_size);
79 int SetFreewheel(bool onoff);
80 int InternalClientLoad(const char* client_name, const char* so_name, const char* objet_data, int options, int* int_ref, int* status);
81 int InternalClientLoad(const char* client_name, const char* so_name, const JSList * parameters, int options, int* int_ref, int* status);
82 void ClientKill(int refnum);
84 // Transport management
85 int ReleaseTimebase(int refnum);
86 int SetTimebaseCallback(int refnum, int conditional);
88 // Backend management
89 JackDriverInfo* AddSlave(jack_driver_desc_t* driver_desc, JSList* driver_params);
90 void RemoveSlave(JackDriverInfo* info);
91 int SwitchMaster(jack_driver_desc_t* driver_desc, JSList* driver_params);
93 // Object access
94 JackLockedEngine* GetEngine();
95 JackEngineControl* GetEngineControl();
96 JackSynchro* GetSynchroTable();
97 JackGraphManager* GetGraphManager();
101 } // end of namespace
104 #endif