JackChannel.h 4.92 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

*/

#ifndef __JackChannel__
#define __JackChannel__

#include "types.h"
24
#include "session.h"
sletz's avatar
sletz committed
25
26
27
28
29
30
31
32
33
34

namespace Jack
{

class JackClientInterface;
class JackClient;
class JackServer;
struct JackEngineControl;
class JackGraphManager;

35
36
namespace detail
{
sletz's avatar
sletz committed
37

sletz's avatar
sletz committed
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*!
\brief Inter process channel for server/client bidirectionnal communication : request and (receiving) notifications.
*/

class JackClientChannelInterface
{

    public:

        JackClientChannelInterface()
        {}
        virtual ~JackClientChannelInterface()
        {}

        // Open the Server/Client connection
53
        virtual int Open(const char* server_name, const char* name, int uuid, char* name_res, JackClient* obj, jack_options_t options, jack_status_t* status)
sletz's avatar
sletz committed
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
        {
            return 0;
        }

        // Close the Server/Client connection
        virtual void Close()
        {}

        // Start listening for messages from the server
        virtual int Start()
        {
            return 0;
        }

        // Stop listening for messages from the server
        virtual void Stop()
        {}
sletz's avatar
sletz committed
71
72

        virtual int ServerCheck(const char* server_name)
sletz's avatar
sletz committed
73
        {
sletz's avatar
sletz committed
74
75
76
            return -1;
        }

77
        virtual void ClientCheck(const char* name, int uuid, char* name_res, int protocol, int options, int* status, int* result)
78
        {}
79
        virtual void ClientOpen(const char* name, int pid, int uuid, int* shared_engine, int* shared_client, int* shared_graph, int* result)
sletz's avatar
sletz committed
80
        {}
sletz's avatar
sletz committed
81
        virtual void ClientOpen(const char* name, int* ref, JackEngineControl** shared_engine, JackGraphManager** shared_manager, JackClientInterface* client, int* result)
sletz's avatar
sletz committed
82
83
84
85
        {}
        virtual void ClientClose(int refnum, int* result)
        {}

sletz's avatar
sletz committed
86
        virtual void ClientActivate(int refnum, int is_real_time, int* result)
sletz's avatar
sletz committed
87
88
89
90
        {}
        virtual void ClientDeactivate(int refnum, int* result)
        {}

sletz's avatar
sletz committed
91
        virtual void PortRegister(int refnum, const char* name, const char* type, unsigned int flags, unsigned int buffer_size, jack_port_id_t* port_index, int* result)
sletz's avatar
sletz committed
92
93
94
95
96
97
98
99
100
101
102
103
        {}
        virtual void PortUnRegister(int refnum, jack_port_id_t port_index, int* result)
        {}

        virtual void PortConnect(int refnum, const char* src, const char* dst, int* result)
        {}
        virtual void PortDisconnect(int refnum, const char* src, const char* dst, int* result)
        {}
        virtual void PortConnect(int refnum, jack_port_id_t src, jack_port_id_t dst, int* result)
        {}
        virtual void PortDisconnect(int refnum, jack_port_id_t src, jack_port_id_t dst, int* result)
        {}
104
105
        virtual void PortRename(int refnum, jack_port_id_t port, const char* name, int* result)
        {}
sletz's avatar
sletz committed
106

107
        virtual void SetBufferSize(jack_nframes_t buffer_size, int* result)
sletz's avatar
sletz committed
108
109
110
111
112
113
114
115
        {}
        virtual void SetFreewheel(int onoff, int* result)
        {}

        virtual void ReleaseTimebase(int refnum, int* result)
        {}

        virtual void SetTimebaseCallback(int refnum, int conditional, int* result)
116
        {}
sletz's avatar
sletz committed
117
118

        virtual void GetInternalClientName(int refnum, int int_ref, char* name_res, int* result)
119
120
        {}

sletz's avatar
sletz committed
121
        virtual void InternalClientHandle(int refnum, const char* client_name, int* status, int* int_ref, int* result)
sletz's avatar
sletz committed
122
123
        {}

Stéphane LETZ's avatar
Stéphane LETZ committed
124
        virtual void InternalClientLoad(int refnum, const char* client_name, const char* so_name, const char* objet_data, int options, int* status, int* int_ref, int uuid, int* result)
125
        {}
sletz's avatar
sletz committed
126
127

        virtual void InternalClientUnload(int refnum, int int_ref, int* status, int* result)
128
        {}
sletz's avatar
sletz committed
129
        
130
131
        virtual void SessionNotify(int refnum, const char* target, jack_session_event_type_t type, const char *path, jack_session_command_t **result)
        {}
Torben Hohn's avatar
Torben Hohn committed
132

133
134
        virtual void SessionReply(int refnum, int *result)
        {}
135

Stéphane Letz's avatar
Stéphane Letz committed
136
        virtual void GetUUIDForClientName(int refnum, const char *client_name, char *uuid_res, int *result)
137
        {}
138

Stéphane Letz's avatar
Stéphane Letz committed
139
        virtual void GetClientNameForUUID(int refnum, const char *uuid, char *name_res, int *result)
140
        {}
141

Stéphane Letz's avatar
Stéphane Letz committed
142
        virtual void ReserveClientName(int refnum, const char *client_name, const char *uuid, int *result)
143
        {}
144

145
        virtual bool IsChannelThread()
Stéphane Letz's avatar
Stéphane Letz committed
146
147
148
        { 
            return false; 
        }
sletz's avatar
sletz committed
149
};
sletz's avatar
sletz committed
150

151
}
sletz's avatar
sletz committed
152
153
154
155
156

} // end of namespace

#endif