1 |
/* |
---|
2 |
* Copyright (C) 2005-2007 by Pieter Palmers |
---|
3 |
* |
---|
4 |
* This file is part of FFADO |
---|
5 |
* FFADO = Free Firewire (pro-)audio drivers for linux |
---|
6 |
* |
---|
7 |
* FFADO is based upon FreeBoB |
---|
8 |
* |
---|
9 |
* This library is free software; you can redistribute it and/or |
---|
10 |
* modify it under the terms of the GNU Lesser General Public |
---|
11 |
* License version 2.1, as published by the Free Software Foundation; |
---|
12 |
* |
---|
13 |
* This library is distributed in the hope that it will be useful, |
---|
14 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
15 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
16 |
* Lesser General Public License for more details. |
---|
17 |
* |
---|
18 |
* You should have received a copy of the GNU Lesser General Public |
---|
19 |
* License along with this library; if not, write to the Free Software |
---|
20 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
---|
21 |
* MA 02110-1301 USA |
---|
22 |
*/ |
---|
23 |
|
---|
24 |
#include <lo/lo.h> |
---|
25 |
|
---|
26 |
#include "OscClient.h" |
---|
27 |
#include "OscMessage.h" |
---|
28 |
#include "OscResponse.h" |
---|
29 |
|
---|
30 |
#include <assert.h> |
---|
31 |
|
---|
32 |
namespace OSC { |
---|
33 |
|
---|
34 |
IMPL_DEBUG_MODULE( OscClient, OscClient, DEBUG_LEVEL_VERBOSE ); |
---|
35 |
|
---|
36 |
OscClient::OscClient(string target) |
---|
37 |
: m_target(target) |
---|
38 |
{ |
---|
39 |
|
---|
40 |
} |
---|
41 |
|
---|
42 |
OscClient::~OscClient() { |
---|
43 |
|
---|
44 |
} |
---|
45 |
|
---|
46 |
void |
---|
47 |
OscClient::setVerboseLevel(int l) { |
---|
48 |
setDebugLevel(l); |
---|
49 |
} |
---|
50 |
|
---|
51 |
bool |
---|
52 |
OscClient::init() |
---|
53 |
{ |
---|
54 |
|
---|
55 |
return true; |
---|
56 |
} |
---|
57 |
|
---|
58 |
// callbacks |
---|
59 |
|
---|
60 |
void |
---|
61 |
OscClient::error_cb(int num, const char* msg, const char* path) |
---|
62 |
{ |
---|
63 |
debugError("liblo server error %d in path %s, message: %s\n", num, path, msg); |
---|
64 |
} |
---|
65 |
|
---|
66 |
// Display incoming OSC messages (for debugging purposes) |
---|
67 |
int |
---|
68 |
OscClient::generic_cb(const char* path, const char* types, lo_arg** argv, int argc, lo_message msg, void* user_data) |
---|
69 |
{ |
---|
70 |
OscClient *client=reinterpret_cast<OscClient *>(user_data); |
---|
71 |
assert(client); |
---|
72 |
|
---|
73 |
debugOutput(DEBUG_LEVEL_VERBOSE, "Message on: %s\n", path); |
---|
74 |
|
---|
75 |
} |
---|
76 |
|
---|
77 |
|
---|
78 |
} // end of namespace OSC |
---|