summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-08-15 02:48:48 +0000
committerDavid Robillard <d@drobilla.net>2008-08-15 02:48:48 +0000
commitb18b677b0b747ad4fbcd71102488b2cfab7cb3f9 (patch)
tree14d4ab8bdfb0918fd1c6fbdc87bc6e822ddeb197 /src
parentbde12203a31e8db6b04793587bf1864383d07539 (diff)
downloadingen-b18b677b0b747ad4fbcd71102488b2cfab7cb3f9.tar.gz
ingen-b18b677b0b747ad4fbcd71102488b2cfab7cb3f9.tar.bz2
ingen-b18b677b0b747ad4fbcd71102488b2cfab7cb3f9.zip
Add strong Symbol class (just a restricted string, like path) and use it for ingen object symbols.
git-svn-id: http://svn.drobilla.net/lad/ingen@1387 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r--src/common/interface/EngineInterface.hpp2
-rw-r--r--src/common/interface/GraphObject.hpp3
-rw-r--r--src/libs/client/NodeModel.hpp2
-rw-r--r--src/libs/client/ObjectModel.hpp3
-rw-r--r--src/libs/engine/GraphObjectImpl.hpp3
-rw-r--r--src/libs/engine/PatchImpl.cpp10
-rw-r--r--src/libs/engine/QueuedEngineInterface.cpp4
-rw-r--r--src/libs/gui/BreadCrumb.hpp2
8 files changed, 16 insertions, 13 deletions
diff --git a/src/common/interface/EngineInterface.hpp b/src/common/interface/EngineInterface.hpp
index 41406ca8..08fb9c1a 100644
--- a/src/common/interface/EngineInterface.hpp
+++ b/src/common/interface/EngineInterface.hpp
@@ -80,7 +80,7 @@ public:
bool polyphonic) = 0;
virtual void rename(const string& old_path,
- const string& new_name) = 0;
+ const string& new_symbol) = 0;
virtual void destroy(const string& path) = 0;
diff --git a/src/common/interface/GraphObject.hpp b/src/common/interface/GraphObject.hpp
index 0f6ff9cb..88ee8df0 100644
--- a/src/common/interface/GraphObject.hpp
+++ b/src/common/interface/GraphObject.hpp
@@ -22,6 +22,7 @@
#include <map>
#include <raul/Deletable.hpp>
#include <raul/PathTable.hpp>
+#include <raul/Symbol.hpp>
#include <raul/Atom.hpp>
#include <raul/SharedPtr.hpp>
#include <raul/WeakPtr.hpp>
@@ -46,7 +47,7 @@ public:
typedef PathTable< SharedPtr<GraphObject> >::const_iterator const_iterator;
virtual const Raul::Path path() const = 0;
- virtual const std::string name() const = 0;
+ virtual const Raul::Symbol symbol() const = 0;
virtual const Variables& variables() const = 0;
virtual bool polyphonic() const = 0;
diff --git a/src/libs/client/NodeModel.hpp b/src/libs/client/NodeModel.hpp
index d50926ae..72665e66 100644
--- a/src/libs/client/NodeModel.hpp
+++ b/src/libs/client/NodeModel.hpp
@@ -57,7 +57,7 @@ public:
const string& plugin_uri() const { return _plugin_uri; }
const Shared::Plugin* plugin() const { return _plugin.get(); }
uint32_t num_ports() const { return _ports.size(); }
- const PortModelList& ports() const { return _ports; }
+ const PortModelList& ports() const { return _ports; }
void port_value_range(SharedPtr<PortModel> port, float& min, float& max);
diff --git a/src/libs/client/ObjectModel.hpp b/src/libs/client/ObjectModel.hpp
index 55a5e6e1..61ac62bb 100644
--- a/src/libs/client/ObjectModel.hpp
+++ b/src/libs/client/ObjectModel.hpp
@@ -36,6 +36,7 @@ using Raul::PathTable;
using std::string;
using Raul::Atom;
using Raul::Path;
+using Raul::Symbol;
namespace Ingen {
namespace Client {
@@ -65,7 +66,7 @@ public:
const Variables& variables() const { return _variables; }
const Path path() const { return _path; }
- const string name() const { return _path.name(); }
+ const Symbol symbol() const { return _path.name(); }
SharedPtr<ObjectModel> parent() const { return _parent; }
bool polyphonic() const { return _polyphonic; }
diff --git a/src/libs/engine/GraphObjectImpl.hpp b/src/libs/engine/GraphObjectImpl.hpp
index b5a259af..f3c7286a 100644
--- a/src/libs/engine/GraphObjectImpl.hpp
+++ b/src/libs/engine/GraphObjectImpl.hpp
@@ -30,6 +30,7 @@
using Raul::Atom;
using Raul::Path;
+using Raul::Symbol;
namespace Raul { class Maid; }
@@ -58,7 +59,7 @@ public:
GraphObject* graph_parent() const { return _parent; }
inline GraphObjectImpl* parent() const { return _parent; }
- const std::string name() const { return _name; }
+ const Symbol symbol() const { return _name; }
virtual void process(ProcessContext& context) = 0;
diff --git a/src/libs/engine/PatchImpl.cpp b/src/libs/engine/PatchImpl.cpp
index aedaacbf..97f9dde3 100644
--- a/src/libs/engine/PatchImpl.cpp
+++ b/src/libs/engine/PatchImpl.cpp
@@ -274,11 +274,11 @@ PatchImpl::add_node(List<NodeImpl*>::Node* ln)
* Preprocessing thread only.
*/
PatchImpl::Nodes::Node*
-PatchImpl::remove_node(const string& name)
+PatchImpl::remove_node(const string& symbol)
{
assert(ThreadManager::current_thread_id() == THREAD_PRE_PROCESS);
for (List<NodeImpl*>::iterator i = _nodes.begin(); i != _nodes.end(); ++i)
- if ((*i)->name() == name)
+ if ((*i)->symbol() == symbol)
return _nodes.erase(i);
return NULL;
@@ -360,14 +360,14 @@ PatchImpl::create_port(const string& name, DataType type, size_t buffer_size, bo
* Realtime safe. Preprocessing thread only.
*/
List<PortImpl*>::Node*
-PatchImpl::remove_port(const string& name)
+PatchImpl::remove_port(const string& symbol)
{
assert(ThreadManager::current_thread_id() == THREAD_PRE_PROCESS);
bool found = false;
List<PortImpl*>::Node* ret = NULL;
for (List<PortImpl*>::iterator i = _input_ports.begin(); i != _input_ports.end(); ++i) {
- if ((*i)->name() == name) {
+ if ((*i)->symbol() == symbol) {
ret = _input_ports.erase(i);
found = true;
}
@@ -375,7 +375,7 @@ PatchImpl::remove_port(const string& name)
if (!found)
for (List<PortImpl*>::iterator i = _output_ports.begin(); i != _output_ports.end(); ++i) {
- if ((*i)->name() == name) {
+ if ((*i)->symbol() == symbol) {
ret = _output_ports.erase(i);
found = true;
}
diff --git a/src/libs/engine/QueuedEngineInterface.cpp b/src/libs/engine/QueuedEngineInterface.cpp
index d6792b09..988093aa 100644
--- a/src/libs/engine/QueuedEngineInterface.cpp
+++ b/src/libs/engine/QueuedEngineInterface.cpp
@@ -176,9 +176,9 @@ QueuedEngineInterface::create_node(const string& path,
void
QueuedEngineInterface::rename(const string& old_path,
- const string& new_name)
+ const string& new_symbol)
{
- push_queued(new RenameEvent(_engine, _responder, now(), old_path, new_name));
+ push_queued(new RenameEvent(_engine, _responder, now(), old_path, new_symbol));
}
diff --git a/src/libs/gui/BreadCrumb.hpp b/src/libs/gui/BreadCrumb.hpp
index 194a1e8f..c3b05e01 100644
--- a/src/libs/gui/BreadCrumb.hpp
+++ b/src/libs/gui/BreadCrumb.hpp
@@ -60,7 +60,7 @@ public:
void set_path(const Path& path)
{
remove();
- const string text = (path == "/") ? "/" : path.name();
+ const string text = (path == "/") ? "/" : path.name().c_str();
Gtk::Label* lab = manage(new Gtk::Label(text));
lab->set_padding(0, 0);
lab->show();