Commit Graph

737 Commits

Author SHA1 Message Date
Robin Gareus
c2618903ae Allow to overload drop_references()
This is useful in cases where an object owns child objects
which in turn hold a reference to the parent.

In this case PluginInsert has-a Plugin, which may have a reference
to the insert or the Route.
2020-08-05 22:35:35 +02:00
Ben Loftis
a2f4521e77 Short-circuit gain interpolation if the change is negligibly small 2020-07-21 18:37:32 -05:00
Robin Gareus
fa495b7727 Account for additional TLS on macOS/X
On GLIBC systems pbd_stack_size() adds __pthread_get_minstack,
this is no available on mac systems, causing issues with some
libraries used by plugins.
2020-07-21 23:10:01 +02:00
Robin Gareus
6d950d15ba Use signed int for atomic operations -- #8314 2020-07-16 16:13:21 +02:00
Paul Davis
71f088dbbd move virtual method requiring std::min from header into .cc
The method is virtual so it could never have been inlined anyway
2020-06-18 16:26:44 -06:00
Paul Davis
0d8fac079d The presence of "using std::***" in any header file is not acceptable. Do not revert or change this.
Revert "Partially revert commit #23feb0491e"

This reverts commit 3b5546cfce.
2020-06-18 16:19:18 -06:00
John Emmas
3b5546cfce Partially revert commit #23feb0491e
For MSVC, the 'using std::' statements are needed when building anything which #includes 'pbd/controllable.h' (never quite figured out why...)
2020-06-18 12:46:05 +01:00
Robin Gareus
23feb0491e Remove using std::min/max from header 2020-06-18 01:05:48 +02:00
Robin Gareus
c424e4d61c Allow to set group-override with common set_interface() API 2020-06-18 00:42:09 +02:00
Robin Gareus
515ffbdfe2 Add API to create threads with given stacksize 2020-06-06 18:32:09 +02:00
Paul Davis
a660077c97 PlaybackBuffer: extend API to include write_ptr()
It's just useful
2020-05-13 23:55:02 -06:00
Paul Davis
98d56d6b21 Add API to PlaybackBuffer to compute amount of data that can overwritten
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-05-12 11:34:37 -06:00
Robin Gareus
705ac7bfc5 Prevent huge stack allocations for MIDNAM files
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-23 02:25:38 +02:00
Robin Gareus
3d166c7789 Consolidate stack-size and priority of rt-threads 2020-04-23 01:28:58 +02:00
Robin Gareus
ea2bda6668 Fix playback alignment when adding/removing channels
The disk-reader assumes that all playback ringbuffers are in sync
and have the same fill_level.
2020-04-14 03:57:26 +02:00
Paul Davis
feff57d29a prefer initialization to assignment 2020-04-08 19:56:08 -06:00
Johannes Mueller
c74cc2675e Extend FileArchive to import archive entries individually
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-04-05 16:34:48 +02:00
John Emmas
4dd3d4effe Some initial changes (currently for libpbd only) to help a new contributer 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-26 10:40:36 +00:00
Robin Gareus
28f15d3fa6 Add flag to explicitly hide a control
Eventually this is to replace a literal name "hidden" that is
currently used as hack throughout Ardour's codebase.
2020-03-18 18:16:29 +01:00
Robin Gareus
26b6b8d840 mingw/gcc-8: use glib's stat(), drop hardlink support 2020-03-13 01:21:51 +01:00
Robin Gareus
2b17ded785 Add convenience ControlFlags operators
Explicit functions for operator&=~ and operator|=
2020-03-10 20:55:50 +01:00
Robin Gareus
379115a20e Fix MacOS 10.11 (clang-8.0.0) builds
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-09 18:33:11 +01:00
Robin Gareus
50556db405 Add a STL Allocator using the stack (for rt safety)
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-03-06 19:13:44 +01:00
Robin Gareus
016eaddad7 NO-OP: whitespace, re-indent 2020-02-28 06:08:26 +01:00
Robin Gareus
4b28e4ee3c Fix some recursive undo removal
~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-28 06:06:44 +01:00
Robin Gareus
73c5bdd3cb Fix double free of undo commands (amend 9e6435ff14)
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-28 02:09:58 +01:00
Robin Gareus
aa3f7f2414 Remove undo function from global namespace 2020-02-25 20:09:47 +01:00
Robin Gareus
7532571fb2 NO-OP: whitespace 2020-02-25 17:55:51 +01:00
Ben Loftis
4f5076a81a controllable::{get_set}_interface() are convenience wrappers for funcs that need the Rotary flag set 2020-02-20 12:25:51 -06:00
Paul Davis
ca3714bccf NOOP: fix brace/newline use 2020-02-20 00:09:32 -07:00
Paul Davis
d1b335b36e expose PlaybackBuffer::reservation and make the member const 2020-02-19 23:10:13 -07:00
Paul Davis
58123c969b remove unused method 2020-02-19 23:09:51 -07:00
Robin Gareus
f62fb6dd98 Remove unused dummy control class
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-19 17:03:46 +01:00
John Emmas
75aaae9963 Fix two more cases of of C99 strtoll() 2019-12-31 10:11:18 +00:00
Robin Gareus
def4be7285 Fix MSVC builds, use C89 strtol() instead of C99 strtoll()
For the case at hand (plugin scale-points) it's highly unlikely to
encounter numbers > INT_MAX.
2019-12-30 19:05:51 +01:00
Robin Gareus
04a409df6f Add a numerically_less compare operator
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-29 19:47:48 +01:00
Robin Gareus
93180ceea9 Add Inline Control Port Property
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.
2019-12-14 15:50:56 +01:00
Paul Davis
c3e3930f14 revert to single buffer for disk playback, and 5.x-style overwrite
Also address issues with MIDI and also atomicity of _pending_overwrite
2019-12-10 09:29:22 -07:00
David Robillard
8ec3e5fb54 Fix deprecated-copy warnings
It's long been a guideline (and IIRC a Weff-c++ warning) that either all, or
none, of the copy methods should be defined, but this became a standard warning
in GCC9.  Presumably to account for a later language change though I'm not sure
which.

