JackDebugClient.h

00001 /*
00002 Copyright (C) 2004-2006 Grame
00003 
00004 This program is free software; you can redistribute it and/or modify
00005 it under the terms of the GNU General Public License as published by
00006 the Free Software Foundation; either version 2 of the License, or
00007 (at your option) any later version.
00008 
00009 This program is distributed in the hope that it will be useful,
00010 but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 GNU General Public License for more details.
00013 
00014 You should have received a copy of the GNU General Public License
00015 along with this program; if not, write to the Free Software
00016 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00017 
00018 */
00019 
00020 #ifndef __JackDebugClient__
00021 #define __JackDebugClient__
00022 
00023 #define MAX_PORT_HISTORY 2048
00024 
00025 #include "JackClient.h"
00026 #include <list>
00027 
00028 namespace Jack
00029 {
00030 
00035 typedef struct
00036 {
00037     jack_port_id_t idport;
00038     char name[JACK_PORT_NAME_SIZE]; //portname
00039     int IsConnected;
00040     int IsUnregistrated;
00041 }
00042 PortFollower;
00043 
00048 class JackDebugClient : public JackClient
00049 {
00050     private:
00051 
00052         JackClient* fClient;
00053         std::ofstream* fStream;
00054 
00055     protected:
00056         PortFollower fPortList[MAX_PORT_HISTORY]; // Arbitrary value... To be tuned...
00057         int fTotalPortNumber;   // The total number of port opened and maybe closed. Historical view.
00058         int fOpenPortNumber;    // The current number of opened port.
00059         int fIsActivated;
00060         int fIsDeactivated;
00061         int fIsClosed;
00062         char fClientName[JACK_CLIENT_NAME_SIZE];
00063 
00064     public:
00065 
00066         JackDebugClient(JackClient *fTheClient);
00067 
00068         virtual ~JackDebugClient();
00069 
00070         virtual int Open(const char* name);
00071         int Close();
00072 
00073         virtual JackGraphManager* GetGraphManager() const;
00074         virtual JackEngineControl* GetEngineControl() const;
00075 
00076         // Notifications
00077         int ClientNotify(int refnum, const char* name, int notify, int sync, int value);
00078 
00079         int Activate();
00080         int Deactivate();
00081 
00082         // Context
00083         int SetBufferSize(jack_nframes_t buffer_size);
00084         int SetFreeWheel(int onoff);
00085         void ShutDown();
00086         pthread_t GetThreadID();
00087 
00088         // Port management
00089         int PortRegister(const char* port_name, const char* port_type, unsigned long flags, unsigned long buffer_size);
00090         int PortUnRegister(jack_port_id_t port);
00091 
00092         int PortConnect(const char* src, const char* dst);
00093         int PortDisconnect(const char* src, const char* dst);
00094         int PortConnect(jack_port_id_t src, jack_port_id_t dst);
00095         int PortDisconnect(jack_port_id_t src);
00096 
00097         int PortIsMine(jack_port_id_t port_index);
00098 
00099         // Transport
00100         int ReleaseTimebase();
00101         int SetSyncCallback(JackSyncCallback sync_callback, void* arg);
00102         int SetSyncTimeout(jack_time_t timeout);
00103         int SetTimebaseCallback(int conditional, JackTimebaseCallback timebase_callback, void* arg);
00104         int TransportLocate(jack_nframes_t frame);
00105         jack_transport_state_t TransportQuery(jack_position_t* pos);
00106         jack_nframes_t GetCurrentTransportFrame();
00107         int TransportReposition(jack_position_t* pos);
00108         void TransportStart();
00109         void TransportStop();
00110 
00111         // Callbacks
00112         void OnShutdown(JackShutdownCallback callback, void *arg);
00113         int SetProcessCallback(JackProcessCallback callback, void* arg);
00114         int SetXRunCallback(JackXRunCallback callback, void* arg);
00115         int SetInitCallback(JackThreadInitCallback callback, void* arg);
00116         int SetGraphOrderCallback(JackGraphOrderCallback callback, void* arg);
00117         int SetBufferSizeCallback(JackBufferSizeCallback callback, void* arg);
00118         int SetFreewheelCallback(JackFreewheelCallback callback, void* arg);
00119         int SetPortRegistrationCallback(JackPortRegistrationCallback callback, void* arg);
00120         JackClientControl* GetClientControl() const;
00121 
00122 };
00123 
00124 
00125 } // end of namespace
00126 
00127 #endif

Generated on Wed Jan 10 11:42:44 2007 for Jackdmp by  doxygen 1.4.5