Changeset 2504

Show
Ignore:
Timestamp:
02/25/10 22:01:18 (7 months ago)
Author:
drobilla
Message:

Remove request_plugins from EngineInterface? (and RequestPlugins? event from engine), replacing with get of magic URI "ingen:plugins".

Location:
trunk/ingen/src
Files:
2 removed
15 modified

Legend:

Unmodified
Added
Removed
  • trunk/ingen/src/client/HTTPEngineSender.cpp

    r2503 r2504  
    225225 
    226226 
    227 void 
    228 HTTPEngineSender::request_plugins() 
    229 { 
    230         SoupMessage* msg = soup_message_new("GET", (_engine_url.str() + "/plugins").c_str()); 
    231         HTTPClientReceiver::send(msg); 
    232 } 
    233  
    234  
    235227} // namespace Client 
    236228} // namespace Ingen 
  • trunk/ingen/src/client/HTTPEngineSender.hpp

    r2503 r2504  
    110110        void get(const Raul::URI& uri); 
    111111        void request_property(const Raul::URI& path, const Raul::URI& key); 
    112         void request_plugins(); 
    113112 
    114113protected: 
  • trunk/ingen/src/client/OSCEngineSender.cpp

    r2503 r2504  
    262262 
    263263 
    264 void 
    265 OSCEngineSender::request_plugins() 
    266 { 
    267         send("/request_plugins", "i", next_id(), LO_ARGS_END); 
    268 } 
    269  
    270  
    271264} // namespace Client 
    272265} // namespace Ingen 
  • trunk/ingen/src/client/OSCEngineSender.hpp

    r2503 r2504  
    107107        void get(const Raul::URI& uri); 
    108108        void request_property(const Raul::URI& path, const Raul::URI& key); 
    109         void request_plugins(); 
    110109 
    111110protected: 
  • trunk/ingen/src/common/interface/EngineInterface.hpp

    r2503 r2504  
    6767        virtual void request_property(const Raul::URI& uri, 
    6868                                      const Raul::URI& key) = 0; 
    69  
    70         virtual void request_plugins() = 0; 
    7169}; 
    7270 
  • trunk/ingen/src/engine/events.hpp

    r2503 r2504  
    3737#include "events/RegisterClient.hpp" 
    3838#include "events/RequestMetadata.hpp" 
    39 #include "events/RequestPlugins.hpp" 
    4039#include "events/SetMetadata.hpp" 
    4140#include "events/SetPortValue.hpp" 
  • trunk/ingen/src/engine/events/Get.cpp

    r2503 r2504  
    5050Get::pre_process() 
    5151{ 
    52         if (Path::is_valid(_uri.str())) 
     52        if (_uri == "ingen:plugins") { 
     53                _plugins = _engine.node_factory()->plugins(); 
     54        } else if (Path::is_valid(_uri.str())) { 
    5355                _object = _engine.engine_store()->find_object(Path(_uri.str())); 
    54         else 
     56        } else { 
    5557                _plugin = _engine.node_factory()->plugin(_uri); 
     58        } 
    5659 
    5760        QueuedEvent::pre_process(); 
     
    6063 
    6164void 
    62 Get::execute(ProcessContext& context) 
    63 { 
    64         QueuedEvent::execute(context); 
    65         assert(_time >= context.start() && _time <= context.end()); 
    66 } 
    67  
    68  
    69 void 
    7065Get::post_process() 
    7166{ 
    72         if (!_object && !_plugin) { 
     67        if (_uri == "ingen:plugins") { 
     68                _request->respond_ok(); 
     69                _engine.broadcaster()->send_plugins_to(_request->client(), _plugins); 
     70        } else if (!_object && !_plugin) { 
    7371                _request->respond_error("Unable to find object requested."); 
    7472        } else if (_request->client()) { 
  • trunk/ingen/src/engine/events/Get.hpp

    r2417 r2504  
    2020 
    2121#include "QueuedEvent.hpp" 
     22#include "NodeFactory.hpp" 
    2223#include "types.hpp" 
    2324 
     
    4445 
    4546        void pre_process(); 
    46         void execute(ProcessContext& context); 
    4747        void post_process(); 
    4848 
    4949private: 
    50         const Raul::URI   _uri; 
    51         GraphObjectImpl*  _object; 
    52         const PluginImpl* _plugin; 
     50        const Raul::URI      _uri; 
     51        GraphObjectImpl*     _object; 
     52        const PluginImpl*    _plugin; 
     53        NodeFactory::Plugins _plugins; 
    5354}; 
    5455 
  • trunk/ingen/src/engine/OSCEngineReceiver.cpp

    r2503 r2504  
    113113        lo_server_add_method(_server, "/request_property", "iss", request_property_cb, this); 
    114114        lo_server_add_method(_server, "/get", "is", get_cb, this); 
    115         lo_server_add_method(_server, "/request_plugins", "i", request_plugins_cb, this); 
    116         lo_server_add_method(_server, "/request_all_objects", "i", request_all_objects_cb, this); 
    117115 
    118116        lo_server_add_method(_server, NULL, NULL, unknown_cb, NULL); 
     
    634632 
    635633 
    636 /** \page engine_osc_namespace 
    637  * <h2>/request_plugins</h2> 
    638  * \arg \b response-id (integer) 
    639  * 
    640  * Request the engine send a list of all known plugins. 
    641  */ 
    642 int 
    643 OSCEngineReceiver::_request_plugins_cb(const char* path, const char* types, lo_arg** argv, int argc, lo_message msg) 
    644 { 
    645         request_plugins(); 
    646         return 0; 
    647 } 
    648  
    649  
    650  
    651634//  Static Callbacks // 
    652635 
  • trunk/ingen/src/engine/OSCEngineReceiver.hpp

    r2458 r2504  
    113113        LO_HANDLER(property_set); 
    114114        LO_HANDLER(request_property); 
    115         LO_HANDLER(request_plugins); 
    116         LO_HANDLER(request_all_objects); 
    117115 
    118116        lo_server _server; 
  • trunk/ingen/src/engine/QueuedEngineInterface.cpp

    r2503 r2504  
    265265 
    266266 
    267 void 
    268 QueuedEngineInterface::request_plugins() 
    269 { 
    270         push_queued(new Events::RequestPlugins(_engine, _request, now())); 
    271 } 
    272  
    273  
    274267} // namespace Ingen 
  • trunk/ingen/src/engine/QueuedEngineInterface.hpp

    r2503 r2504  
    103103        virtual void get(const Raul::URI& uri); 
    104104        virtual void request_property(const Raul::URI& object_path, const Raul::URI& key); 
    105         virtual void request_plugins(); 
    106105 
    107106protected: 
  • trunk/ingen/src/engine/wscript

    r2503 r2504  
    4949                events/RegisterClient.cpp 
    5050                events/RequestMetadata.cpp 
    51                 events/RequestPlugins.cpp 
    5251                events/SendBinding.cpp 
    5352                events/SendPortActivity.cpp 
  • trunk/ingen/src/gui/ConnectWindow.cpp

    r2503 r2504  
    463463                } 
    464464        } else if (_connect_stage == 4) { 
    465                 App::instance().engine()->request_plugins(); 
     465                App::instance().engine()->get("ingen:plugins"); 
    466466                hide(); 
    467467                if (_widgets_loaded) 
  • trunk/ingen/src/ingen/main.cpp

    r2497 r2504  
    219219                        engine_interface->load_plugins(); 
    220220                        if (conf.option("gui").get_bool()) 
    221                                 engine_interface->request_plugins(); 
     221                                engine_interface->get("ingen:plugins"); 
    222222                        world->parser->parse_document( 
    223223                                        world, engine_interface.get(), uri, data_path, parent, symbol);