Changeset 1445
- Timestamp:
- 2008-08-18 19:33:04 (5 years ago)
- Location:
- ingen/src/libs
- Files:
-
- 6 edited
-
client/OSCClientReceiver.cpp (modified) (20 diffs)
-
client/OSCClientReceiver.hpp (modified) (3 diffs)
-
client/SigClientInterface.hpp (modified) (1 diff)
-
gui/App.cpp (modified) (3 diffs)
-
gui/App.hpp (modified) (4 diffs)
-
gui/ConnectWindow.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ingen/src/libs/client/OSCClientReceiver.cpp
r1443 r1445 30 30 namespace Client { 31 31 32 33 OSCClientReceiver::OSCClientReceiver(int listen_port) 34 : _listen_port(listen_port) 32 33 OSCClientReceiver::OSCClientReceiver(int listen_port, SharedPtr<Shared::ClientInterface> target) 34 : _target(target) 35 , _listen_port(listen_port) 35 36 , _st(NULL) 36 37 { … … 166 167 OSCClientReceiver::_error_cb(const char* path, const char* types, lo_arg** argv, int argc, lo_message msg) 167 168 { 168 error((char*)argv[0]);169 _target->error((char*)argv[0]); 169 170 return 0; 170 171 } … … 174 175 OSCClientReceiver::_new_patch_cb(const char* path, const char* types, lo_arg** argv, int argc, lo_message msg) 175 176 { 176 new_patch(&argv[0]->s, argv[1]->i); // path, poly177 _target->new_patch(&argv[0]->s, argv[1]->i); // path, poly 177 178 return 0; 178 179 } … … 182 183 OSCClientReceiver::_destroyed_cb(const char* path, const char* types, lo_arg** argv, int argc, lo_message msg) 183 184 { 184 destroy((const char*)&argv[0]->s);185 _target->destroy((const char*)&argv[0]->s); 185 186 return 0; 186 187 } … … 190 191 OSCClientReceiver::_patch_cleared_cb(const char* path, const char* types, lo_arg** argv, int argc, lo_message msg) 191 192 { 192 patch_cleared((const char*)&argv[0]->s);193 _target->patch_cleared((const char*)&argv[0]->s); 193 194 return 0; 194 195 } … … 198 199 OSCClientReceiver::_object_renamed_cb(const char* path, const char* types, lo_arg** argv, int argc, lo_message msg) 199 200 { 200 object_renamed((const char*)&argv[0]->s, (const char*)&argv[1]->s);201 _target->object_renamed((const char*)&argv[0]->s, (const char*)&argv[1]->s); 201 202 return 0; 202 203 } … … 209 210 const char* const dst_port_path = &argv[1]->s; 210 211 211 connect(src_port_path, dst_port_path);212 _target->connect(src_port_path, dst_port_path); 212 213 213 214 return 0; … … 221 222 const char* dst_port_path = &argv[1]->s; 222 223 223 disconnect(src_port_path, dst_port_path);224 _target->disconnect(src_port_path, dst_port_path); 224 225 225 226 return 0; … … 235 236 const char* node_path = &argv[1]->s; 236 237 237 new_node(uri, node_path);238 _target->new_node(uri, node_path); 238 239 239 240 return 0; … … 251 252 const bool is_output = (argv[3]->i == 1); 252 253 253 new_port(port_path, index, type, is_output);254 _target->new_port(port_path, index, type, is_output); 254 255 255 256 return 0; … … 270 271 Atom value = AtomLiblo::lo_arg_to_atom(types[2], argv[2]); 271 272 272 set_variable(obj_path, key, value);273 _target->set_variable(obj_path, key, value); 273 274 274 275 return 0; … … 289 290 Atom value = AtomLiblo::lo_arg_to_atom(types[2], argv[2]); 290 291 291 set_property(obj_path, key, value);292 _target->set_property(obj_path, key, value); 292 293 293 294 return 0; … … 301 302 const float value = argv[1]->f; 302 303 303 set_port_value(port_path, value);304 _target->set_port_value(port_path, value); 304 305 305 306 return 0; … … 314 315 const float value = argv[2]->f; 315 316 316 set_voice_value(port_path, voice, value);317 _target->set_voice_value(port_path, voice, value); 317 318 318 319 return 0; … … 325 326 const char* const port_path = &argv[0]->s; 326 327 327 port_activity(port_path);328 _target->port_activity(port_path); 328 329 329 330 return 0; … … 335 336 { 336 337 assert(!strcmp(types, "i")); 337 response_ok(argv[0]->i);338 _target->response_ok(argv[0]->i); 338 339 339 340 return 0; … … 345 346 { 346 347 assert(!strcmp(types, "is")); 347 response_error(argv[0]->i, &argv[1]->s);348 _target->response_error(argv[0]->i, &argv[1]->s); 348 349 349 350 return 0; … … 357 358 { 358 359 assert(argc == 4 && !strcmp(types, "ssss")); 359 new_plugin(&argv[0]->s, &argv[1]->s, &argv[2]->s, &argv[3]->s); // uri, type, symbol, name360 _target->new_plugin(&argv[0]->s, &argv[1]->s, &argv[2]->s, &argv[3]->s); // uri, type, symbol, name 360 361 361 362 return 0; … … 371 372 const char* name = &argv[3]->s; 372 373 373 program_add(node_path, bank, program, name);374 _target->program_add(node_path, bank, program, name); 374 375 375 376 return 0; … … 384 385 int32_t program = argv[2]->i; 385 386 386 program_remove(node_path, bank, program);387 _target->program_remove(node_path, bank, program); 387 388 388 389 return 0; -
ingen/src/libs/client/OSCClientReceiver.hpp
r1442 r1445 23 23 #include <lo/lo.h> 24 24 #include "interface/ClientInterface.hpp" 25 #include "raul/Deletable.hpp" 25 26 26 27 namespace Ingen { … … 56 57 * \ingroup IngenClient 57 58 */ 58 class OSCClientReceiver : boost::noncopyable, virtual public Ingen::Shared::ClientInterface59 class OSCClientReceiver : public boost::noncopyable, public Raul::Deletable 59 60 { 60 61 public: 61 OSCClientReceiver(int listen_port );62 OSCClientReceiver(int listen_port, SharedPtr<Shared::ClientInterface> target); 62 63 ~OSCClientReceiver(); 63 64 … … 76 77 static int unknown_cb(const char* path, const char* types, lo_arg** argv, int argc, void* data, void* osc_receiver); 77 78 79 SharedPtr<Shared::ClientInterface> _target; 80 78 81 int _listen_port; 79 82 lo_server_thread _st; -
ingen/src/libs/client/SigClientInterface.hpp
r1443 r1445 38 38 * documentation for ClientInterface for meanings of signal parameters. 39 39 */ 40 class SigClientInterface : virtualpublic Ingen::Shared::ClientInterface, public sigc::trackable40 class SigClientInterface : public Ingen::Shared::ClientInterface, public sigc::trackable 41 41 { 42 42 public: -
ingen/src/libs/gui/App.cpp
r1428 r1445 143 143 144 144 void 145 App::attach(SharedPtr<SigClientInterface> client) 145 App::attach(SharedPtr<SigClientInterface> client, 146 SharedPtr<Raul::Deletable> handle) 146 147 { 147 148 assert( ! _client); … … 152 153 153 154 _client = client; 155 _handle = handle; 154 156 _store = SharedPtr<ClientStore>(new ClientStore(_world->engine, client)); 155 157 _loader = SharedPtr<ThreadedLoader>(new ThreadedLoader(_world->engine)); … … 172 174 _store.reset(); 173 175 _client.reset(); 176 _handle.reset(); 174 177 _world->engine.reset(); 175 178 } -
ingen/src/libs/gui/App.hpp
r1443 r1445 38 38 namespace Shared { 39 39 class EngineInterface; 40 class ClientInterface; 40 41 class World; 41 42 } … … 86 87 void error_message(const string& msg); 87 88 88 void attach(SharedPtr<SigClientInterface> client); 89 void attach(SharedPtr<SigClientInterface> client, 90 SharedPtr<Raul::Deletable> handle=SharedPtr<Raul::Deletable>()); 91 89 92 void detach(); 90 93 … … 107 110 Glib::RefPtr<Gdk::Pixbuf> icon_from_path(const string& path, int size); 108 111 109 const SharedPtr<EngineInterface> engine() const { return _world->engine; }112 const SharedPtr<EngineInterface>& engine() const { return _world->engine; } 110 113 const SharedPtr<SigClientInterface>& client() const { return _client; } 111 114 const SharedPtr<ClientStore>& store() const { return _store; } … … 144 147 145 148 SharedPtr<SigClientInterface> _client; 149 SharedPtr<Raul::Deletable> _handle; 146 150 SharedPtr<ClientStore> _store; 147 151 SharedPtr<Serialiser> _serialiser; -
ingen/src/libs/gui/ConnectWindow.cpp
r1405 r1445 45 45 46 46 47 // Paste together some interfaces to get the combination we want48 49 50 struct OSCSigEmitter : public OSCClientReceiver, public ThreadedSigClientInterface {51 OSCSigEmitter(size_t queue_size, int listen_port)52 : Ingen::Shared::ClientInterface()53 , OSCClientReceiver(listen_port)54 , ThreadedSigClientInterface(queue_size)55 {56 }57 };58 59 60 47 // ConnectWindow 61 48 … … 171 158 } 172 159 173 OSCSigEmitter* ose = new OSCSigEmitter(1024, 16181); // FIXME: args 174 SharedPtr<ThreadedSigClientInterface> client(ose); 175 App::instance().attach(client); 160 // FIXME: static args 161 SharedPtr<ThreadedSigClientInterface> tsci(new ThreadedSigClientInterface(1024)); 162 SharedPtr<OSCClientReceiver> client(new OSCClientReceiver(16181, tsci)); 163 App::instance().attach(tsci, client); 176 164 177 165 Glib::signal_timeout().connect( … … 192 180 new OSCEngineSender(string("osc.udp://localhost:").append(port_str))); 193 181 194 OSCSigEmitter* ose = new OSCSigEmitter(1024, 16181); // FIXME: args 195 SharedPtr<ThreadedSigClientInterface> client(ose); 196 App::instance().attach(client); 182 // FIXME: static args 183 SharedPtr<ThreadedSigClientInterface> tsci(new ThreadedSigClientInterface(1024)); 184 SharedPtr<OSCClientReceiver> client(new OSCClientReceiver(16181, tsci)); 185 App::instance().attach(tsci, client); 197 186 198 187 Glib::signal_timeout().connect(
Note: See TracChangeset
for help on using the changeset viewer.
