projects
/
ardour.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add a new API to format midi-note-names with translation: Do Re Mi...
[ardour.git]
/
libs
/
ardour
/
ardour
/
session_object.h
diff --git
a/libs/ardour/ardour/session_object.h
b/libs/ardour/ardour/session_object.h
index 47caab54758ca438594bb8fe352baf162de51177..ac74f07b7700c3522e13f7597abc620487fa25d2 100644
(file)
--- a/
libs/ardour/ardour/session_object.h
+++ b/
libs/ardour/ardour/session_object.h
@@
-1,5
+1,5
@@
/*
/*
- Copyright (C) 2000-20
07
Paul Davis
+ Copyright (C) 2000-20
10
Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-23,40
+23,48
@@
#include <string>
#include "pbd/statefuldestructible.h"
#include "pbd/signals.h"
#include <string>
#include "pbd/statefuldestructible.h"
#include "pbd/signals.h"
+#include "pbd/properties.h"
+#include "ardour/ardour.h"
#include "ardour/session_handle.h"
namespace ARDOUR {
#include "ardour/session_handle.h"
namespace ARDOUR {
+namespace Properties {
+ LIBARDOUR_API extern PBD::PropertyDescriptor<std::string> name;
+}
+
class Session;
/** A named object associated with a Session. Objects derived from this class are
expected to be destroyed before the session calls drop_references().
*/
class Session;
/** A named object associated with a Session. Objects derived from this class are
expected to be destroyed before the session calls drop_references().
*/
-class SessionObject : public SessionHandleRef, public PBD::StatefulDestructible
+class
LIBARDOUR_API
SessionObject : public SessionHandleRef, public PBD::StatefulDestructible
{
public:
{
public:
+ static void make_property_quarks ();
+
SessionObject (Session& session, const std::string& name)
: SessionHandleRef (session)
SessionObject (Session& session, const std::string& name)
: SessionHandleRef (session)
- , _name(name)
- {}
-
- Session& session() const { return _session; }
- const std::string& name() const { return _name; }
+ , _name (Properties::name, name)
+ {
+ add_property (_name);
+ }
+
+ Session& session() const { return _session; }
+ std::string name() const { return _name; }
virtual bool set_name (const std::string& str) {
if (_name != str) {
_name = str;
virtual bool set_name (const std::string& str) {
if (_name != str) {
_name = str;
-
NameChanged(
);
+
PropertyChanged (PBD::PropertyChange (Properties::name)
);
}
return true;
}
}
return true;
}
- PBD::Signal0<void> NameChanged;
-
protected:
protected:
-
std::string
_name;
+
PBD::Property<std::string>
_name;
};
} // namespace ARDOUR
};
} // namespace ARDOUR