13
0
Commit Graph

1284 Commits

Author SHA1 Message Date
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
John Emmas
a4449aa0f6 Fix 'samples / frames' typo in PBD::stacktrace() 2020-02-29 14:38:58 +00:00
016eaddad7
NO-OP: whitespace, re-indent 2020-02-28 06:08:26 +01:00
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
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
9e6435ff14
Fix mem-leak, Playlist/Region SessionHandleRef
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-25 21:45:07 +01:00
aa3f7f2414
Remove undo function from global namespace 2020-02-25 20:09:47 +01:00
7532571fb2
NO-OP: whitespace 2020-02-25 17:55:51 +01:00
4f8777e968
Tweak mach thread priority debug msg 2020-02-24 05:29:56 +01:00
e737a9b000 Fix setting CoreAudio RT-priority 2020-02-24 04:38:49 +01:00
587fc50059
Fix Inline-control visibility state
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-20 23:06:55 +01:00
4f5076a81a controllable::{get_set}_interface() are convenience wrappers for funcs that need the Rotary flag set 2020-02-20 12:25:51 -06:00
ca3714bccf NOOP: fix brace/newline use 2020-02-20 00:09:32 -07:00
d1b335b36e expose PlaybackBuffer::reservation and make the member const 2020-02-19 23:10:13 -07:00
58123c969b remove unused method 2020-02-19 23:09:51 -07:00
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
40cca52bbb Changes needed for building with MSVC
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-02-07 11:27:22 +00:00
5c789547cb
Fix building unit-tests 2020-01-27 17:43:37 +01:00
David Runge
2e9ac80e99
Towards waf python 2+3 support 2020-01-25 04:07:37 +01:00
bca825e515
NO-OP: whitespace 2020-01-14 00:52:24 +01:00
5ff8e260ff remove unnecessary call to xmlKeepBlanksDefault() 2020-01-05 17:58:54 -07:00
df3a4ed9c6 move call to xmlKeepBlanksDefault(0) to before the creation of an XML parser 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-05 17:58:54 -07:00
560994c97a repeat baf0cdcbef but for BaseUI, thus covering all control protocols 2020-01-05 11:40:59 -07:00
1ced4067aa ensure that xmlKeepBlankDefault() is called early in instance-life, from PBD::init()
See comment for details on why
2019-12-31 12:06:14 -07:00
John Emmas
75aaae9963 Fix two more cases of of C99 strtoll() 2019-12-31 10:11:18 +00:00
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
60ccbcf9cc use a local version (copy) of the G_SOURCE_FUNC macro, since it is not available in the GTK+ version we use for the official build stack 2019-12-30 09:49:23 -07:00
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
514c05a44e truncate unnecessarily verbose debug set/bits output 2019-12-14 10:40:07 -07:00
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
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
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
21e9c41d96 Fix catch of polymorphic type by value 2019-12-09 22:58:08 +01:00
John Emmas
09d34abaa9 MSVC project changes needed to support the new 'mp3 import' stuff 2019-12-08 15:04:02 +00:00
8d05f6d4b7 initial conversion to double buffering inside DiskReader
Second buffer is not used (or allocated) yet.
2019-12-07 10:30:38 -07:00
b157e1a09a
Remove invalid error message
This clause is in NO_VFORK, vfork_exec_wrapper is irrelevant there
2019-11-09 06:30:46 +01:00
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
24252b92c6 move at-exit messages about pool utilization to DEBUG_TRACE 2019-11-06 09:27:49 -07:00
01f65f557f
Fix build -- 'printf' was not declared in this scope 2019-11-03 14:15:11 +01:00
cd2618246a make it more likely that debug messages are printed without x-thread interruption 2019-11-02 16:32:18 -06:00
7852047dca
Fix XML-writer edge-case (empty content) 2019-11-01 15:39:44 +01:00
43eb64d23b add new debug bit (DebugTimestamps) that adds timestamps to all debug messages 2019-10-28 16:52:18 -06:00
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
feb5d1261e
Fix use of doxygen documented parameters in running text 2019-09-30 06:30:11 +02:00
ee54b13d6d
Fix some more doxygen warnings 2019-09-30 05:33:44 +02:00
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
5395a557d2
Another try at C++11/boost spinlock initialization 2019-09-26 02:48:17 +02:00
52021bc3ca
Consistent use of abort() /* NOTREACHED */
This fixes some static analysis warnings:
PBD::fatal transmitter needs to be connected to a function
that aborts. This is usually the case with GUI
2019-09-18 05:57:26 +02:00
bd229936ec add finite state machine to control/manage transport state 2019-09-17 18:26:03 -06:00
f52781b46b fix thinko when testing for internal seek with negative distance 2019-09-17 17:59:23 -06:00