JackInternalClientChannel.h 3.95 KB
Newer Older
sletz's avatar
sletz committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
Copyright (C) 2004-2006 Grame  

This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (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
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

*/

#ifndef __JackInternalClientChannel__
#define __JackInternalClientChannel__

#include "JackChannel.h"

namespace Jack
{

/*!
\brief JackClientChannel for server internal clients.
*/

class JackInternalClientChannel : public JackClientChannelInterface
{

    private:

        JackServer* fServer;
        JackEngine* fEngine;

    public:

        JackInternalClientChannel(JackServer* server): fServer(server), fEngine(server->GetEngine())
        {}
        virtual ~JackInternalClientChannel()
        {}
46
47
48
49
50
51
		
		// Open the Server/Client connection
        virtual int Open(const char* name, char* name_res, JackClient* obj, jack_options_t options, jack_status_t* status)
        {
            return 0;
        }
sletz's avatar
sletz committed
52

53
54
55
56
		void ClientCheck(const char* name, char* name_res, int options, int* status, int* result)
		{
            *result = fEngine->ClientCheck(name, name_res, options, status);
        }
sletz's avatar
sletz committed
57
        void ClientOpen(const char* name, int* ref, JackEngineControl** shared_engine, JackGraphManager** shared_manager, JackClientInterface* client, int* result)
sletz's avatar
sletz committed
58
        {
sletz's avatar
sletz committed
59
            *result = fEngine->ClientInternalOpen(name, ref, shared_engine, shared_manager, client);
sletz's avatar
sletz committed
60
61
62
63
64
        }
        void ClientClose(int refnum, int* result)
        {
            *result = fEngine->ClientInternalClose(refnum);
        }
65
		
sletz's avatar
sletz committed
66
67
        void ClientActivate(int refnum, int* result)
        {
68
    		*result = fEngine->ClientActivate(refnum);
sletz's avatar
sletz committed
69
70
71
        }
        void ClientDeactivate(int refnum, int* result)
        {
72
     		*result = fEngine->ClientDeactivate(refnum);
sletz's avatar
sletz committed
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
        }

        void PortRegister(int refnum, const char* name, unsigned int flags, unsigned int buffer_size, jack_port_id_t* port_index, int* result)
        {
            *result = fEngine->PortRegister(refnum, name, flags, buffer_size, port_index);
        }
        void PortUnRegister(int refnum, jack_port_id_t port_index, int* result)
        {
            *result = fEngine->PortUnRegister(refnum, port_index);
        }

        void PortConnect(int refnum, const char* src, const char* dst, int* result)
        {
            *result = fEngine->PortConnect(refnum, src, dst);
        }
        void PortDisconnect(int refnum, const char* src, const char* dst, int* result)
        {
            *result = fEngine->PortDisconnect(refnum, src, dst);
        }

        void PortConnect(int refnum, jack_port_id_t src, jack_port_id_t dst, int* result)
        {
            *result = fEngine->PortConnect(refnum, src, dst);
        }
        void PortDisconnect(int refnum, jack_port_id_t src, jack_port_id_t dst, int* result)
        {
            *result = fEngine->PortDisconnect(refnum, src, dst);
        }

102
        void SetBufferSize(jack_nframes_t buffer_size, int* result)
sletz's avatar
sletz committed
103
        {
104
            *result = fServer->SetBufferSize(buffer_size);
sletz's avatar
sletz committed
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
        }
        void SetFreewheel(int onoff, int* result)
        {
            *result = fServer->SetFreewheel(onoff);
        }

        // A FINIR
        virtual void ReleaseTimebase(int refnum, int* result)
        {
            *result = fEngine->ReleaseTimebase(refnum);
        }

        virtual void SetTimebaseCallback(int refnum, int conditional, int* result)
        {
            *result = fEngine->SetTimebaseCallback(refnum, conditional);
        }

};

} // end of namespace

#endif