Jack2 1.9.12

JackServer.h
1 /*
2 Copyright (C) 2001 Paul Davis
3 Copyright (C) 2004-2008 Grame
4
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.
9
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.
14
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.
18
19 */
20
21 #ifndef __JackServer__
22 #define __JackServer__
23
24 #include "JackCompilerDeps.h"
25 #include "driver_interface.h"
26 #include "JackDriverLoader.h"
27 #include "JackDriverInfo.h"
28 #include "JackConnectionManager.h"
29 #include "JackGlobals.h"
30 #include "JackPlatformPlug.h"
31 #include "jslist.h"
32
33 namespace Jack
34 {
35
36 class JackGraphManager;
37 class JackDriverClientInterface;
38 struct JackEngineControl;
39 class JackLockedEngine;
40 class JackLoadableInternalClient;
41
46 class SERVER_EXPORT JackServer
47 {
48
49 private:
50
51 JackDriverInfo* fDriverInfo;
52 JackDriverClientInterface* fAudioDriver;
53 JackDriverClientInterface* fFreewheelDriver;
54 JackDriverClientInterface* fThreadedFreewheelDriver;
55 JackLockedEngine* fEngine;
56 JackEngineControl* fEngineControl;
57 JackGraphManager* fGraphManager;
58 JackServerChannel fRequestChannel;
59 JackConnectionManager fConnectionState;
60 JackSynchro fSynchroTable[CLIENT_NUM];
61 bool fFreewheel;
62
63 int InternalClientLoadAux(JackLoadableInternalClient* client, const char* so_name, const char* client_name, int options, int* int_ref, int uuid, int* status);
64
65 public:
66
67 JackServer(bool sync, bool temporary, int timeout, bool rt, int priority, int port_max, bool verbose, jack_timer_type_t clock, char self_connect_mode, const char* server_name);
68 ~JackServer();
69
70 // Server control
71 int Open(jack_driver_desc_t* driver_desc, JSList* driver_params);
72 int Close();
73
74 int Start();
75 int Stop();
76
77 bool IsRunning();
78
79 // RT thread
80 void Notify(int refnum, int notify, int value);
81
82 // From request thread : API
83 int SetBufferSize(jack_nframes_t buffer_size);
84 int SetFreewheel(bool onoff);
85
86 // Internals clients
87 int InternalClientLoad1(const char* client_name, const char* so_name, const char* objet_data, int options, int* int_ref, int uuid, int* status);
88 int InternalClientLoad2(const char* client_name, const char* so_name, const JSList * parameters, int options, int* int_ref, int uuid, int* status);
89
90 // Internal session file
91 int LoadInternalSessionFile(const char* file);
92
93 // Transport management
94 int ReleaseTimebase(int refnum);
95 int SetTimebaseCallback(int refnum, int conditional);
96
97 // Backend management
98 JackDriverInfo* AddSlave(jack_driver_desc_t* driver_desc, JSList* driver_params);
99 void RemoveSlave(JackDriverInfo* info);
100 int SwitchMaster(jack_driver_desc_t* driver_desc, JSList* driver_params);
101
102 // Object access
103 JackLockedEngine* GetEngine();
104 JackEngineControl* GetEngineControl();
105 JackSynchro* GetSynchroTable();
106 JackGraphManager* GetGraphManager();
107
108 };
109
110 } // end of namespace
111
112
113 #endif
Jack::JackConnectionManager
Connection manager.
Definition: JackConnectionManager.h:411
Jack::JackLockedEngine
Locked Engine, access to methods is serialized using a mutex.
Definition: JackLockedEngine.h:78
Jack::JackPosixSemaphore
Inter process synchronization using POSIX semaphore.
Definition: JackPosixSemaphore.h:36
Jack::JackGraphManager
Graph manager: contains the connection manager and the port array.
Definition: JackGraphManager.h:40
Jack::JackServer
The Jack server.
Definition: JackServer.h:46
Jack::JackSocketServerChannel
JackServerChannel using sockets.
Definition: JackSocketServerChannel.h:39
JackDriverInfo
Definition: JackDriverInfo.h:30
Jack::JackDriverClientInterface
The base interface for drivers clients.
Definition: JackDriver.h:114
Jack::JackLoadableInternalClient
Definition: JackInternalClient.h:68
Jack::JackEngineControl
Engine control in shared memory.
Definition: JackEngineControl.h:49
_JSList
Definition: linux/alsa/jslist.h:35
jack_driver_desc_t
Definition: driver_interface.h:132