13
0
Commit Graph

1163 Commits

Author SHA1 Message Date
7258c6334d Namespace PBD::RingBuffer
class RingBuffer<> is a very generic name and should not pollute the
global namespace.
2017-09-16 16:37:29 +02:00
7d88091229 Avoid assert() when loading xml: Throw an XMLerror if attribute_value fails. 2017-08-30 10:23:34 -05:00
467c801ce8 Abstract definition of rt-scheduler policy
pthread-w32 does not support pthread_setschedparam() with
SCHED_FIFO and bails out. While pthread_create() simply ignores the policy
and sets the priority regadless.

This only affects ctrl-surface event-loops & AutomationWatch on Windows.
2017-08-29 20:35:36 +02:00
229c9584bf Add a PBD API to set pthread priority 2017-08-29 17:25:23 +02:00
8374e23014 Add API to set thread-priority (for ctrl-surfaces) 2017-08-05 01:28:11 +02:00
cec84d242d NO-OP: whitespace 2017-08-04 16:26:37 +02:00
1ed9564ffd Graph profiling: allow to override max DSP thread count & calc avg. 2017-08-04 16:26:26 +02:00
ea48c56061 NO-OP: name-change (_list and _lock are also used in other places)
Derived classes need to explicitly specify namespace and class
to avoid ambiguities (even for private members)
2017-07-30 02:42:55 +02:00
bde3edf1c8 Make start_touch() truly idempotent
Also don't allow outsiders to call Controllable::set_touching()
2017-07-25 20:15:12 +02:00
ddf55c0d88 PBD::init() failing is fatal in main(), don't silently exit. 2017-07-03 14:45:41 +02:00
6f986173f3 Controllable focus notification API
This allows to inform control-surfaces about the current GUI
control-element. "Link" control-surface interaction to GUI focus.
2017-07-02 18:19:13 +02:00
6180c5a5fc Accommodate newly introduced source(s) in our MSVC project (libpbd) 2017-06-22 17:59:16 +01:00
6ab970efa3 Remove LocaleGuard from PBD::Controllable state methods
These are no longer necessary as float <=> string conversion is handled by
locale independent PBD::to_string/string_to via XMLNode::get/set_property
2017-06-22 10:48:38 +10:00
940be0cbb9 compilation requires <stdint.h> 2017-06-21 14:19:21 -04:00
ce059e2d66 Remove internal_to_user/user_to_internal API
Also GainControl can just use the AutomationControl's implementation of
get_user_string()
2017-06-21 18:13:46 +02:00
e91b80eb85 Centralize control-parameter math functions in libpbd.
Functions formerly in ardour/util.h and some more functions.
The main motivation is libevoral which can use libpbd but not libardour.

The eventual goal is to consolidate various different interpolation,
scaling and deflection methods.
2017-06-21 18:12:01 +02:00
333e20a3a6 VCA/SlavableAutomationCtrl re-design:
* remember master-ctrl value on assignment & save with session
* Control/AutomationCtrl only stores ctrl's own value (w/o master)
* virtual AutomationControl::get_value () -> use SlavableAC method
* MasterRecord uses weak-ptr (fixes recursive ~Controllable() deadlock)
2017-06-12 02:26:23 +02:00
628e60f8fd NO-OP: whitespace 2017-05-29 23:45:16 +02:00
Daniel Sheeler
d67436af3b duplicate routes start off unsoloed to avoid issues related to upstream / downstream buses 2017-05-29 15:42:27 -05:00
1f094027c5 Remove normalization of property names from libpbd xml code
It may have been OK to add this code temporarily at this low level, but as it
was introduced in 2008, this change is made with the assumption that any
Sessions that were affected have been re-saved since then with corrected
property names and that "normalization" is no longer necessary.

Timing results before changes:

XMLTest::testPerfMediumXMLDocumentTiming
   Create : Count: 10 Min: 30375 Max: 48253 Total: 431727 Avg: 43172 (43 msecs)
   Write : Count: 10 Min: 42553 Max: 49163 Total: 453353 Avg: 45335 (45 msecs)
   Read : Count: 10 Min: 70307 Max: 75987 Total: 734923 Avg: 73492 (73 msecs)
XMLTest::testPerfLargeXMLDocumentTiming
   Create : Count: 10 Min: 154486 Max: 307856 Total: 2678989 Avg: 267898 (267 msecs)
   Write : Count: 10 Min: 304273 Max: 343274 Total: 3169158 Avg: 316915 (316 msecs)
   Read : Count: 10 Min: 496920 Max: 541394 Total: 5260410 Avg: 526041 (526 msecs)

Timing results after changes:

XMLTest::testPerfMediumXMLDocumentTiming
   Create : Count: 10 Min: 21437 Max: 39749 Total: 348622 Avg: 34862 (34 msecs)
   Write : Count: 10 Min: 42320 Max: 49989 Total: 446135 Avg: 44613 (44 msecs)
   Read : Count: 10 Min: 63252 Max: 68389 Total: 660841 Avg: 66084 (66 msecs)
XMLTest::testPerfLargeXMLDocumentTiming
   Create : Count: 10 Min: 113458 Max: 263225 Total: 2215595 Avg: 221559 (221 msecs)
   Write : Count: 10 Min: 305439 Max: 339986 Total: 3150697 Avg: 315069 (315 msecs)
   Read : Count: 10 Min: 447560 Max: 488121 Total: 4698903 Avg: 469890 (469 msecs)
