mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-09 00:04:56 +01:00
add API to query stateful ID override mode
This commit is contained in:
parent
91f5cd008c
commit
b48d87b3ea
2 changed files with 18 additions and 5 deletions
|
|
@ -131,9 +131,11 @@ class LIBPBD_API Stateful {
|
||||||
*/
|
*/
|
||||||
virtual void mid_thaw (const PropertyChange&) { }
|
virtual void mid_thaw (const PropertyChange&) { }
|
||||||
|
|
||||||
|
bool regenerate_xml_or_string_ids () const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend struct ForceIDRegeneration;
|
friend struct ForceIDRegeneration;
|
||||||
static Glib::Threads::Private<bool> regenerate_xml_or_string_ids;
|
static Glib::Threads::Private<bool> _regenerate_xml_or_string_ids;
|
||||||
PBD::ID _id;
|
PBD::ID _id;
|
||||||
gint _stateful_frozen;
|
gint _stateful_frozen;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ namespace PBD {
|
||||||
int Stateful::current_state_version = 0;
|
int Stateful::current_state_version = 0;
|
||||||
int Stateful::loading_state_version = 0;
|
int Stateful::loading_state_version = 0;
|
||||||
|
|
||||||
Glib::Threads::Private<bool> Stateful::regenerate_xml_or_string_ids;
|
Glib::Threads::Private<bool> Stateful::_regenerate_xml_or_string_ids;
|
||||||
|
|
||||||
Stateful::Stateful ()
|
Stateful::Stateful ()
|
||||||
: _extra_xml (0)
|
: _extra_xml (0)
|
||||||
|
|
@ -383,7 +383,7 @@ bool
|
||||||
Stateful::set_id (const XMLNode& node)
|
Stateful::set_id (const XMLNode& node)
|
||||||
{
|
{
|
||||||
const XMLProperty* prop;
|
const XMLProperty* prop;
|
||||||
bool* regen = regenerate_xml_or_string_ids.get();
|
bool* regen = _regenerate_xml_or_string_ids.get();
|
||||||
|
|
||||||
if (regen && *regen) {
|
if (regen && *regen) {
|
||||||
reset_id ();
|
reset_id ();
|
||||||
|
|
@ -407,7 +407,7 @@ Stateful::reset_id ()
|
||||||
void
|
void
|
||||||
Stateful::set_id (const string& str)
|
Stateful::set_id (const string& str)
|
||||||
{
|
{
|
||||||
bool* regen = regenerate_xml_or_string_ids.get();
|
bool* regen = _regenerate_xml_or_string_ids.get();
|
||||||
|
|
||||||
if (regen && *regen) {
|
if (regen && *regen) {
|
||||||
reset_id ();
|
reset_id ();
|
||||||
|
|
@ -416,11 +416,22 @@ Stateful::set_id (const string& str)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
Stateful::regenerate_xml_or_string_ids () const
|
||||||
|
{
|
||||||
|
bool* regen = _regenerate_xml_or_string_ids.get();
|
||||||
|
if (regen && *regen) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Stateful::set_regenerate_xml_and_string_ids_in_this_thread (bool yn)
|
Stateful::set_regenerate_xml_and_string_ids_in_this_thread (bool yn)
|
||||||
{
|
{
|
||||||
bool* val = new bool (yn);
|
bool* val = new bool (yn);
|
||||||
regenerate_xml_or_string_ids.set (val);
|
_regenerate_xml_or_string_ids.set (val);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace PBD
|
} // namespace PBD
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue