Changeset 1445


Ignore:
Timestamp:
08/18/08 19:33:04 (6 years ago)
Author:
drobilla
Message:

Remove weird virtual inheritance interface overlay thing from client in favour of wrappers.

Location:
ingen/src/libs
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • ingen/src/libs/client/OSCClientReceiver.cpp

    r1443 r1445  
    3030namespace Client { 
    3131 
    32      
    33 OSCClientReceiver::OSCClientReceiver(int listen_port) 
    34     : _listen_port(listen_port) 
     32 
     33OSCClientReceiver::OSCClientReceiver(int listen_port, SharedPtr<Shared::ClientInterface> target) 
     34    : _target(target) 
     35    , _listen_port(listen_port) 
    3536    , _st(NULL) 
    3637{ 
     
    166167OSCClientReceiver::_error_cb(const char* path, const char* types, lo_arg** argv, int argc, lo_message msg) 
    167168{ 
    168     error((char*)argv[0]); 
     169    _target->error((char*)argv[0]); 
    169170    return 0; 
    170171} 
     
    174175OSCClientReceiver::_new_patch_cb(const char* path, const char* types, lo_arg** argv, int argc, lo_message msg) 
    175176{ 
    176     new_patch(&argv[0]->s, argv[1]->i); // path, poly 
     177    _target->new_patch(&argv[0]->s, argv[1]->i); // path, poly 
    177178    return 0; 
    178179} 
     
    182183OSCClientReceiver::_destroyed_cb(const char* path, const char* types, lo_arg** argv, int argc, lo_message msg) 
    183184{ 
    184     destroy((const char*)&argv[0]->s); 
     185    _target->destroy((const char*)&argv[0]->s); 
    185186    return 0; 
    186187} 
     
    190191OSCClientReceiver::_patch_cleared_cb(const char* path, const char* types, lo_arg** argv, int argc, lo_message msg) 
    191192{ 
    192     patch_cleared((const char*)&argv[0]->s); 
     193    _target->patch_cleared((const char*)&argv[0]->s); 
    193194    return 0; 
    194195} 
     
    198199OSCClientReceiver::_object_renamed_cb(const char* path, const char* types, lo_arg** argv, int argc, lo_message msg) 
    199200{ 
    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); 
    201202    return 0; 
    202203} 
     
    209210    const char* const dst_port_path = &argv[1]->s; 
    210211     
    211     connect(src_port_path, dst_port_path); 
     212    _target->connect(src_port_path, dst_port_path); 
    212213 
    213214    return 0; 
     
    221222    const char* dst_port_path = &argv[1]->s; 
    222223 
    223     disconnect(src_port_path, dst_port_path); 
     224    _target->disconnect(src_port_path, dst_port_path); 
    224225 
    225226    return 0; 
     
    235236    const char*   node_path  = &argv[1]->s; 
    236237 
    237     new_node(uri, node_path); 
     238    _target->new_node(uri, node_path); 
    238239 
    239240    return 0; 
     
    251252    const bool     is_output = (argv[3]->i == 1); 
    252253 
    253     new_port(port_path, index, type, is_output); 
     254    _target->new_port(port_path, index, type, is_output); 
    254255     
    255256    return 0;    
     
    270271    Atom value = AtomLiblo::lo_arg_to_atom(types[2], argv[2]); 
    271272 
    272     set_variable(obj_path, key, value); 
     273    _target->set_variable(obj_path, key, value); 
    273274 
    274275    return 0;    
     
    289290    Atom value = AtomLiblo::lo_arg_to_atom(types[2], argv[2]); 
    290291 
    291     set_property(obj_path, key, value); 
     292    _target->set_property(obj_path, key, value); 
    292293 
    293294    return 0;    
     
    301302    const float       value      =  argv[1]->f; 
    302303 
    303     set_port_value(port_path, value); 
     304    _target->set_port_value(port_path, value); 
    304305 
    305306    return 0;    
     
    314315    const float       value      =  argv[2]->f; 
    315316 
    316     set_voice_value(port_path, voice, value); 
     317    _target->set_voice_value(port_path, voice, value); 
    317318 
    318319    return 0;    
     
    325326    const char* const port_path = &argv[0]->s; 
    326327 
    327     port_activity(port_path); 
     328    _target->port_activity(port_path); 
    328329 
    329330    return 0;    
     
    335336{ 
    336337    assert(!strcmp(types, "i")); 
    337     response_ok(argv[0]->i); 
     338    _target->response_ok(argv[0]->i); 
    338339 
    339340    return 0; 
     
    345346{ 
    346347    assert(!strcmp(types, "is")); 
    347     response_error(argv[0]->i, &argv[1]->s); 
     348    _target->response_error(argv[0]->i, &argv[1]->s); 
    348349 
    349350    return 0; 
     
    357358{ 
    358359    assert(argc == 4 && !strcmp(types, "ssss")); 
    359     new_plugin(&argv[0]->s, &argv[1]->s, &argv[2]->s, &argv[3]->s); // uri, type, symbol, name 
     360    _target->new_plugin(&argv[0]->s, &argv[1]->s, &argv[2]->s, &argv[3]->s); // uri, type, symbol, name 
    360361 
    361362    return 0;    
     
    371372    const char* name       = &argv[3]->s; 
    372373 
    373     program_add(node_path, bank, program, name); 
     374    _target->program_add(node_path, bank, program, name); 
    374375 
    375376    return 0;    
     
    384385    int32_t     program    =  argv[2]->i; 
    385386 
    386     program_remove(node_path, bank, program); 
     387    _target->program_remove(node_path, bank, program); 
    387388 
    388389    return 0;    
  • ingen/src/libs/client/OSCClientReceiver.hpp

    r1442 r1445  
    2323#include <lo/lo.h> 
    2424#include "interface/ClientInterface.hpp" 
     25#include "raul/Deletable.hpp" 
    2526 
    2627namespace Ingen { 
     
    5657 * \ingroup IngenClient 
    5758 */ 
    58 class OSCClientReceiver : boost::noncopyable, virtual public Ingen::Shared::ClientInterface 
     59class OSCClientReceiver : public boost::noncopyable, public Raul::Deletable 
    5960{ 
    6061public: 
    61     OSCClientReceiver(int listen_port); 
     62    OSCClientReceiver(int listen_port, SharedPtr<Shared::ClientInterface> target); 
    6263    ~OSCClientReceiver(); 
    6364 
     
    7677    static int  unknown_cb(const char* path, const char* types, lo_arg** argv, int argc, void* data, void* osc_receiver); 
    7778     
     79    SharedPtr<Shared::ClientInterface> _target; 
     80 
    7881    int              _listen_port; 
    7982    lo_server_thread _st; 
  • ingen/src/libs/client/SigClientInterface.hpp

    r1443 r1445  
    3838 * documentation for ClientInterface for meanings of signal parameters. 
    3939 */ 
    40 class SigClientInterface : virtual public Ingen::Shared::ClientInterface, public sigc::trackable 
     40class SigClientInterface : public Ingen::Shared::ClientInterface, public sigc::trackable 
    4141{ 
    4242public: 
  • ingen/src/libs/gui/App.cpp

    r1428 r1445  
    143143 
    144144void 
    145 App::attach(SharedPtr<SigClientInterface> client) 
     145App::attach(SharedPtr<SigClientInterface> client, 
     146            SharedPtr<Raul::Deletable>    handle) 
    146147{ 
    147148    assert( ! _client); 
     
    152153     
    153154    _client = client; 
     155    _handle = handle; 
    154156    _store = SharedPtr<ClientStore>(new ClientStore(_world->engine, client)); 
    155157    _loader = SharedPtr<ThreadedLoader>(new ThreadedLoader(_world->engine)); 
     
    172174        _store.reset(); 
    173175        _client.reset(); 
     176        _handle.reset(); 
    174177        _world->engine.reset(); 
    175178    } 
  • ingen/src/libs/gui/App.hpp

    r1443 r1445  
    3838    namespace Shared { 
    3939        class EngineInterface; 
     40        class ClientInterface; 
    4041        class World; 
    4142    } 
     
    8687    void error_message(const string& msg); 
    8788 
    88     void attach(SharedPtr<SigClientInterface> client); 
     89    void attach(SharedPtr<SigClientInterface> client, 
     90                SharedPtr<Raul::Deletable>    handle=SharedPtr<Raul::Deletable>()); 
     91 
    8992    void detach(); 
    9093     
     
    107110    Glib::RefPtr<Gdk::Pixbuf>            icon_from_path(const string& path, int size); 
    108111 
    109     const SharedPtr<EngineInterface>     engine()     const { return _world->engine; } 
     112    const SharedPtr<EngineInterface>&    engine()     const { return _world->engine; } 
    110113    const SharedPtr<SigClientInterface>& client()     const { return _client; } 
    111114    const SharedPtr<ClientStore>&        store()      const { return _store; } 
     
    144147     
    145148    SharedPtr<SigClientInterface> _client; 
     149    SharedPtr<Raul::Deletable>    _handle; 
    146150    SharedPtr<ClientStore>        _store; 
    147151    SharedPtr<Serialiser>         _serialiser; 
  • ingen/src/libs/gui/ConnectWindow.cpp

    r1405 r1445  
    4545 
    4646 
    47 // Paste together some interfaces to get the combination we want 
    48  
    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  
    6047// ConnectWindow 
    6148 
     
    171158        } 
    172159 
    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); 
    176164         
    177165        Glib::signal_timeout().connect( 
     
    192180                    new OSCEngineSender(string("osc.udp://localhost:").append(port_str))); 
    193181 
    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); 
    197186 
    198187            Glib::signal_timeout().connect( 
Note: See TracChangeset for help on using the changeset viewer.