I don't remember why the ChanMapping copy constructor can't just be a simple
copy (it's just a map of POD), but figure it's safer to just copy what that
does.
2019-12-09 23:25:59 +01:00
Paul Davis
8d05f6d4b7 initial conversion to double buffering inside DiskReader
Second buffer is not used (or allocated) yet.
2019-12-07 10:30:38 -07:00
Robin Gareus
a8a699133e Fix child-process communication (video monitor in particular)
103ef2ba08 introduced an API to write raw data (const void*)
to a child process, along with the previous API to
write (std::string const&)

VideoMonitor uses write_to_stdin("fixed text"), and g++
interprets this to use the (const void*) API instead
of the std::string, which breaks communication.
2019-11-09 06:28:55 +01:00
Paul Davis
43eb64d23b add new debug bit (DebugTimestamps) that adds timestamps to all debug messages 2019-10-28 16:52:18 -06:00
Robin Gareus
c663a2d8ef Invert Pan-Azimuth (up means left)
It's a well established convention that pan y-axis automation,
or vertical uses (top) +1 for left.

This special cases rotary knobs (and horizontal sliders) to retain
a clockwise movement (or movement to the right) for panning to the
right.
2019-10-07 05:07:55 +02:00
Robin Gareus
feb5d1261e Fix use of doxygen documented parameters in running text 2019-09-30 06:30:11 +02:00
Robin Gareus
ee54b13d6d Fix some more doxygen warnings 2019-09-30 05:33:44 +02:00
Robin Gareus
959a37144b Fix a few hundred doxygen warnings..
There are still over a hundred left, but this addresses many already.
In particular @param references to undocumented parameters.
Most notably in audio_backend.h
2019-09-30 04:45:59 +02:00
Robin Gareus
5395a557d2 Another try at C++11/boost spinlock initialization 2019-09-26 02:48:17 +02:00
Paul Davis
f52781b46b fix thinko when testing for internal seek with negative distance 2019-09-17 17:59:23 -06:00
Robin Gareus
ffbf40c3d1 Add PBD API to hard-link files 2019-08-12 16:41:25 +02:00
Robin Gareus
0301c47f6b Update core library GPL boilerplate and (C) from git log 2019-08-03 15:53:17 +02:00