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
nick_m
d118a60090
fix unused Outside filled framed curve for constant points outside the draw area.
2016-12-16 02:54:10 +11:00
nick_m
49c6d13386
revert c3ab67dd
now that this misbehaviour is understood.
2016-12-16 02:52:39 +11:00
nick_m
d3ad6dc001
fix issue with disappearing tempo curve at constant tempi.
2016-12-16 02:50:07 +11:00
nick_m
9add5ed480
tempo before the initial section is always constant.
2016-12-16 02:15:56 +11:00
nick_m
9afe719827
amend incomplete change in previous commit.
2016-12-16 02:01:50 +11:00
nick_m
a99331a4e9
more work on patch change redisplay.
...
- fixes just-introduced undo crash.
2016-12-16 01:58:58 +11:00
nick_m
2a79bcd6b2
fix thinko in TempoMap::framepos_plus_qn.
...
- affects region relative time conversion when
initial meter is non-zero.
2016-12-16 01:04:22 +11:00
cf4668a11e
std::list::erase() needs a non-const iterator.;
...
at least for some versions of gcc.
2016-12-15 11:40:22 +00:00
714da0f68e
and now with erase
2016-12-15 10:57:40 +01:00
71bfe79e2c
C++98 compatible iterator erase
2016-12-15 10:40:45 +01:00
a95be76741
rework request invalidation
...
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-15 06:11:30 +01:00
62b06fa427
Add a trash pool for invalidation requests.
...
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-14 22:39:25 +01:00
07bcdc7f0a
NO-OP: re-indent
2016-12-14 22:39:22 +01:00
77845f6019
Atomically to invalidate request
...
Yet another slightly overkill approach, but it /may/ explain crashes.
2016-12-14 22:39:18 +01:00
7dbdf6cc6d
Add some more invalidation debug messages.
2016-12-14 19:43:12 +01:00
6b5891a78f
The threading anecdotes - Episode 7
...
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-14 18:46:01 +01:00
518c31eeb7
skip dead threads (if the event remains, it'll be cleaned up below)
2016-12-14 17:48:44 +01:00
036390f4c2
fix potential invalid lock
2016-12-14 17:31:31 +01:00
7a1ff7ce8f
rework locking ( fa07233a
, 112fba182
)
...
For now: use a single lock, which should fix all related crashes.
optimize (with less contended partial locks) if this works.
2016-12-14 13:43:20 +01:00
f3b3a411d0
use SMF track or instrument names in imported MIDI track names, if requested
2016-12-14 11:46:26 +00:00
6ea7f37c6b
add new member to ImportStatus object to allow specifying how to name new MIDI tracks
2016-12-14 11:46:26 +00:00
721f3270c3
add a new enum to identify how SMF data should be used when naming imported MIDI tracks
2016-12-14 11:46:26 +00:00
d2fd01c241
add API to Evoral::SMF to retrieve all track/instrument names for use when importing
2016-12-14 11:46:26 +00:00
7e0dbd06db
extract track and instrument names from SMF while loading
2016-12-14 11:46:26 +00:00
24160a3b85
add braces and warning for unlikely error
2016-12-14 11:46:26 +00:00
ff6f8ca6c4
fix incorrect test for textual meta events in libsmf
2016-12-14 11:46:26 +00:00
54ef5fadc2
braces please
2016-12-14 11:46:26 +00:00
d5074be4f1
braces, please
2016-12-14 11:46:26 +00:00
8002a0c66e
free track name/instrument string memory when necessary
2016-12-14 11:46:26 +00:00
28caef7d81
add track and instrument name members to smf_track_t
2016-12-14 11:46:26 +00:00
dd525d1613
release locks before deleting record
2016-12-14 02:25:13 +01:00
112fba182f
amend prev commit
2016-12-14 00:51:40 +01:00
fa07233a17
mutex 'er up
...
Some overzealous locking to track down RequestObject related crashes.
bc0fa4d689
wrongly locked the current event loop's
request_invalidation_lock instead of the invalidation's list lock.
Also Abstract UI is able to delete requests concurrently with with
EventLoop invalidation.
e.g. PortManager::PortRegisteredOrUnregistered and GlobalPortMatrixWindow
so the lock needs to be exposed.
If this solves various issues, mutexes should to be consolidated
(request_buffer_map_lock + request_invalidation_lock) and be chosen
such that there is as little contention as possible.
2016-12-13 23:47:07 +01:00
545f5bee87
changes to adapt to modified version of GTK/Quartz which uses only MOD2 for Command, everywhere.
...
The default version of GTK2/Quartz uses MOD2+META for keys and MOD2 for scroll, which is
basically insane
2016-12-13 07:02:08 -05:00
989f934c38
Fix layered-record undo, include changes to existing region(s)
2016-12-13 02:33:07 +01:00
8276a4658a
Fix possible crash when removing ports with jack1
2016-12-12 22:47:16 +01:00
e37bfffca5
Add Slavable::AssignmentChanged signal to notify when a slavable is assigned/unassigned to/from a master
2016-12-12 18:43:55 +00:00
nick_m
e9deb82ef6
only update MidiRegion length_beats in partial copy ctor if there is an offset.
2016-12-13 04:36:07 +11:00
nick_m
a4d8cc2e04
only recalculate MidiRegion start_beats if there is an offset in the 'part-of' ctor.
...
- when drag-copying MIDI regions, a partial region ctor is used
which can lead to _start_beats being off by a sample.
this in turn leads to 7168 happening, but only if magnetic snap
is used and the regions are copied as a group.
this should fix 7168, but the magnetic snap part is not yet addressed.
2016-12-13 02:15:34 +11:00
d3803c54de
Fix a potential deadlock/crash (here tape-track peak-file)
...
read_peaks_with_fpp() already holds _lock, build_peaks_from_scratch()
takes the _lock again.
Depending on glib[mm] and the threading lib it may either result in a
deadlock, or with EDEADLK in undefined behavior when a
non-recursive lock is released twice.
2016-12-12 03:13:16 +01:00
b52bf1a42c
Fix potential deadlock on session-load
2016-12-12 00:09:38 +01:00
nick_m
e4d6e4a87f
disallow placement of audio-locked tempi within a frame of any other.
2016-12-12 02:37:26 +11:00
nick_m
9598f2a811
fix loop/crash when dragging an audio-locked tempo over a music-locked one while snapped to grid.
2016-12-12 02:07:00 +11:00
nick_m
0d7b298fbe
no-op - rename TempoMap::set_active_tempos -> TempoMap::set_active_tempi
2016-12-12 02:07:00 +11:00
nick_m
4d625d35b6
clean up some odd logic.
2016-12-12 02:07:00 +11:00
nick_m
34e41a3ca6
rename MetricSection movable -> initial, but of course initial is !movable..
2016-12-12 02:07:00 +11:00