diff options
author | David Robillard <d@drobilla.net> | 2008-09-28 04:55:46 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-09-28 04:55:46 +0000 |
commit | 46459ab2f46fdb826102562c266b0bc2921a3737 (patch) | |
tree | 892a8974c7a42316fc29e07c039360dbebbdce91 /src/libs/gui | |
parent | d83003cd073380fe0a28cd1b3ce40dc7ab072fe0 (diff) | |
download | ingen-46459ab2f46fdb826102562c266b0bc2921a3737.tar.gz ingen-46459ab2f46fdb826102562c266b0bc2921a3737.tar.bz2 ingen-46459ab2f46fdb826102562c266b0bc2921a3737.zip |
Remove header namespace pollution (particularly from libs/gui/App.hpp).
Fix more LV2 plugin RDF race/lock issues with -eg.
Show human readable names on new ports when human readable is set (fix ticket #202).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1523 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/gui')
-rw-r--r-- | src/libs/gui/App.hpp | 53 | ||||
-rw-r--r-- | src/libs/gui/Configuration.hpp | 7 | ||||
-rw-r--r-- | src/libs/gui/ConnectWindow.cpp | 1 | ||||
-rw-r--r-- | src/libs/gui/ControlPanel.cpp | 2 | ||||
-rw-r--r-- | src/libs/gui/LoadPatchWindow.cpp | 1 | ||||
-rw-r--r-- | src/libs/gui/LoadPluginWindow.hpp | 2 | ||||
-rw-r--r-- | src/libs/gui/LoadRemotePatchWindow.cpp | 1 | ||||
-rw-r--r-- | src/libs/gui/LoadSubpatchWindow.cpp | 1 | ||||
-rw-r--r-- | src/libs/gui/NodeModule.cpp | 9 | ||||
-rw-r--r-- | src/libs/gui/PatchCanvas.cpp | 1 | ||||
-rw-r--r-- | src/libs/gui/PatchPortModule.cpp | 2 | ||||
-rw-r--r-- | src/libs/gui/PatchTreeWindow.cpp | 2 | ||||
-rw-r--r-- | src/libs/gui/PatchTreeWindow.hpp | 10 | ||||
-rw-r--r-- | src/libs/gui/Port.cpp | 10 | ||||
-rw-r--r-- | src/libs/gui/Port.hpp | 6 | ||||
-rw-r--r-- | src/libs/gui/PortPropertiesWindow.cpp | 2 | ||||
-rw-r--r-- | src/libs/gui/RenameWindow.cpp | 1 |
17 files changed, 68 insertions, 43 deletions
diff --git a/src/libs/gui/App.hpp b/src/libs/gui/App.hpp index 08ceb271..4a4b6580 100644 --- a/src/libs/gui/App.hpp +++ b/src/libs/gui/App.hpp @@ -15,23 +15,20 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef APP_H -#define APP_H +#ifndef INGEN_APP_HPP +#define INGEN_APP_HPP #include <cassert> #include <string> #include <map> -#include <list> +#include <utility> #include <iostream> #include <libgnomecanvasmm.h> #include <gtkmm.h> #include <libglademm.h> #include <raul/SharedPtr.hpp> -#include <redlandmm/World.hpp> +#include <raul/Deletable.hpp> #include <module/World.hpp> -#include <shared/Store.hpp> - -using namespace std; namespace Ingen { class Engine; @@ -51,10 +48,6 @@ namespace Ingen { } } -using namespace Ingen::Shared; -using namespace Ingen::Serialisation; -using namespace Ingen::Client; - /** \defgroup GUI GTK GUI */ @@ -84,10 +77,10 @@ class App public: ~App(); - void error_message(const string& msg); + void error_message(const std::string& msg); - void attach(SharedPtr<SigClientInterface> client, - SharedPtr<Raul::Deletable> handle=SharedPtr<Raul::Deletable>()); + void attach(SharedPtr<Client::SigClientInterface> client, + SharedPtr<Raul::Deletable> handle=SharedPtr<Raul::Deletable>()); void detach(); @@ -110,14 +103,14 @@ public: Configuration* configuration() const { return _configuration; } WindowFactory* window_factory() const { return _window_factory; } - Glib::RefPtr<Gdk::Pixbuf> icon_from_path(const string& path, int size); + Glib::RefPtr<Gdk::Pixbuf> icon_from_path(const std::string& path, int size); - const SharedPtr<EngineInterface>& engine() const { return _world->engine; } - const SharedPtr<SigClientInterface>& client() const { return _client; } - const SharedPtr<ClientStore>& store() const { return _store; } - const SharedPtr<ThreadedLoader>& loader() const { return _loader; } + const SharedPtr<Shared::EngineInterface>& engine() const { return _world->engine; } + const SharedPtr<Client::SigClientInterface>& client() const { return _client; } + const SharedPtr<Client::ClientStore>& store() const { return _store; } + const SharedPtr<ThreadedLoader>& loader() const { return _loader; } - const SharedPtr<Serialiser>& serialiser(); + const SharedPtr<Serialisation::Serialiser>& serialiser(); static inline App& instance() { assert(_instance); return *_instance; } @@ -130,29 +123,31 @@ protected: /** This is needed for the icon map. */ template <typename A, typename B> struct LexicalCompare { - bool operator()(const pair<A, B>& p1, const pair<A, B>& p2) { + bool operator()(const std::pair<A, B>& p1, const std::pair<A, B>& p2) { return (p1.first < p2.first) || ((p1.first == p2.first) && (p1.second < p2.second)); } }; - typedef map<pair<string, int>, Gdk::Pixbuf*, LexicalCompare<string, int> > Icons; + typedef std::map< std::pair<std::string, int>, + Gdk::Pixbuf*, + LexicalCompare<std::string, int> > Icons; Icons _icons; App(Ingen::Shared::World* world); bool animate(); - void error_response(int32_t id, const string& str); + void error_response(int32_t id, const std::string& str); static void* icon_destroyed(void* data); static App* _instance; - SharedPtr<SigClientInterface> _client; - SharedPtr<Raul::Deletable> _handle; - SharedPtr<ClientStore> _store; - SharedPtr<Serialiser> _serialiser; - SharedPtr<ThreadedLoader> _loader; + SharedPtr<Client::SigClientInterface> _client; + SharedPtr<Raul::Deletable> _handle; + SharedPtr<Client::ClientStore> _store; + SharedPtr<Serialisation::Serialiser> _serialiser; + SharedPtr<ThreadedLoader> _loader; Configuration* _configuration; @@ -174,5 +169,5 @@ protected: } // namespace GUI } // namespace Ingen -#endif // APP_H +#endif // INGEN_APP_HPP diff --git a/src/libs/gui/Configuration.hpp b/src/libs/gui/Configuration.hpp index 5baa7a09..124b41c8 100644 --- a/src/libs/gui/Configuration.hpp +++ b/src/libs/gui/Configuration.hpp @@ -52,11 +52,18 @@ public: void set_patch_folder(const string& f) { _patch_folder = f; } uint32_t get_port_color(const PortModel* pi); + + enum NameStyle { PATH, HUMAN }; + + NameStyle name_style() const { return _name_style; } + void set_name_style(NameStyle s) { _name_style = s; } private: /** Most recent patch folder shown in open dialog */ string _patch_folder; + NameStyle _name_style; + uint32_t _audio_port_color; uint32_t _control_port_color; uint32_t _event_port_color; diff --git a/src/libs/gui/ConnectWindow.cpp b/src/libs/gui/ConnectWindow.cpp index 3037ee88..5600a0b2 100644 --- a/src/libs/gui/ConnectWindow.cpp +++ b/src/libs/gui/ConnectWindow.cpp @@ -40,6 +40,7 @@ #include "ConnectWindow.hpp" using Ingen::QueuedEngineInterface; using Ingen::Client::ThreadedSigClientInterface; +using namespace std; namespace Ingen { namespace GUI { diff --git a/src/libs/gui/ControlPanel.cpp b/src/libs/gui/ControlPanel.cpp index 032f5758..0e637721 100644 --- a/src/libs/gui/ControlPanel.cpp +++ b/src/libs/gui/ControlPanel.cpp @@ -25,6 +25,8 @@ #include "Controls.hpp" #include "GladeFactory.hpp" +using namespace std; + namespace Ingen { namespace GUI { diff --git a/src/libs/gui/LoadPatchWindow.cpp b/src/libs/gui/LoadPatchWindow.cpp index 2f3b6af7..c33ad495 100644 --- a/src/libs/gui/LoadPatchWindow.cpp +++ b/src/libs/gui/LoadPatchWindow.cpp @@ -27,6 +27,7 @@ using namespace Ingen::Serialisation; using boost::optional; +using namespace std; namespace Ingen { namespace GUI { diff --git a/src/libs/gui/LoadPluginWindow.hpp b/src/libs/gui/LoadPluginWindow.hpp index a5246c39..98644dde 100644 --- a/src/libs/gui/LoadPluginWindow.hpp +++ b/src/libs/gui/LoadPluginWindow.hpp @@ -94,7 +94,7 @@ public: LoadPluginWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& xml); void set_patch(SharedPtr<PatchModel> patch); - void set_plugins(SharedPtr<const ClientStore::Plugins> plugins); + void set_plugins(SharedPtr<const Client::ClientStore::Plugins> plugins); void add_plugin(SharedPtr<PluginModel> plugin); diff --git a/src/libs/gui/LoadRemotePatchWindow.cpp b/src/libs/gui/LoadRemotePatchWindow.cpp index 5d4bcb5c..5567d67b 100644 --- a/src/libs/gui/LoadRemotePatchWindow.cpp +++ b/src/libs/gui/LoadRemotePatchWindow.cpp @@ -30,6 +30,7 @@ using boost::optional; using namespace Raul; +using namespace std; namespace Ingen { namespace GUI { diff --git a/src/libs/gui/LoadSubpatchWindow.cpp b/src/libs/gui/LoadSubpatchWindow.cpp index df954e48..52a989af 100644 --- a/src/libs/gui/LoadSubpatchWindow.cpp +++ b/src/libs/gui/LoadSubpatchWindow.cpp @@ -28,6 +28,7 @@ #include "Configuration.hpp" #include "ThreadedLoader.hpp" using boost::optional; +using namespace std; namespace Ingen { namespace GUI { diff --git a/src/libs/gui/NodeModule.cpp b/src/libs/gui/NodeModule.cpp index 09df174e..f8308264 100644 --- a/src/libs/gui/NodeModule.cpp +++ b/src/libs/gui/NodeModule.cpp @@ -31,6 +31,9 @@ #include "RenameWindow.hpp" #include "SubpatchModule.hpp" #include "WindowFactory.hpp" +#include "Configuration.hpp" + +using namespace std; namespace Ingen { namespace GUI { @@ -227,8 +230,12 @@ NodeModule::add_port(SharedPtr<PortModel> port, bool resize_to_fit) { uint32_t index = _ports.size(); // FIXME: kludge, engine needs to tell us this + string name = (App::instance().configuration()->name_style() == Configuration::PATH) + ? port->path().name() + : ((PluginModel*)node()->plugin())->port_human_name(index); + Module::add_port(boost::shared_ptr<Port>( - new Port(PtrCast<NodeModule>(shared_from_this()), port))); + new Port(PtrCast<NodeModule>(shared_from_this()), port, name))); port->signal_value_changed.connect(sigc::bind<0>( sigc::mem_fun(this, &NodeModule::value_changed), index)); diff --git a/src/libs/gui/PatchCanvas.cpp b/src/libs/gui/PatchCanvas.cpp index ddbbdc2b..f96a9f57 100644 --- a/src/libs/gui/PatchCanvas.cpp +++ b/src/libs/gui/PatchCanvas.cpp @@ -47,6 +47,7 @@ using Ingen::Client::ClientStore; using Ingen::Serialisation::Serialiser; using Ingen::Client::PluginModel; +using namespace std; namespace Ingen { namespace GUI { diff --git a/src/libs/gui/PatchPortModule.cpp b/src/libs/gui/PatchPortModule.cpp index 76bc8812..d8aaa91d 100644 --- a/src/libs/gui/PatchPortModule.cpp +++ b/src/libs/gui/PatchPortModule.cpp @@ -70,7 +70,7 @@ PatchPortModule::create(boost::shared_ptr<PatchCanvas> canvas, SharedPtr<PortMod new PatchPortModule(canvas, port)); assert(ret); - ret->_patch_port = boost::shared_ptr<Port>(new Port(ret, port, true)); + ret->_patch_port = boost::shared_ptr<Port>(new Port(ret, port, port->symbol(), true)); ret->add_port(ret->_patch_port); diff --git a/src/libs/gui/PatchTreeWindow.cpp b/src/libs/gui/PatchTreeWindow.cpp index 87393cec..4730da2b 100644 --- a/src/libs/gui/PatchTreeWindow.cpp +++ b/src/libs/gui/PatchTreeWindow.cpp @@ -25,6 +25,8 @@ #include "SubpatchModule.hpp" #include "WindowFactory.hpp" +using namespace std; + namespace Ingen { namespace GUI { diff --git a/src/libs/gui/PatchTreeWindow.hpp b/src/libs/gui/PatchTreeWindow.hpp index 5cd078a5..f549a322 100644 --- a/src/libs/gui/PatchTreeWindow.hpp +++ b/src/libs/gui/PatchTreeWindow.hpp @@ -45,12 +45,12 @@ public: void init(ClientStore& store); - void new_object(SharedPtr<ObjectModel> object); + void new_object(SharedPtr<Client::ObjectModel> object); void patch_property_changed(const string& key, const Raul::Atom& value, const Path& path); void patch_renamed(const Path& old_path, const Path& new_path); - void add_patch(SharedPtr<PatchModel> pm); + void add_patch(SharedPtr<Client::PatchModel> pm); void remove_patch(const Path& path); void show_patch_menu(GdkEventButton* ev); @@ -68,9 +68,9 @@ protected: PatchTreeModelColumns() { add(name_col); add(enabled_col); add(patch_model_col); } - Gtk::TreeModelColumn<Glib::ustring> name_col; - Gtk::TreeModelColumn<bool> enabled_col; - Gtk::TreeModelColumn<SharedPtr<PatchModel> > patch_model_col; + Gtk::TreeModelColumn<Glib::ustring> name_col; + Gtk::TreeModelColumn<bool> enabled_col; + Gtk::TreeModelColumn<SharedPtr<Client::PatchModel> > patch_model_col; }; bool _enable_signal; diff --git a/src/libs/gui/Port.cpp b/src/libs/gui/Port.cpp index 0452edc6..ab574f88 100644 --- a/src/libs/gui/Port.cpp +++ b/src/libs/gui/Port.cpp @@ -28,6 +28,7 @@ #include "GladeFactory.hpp" using namespace Ingen::Client; +using namespace std; namespace Ingen { namespace GUI { @@ -35,9 +36,12 @@ namespace GUI { /** @param flip Make an input port appear as an output port, and vice versa. */ -Port::Port(boost::shared_ptr<FlowCanvas::Module> module, SharedPtr<PortModel> pm, bool flip) - : FlowCanvas::Port(module, - pm->path().name(), +Port::Port( + boost::shared_ptr<FlowCanvas::Module> module, + SharedPtr<PortModel> pm, + const string& name, + bool flip) + : FlowCanvas::Port(module, name, flip ? (!pm->is_input()) : pm->is_input(), App::instance().configuration()->get_port_color(pm.get())) , _port_model(pm) diff --git a/src/libs/gui/Port.hpp b/src/libs/gui/Port.hpp index 4851a63f..7b347194 100644 --- a/src/libs/gui/Port.hpp +++ b/src/libs/gui/Port.hpp @@ -38,7 +38,11 @@ namespace GUI { class Port : public FlowCanvas::Port { public: - Port(boost::shared_ptr<FlowCanvas::Module> module, SharedPtr<PortModel> pm, bool flip=false); + Port(boost::shared_ptr<FlowCanvas::Module> module, + SharedPtr<PortModel> pm, + const std::string& name, + bool flip=false); + ~Port(); SharedPtr<PortModel> model() const { return _port_model; } diff --git a/src/libs/gui/PortPropertiesWindow.cpp b/src/libs/gui/PortPropertiesWindow.cpp index 0129993b..ddab5715 100644 --- a/src/libs/gui/PortPropertiesWindow.cpp +++ b/src/libs/gui/PortPropertiesWindow.cpp @@ -24,7 +24,7 @@ #include "Controls.hpp" #include "PortPropertiesWindow.hpp" -using std::string; +using namespace std; namespace Ingen { namespace GUI { diff --git a/src/libs/gui/RenameWindow.cpp b/src/libs/gui/RenameWindow.cpp index 465b6b1b..b9c252d0 100644 --- a/src/libs/gui/RenameWindow.cpp +++ b/src/libs/gui/RenameWindow.cpp @@ -91,7 +91,6 @@ RenameWindow::name_changed() void RenameWindow::cancel_clicked() { - cout << "cancel\n"; _name_entry->set_text(""); hide(); } |