summaryrefslogtreecommitdiff
path: root/libs/pbd
AgeCommit message (Collapse)Author
2020-05-13PlaybackBuffer: extend API to include write_ptr()Paul Davis
It's just useful
2020-05-12Add API to PlaybackBuffer to compute amount of data that can overwrittenPaul Davis
The distance is between a given offset in the buffer (probably a read position at some point in time) and the write ptr. Any data after the write ptr is "old" and not readable, and thus not worth overwriting since we would not read it anyway.
2020-04-24Fix builds, missing includeRobin Gareus
2020-04-23Fix parsing XML with blanks from memoryRobin Gareus
This is needed when the butler thread loads a plugin with MIDNAM. xmlKeepBlanksDefault() setting is per thread. see also df3a4ed9c61d
2020-04-23Prevent huge stack allocations for MIDNAM filesRobin Gareus
xmlParseMemory() uses a c-pointer char*. Previously MIDNAM data on the heap were wrapped inside a std::string only to be later accessed via c_str().
2020-04-23Consolidate stack-size and priority of rt-threadsRobin Gareus
2020-04-14Fix playback alignment when adding/removing channelsRobin Gareus
The disk-reader assumes that all playback ringbuffers are in sync and have the same fill_level.
2020-04-08prefer initialization to assignmentPaul Davis
2020-04-05Extend FileArchive to import archive entries individuallyJohannes Mueller
This is needed primarily for a workaround for #7971. When importing a template that has been exported on Ardour5 on MacOS we need to fix the paths of the archive entries. Later we can use this functionality also to handle imported templates if templates with the same name already exist. This commit only adds methods and members to FileArchive, it does not modify anything to make regressions unlikely. This, however, leads to some duplicated code. Eventually we should consolidate this a bit.
2020-03-29Set thread-names (libs)Robin Gareus
2020-03-29Set public thread nameRobin Gareus
This allows to identify Ardour thread using standard unix tools (ps, htop) and inspect priorities, CPU load etc.
2020-03-26Some initial changes (currently for libpbd only) to help a new contributer ↵John Emmas
who's trying to build with MSVC2017 These changes compile okay for me (using VS2019) although they wouldn't link to my older-built libraries. Hopefully he'll be okay if he builds everything with the same compiler.
2020-03-25remove old, undocumented mechanism to set PBD::DEBUG flags from environment ↵Paul Davis
variable An app-level mechanism now exists in main(), via ARDOUR_DEBUG_FLAGS, and will do the same thing
2020-03-25improve debug flag setting messagePaul Davis
2020-03-18Add flag to explicitly hide a controlRobin Gareus
Eventually this is to replace a literal name "hidden" that is currently used as hack throughout Ardour's codebase.
2020-03-13mingw/gcc-8: use glib's stat(), drop hardlink supportRobin Gareus
2020-03-11fix apparent free-ordering issue reported in #7926Paul Davis
2020-03-11Fix win32, mingw/gcc-8.3 buildsRobin Gareus
2020-03-10Add convenience ControlFlags operatorsRobin Gareus
Explicit functions for operator&=~ and operator|=
2020-03-09Fix MacOS 10.11 (clang-8.0.0) buildsRobin Gareus
gcc, and recent clang-10 can construct new objects using references as arguments. However clang-8 (and MSVC?) do not: "error: no matching function for call to 'operator new'" The compiler apparently does not expand the template class A <-> `A*` vs. `A const&` for different cases.
2020-03-06Add a STL Allocator using the stack (for rt safety)Robin Gareus
This is a dumb stack allocator using LIFO allocation/free, with a fallback to new/delete. This works well for small STL containers in particular std::vector, but it's also suitable for std::map<>, in particular copy constructing small POD maps (plugin pin mappings). Eventually this could be combined with TLSF for a flexible memory arena management. This is however not currently needed for any the planned use-cases. This code is ANSI C++98 compatible, and yet also works with modern C++11, C++14
2020-02-29Fix 'samples / frames' typo in PBD::stacktrace()John Emmas
2020-02-28NO-OP: whitespace, re-indentRobin Gareus
2020-02-28Fix some recursive undo removalRobin Gareus
~StatefulDiffCommand() may trigger UndoTransaction::command_death() which may delete the StatefulDiffCommand() that's just being destroyed. This depends on the signal-connection order, which is undefined. In any case when a shared_ptr<> object is being destroyed it means that all references to it are already gone. There's no need to emit drop_references from the d'tor.
2020-02-28Fix double free of undo commands (amend 9e6435ff145)Robin Gareus
This fixes a case when deleting a plugin, deletes all automation undo/redo events: <UndoTransaction name="add automation event"> <MementoCommand type-name="ARDOUR::AutomationList"> ... `delete this;` calls the d'tor which emits drop_references(), that leads to UndoTransaction::command_death() destroying the object, whichh causes a double free.
2020-02-25Fix mem-leak, Playlist/Region SessionHandleRefRobin Gareus
When a playlist is deleted and drops_references(), any undo/redo StatefulDiffCommand referncing playlist invoke Destructible::drop_references() of the Command. This leads to command_death(). As opposed to UndoTransaction::clear() the StatefulDiffCommand was not destroyed. In case of playlists StatefulDiffCommand::_changes contains PBD::SequenceProperty<std::list<boost::shared_ptr<Region> > > and shared pointer reference of the playlist regions were kept indefinitely. This fixes the following scenario: New session, import an file, delete the created track, clean up unused sources (delete unused playlists)[, quit]. A reference to the imported region was kept, because of the playlist's undo command (insert region). Yet the source file was deleted. PS. Most playlist changes are accompanied by GUI zoom/selection MementoCommands. Those are currently never directly dropped. command_death() leaves those in place.
2020-02-25Remove undo function from global namespaceRobin Gareus
2020-02-25NO-OP: whitespaceRobin Gareus
2020-02-24Tweak mach thread priority debug msgRobin Gareus
2020-02-24Fix setting CoreAudio RT-priorityRobin Gareus
2020-02-20Fix Inline-control visibility stateRobin Gareus
This fixes an issue when copy/pasting plugins or aux-sends from one track to another. After copying the processor, the state is copied, however the Controllable state did save the InlineControl flag, so this as lost. (amend 93180ceea)
2020-02-20controllable::{get_set}_interface() are convenience wrappers for funcs that ↵Ben Loftis
need the Rotary flag set
2020-02-20NOOP: fix brace/newline usePaul Davis
2020-02-19expose PlaybackBuffer::reservation and make the member constPaul Davis
2020-02-19remove unused methodPaul Davis
2020-02-19Remove unused dummy control classRobin Gareus
PBD::IgnorableControllable() is no longer used. It also was problematic, because in every case where a Controllable is required, min/max range and usually also get/set value are significant.
2020-02-07Changes needed for building with MSVCJohn Emmas
Mostly these are to do with TLSF which I hadn't in fact been building!! Hopefully there won't be any problems for the gcc builds.
2020-01-27Fix building unit-testsRobin Gareus
2020-01-25Towards waf python 2+3 supportDavid Runge
2020-01-14NO-OP: whitespaceRobin Gareus
2020-01-05remove unnecessary call to xmlKeepBlanksDefault()Paul Davis
2020-01-05move call to xmlKeepBlanksDefault(0) to before the creation of an XML parser ↵Paul Davis
context the value is used by the parser context; the old code called it only after the *first* parser context was created. therefore the first XMLTree::read() call has its behavior determined by libxml2's default for this value, rather than by our explicit choice (do not treat whitespace as a note). All subequent read() calls will use our value. This variable inside libxml2 is actually per-thread, which just increases the stakes for calling xmlKeepBlanksDefault() at the right time
2020-01-05repeat baf0cdcbef1 but for BaseUI, thus covering all control protocolsPaul Davis
2019-12-31ensure that xmlKeepBlankDefault() is called early in instance-life, from ↵Paul Davis
PBD::init() See comment for details on why
2019-12-31Fix two more cases of of C99 strtoll()John Emmas
2019-12-30Fix MSVC builds, use C89 strtol() instead of C99 strtoll()Robin Gareus
For the case at hand (plugin scale-points) it's highly unlikely to encounter numbers > INT_MAX.
2019-12-30use a local version (copy) of the G_SOURCE_FUNC macro, since it is not ↵Paul Davis
available in the GTK+ version we use for the official build stack
2019-12-29Add a numerically_less compare operatorRobin Gareus
This is similar to sort(1) --human-numeric-sort, as opposed to naturally_less() negative numbers, hex-prefixes and SI metric prefixes are taken into account.
2019-12-14truncate unnecessarily verbose debug set/bits outputPaul Davis
2019-12-14Add Inline Control Port PropertyRobin Gareus
This allows to indicate that a control should by default be displayed inline in the mixer-strip. Previously that was hard-coded for and enabled for send-level controls only.