projects
/
ardour.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix compilation breakages from the last commit
[ardour.git]
/
libs
/
pbd
/
controllable.cc
diff --git
a/libs/pbd/controllable.cc
b/libs/pbd/controllable.cc
index fbbb4d6f254a51d44d59952e5cddb5fd0ec89c3a..35f760554189d09d59195343f0a4100fff4ee780 100644
(file)
--- a/
libs/pbd/controllable.cc
+++ b/
libs/pbd/controllable.cc
@@
-24,6
+24,7
@@
#include "i18n.h"
using namespace PBD;
#include "i18n.h"
using namespace PBD;
+using namespace std;
sigc::signal<void,Controllable*> Controllable::Destroyed;
sigc::signal<bool,Controllable*> Controllable::StartLearning;
sigc::signal<void,Controllable*> Controllable::Destroyed;
sigc::signal<bool,Controllable*> Controllable::StartLearning;
@@
-35,7
+36,7
@@
Glib::StaticRWLock Controllable::registry_lock = GLIBMM_STATIC_RW_LOCK_INIT;
Controllable::Controllables Controllable::registry;
Controllable::ControllablesByURI Controllable::registry_by_uri;
Controllable::Controllables Controllable::registry;
Controllable::ControllablesByURI Controllable::registry_by_uri;
-Controllable::Controllable (const st
d::string& name, const std::
string& uri)
+Controllable::Controllable (const st
ring& name, const
string& uri)
: _name (name)
, _uri (uri)
, _touching (false)
: _name (name)
, _uri (uri)
, _touching (false)
@@
-46,7
+47,7
@@
Controllable::Controllable (const std::string& name, const std::string& uri)
void
Controllable::add ()
{
void
Controllable::add ()
{
- Glib::RWLock::WriterLock lm (
*
registry_lock);
+ Glib::RWLock::WriterLock lm (registry_lock);
registry.insert (this);
if (!_uri.empty()) {
registry.insert (this);
if (!_uri.empty()) {
@@
-62,7
+63,7
@@
Controllable::add ()
void
Controllable::remove ()
{
void
Controllable::remove ()
{
- Glib::RWLock::WriterLock lm (
*
registry_lock);
+ Glib::RWLock::WriterLock lm (registry_lock);
for (Controllables::iterator i = registry.begin(); i != registry.end(); ++i) {
if ((*i) == this) {
for (Controllables::iterator i = registry.begin(); i != registry.end(); ++i) {
if ((*i) == this) {
@@
-71,7
+72,7
@@
Controllable::remove ()
}
}
}
}
- if (
_uri
) {
+ if (
!_uri.empty()
) {
ControllablesByURI::iterator i = registry_by_uri.find (_uri);
if (i != registry_by_uri.end()) {
registry_by_uri.erase (i);
ControllablesByURI::iterator i = registry_by_uri.find (_uri);
if (i != registry_by_uri.end()) {
registry_by_uri.erase (i);
@@
-82,11
+83,11
@@
Controllable::remove ()
}
void
}
void
-Controllable::set_uri (const st
d::st
ring& new_uri)
+Controllable::set_uri (const string& new_uri)
{
{
- Glib::RWLock::WriterLock lm (
*
registry_lock);
+ Glib::RWLock::WriterLock lm (registry_lock);
- if (
_uri
) {
+ if (
!_uri.empty()
) {
ControllablesByURI::iterator i = registry_by_uri.find (_uri);
if (i != registry_by_uri.end()) {
registry_by_uri.erase (i);
ControllablesByURI::iterator i = registry_by_uri.find (_uri);
if (i != registry_by_uri.end()) {
registry_by_uri.erase (i);
@@
-106,7
+107,7
@@
Controllable::set_uri (const std::string& new_uri)
Controllable*
Controllable::by_id (const ID& id)
{
Controllable*
Controllable::by_id (const ID& id)
{
- Glib::RWLock::ReaderLock lm (
*
registry_lock);
+ Glib::RWLock::ReaderLock lm (registry_lock);
for (Controllables::iterator i = registry.begin(); i != registry.end(); ++i) {
if ((*i)->id() == id) {
for (Controllables::iterator i = registry.begin(); i != registry.end(); ++i) {
if ((*i)->id() == id) {
@@
-119,19
+120,19
@@
Controllable::by_id (const ID& id)
Controllable*
Controllable::by_uri (const string& uri)
{
Controllable*
Controllable::by_uri (const string& uri)
{
- Glib::RWLock::ReaderLock lm (
*
registry_lock);
+ Glib::RWLock::ReaderLock lm (registry_lock);
ControllablesByURI::iterator i;
ControllablesByURI::iterator i;
- if ((i = registry_by_ui.find (uri)) != registry_by_uri.end()) {
+ if ((i = registry_by_u
r
i.find (uri)) != registry_by_uri.end()) {
return i->second;
}
return 0;
}
Controllable*
return i->second;
}
return 0;
}
Controllable*
-Controllable::by_name (const st
d::st
ring& str)
+Controllable::by_name (const string& str)
{
{
- Glib::RWLock::ReaderLock lm (
*
registry_lock);
+ Glib::RWLock::ReaderLock lm (registry_lock);
for (Controllables::iterator i = registry.begin(); i != registry.end(); ++i) {
if ((*i)->_name == str) {
for (Controllables::iterator i = registry.begin(); i != registry.end(); ++i) {
if ((*i)->_name == str) {