JackDebugClient.cpp 18.2 KB
Newer Older
sletz's avatar
sletz committed
1
/*
sletz's avatar
sletz committed
2
Copyright (C) 2004-2008 Grame
sletz's avatar
sletz committed
3
4

This program is free software; you can redistribute it and/or modify
sletz's avatar
sletz committed
5
6
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
sletz's avatar
sletz committed
7
8
9
10
11
(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
sletz's avatar
sletz committed
12
GNU Lesser General Public License for more details.
sletz's avatar
sletz committed
13

sletz's avatar
sletz committed
14
15
16
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.
sletz's avatar
sletz committed
17
18
19

*/

20
21
22
23
#if defined(HAVE_CONFIG_H)
#include "config.h"
#endif

sletz's avatar
sletz committed
24
#include "JackDebugClient.h"
25
#include "JackEngineControl.h"
sletz's avatar
sletz committed
26
#include "JackError.h"
27
#include "JackTime.h"
sletz's avatar
sletz committed
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include <iostream>
#include <iomanip>
#include <sstream>
#include <fstream>
#include <string>
#include <time.h>

using namespace std;

namespace Jack
{

JackDebugClient::JackDebugClient(JackClient * client)
{
    fTotalPortNumber = 1;	// The total number of port opened and maybe closed. Historical view.
    fOpenPortNumber = 0;	// The current number of opened port.
    fIsActivated = 0;
    fIsDeactivated = 0;
    fIsClosed = 0;
    fClient = client;
48
    fFreewheel = false;
sletz's avatar
sletz committed
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
}

JackDebugClient::~JackDebugClient()
{
    fTotalPortNumber--; // fTotalPortNumber start at 1
    *fStream << endl << endl << "----------------------------------- JackDebugClient summary ------------------------------- " << endl << endl;
    *fStream << "Client flags ( 1:yes / 0:no ) :" << endl;
    *fStream << setw(5) << "- Client call activated : " << fIsActivated << endl;
    *fStream << setw(5) << "- Client call deactivated : " << fIsDeactivated << endl;
    *fStream << setw(5) << "- Client call closed : " << fIsClosed << endl;
    *fStream << setw(5) << "- Total number of instantiated port : " << fTotalPortNumber << endl;
    *fStream << setw(5) << "- Number of port remaining open when exiting client : " << fOpenPortNumber << endl;
    if (fOpenPortNumber != 0)
        *fStream << "!!! WARNING !!! Some ports have not been unregistrated ! Incorrect exiting !" << endl;
    if (fIsDeactivated != fIsActivated)
        *fStream << "!!! ERROR !!! Client seem do not perform symetric activation-deactivation ! (not the same number of activate and deactivate)" << endl;
    if (fIsClosed == 0)
        *fStream << "!!! ERROR !!! Client have not been closed with jack_client_close() !" << endl;

    *fStream << endl << endl << "---------------------------- JackDebugClient detailed port summary ------------------------ " << endl << endl;
    //for (int i = 0; i < fTotalPortNumber ; i++) {
    for (int i = 1; i <= fTotalPortNumber ; i++) {
        *fStream << endl << "Port index (internal debug test value) : " << i << endl;
        *fStream << setw(5) << "- Name : " << fPortList[i].name << endl;
        *fStream << setw(5) << "- idport : " << fPortList[i].idport << endl;
        *fStream << setw(5) << "- IsConnected : " << fPortList[i].IsConnected << endl;
        *fStream << setw(5) << "- IsUnregistrated : " << fPortList[i].IsUnregistrated << endl;
        if (fPortList[i].IsUnregistrated == 0)
            *fStream << "!!! WARNING !!! Port have not been unregistrated ! Incorrect exiting !" << endl;
    }
    *fStream << "delete object JackDebugClient : end of tracing" << endl;
    delete fStream;
    delete fClient;
}

84
int JackDebugClient::Open(const char* server_name, const char* name, jack_options_t options, jack_status_t* status)
sletz's avatar
sletz committed
85
{
86
    int res = fClient->Open(server_name, name, options, status);
sletz's avatar
sletz committed
87
88
89
90
91
92
93
94
95
96
97
98
    char provstr[256];
    char buffer[256];
    time_t curtime;
    struct tm *loctime;
    /* Get the current time. */
    curtime = time (NULL);
    /* Convert it to local time representation. */
    loctime = localtime (&curtime);
    strftime (buffer, 256, "%I-%M", loctime);
    sprintf(provstr, "JackClientDebug-%s-%s.log", name, buffer);
    fStream = new ofstream(provstr, ios_base::ate);
    if (fStream->is_open()) {
99
100
        if (res == -1) {
            *fStream << "Trying to open client with name '" << name << "' with bad result (client not opened)." << res << endl;
sletz's avatar
sletz committed
101
        } else {
102
            *fStream << "Open client with name '" << name << "'." << endl;
sletz's avatar
sletz committed
103
104
        }
    } else {
sletz's avatar
sletz committed
105
        jack_log("JackDebugClient::Open : cannot open log file");
sletz's avatar
sletz committed
106
107
    }
    strcpy(fClientName, name);
108
    return res;
sletz's avatar
sletz committed
109
110
111
112
113
}

int JackDebugClient::Close()
{
    fIsClosed++;
114
    *fStream << "Client '" << fClientName << "' was closed" << endl;
sletz's avatar
sletz committed
115
116
117
    return fClient->Close();
}

118
119
120
void JackDebugClient::CheckClient() const
{
    if (fIsClosed > 0)  {
sletz's avatar
sletz committed
121
122
123
        *fStream << "!!! ERROR !!! : Accessing a client '" << fClientName << "' already closed !" << endl;
        *fStream << "This is likely to cause crash !'" << endl;
    }
124
125
}

sletz's avatar
sletz committed
126
127
pthread_t JackDebugClient::GetThreadID()
{
sletz's avatar
sletz committed
128
    CheckClient();
sletz's avatar
sletz committed
129
130
131
132
133
    return fClient->GetThreadID();
}

JackGraphManager* JackDebugClient::GetGraphManager() const
{
sletz's avatar
sletz committed
134
    CheckClient();
sletz's avatar
sletz committed
135
136
137
138
    return fClient->GetGraphManager();
}
JackEngineControl* JackDebugClient::GetEngineControl() const
{
sletz's avatar
sletz committed
139
    CheckClient();
sletz's avatar
sletz committed
140
141
142
143
144
145
    return fClient->GetEngineControl();
}
/*!
\brief Notification received from the server.
*/

sletz's avatar
sletz committed
146
int JackDebugClient::ClientNotify(int refnum, const char* name, int notify, int sync, int value1, int value2)
sletz's avatar
sletz committed
147
{
sletz's avatar
sletz committed
148
    CheckClient();
sletz's avatar
sletz committed
149
    return fClient->ClientNotify( refnum, name, notify, sync, value1, value2);
sletz's avatar
sletz committed
150
151
152
153
}

int JackDebugClient::Activate()
{
sletz's avatar
sletz committed
154
    CheckClient();
sletz's avatar
Cleanup    
sletz committed
155
    int res = fClient->Activate();
sletz's avatar
sletz committed
156
157
158
159
    fIsActivated++;
    if (fIsDeactivated)
        *fStream << "Client '" << fClientName << "' call activate a new time (it already call 'activate' previously)." << endl;
    *fStream << "Client '" << fClientName << "' Activated" << endl;
160
161
162
    if (res != 0)
        *fStream << "Client '" << fClientName << "' try to activate but server return " << res << " ." << endl;
    return res;
sletz's avatar
sletz committed
163
164
165
166
}

int JackDebugClient::Deactivate()
{
sletz's avatar
sletz committed
167
    CheckClient();
sletz's avatar
Cleanup    
sletz committed
168
    int res = fClient->Deactivate();
sletz's avatar
sletz committed
169
170
171
172
    fIsDeactivated++;
    if (fIsActivated == 0)
        *fStream << "Client '" << fClientName << "' deactivate while it hasn't been previoulsy activated !" << endl;
    *fStream << "Client '" << fClientName << "' Deactivated" << endl;
173
174
175
    if (res != 0)
        *fStream << "Client '" << fClientName << "' try to deactivate but server return " << res << " ." << endl;
    return res;
sletz's avatar
sletz committed
176
177
178
179
180
181
182
183
}

//-----------------
// Port management
//-----------------

int JackDebugClient::PortRegister(const char* port_name, const char* port_type, unsigned long flags, unsigned long buffer_size)
{
sletz's avatar
sletz committed
184
    CheckClient();
sletz's avatar
Cleanup    
sletz committed
185
    int res = fClient->PortRegister(port_name, port_type, flags, buffer_size);
186
187
    if (res <= 0) {
        *fStream << "Client '" << fClientName << "' try port register ('" << port_name << "') and server return error  " << res << " ." << endl;
sletz's avatar
sletz committed
188
189
    } else {
        if (fTotalPortNumber < MAX_PORT_HISTORY) {
190
            fPortList[fTotalPortNumber].idport = res;
sletz's avatar
sletz committed
191
192
193
194
195
196
197
198
            strcpy(fPortList[fTotalPortNumber].name, port_name);
            fPortList[fTotalPortNumber].IsConnected = 0;
            fPortList[fTotalPortNumber].IsUnregistrated = 0;
        } else {
            *fStream << "!!! WARNING !!! History is full : no more port history will be recorded." << endl;
        }
        fTotalPortNumber++;
        fOpenPortNumber++;
199
        *fStream << "Client '" << fClientName << "' port register with portname '" << port_name << " port " << res << "' ." << endl;
sletz's avatar
sletz committed
200
    }
201
    return res;
sletz's avatar
sletz committed
202
203
204
205
}

int JackDebugClient::PortUnRegister(jack_port_id_t port_index)
{
sletz's avatar
sletz committed
206
    CheckClient();
sletz's avatar
Cleanup    
sletz committed
207
    int res = fClient->PortUnRegister(port_index);
sletz's avatar
sletz committed
208
209
210
211
212
213
214
215
216
217
218
219
    fOpenPortNumber--;
    int i;
    for (i = (fTotalPortNumber - 1); i >= 0; i--) {	// We search the record into the history
        if (fPortList[i].idport == port_index) {		// We found the last record
            if (fPortList[i].IsUnregistrated != 0)
                *fStream << "!!! ERROR !!! : '" << fClientName << "' id deregistering port '" << fPortList[i].name << "' that have already been unregistered !" << endl;
            fPortList[i].IsUnregistrated++;
            break;
        }
    }
    if (i == 0) // Port is not found
        *fStream << "JackClientDebug : PortUnregister : port " << port_index << " was not previously registered !" << endl;
220
221
    if (res != 0)
        *fStream << "Client '" << fClientName << "' try to do PortUnregister and server return " << res << " )." << endl;
sletz's avatar
sletz committed
222
    *fStream << "Client '" << fClientName << "' unregister port '" << port_index << "'." << endl;
223
    return res;
sletz's avatar
sletz committed
224
225
226
227
}

int JackDebugClient::PortConnect(const char* src, const char* dst)
{
sletz's avatar
sletz committed
228
    CheckClient();
229
    if (!fIsActivated)
sletz's avatar
sletz committed
230
231
        *fStream << "!!! ERROR !!! Trying to connect a port ( " << src << " to " << dst << ") while the client has not been activated !" << endl;
    int i;
sletz's avatar
Cleanup    
sletz committed
232
    int res = fClient->PortConnect( src, dst);
sletz's avatar
sletz committed
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
    for (i = (fTotalPortNumber - 1); i >= 0; i--) {	// We search the record into the history
        if (strcmp(fPortList[i].name, src) == 0) {	// We found the last record in sources
            if (fPortList[i].IsUnregistrated != 0)
                *fStream << "!!! ERROR !!! Connecting port " << src << " previoulsy unregistered !" << endl;
            fPortList[i].IsConnected++;
            *fStream << "Connecting port " << src << " to " << dst << ". ";
            break;
        } else if (strcmp(fPortList[i].name, dst) == 0 ) { // We found the record in dest
            if (fPortList[i].IsUnregistrated != 0)
                *fStream << "!!! ERROR !!! Connecting port  " << dst << " previoulsy unregistered !" << endl;
            fPortList[i].IsConnected++;
            *fStream << "Connecting port " << src << " to " << dst << ". ";
            break;
        }
    }
    if (i == 0) // Port is not found
        *fStream << "JackClientDebug : PortConnect : port was not found in debug database !" << endl;
250
251
    if (res != 0)
        *fStream << "Client '" << fClientName << "' try to do PortConnect but server return " << res << " ." << endl;
sletz's avatar
sletz committed
252
    //*fStream << "Client Port Connect done with names" << endl;
253
    return res;
sletz's avatar
sletz committed
254
255
256
257
}

int JackDebugClient::PortDisconnect(const char* src, const char* dst)
{
sletz's avatar
sletz committed
258
    CheckClient();
259
    if (!fIsActivated)
sletz's avatar
sletz committed
260
        *fStream << "!!! ERROR !!! Trying to disconnect a port ( " << src << " to " << dst << ") while the client has not been activated !" << endl;
sletz's avatar
Cleanup    
sletz committed
261
    int res = fClient->PortDisconnect( src, dst);
sletz's avatar
sletz committed
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
    int i;
    for (i = (fTotalPortNumber - 1); i >= 0; i--) { // We search the record into the history
        if (strcmp(fPortList[i].name, src) == 0) { // We found the record in sources
            if (fPortList[i].IsUnregistrated != 0)
                *fStream << "!!! ERROR !!! : Disconnecting port " << src << " previoulsy unregistered !" << endl;
            fPortList[i].IsConnected--;
            *fStream << "disconnecting port " << src << ". ";
            break;
        } else if (strcmp(fPortList[i].name, dst) == 0 ) { // We found the record in dest
            if (fPortList[i].IsUnregistrated != 0)
                *fStream << "!!! ERROR !!! : Disonnecting port  " << dst << " previoulsy unregistered !" << endl;
            fPortList[i].IsConnected--;
            *fStream << "disconnecting port " << dst << ". ";
            break;
        }
    }
    if (i == 0) // Port is not found
        *fStream << "JackClientDebug : PortDisConnect : port was not found in debug database !" << endl;
280
281
    if (res != 0)
        *fStream << "Client '" << fClientName << "' try to do PortDisconnect but server return " << res << " ." << endl;
sletz's avatar
sletz committed
282
    //*fStream << "Client Port Disconnect done." << endl;
283
    return res;
sletz's avatar
sletz committed
284
285
286
287
}

int JackDebugClient::PortDisconnect(jack_port_id_t src)
{
sletz's avatar
sletz committed
288
    CheckClient();
289
    if (!fIsActivated)
sletz's avatar
sletz committed
290
        *fStream << "!!! ERROR !!! : Trying to disconnect port  " << src << " while that client has not been activated !" << endl;
sletz's avatar
Cleanup    
sletz committed
291
    int res = fClient->PortDisconnect(src);
sletz's avatar
sletz committed
292
293
294
295
296
297
298
299
300
301
302
303
    int i;
    for (i = (fTotalPortNumber - 1); i >= 0; i--) {		// We search the record into the history
        if (fPortList[i].idport == src) {				// We found the record in sources
            if (fPortList[i].IsUnregistrated != 0)
                *fStream << "!!! ERROR !!! : Disconnecting port  " << src << " previoulsy unregistered !" << endl;
            fPortList[i].IsConnected--;
            *fStream << "Disconnecting port " << src << ". " << endl;
            break;
        }
    }
    if (i == 0) // Port is not found
        *fStream << "JackClientDebug : PortDisconnect : port was not found in debug database !" << endl;
304
305
    if (res != 0)
        *fStream << "Client '" << fClientName << "' try to do PortDisconnect but server return " << res << " ." << endl;
sletz's avatar
sletz committed
306
    //*fStream << "Client Port Disconnect with ID done." << endl;
307
    return res;
sletz's avatar
sletz committed
308
309
310
311
}

int JackDebugClient::PortIsMine(jack_port_id_t port_index)
{
sletz's avatar
sletz committed
312
    CheckClient();
sletz's avatar
sletz committed
313
314
315
316
317
318
319
    return fClient->PortIsMine(port_index);
}

//--------------------
// Context management
//--------------------

320
int JackDebugClient::SetBufferSize(jack_nframes_t buffer_size)
sletz's avatar
sletz committed
321
{
sletz's avatar
sletz committed
322
    CheckClient();
323
    return fClient->SetBufferSize(buffer_size);
sletz's avatar
sletz committed
324
325
326
327
}

int JackDebugClient::SetFreeWheel(int onoff)
{
sletz's avatar
sletz committed
328
    CheckClient();
329
330
331
332
333
    if (onoff && fFreewheel)
         *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;
sletz's avatar
sletz committed
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
    return fClient->SetFreeWheel(onoff);
}

/*
ShutDown is called:
- from the RT thread when Execute method fails
- possibly from a "closed" notification channel
(Not needed since the synch object used (Sema of Fifo will fails when server quits... see ShutDown))
*/

void JackDebugClient::ShutDown()
{
    fClient->ShutDown();
}

//---------------------
// Transport management
//---------------------

int JackDebugClient::ReleaseTimebase()
{
sletz's avatar
sletz committed
355
    CheckClient();
sletz's avatar
sletz committed
356
357
358
359
360
    return fClient->ReleaseTimebase();
}

int JackDebugClient::SetSyncCallback(JackSyncCallback sync_callback, void* arg)
{
sletz's avatar
sletz committed
361
    CheckClient();
sletz's avatar
sletz committed
362
363
364
365
366
    return fClient->SetSyncCallback(sync_callback, arg);
}

int JackDebugClient::SetSyncTimeout(jack_time_t timeout)
{
sletz's avatar
sletz committed
367
    CheckClient();
sletz's avatar
sletz committed
368
369
370
371
372
    return fClient->SetSyncTimeout(timeout);
}

int JackDebugClient::SetTimebaseCallback(int conditional, JackTimebaseCallback timebase_callback, void* arg)
{
sletz's avatar
sletz committed
373
    CheckClient();
sletz's avatar
sletz committed
374
375
376
377
378
    return fClient->SetTimebaseCallback( conditional, timebase_callback, arg);
}

int JackDebugClient::TransportLocate(jack_nframes_t frame)
{
sletz's avatar
sletz committed
379
    CheckClient();
sletz's avatar
sletz committed
380
381
382
383
384
    return fClient->TransportLocate(frame);
}

jack_transport_state_t JackDebugClient::TransportQuery(jack_position_t* pos)
{
sletz's avatar
sletz committed
385
    CheckClient();
sletz's avatar
sletz committed
386
387
388
389
390
    return fClient->TransportQuery(pos);
}

jack_nframes_t JackDebugClient::GetCurrentTransportFrame()
{
sletz's avatar
sletz committed
391
    CheckClient();
sletz's avatar
sletz committed
392
393
394
395
396
    return fClient->GetCurrentTransportFrame();
}

int JackDebugClient::TransportReposition(jack_position_t* pos)
{
sletz's avatar
sletz committed
397
    CheckClient();
sletz's avatar
sletz committed
398
399
400
401
402
    return fClient->TransportReposition(pos);
}

void JackDebugClient::TransportStart()
{
sletz's avatar
sletz committed
403
    CheckClient();
sletz's avatar
sletz committed
404
405
406
407
408
    fClient->TransportStart();
}

void JackDebugClient::TransportStop()
{
sletz's avatar
sletz committed
409
    CheckClient();
sletz's avatar
sletz committed
410
411
412
413
414
415
416
417
418
    fClient->TransportStop();
}

//---------------------
// Callback management
//---------------------

void JackDebugClient::OnShutdown(JackShutdownCallback callback, void *arg)
{
sletz's avatar
sletz committed
419
    CheckClient();
sletz's avatar
sletz committed
420
421
422
    fClient->OnShutdown(callback, arg);
}

423
424
int JackDebugClient::TimeCallback(jack_nframes_t nframes, void *arg)
{
sletz's avatar
sletz committed
425
426
427
428
429
    JackDebugClient* client = (JackDebugClient*)arg;
    jack_time_t t1 = GetMicroSeconds();
    int res = client->fProcessTimeCallback(nframes, client->fProcessTimeCallbackArg);
    jack_time_t t2 = GetMicroSeconds();
    long delta = long((t2 - t1) - client->GetEngineControl()->fPeriodUsecs);
sletz's avatar
sletz committed
430
    if (delta > 0 && !client->fFreewheel)
sletz's avatar
sletz committed
431
432
        *client->fStream << "!!! ERROR !!! : Process overload of " << delta << " us" << endl;
    return res;
433
434
}

sletz's avatar
sletz committed
435
436
int JackDebugClient::SetProcessCallback(JackProcessCallback callback, void *arg)
{
sletz's avatar
sletz committed
437
438
439
    CheckClient();
    fProcessTimeCallback = callback;
    fProcessTimeCallbackArg = arg;
440
    return fClient->SetProcessCallback(TimeCallback, this);
sletz's avatar
sletz committed
441
442
443
444
}

int JackDebugClient::SetXRunCallback(JackXRunCallback callback, void *arg)
{
sletz's avatar
sletz committed
445
    CheckClient();
sletz's avatar
sletz committed
446
447
448
449
450
    return fClient->SetXRunCallback(callback, arg);
}

int JackDebugClient::SetInitCallback(JackThreadInitCallback callback, void *arg)
{
sletz's avatar
sletz committed
451
    CheckClient();
sletz's avatar
sletz committed
452
453
454
455
456
    return fClient->SetInitCallback(callback, arg);
}

int JackDebugClient::SetGraphOrderCallback(JackGraphOrderCallback callback, void *arg)
{
sletz's avatar
sletz committed
457
    CheckClient();
sletz's avatar
sletz committed
458
459
460
461
462
    return fClient->SetGraphOrderCallback(callback, arg);
}

int JackDebugClient::SetBufferSizeCallback(JackBufferSizeCallback callback, void *arg)
{
sletz's avatar
sletz committed
463
    CheckClient();
sletz's avatar
sletz committed
464
465
466
    return fClient->SetBufferSizeCallback(callback, arg);
}

sletz's avatar
Cleanup    
sletz committed
467
468
int JackDebugClient::SetClientRegistrationCallback(JackClientRegistrationCallback callback, void* arg)
{
sletz's avatar
sletz committed
469
    CheckClient();
sletz's avatar
Cleanup    
sletz committed
470
471
472
    return fClient->SetClientRegistrationCallback(callback, arg);
}

sletz's avatar
sletz committed
473
474
int JackDebugClient::SetFreewheelCallback(JackFreewheelCallback callback, void *arg)
{
sletz's avatar
sletz committed
475
    CheckClient();
sletz's avatar
sletz committed
476
477
478
479
480
    return fClient->SetFreewheelCallback(callback, arg);
}

int JackDebugClient::SetPortRegistrationCallback(JackPortRegistrationCallback callback, void *arg)
{
sletz's avatar
sletz committed
481
    CheckClient();
sletz's avatar
sletz committed
482
483
484
    return fClient->SetPortRegistrationCallback(callback, arg);
}

sletz's avatar
sletz committed
485
486
int JackDebugClient::SetPortConnectCallback(JackPortConnectCallback callback, void *arg)
{
sletz's avatar
sletz committed
487
    CheckClient();
sletz's avatar
sletz committed
488
489
490
    return fClient->SetPortConnectCallback(callback, arg);
}

sletz's avatar
sletz committed
491
492
JackClientControl* JackDebugClient::GetClientControl() const
{
sletz's avatar
sletz committed
493
    CheckClient();
sletz's avatar
sletz committed
494
495
496
    return fClient->GetClientControl();
}

sletz's avatar
sletz committed
497
498
499
// Internal clients
char* JackDebugClient::GetInternalClientName(int ref)
{
sletz's avatar
sletz committed
500
    CheckClient();
sletz's avatar
sletz committed
501
502
503
504
505
    return fClient->GetInternalClientName(ref);
}

int JackDebugClient::InternalClientHandle(const char* client_name, jack_status_t* status)
{
sletz's avatar
sletz committed
506
    CheckClient();
sletz's avatar
sletz committed
507
508
509
510
511
    return fClient->InternalClientHandle(client_name, status);
}

int JackDebugClient::InternalClientLoad(const char* client_name, jack_options_t options, jack_status_t* status, jack_varargs_t* va)
{
sletz's avatar
sletz committed
512
    CheckClient();
sletz's avatar
sletz committed
513
514
515
516
517
    return fClient->InternalClientLoad(client_name, options, status, va);
}

void JackDebugClient::InternalClientUnload(int ref, jack_status_t* status)
{
sletz's avatar
sletz committed
518
    CheckClient();
sletz's avatar
sletz committed
519
520
    fClient->InternalClientUnload(ref, status);
}
sletz's avatar
sletz committed
521

sletz's avatar
sletz committed
522
523
jack_nframes_t JackDebugClient::Wait(int status)
{
sletz's avatar
sletz committed
524
    CheckClient();
sletz's avatar
sletz committed
525
526
527
    return fClient->Wait(status);
}

sletz's avatar
sletz committed
528
529
} // end of namespace