jack2 codebase
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

632 lines
23KB

  1. /*
  2. Copyright (C) 2004-2008 Grame
  3. This program is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU Lesser General Public License as published by
  5. the Free Software Foundation; either version 2.1 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public License
  12. along with this program; if not, write to the Free Software
  13. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  14. */
  15. #include "JackDebugClient.h"
  16. #include "JackEngineControl.h"
  17. #include "JackException.h"
  18. #include "JackError.h"
  19. #include "JackTime.h"
  20. #include <iostream>
  21. #include <iomanip>
  22. #include <sstream>
  23. #include <fstream>
  24. #include <string>
  25. #include <time.h>
  26. using namespace std;
  27. namespace Jack
  28. {
  29. JackDebugClient::JackDebugClient(JackClient * client)
  30. : JackClient(client->fSynchroTable)
  31. {
  32. fTotalPortNumber = 1; // The total number of port opened and maybe closed. Historical view.
  33. fOpenPortNumber = 0; // The current number of opened port.
  34. fIsActivated = 0;
  35. fIsDeactivated = 0;
  36. fIsClosed = 0;
  37. fClient = client;
  38. fFreewheel = false;
  39. }
  40. JackDebugClient::~JackDebugClient()
  41. {
  42. fTotalPortNumber--; // fTotalPortNumber start at 1
  43. *fStream << endl << endl << "----------------------------------- JackDebugClient summary ------------------------------- " << endl << endl;
  44. *fStream << "Client flags ( 1:yes / 0:no ) :" << endl;
  45. *fStream << setw(5) << "- Client call activated : " << fIsActivated << endl;
  46. *fStream << setw(5) << "- Client call deactivated : " << fIsDeactivated << endl;
  47. *fStream << setw(5) << "- Client call closed : " << fIsClosed << endl;
  48. *fStream << setw(5) << "- Total number of instantiated port : " << fTotalPortNumber << endl;
  49. *fStream << setw(5) << "- Number of port remaining open when exiting client : " << fOpenPortNumber << endl;
  50. if (fOpenPortNumber != 0)
  51. *fStream << "!!! WARNING !!! Some ports have not been unregistered ! Incorrect exiting !" << endl;
  52. if (fIsDeactivated != fIsActivated)
  53. *fStream << "!!! ERROR !!! Client seem to not perform symmetric activation-deactivation ! (not the same number of activate and deactivate)" << endl;
  54. if (fIsClosed == 0)
  55. *fStream << "!!! ERROR !!! Client have not been closed with jack_client_close() !" << endl;
  56. *fStream << endl << endl << "---------------------------- JackDebugClient detailed port summary ------------------------ " << endl << endl;
  57. //for (int i = 0; i < fTotalPortNumber ; i++) {
  58. for (int i = 1; i <= fTotalPortNumber ; i++) {
  59. *fStream << endl << "Port index (internal debug test value) : " << i << endl;
  60. *fStream << setw(5) << "- Name : " << fPortList[i].name << endl;
  61. *fStream << setw(5) << "- idport : " << fPortList[i].idport << endl;
  62. *fStream << setw(5) << "- IsConnected : " << fPortList[i].IsConnected << endl;
  63. *fStream << setw(5) << "- IsUnregistered : " << fPortList[i].IsUnregistered << endl;
  64. if (fPortList[i].IsUnregistered == 0)
  65. *fStream << "!!! WARNING !!! Port have not been unregistered ! Incorrect exiting !" << endl;
  66. }
  67. *fStream << "delete object JackDebugClient : end of tracing" << endl;
  68. delete fStream;
  69. delete fClient;
  70. }
  71. int JackDebugClient::Open(const char* server_name, const char* name, jack_uuid_t uuid, jack_options_t options, jack_status_t* status)
  72. {
  73. int res = fClient->Open(server_name, name, uuid, options, status);
  74. char provstr[256];
  75. char buffer[256];
  76. time_t curtime;
  77. struct tm *loctime;
  78. /* Get the current time. */
  79. curtime = time (NULL);
  80. /* Convert it to local time representation. */
  81. loctime = localtime (&curtime);
  82. strftime (buffer, 256, "%I-%M", loctime);
  83. snprintf(provstr, sizeof(provstr), "JackClientDebug-%s-%s.log", name, buffer);
  84. fStream = new ofstream(provstr, ios_base::ate);
  85. if (fStream->is_open()) {
  86. if (res == -1) {
  87. *fStream << "Trying to open client with name '" << name << "' with bad result (client not opened)." << res << endl;
  88. } else {
  89. *fStream << "Open client with name '" << name << "'." << endl;
  90. }
  91. } else {
  92. jack_log("JackDebugClient::Open : cannot open log file");
  93. }
  94. strcpy(fClientName, name);
  95. return res;
  96. }
  97. int JackDebugClient::Close()
  98. {
  99. *fStream << "Client '" << fClientName << "' was closed" << endl;
  100. int res = fClient->Close();
  101. fIsClosed++;
  102. return res;
  103. }
  104. void JackDebugClient::CheckClient(const char* function_name) const
  105. {
  106. #ifdef WIN32
  107. *fStream << "CheckClient : " << function_name << ", calling thread : " << GetCurrentThread() << endl;
  108. #else
  109. *fStream << "CheckClient : " << function_name << ", calling thread : " << pthread_self() << endl;
  110. #endif
  111. if (fIsClosed > 0) {
  112. *fStream << "!!! ERROR !!! : Accessing a client '" << fClientName << "' already closed " << "from " << function_name << endl;
  113. *fStream << "This is likely to cause crash !'" << endl;
  114. #ifdef __APPLE__
  115. // Debugger();
  116. #endif
  117. }
  118. }
  119. jack_native_thread_t JackDebugClient::GetThreadID()
  120. {
  121. CheckClient("GetThreadID");
  122. return fClient->GetThreadID();
  123. }
  124. JackGraphManager* JackDebugClient::GetGraphManager() const
  125. {
  126. CheckClient("GetGraphManager");
  127. return fClient->GetGraphManager();
  128. }
  129. JackEngineControl* JackDebugClient::GetEngineControl() const
  130. {
  131. CheckClient("GetEngineControl");
  132. return fClient->GetEngineControl();
  133. }
  134. /*!
  135. \brief Notification received from the server.
  136. */
  137. int JackDebugClient::ClientNotify(int refnum, const char* name, int notify, int sync, const char* message, int value1, int value2)
  138. {
  139. CheckClient("ClientNotify");
  140. return fClient->ClientNotify( refnum, name, notify, sync, message, value1, value2);
  141. }
  142. int JackDebugClient::Activate()
  143. {
  144. CheckClient("Activate");
  145. int res = fClient->Activate();
  146. fIsActivated++;
  147. if (fIsDeactivated)
  148. *fStream << "Client '" << fClientName << "' call activate a new time (it already call 'activate' previously)." << endl;
  149. *fStream << "Client '" << fClientName << "' Activated" << endl;
  150. if (res != 0)
  151. *fStream << "Client '" << fClientName << "' try to activate but server return " << res << " ." << endl;
  152. return res;
  153. }
  154. int JackDebugClient::Deactivate()
  155. {
  156. CheckClient("Deactivate");
  157. int res = fClient->Deactivate();
  158. fIsDeactivated++;
  159. if (fIsActivated == 0)
  160. *fStream << "Client '" << fClientName << "' deactivate while it hasn't been previoulsy activated !" << endl;
  161. *fStream << "Client '" << fClientName << "' Deactivated" << endl;
  162. if (res != 0)
  163. *fStream << "Client '" << fClientName << "' try to deactivate but server return " << res << " ." << endl;
  164. return res;
  165. }
  166. //-----------------
  167. // Port management
  168. //-----------------
  169. int JackDebugClient::PortRegister(const char* port_name, const char* port_type, unsigned long flags, unsigned long buffer_size)
  170. {
  171. CheckClient("PortRegister");
  172. int res = fClient->PortRegister(port_name, port_type, flags, buffer_size);
  173. if (res <= 0) {
  174. *fStream << "Client '" << fClientName << "' try port register ('" << port_name << "') and server return error " << res << " ." << endl;
  175. } else {
  176. if (fTotalPortNumber < MAX_PORT_HISTORY) {
  177. fPortList[fTotalPortNumber].idport = res;
  178. strcpy(fPortList[fTotalPortNumber].name, port_name);
  179. fPortList[fTotalPortNumber].IsConnected = 0;
  180. fPortList[fTotalPortNumber].IsUnregistered = 0;
  181. } else {
  182. *fStream << "!!! WARNING !!! History is full : no more port history will be recorded." << endl;
  183. }
  184. fTotalPortNumber++;
  185. fOpenPortNumber++;
  186. *fStream << "Client '" << fClientName << "' port register with portname '" << port_name << " port " << res << "' ." << endl;
  187. }
  188. return res;
  189. }
  190. int JackDebugClient::PortUnRegister(jack_port_id_t port_index)
  191. {
  192. CheckClient("PortUnRegister");
  193. int res = fClient->PortUnRegister(port_index);
  194. fOpenPortNumber--;
  195. int i;
  196. for (i = (fTotalPortNumber - 1); i >= 0; i--) { // We search the record into the history
  197. if (fPortList[i].idport == port_index) { // We found the last record
  198. if (fPortList[i].IsUnregistered != 0)
  199. *fStream << "!!! ERROR !!! : '" << fClientName << "' id deregistering port '" << fPortList[i].name << "' that have already been unregistered !" << endl;
  200. fPortList[i].IsUnregistered++;
  201. break;
  202. }
  203. }
  204. if (i == 0) // Port is not found
  205. *fStream << "JackClientDebug : PortUnregister : port " << port_index << " was not previously registered !" << endl;
  206. if (res != 0)
  207. *fStream << "Client '" << fClientName << "' try to do PortUnregister and server return " << res << endl;
  208. *fStream << "Client '" << fClientName << "' unregister port '" << port_index << "'." << endl;
  209. return res;
  210. }
  211. int JackDebugClient::PortConnect(const char* src, const char* dst)
  212. {
  213. CheckClient("PortConnect");
  214. if (!fIsActivated)
  215. *fStream << "!!! ERROR !!! Trying to connect a port ( " << src << " to " << dst << ") while the client has not been activated !" << endl;
  216. int i;
  217. int res = fClient->PortConnect( src, dst);
  218. for (i = (fTotalPortNumber - 1); i >= 0; i--) { // We search the record into the history
  219. if (strcmp(fPortList[i].name, src) == 0) { // We found the last record in sources
  220. if (fPortList[i].IsUnregistered != 0)
  221. *fStream << "!!! ERROR !!! Connecting port " << src << " previoulsy unregistered !" << endl;
  222. fPortList[i].IsConnected++;
  223. *fStream << "Connecting port " << src << " to " << dst << ". ";
  224. break;
  225. } else if (strcmp(fPortList[i].name, dst) == 0 ) { // We found the record in dest
  226. if (fPortList[i].IsUnregistered != 0)
  227. *fStream << "!!! ERROR !!! Connecting port " << dst << " previoulsy unregistered !" << endl;
  228. fPortList[i].IsConnected++;
  229. *fStream << "Connecting port " << src << " to " << dst << ". ";
  230. break;
  231. }
  232. }
  233. if (i == 0) // Port is not found
  234. *fStream << "JackClientDebug : PortConnect : port was not found in debug database !" << endl;
  235. if (res != 0)
  236. *fStream << "Client '" << fClientName << "' try to do PortConnect but server return " << res << " ." << endl;
  237. //*fStream << "Client Port Connect done with names" << endl;
  238. return res;
  239. }
  240. int JackDebugClient::PortDisconnect(const char* src, const char* dst)
  241. {
  242. CheckClient("PortDisconnect");
  243. if (!fIsActivated)
  244. *fStream << "!!! ERROR !!! Trying to disconnect a port ( " << src << " to " << dst << ") while the client has not been activated !" << endl;
  245. int res = fClient->PortDisconnect( src, dst);
  246. int i;
  247. for (i = (fTotalPortNumber - 1); i >= 0; i--) { // We search the record into the history
  248. if (strcmp(fPortList[i].name, src) == 0) { // We found the record in sources
  249. if (fPortList[i].IsUnregistered != 0)
  250. *fStream << "!!! ERROR !!! : Disconnecting port " << src << " previoulsy unregistered !" << endl;
  251. fPortList[i].IsConnected--;
  252. *fStream << "disconnecting port " << src << ". ";
  253. break;
  254. } else if (strcmp(fPortList[i].name, dst) == 0 ) { // We found the record in dest
  255. if (fPortList[i].IsUnregistered != 0)
  256. *fStream << "!!! ERROR !!! : Disonnecting port " << dst << " previoulsy unregistered !" << endl;
  257. fPortList[i].IsConnected--;
  258. *fStream << "disconnecting port " << dst << ". ";
  259. break;
  260. }
  261. }
  262. if (i == 0) // Port is not found
  263. *fStream << "JackClientDebug : PortDisConnect : port was not found in debug database !" << endl;
  264. if (res != 0)
  265. *fStream << "Client '" << fClientName << "' try to do PortDisconnect but server return " << res << " ." << endl;
  266. //*fStream << "Client Port Disconnect done." << endl;
  267. return res;
  268. }
  269. int JackDebugClient::PortDisconnect(jack_port_id_t src)
  270. {
  271. CheckClient("PortDisconnect");
  272. if (!fIsActivated)
  273. *fStream << "!!! ERROR !!! : Trying to disconnect port " << src << " while that client has not been activated !" << endl;
  274. int res = fClient->PortDisconnect(src);
  275. int i;
  276. for (i = (fTotalPortNumber - 1); i >= 0; i--) { // We search the record into the history
  277. if (fPortList[i].idport == src) { // We found the record in sources
  278. if (fPortList[i].IsUnregistered != 0)
  279. *fStream << "!!! ERROR !!! : Disconnecting port " << src << " previoulsy unregistered !" << endl;
  280. fPortList[i].IsConnected--;
  281. *fStream << "Disconnecting port " << src << ". " << endl;
  282. break;
  283. }
  284. }
  285. if (i == 0) // Port is not found
  286. *fStream << "JackClientDebug : PortDisconnect : port was not found in debug database !" << endl;
  287. if (res != 0)
  288. *fStream << "Client '" << fClientName << "' try to do PortDisconnect but server return " << res << " ." << endl;
  289. //*fStream << "Client Port Disconnect with ID done." << endl;
  290. return res;
  291. }
  292. int JackDebugClient::PortIsMine(jack_port_id_t port_index)
  293. {
  294. CheckClient("PortIsMine");
  295. *fStream << "JackClientDebug : PortIsMine port_index " << port_index << endl;
  296. return fClient->PortIsMine(port_index);
  297. }
  298. int JackDebugClient::PortRename(jack_port_id_t port_index, const char* name)
  299. {
  300. CheckClient("PortRename");
  301. *fStream << "JackClientDebug : PortRename port_index " << port_index << "name" << name << endl;
  302. return fClient->PortRename(port_index, name);
  303. }
  304. //--------------------
  305. // Context management
  306. //--------------------
  307. int JackDebugClient::SetBufferSize(jack_nframes_t buffer_size)
  308. {
  309. CheckClient("SetBufferSize");
  310. *fStream << "JackClientDebug : SetBufferSize buffer_size " << buffer_size << endl;
  311. return fClient->SetBufferSize(buffer_size);
  312. }
  313. int JackDebugClient::SetFreeWheel(int onoff)
  314. {
  315. CheckClient("SetFreeWheel");
  316. if (onoff && fFreewheel)
  317. *fStream << "!!! ERROR !!! : Freewheel setup seems incorrect : set = ON while FW is already ON " << endl;
  318. if (!onoff && !fFreewheel)
  319. *fStream << "!!! ERROR !!! : Freewheel setup seems incorrect : set = OFF while FW is already OFF " << endl;
  320. fFreewheel = onoff ? true : false;
  321. return fClient->SetFreeWheel(onoff);
  322. }
  323. int JackDebugClient::ComputeTotalLatencies()
  324. {
  325. CheckClient("ComputeTotalLatencies");
  326. return fClient->ComputeTotalLatencies();
  327. }
  328. /*
  329. ShutDown is called:
  330. - from the RT thread when Execute method fails
  331. - possibly from a "closed" notification channel
  332. (Not needed since the synch object used (Sema of Fifo will fails when server quits... see ShutDown))
  333. */
  334. void JackDebugClient::ShutDown(jack_status_t code, const char* message)
  335. {
  336. CheckClient("ShutDown");
  337. fClient->ShutDown(code, message);
  338. }
  339. //---------------------
  340. // Transport management
  341. //---------------------
  342. int JackDebugClient::ReleaseTimebase()
  343. {
  344. CheckClient("ReleaseTimebase");
  345. return fClient->ReleaseTimebase();
  346. }
  347. int JackDebugClient::SetSyncCallback(JackSyncCallback sync_callback, void* arg)
  348. {
  349. CheckClient("SetSyncCallback");
  350. return fClient->SetSyncCallback(sync_callback, arg);
  351. }
  352. int JackDebugClient::SetSyncTimeout(jack_time_t timeout)
  353. {
  354. CheckClient("SetSyncTimeout");
  355. *fStream << "JackClientDebug : SetSyncTimeout timeout " << timeout << endl;
  356. return fClient->SetSyncTimeout(timeout);
  357. }
  358. int JackDebugClient::SetTimebaseCallback(int conditional, JackTimebaseCallback timebase_callback, void* arg)
  359. {
  360. CheckClient("SetTimebaseCallback");
  361. return fClient->SetTimebaseCallback( conditional, timebase_callback, arg);
  362. }
  363. void JackDebugClient::TransportLocate(jack_nframes_t frame)
  364. {
  365. CheckClient("TransportLocate");
  366. *fStream << "JackClientDebug : TransportLocate frame " << frame << endl;
  367. fClient->TransportLocate(frame);
  368. }
  369. jack_transport_state_t JackDebugClient::TransportQuery(jack_position_t* pos)
  370. {
  371. CheckClient("TransportQuery");
  372. return fClient->TransportQuery(pos);
  373. }
  374. jack_nframes_t JackDebugClient::GetCurrentTransportFrame()
  375. {
  376. CheckClient("GetCurrentTransportFrame");
  377. return fClient->GetCurrentTransportFrame();
  378. }
  379. int JackDebugClient::TransportReposition(const jack_position_t* pos)
  380. {
  381. CheckClient("TransportReposition");
  382. return fClient->TransportReposition(pos);
  383. }
  384. void JackDebugClient::TransportStart()
  385. {
  386. CheckClient("TransportStart");
  387. fClient->TransportStart();
  388. }
  389. void JackDebugClient::TransportStop()
  390. {
  391. CheckClient("TransportStop");
  392. fClient->TransportStop();
  393. }
  394. //---------------------
  395. // Callback management
  396. //---------------------
  397. void JackDebugClient::OnShutdown(JackShutdownCallback callback, void *arg)
  398. {
  399. CheckClient("OnShutdown");
  400. fClient->OnShutdown(callback, arg);
  401. }
  402. void JackDebugClient::OnInfoShutdown(JackInfoShutdownCallback callback, void *arg)
  403. {
  404. CheckClient("OnInfoShutdown");
  405. fClient->OnInfoShutdown(callback, arg);
  406. }
  407. int JackDebugClient::TimeCallback(jack_nframes_t nframes, void *arg)
  408. {
  409. JackDebugClient* client = (JackDebugClient*)arg;
  410. jack_time_t t1 = GetMicroSeconds();
  411. int res = client->fProcessTimeCallback(nframes, client->fProcessTimeCallbackArg);
  412. if (res == 0) {
  413. jack_time_t t2 = GetMicroSeconds();
  414. long delta = long((t2 - t1) - client->GetEngineControl()->fPeriodUsecs);
  415. if (delta > 0 && !client->fFreewheel) {
  416. *client->fStream << "!!! ERROR !!! : Process overload of " << delta << " us" << endl;
  417. }
  418. }
  419. return res;
  420. }
  421. int JackDebugClient::SetProcessCallback(JackProcessCallback callback, void *arg)
  422. {
  423. CheckClient("SetProcessCallback");
  424. fProcessTimeCallback = callback;
  425. fProcessTimeCallbackArg = arg;
  426. if (callback == NULL) {
  427. // Clear the callback...
  428. return fClient->SetProcessCallback(callback, arg);
  429. } else {
  430. // Setup the measuring version...
  431. return fClient->SetProcessCallback(TimeCallback, this);
  432. }
  433. }
  434. int JackDebugClient::SetXRunCallback(JackXRunCallback callback, void *arg)
  435. {
  436. CheckClient("SetXRunCallback");
  437. return fClient->SetXRunCallback(callback, arg);
  438. }
  439. int JackDebugClient::SetInitCallback(JackThreadInitCallback callback, void *arg)
  440. {
  441. CheckClient("SetInitCallback");
  442. return fClient->SetInitCallback(callback, arg);
  443. }
  444. int JackDebugClient::SetGraphOrderCallback(JackGraphOrderCallback callback, void *arg)
  445. {
  446. CheckClient("SetGraphOrderCallback");
  447. return fClient->SetGraphOrderCallback(callback, arg);
  448. }
  449. int JackDebugClient::SetBufferSizeCallback(JackBufferSizeCallback callback, void *arg)
  450. {
  451. CheckClient("SetBufferSizeCallback");
  452. return fClient->SetBufferSizeCallback(callback, arg);
  453. }
  454. int JackDebugClient::SetClientRegistrationCallback(JackClientRegistrationCallback callback, void* arg)
  455. {
  456. CheckClient("SetClientRegistrationCallback");
  457. return fClient->SetClientRegistrationCallback(callback, arg);
  458. }
  459. int JackDebugClient::SetFreewheelCallback(JackFreewheelCallback callback, void *arg)
  460. {
  461. CheckClient("SetFreewheelCallback");
  462. return fClient->SetFreewheelCallback(callback, arg);
  463. }
  464. int JackDebugClient::SetPortRegistrationCallback(JackPortRegistrationCallback callback, void *arg)
  465. {
  466. CheckClient("SetPortRegistrationCallback");
  467. return fClient->SetPortRegistrationCallback(callback, arg);
  468. }
  469. int JackDebugClient::SetPortConnectCallback(JackPortConnectCallback callback, void *arg)
  470. {
  471. CheckClient("SetPortConnectCallback");
  472. return fClient->SetPortConnectCallback(callback, arg);
  473. }
  474. int JackDebugClient::SetPortRenameCallback(JackPortRenameCallback callback, void *arg)
  475. {
  476. CheckClient("SetPortRenameCallback");
  477. return fClient->SetPortRenameCallback(callback, arg);
  478. }
  479. int JackDebugClient::SetSessionCallback(JackSessionCallback callback, void *arg)
  480. {
  481. CheckClient("SetSessionCallback");
  482. return fClient->SetSessionCallback(callback, arg);
  483. }
  484. int JackDebugClient::SetLatencyCallback(JackLatencyCallback callback, void *arg)
  485. {
  486. CheckClient("SetLatencyCallback");
  487. return fClient->SetLatencyCallback(callback, arg);
  488. }
  489. int JackDebugClient::SetProcessThread(JackThreadCallback fun, void *arg)
  490. {
  491. CheckClient("SetProcessThread");
  492. return fClient->SetProcessThread(fun, arg);
  493. }
  494. jack_session_command_t* JackDebugClient::SessionNotify(const char* target, jack_session_event_type_t type, const char* path)
  495. {
  496. CheckClient("SessionNotify");
  497. *fStream << "JackClientDebug : SessionNotify target " << target << "type " << type << "path " << path << endl;
  498. return fClient->SessionNotify(target, type, path);
  499. }
  500. int JackDebugClient::SessionReply(jack_session_event_t* ev)
  501. {
  502. CheckClient("SessionReply");
  503. return fClient->SessionReply(ev);
  504. }
  505. char* JackDebugClient::GetUUIDForClientName(const char* client_name)
  506. {
  507. CheckClient("GetUUIDForClientName");
  508. *fStream << "JackClientDebug : GetUUIDForClientName client_name " << client_name << endl;
  509. return fClient->GetUUIDForClientName(client_name);
  510. }
  511. char* JackDebugClient::GetClientNameByUUID(const char* uuid)
  512. {
  513. CheckClient("GetClientNameByUUID");
  514. *fStream << "JackClientDebug : GetClientNameByUUID uuid " << uuid << endl;
  515. return fClient->GetClientNameByUUID(uuid);
  516. }
  517. int JackDebugClient::ReserveClientName(const char* client_name, const char* uuid)
  518. {
  519. CheckClient("ReserveClientName");
  520. *fStream << "JackClientDebug : ReserveClientName client_name " << client_name << "uuid " << uuid << endl;
  521. return fClient->ReserveClientName(client_name, uuid);
  522. }
  523. int JackDebugClient::ClientHasSessionCallback(const char* client_name)
  524. {
  525. CheckClient("ClientHasSessionCallback");
  526. *fStream << "JackClientDebug : ClientHasSessionCallback client_name " << client_name << endl;
  527. return fClient->ClientHasSessionCallback(client_name);
  528. }
  529. JackClientControl* JackDebugClient::GetClientControl() const
  530. {
  531. CheckClient("GetClientControl");
  532. return fClient->GetClientControl();
  533. }
  534. // Internal clients
  535. char* JackDebugClient::GetInternalClientName(int ref)
  536. {
  537. CheckClient("GetInternalClientName");
  538. return fClient->GetInternalClientName(ref);
  539. }
  540. int JackDebugClient::InternalClientHandle(const char* client_name, jack_status_t* status)
  541. {
  542. CheckClient("InternalClientHandle");
  543. return fClient->InternalClientHandle(client_name, status);
  544. }
  545. int JackDebugClient::InternalClientLoad(const char* client_name, jack_options_t options, jack_status_t* status, jack_varargs_t* va)
  546. {
  547. CheckClient("InternalClientLoad");
  548. return fClient->InternalClientLoad(client_name, options, status, va);
  549. }
  550. void JackDebugClient::InternalClientUnload(int ref, jack_status_t* status)
  551. {
  552. CheckClient("InternalClientUnload");
  553. fClient->InternalClientUnload(ref, status);
  554. }
  555. } // end of namespace