summaryrefslogtreecommitdiff
path: root/libs/pbd
AgeCommit message (Collapse)Author
2017-04-19Use XMLNode::set_property API in PBD::MementoCommand classTim Mayberry
2017-04-19Use XMLNode::set_property API in PBD::StatefulDiffCommand classTim Mayberry
2017-04-19Use XMLNode::set_property API in PBD::Undo classTim Mayberry
2017-04-19Use XMLNode::get/set_property API in PBD::StatefulTim Mayberry
2017-04-19Use XMLNode::get/set_property API in PBD::ControllableTim Mayberry
2017-04-19Add pbd/types_convert.h header for PBD::to_string/string_to specialisationsTim Mayberry
2017-04-19Add a template based get/set_property API to PBD::XMLNodeTim Mayberry
2017-04-19Use PBD string conversion functions in PBD::ConfigurationVariableTim Mayberry
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-19Use PBD string conversion functions in PBD::Property classTim Mayberry
2017-04-19Add DEFINE_ENUM_CONVERT macro for defining PBD::string_to/to_string for enumsTim Mayberry
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-19Remove now unused ID::print methodTim Mayberry
2017-04-19Use ID::to_s() in libpbd instead of ID::print()Tim Mayberry
2017-04-19Use PBD string conversion functions in PBD::ID instead of snprintfTim Mayberry
Keep ID::print in place for now and replace usage in subsequent commit to minimize changes
2017-04-19Make boolean string values 0 and 1 to maintain backwards compatibilityTim Mayberry
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-17Fix string-convert tests for Windows and hopefully macOS/OS XTim Mayberry
Tests requires a locale installed on the host that uses a comma as the decimal mark/point.
2017-04-16Fix Doxygen syntax (amend/revert f1a4767ac)Robin Gareus
1st line after /** brief description. Doxygen is used for Ardour's online source doc and the Lua class reference.
2017-04-16Accommodate newly introduced source(s) in our MSVC project (libpbd)John Emmas
2017-04-16Add locale independent and thread safe string conversion API with testsTim Mayberry
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-16Add PBD::DEBUG::StringConvert debug bitTim Mayberry
This is for debugging errors with string conversion for cases where errors aren't handled
2017-04-16Fix indentation and make comment style consistent in PBD::PropertyList headerTim Mayberry
2017-04-16Silence -Wunused-valueRobin Gareus
2017-03-27Revert "profile instant.xml save"Robin Gareus
This reverts commit e965e5edcdd9fdc8a4c68b4d50656cd4e0c53f18.
2017-03-25profile instant.xml saveRobin Gareus
This does clutter up stderr, but only because instant.xml is arguably saved much too often (and it's not really instant :)
2017-03-10Fix solo/mute when loading old (4.x) sessions.Robin Gareus
2017-02-06add new API to PBD::Controllable, ::get_save_value()Paul Davis
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-06Remove a JE addition to one of the qm-dsp source files (no longer needed)John Emmas
2017-02-05Some minor changes in preparation for building the newer Vamp pluginsJohn Emmas
2017-01-22more consistent terminology in a commentPaul Davis
2017-01-20Reap invalidation recordsRobin Gareus
2017-01-20Free dead request-buffersRobin Gareus
This partially plugs a memory leak of event-loops.
2017-01-05syncing with upstreamDobroslav Slavenskoj
2017-01-05Fixing LV2_SUPPORT #ifdefsDobroslav Slavenskoj
2016-12-16MIDI tracer actually changes the event-loopRobin Gareus
2016-12-15some further invalidation details:Robin Gareus
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-15store InvalidationRecord in a Connection object and ref/unref it as appropriatePaul Davis
2016-12-15add ::use_count() method to InvalidationRecordPaul Davis
2016-12-15std::list::erase() needs a non-const iterator.;Paul Davis
at least for some versions of gcc.
2016-12-15and now with eraseRobin Gareus
2016-12-15C++98 compatible iterator eraseRobin Gareus
2016-12-15rework request invalidationRobin Gareus
This kills 2 birds with 1 stone: Removes the necessity of locks and makes call_slot() realtime safe (req->invalidation->requests list push_back). On object destruction, the invalidation-record (IR) itself is invalidated. Invalidated IRs are pushed onto a trash-pool and deleted in the event-loop of the invalidated object (GUI thread) once all requests that reference it have been processed. One last detail remains: PBD::signal connect should reference the IR and disconnect unreference it. This will guarantee that signal emission will not reference the IR while the pool trash is dropped.
2016-12-14Add a trash pool for invalidation requests.Robin Gareus
While EventLoop::invalidate_request() does invalidate request in the request-list. It does *not* invalidate requests in the per-thread-request-ringbuffer(s). The invalidation record cannot be deleted in EventLoop::invalidate_request see 6b5891a78f.
2016-12-14NO-OP: re-indentRobin Gareus
2016-12-14Atomically to invalidate requestRobin Gareus
Yet another slightly overkill approach, but it /may/ explain crashes.
2016-12-14Add some more invalidation debug messages.Robin Gareus
2016-12-14The threading anecdotes - Episode 7Robin Gareus
When do_request() destroys the receiver object, the receiver will free the invalidation record. So the IR needs to be removed from the list before executing the request. Invalid read of size 8 at: AbstractUI<Gtkmm2ext::UIRequest>::handle_ui_requests() (abstract_ui.cc:242) by: BaseUI::request_handler(Glib::IOCondition) (base_ui.cc:141) by: sigc::bound_mem_functor1<bool, BaseUI, Glib::IOCondition>::operator()(Glib::IOCondition const&) const (mem_fun.h:2066) by: sigc::adaptor_functor<sigc::bound_mem_functor1<bool, BaseUI, Glib::IOCondition> >::deduce_result_type<Glib::IOCondition const&, void, void, void, void, void, void>::type sigc::adaptor_functor<sigc::bound_mem_functor1<bool, BaseUI, Glib::IOCondition> >::operator()<Glib::IOCondition const&>(Glib::IOCondition const&) const (adaptor_trait.h:89) by: sigc::internal::slot_call1<sigc::bound_mem_functor1<bool, BaseUI, Glib::IOCondition>, bool, Glib::IOCondition>::call_it(sigc::internal::slot_rep*, Glib::IOCondition const&) (slot.h:148) by: sigc::slot1<bool, Glib::IOCondition>::operator()(Glib::IOCondition const&) const (slot.h:643) by: cross_thread_channel_call_receive_slot(_GIOChannel*, GIOCondition, void*) (crossthread.cc:49) by: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.2) by: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.2) by: g_main_loop_run (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.2) by: gtk_main (in /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0.2400.31) by: Gtkmm2ext::UI::run(Receiver&) (gtk_ui.cc:286) by main (main.cc:408) Addrd1b8 is 24 bytes inside a block of size 48 free'd at: operator delete(void*) (vg_replace_malloc.c:576) by: PBD::EventLoop::invalidate_request(void*) (event_loop.cc:98) by: sigc::internal::trackable_callback_list::~trackable_callback_list() (in /usr/lib/x86_64-linux-gnu/libsigc-2.0.so.0.0.0) by: sigc::trackable::notify_callbacks() (in /usr/lib/x86_64-linux-gnu/libsigc-2.0.so.0.0.0) by: ProcessorEntry::LuaPluginDisplay::~LuaPluginDisplay() (processor_box.cc:1757) by: ProcessorEntry::LuaPluginDisplay::~LuaPluginDisplay() (processor_box.cc:1760) by: ProcessorEntry::~ProcessorEntry() (processor_box.cc:251)
2016-12-14skip dead threads (if the event remains, it'll be cleaned up below)Robin Gareus
2016-12-14fix potential invalid lockRobin Gareus
2016-12-14rework locking (fa07233a, 112fba182)Robin Gareus
For now: use a single lock, which should fix all related crashes. optimize (with less contended partial locks) if this works.
2016-12-14release locks before deleting recordRobin Gareus
2016-12-14amend prev commitRobin Gareus