2017-05-26 08:48:04 +10:00
5d683eaeca NO-OP: whitespace and FSF address 2017-05-06 15:11:53 +02:00
ccd19ed061 extend PBD::ID API to allow construction and operator== using uint64_t
This is theoretically dangerous, because a PBD::ID is supposed to be unique, and this new constructor
cannot guarantee that. However, the same danger already exists with the std::string-based constructor
2017-05-05 18:56:25 +01:00
9c0ba3b3d5 Add mechanism to reset/lock semaphores 2017-04-22 23:06:22 +02:00
048af97b54 Use correct property names in PBD::Undo class
These have been "normalized" in XMLProperty ctor for many years, so this does
not change the Session format.
2017-04-21 12:46:04 +10:00
d19ec8ba46 Use hyphen for XML property names
These have been normalized/modified by the XMLProperty ctor for many years (~9)
so special treatment when reading properties should not be needed.
2017-04-21 12:46:04 +10:00
ffff31b832 Relax LocaleGuards
Arodur itself on longer depends on C/C++ locale for saving/loading sessions.
However, the Localeguard is kept for 3rd party plugins: Reset the C locale
to "C" to enforce consisten numerics and portable sessions as well
as verify that no plugin changes the C++ locale.
2017-04-20 22:12:33 +02:00
251db7a608 Changes needed for building Tim's new 'string_convert' stuff with MSVC (libpbd) 2017-04-19 17:25:51 +01:00
1ce58ad90a Add additional PBD::string_to/to_string specializations for PBD::ID 2017-04-19 09:37:02 +10:00
4367b51e56 Remove PBD::to_string() function from pbd/convert.h
All uses of this function have now been replaced by PBD::to_string() from
pbd/string_convert.h

Remove this function so that it isn't mistakenly used to perform numeric to
string conversion when the result is being used for serialization as that only
works if the global C++ locale is set with LC_NUMERIC=C, which is the case
currently but may not be in the future.
2017-04-19 09:37:01 +10:00
ac8b5192cd Remove now unused PBD::string_is_affirmative function
The equivalent function is now PBD::string_to<bool>
2017-04-19 09:36:59 +10:00
6e467153a0 Remove unused XMLNode::add_property methods
These are now unused and functionality is replaced by XMLNode::set_property

set_property is a better name as a node can only have properties with unique
names and the property will be set or reset(if it already exists). Changing the
name also makes it easier to transition and test the new API.
2017-04-19 09:36:57 +10:00
e4b1ece143 Use XMLNode::set_property API in xml tests 2017-04-19 09:36:57 +10:00
e01d074ad1 Use XMLNode::set_property in PBD::PropertyTemplate<T> class 2017-04-19 09:36:48 +10:00
32f5464490 Use XMLNode::get/set_property API in PBD::ConfigurationVariable class 2017-04-19 09:36:48 +10:00
b320ba1aa5 Use XMLNode::set_property API in PBD::MementoCommand class 2017-04-19 09:36:48 +10:00
fe577dcbd5 Use XMLNode::set_property API in PBD::StatefulDiffCommand class 2017-04-19 09:36:48 +10:00
9587e11f97 Use XMLNode::set_property API in PBD::Undo class 2017-04-19 09:36:48 +10:00
799077025e Use XMLNode::get/set_property API in PBD::Stateful 2017-04-19 09:36:48 +10:00
0aea5288cd Use XMLNode::get/set_property API in PBD::Controllable 2017-04-19 09:36:48 +10:00
800fdd0f0f Add pbd/types_convert.h header for PBD::to_string/string_to specialisations 2017-04-19 09:36:48 +10:00
ae27e33f29 Add a template based get/set_property API to PBD::XMLNode 2017-04-19 09:36:48 +10:00
2b58bbd50a Use PBD string conversion functions in PBD::ConfigurationVariable
No longer need a specialization for bool as PBD::to_string/string_to already
has specializations for bool

Remove template specialization for float as string_to/to_string handles string
representations of infinity
2017-04-19 09:36:47 +10:00
3edb6b2e1f Use PBD string conversion functions in PBD::Property class 2017-04-19 09:36:47 +10:00
95b4fd64dd Add DEFINE_ENUM_CONVERT macro for defining PBD::string_to/to_string for enums
A simple macro for defining the four template specializations required to
convert an enum to a string and back using the existing string_2_enum and
enum_2_string functions. Generally these will only be instantiated in one
source file, I don't think it is necessary to explicitly instantiate any at
this stage.
2017-04-19 07:49:58 +10:00
f4f4c01f4c Remove now unused ID::print method 2017-04-19 07:49:58 +10:00
4dd0203f01 Use ID::to_s() in libpbd instead of ID::print() 2017-04-19 07:49:58 +10:00
454b2d4e69 Use PBD string conversion functions in PBD::ID instead of snprintf
Keep ID::print in place for now and replace usage in subsequent commit to
minimize changes
2017-04-19 07:49:58 +10:00
13bfd1527a Make boolean string values 0 and 1 to maintain backwards compatibility
I would prefer "yes" and "no" as it distinguishes boolean values from numeric
but using "yes and "no" results in PBD::Property<T>::from_string failing to
parse the correct values when opening in an older Ardour version as there is no
specialization for bool.

Using 0 and 1 also results in less change to the Session file.
2017-04-19 07:49:57 +10:00
272e02b6c8 Fix string-convert tests for Windows and hopefully macOS/OS X
Tests requires a locale installed on the host that uses a comma as the decimal
mark/point.
2017-04-17 13:21:02 +10:00
2e1a884d6e Fix Doxygen syntax (amend/revert f1a4767ac)
1st line after /**  brief description.
Doxygen is used for Ardour's online source doc and the Lua class reference.
2017-04-16 17:26:58 +02:00