13
0
Commit Graph

1143 Commits

Author SHA1 Message Date
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
f18f7dca43 Accommodate newly introduced source(s) in our MSVC project (libpbd) 2017-04-16 12:53:11 +01:00
c634daef6a Add locale independent and thread safe string conversion API with tests
All conversions are performed as if in the "C" locale but without actually
changing locale.

This is a wrapper around printf/sscanf for int types which aren't affected by
locale and uses glib functions g_ascii_strtod and g_ascii_dtostr for
float/double types.

My first attempt at this used std::stringstream and
ios::imbue(std::locale::classic()) as it should be thread safe, but testing
shows it is not for gcc/mingw-w64 on Windows, and possibly also some versions
of macOS/OS X.

Use "yes" and "no" when converting a boolean in PBD::string_to<bool> as this
seems to be the convention used throughout libardour which will allow using
string_to<bool> in those cases.

Add accepted bool string values from PBD::string_is_affirmative to
PBD::string_to<bool>

Mark strings in pbd/string_convert.cc as not for translation

Add u/int16_t string conversions to pbd/string_convert.h and tests

Add DEBUG_TRACE output on conversion errors

Add int8_t/uint8_t conversions(using int16/uint16 types) to string_convert.h

Add support for converting an infinity expression to/from string

Follows the C99/C11 standard for strtof/strtod where subject sequence is an
optional plus or minus sign then INF or INFINITY, ignoring case.
2017-04-16 14:02:41 +10:00
78b82b7ff2 Add PBD::DEBUG::StringConvert debug bit
This is for debugging errors with string conversion for cases where errors
aren't handled
2017-04-16 14:02:41 +10:00
f1a4767ac5 Fix indentation and make comment style consistent in PBD::PropertyList header 2017-04-16 14:02:03 +10:00
4d9690930a Silence -Wunused-value 2017-04-16 00:15:53 +02:00
b66d31891b Revert "profile instant.xml save"
This reverts commit e965e5edcd.
2017-03-27 05:08:30 +02:00
e965e5edcd profile instant.xml save
This does clutter up stderr, but only because instant.xml is arguably
saved much too often (and it's not really instant :)
2017-03-25 15:10:02 +01:00
7a709f23f1 Fix solo/mute when loading old (4.x) sessions. 2017-03-10 21:42:02 +01:00
5d5d9b8114 add new API to PBD::Controllable, ::get_save_value()
Designed to allow derived classes to *save* a different value
than would be reported by ::get_value().

Specifically there so that slaved controls can save/restore
their *own* state, not the value that ::get_value() would
return.
2017-02-06 16:49:08 +01:00
715b9a959a Remove a JE addition to one of the qm-dsp source files (no longer needed) 2017-02-06 09:47:10 +00:00
5dabe45341 Some minor changes in preparation for building the newer Vamp plugins 2017-02-05 15:05:32 +00:00
db981b6085 more consistent terminology in a comment 2017-01-22 19:49:40 +01:00
8f8d0a70d8 Reap invalidation records 2017-01-20 13:54:03 +01:00
fbae5f5ffd Free dead request-buffers
This partially plugs a memory leak of event-loops.
2017-01-20 13:53:59 +01:00
Dobroslav Slavenskoj
04b515d535 syncing with upstream 2017-01-05 09:24:40 +00:00
Dobroslav Slavenskoj
5f0857620e Fixing LV2_SUPPORT #ifdefs 2017-01-05 09:24:40 +00:00
462c3eeb84 MIDI tracer actually changes the event-loop 2016-12-16 01:56:15 +01:00
6c88f339ca some further invalidation details:
Prevent double unref during when the EventLoop terminates:
deleting the ringbuffer deletes all requests, some of which may
contain stale invalidation

remove the buffer_map_lock, now that signals ref-count the IR.
2016-12-15 18:19:38 +01:00
529b91828d store InvalidationRecord in a Connection object and ref/unref it as appropriate 2016-12-15 16:36:50 +00:00
342c112ae3 add ::use_count() method to InvalidationRecord 2016-12-15 16:36:50 +00:00