Commit graph

17229 commits

Author SHA1 Message Date
David Robillard
b0fb8ae2c9 Factor away duplicated ARDOUR_UI::toggle_roll() body 2021-06-17 11:07:58 -04:00
David Robillard
648124dacb WIP: Sync SessionController::transport_play() with ARDOUR_UI 2021-06-17 11:07:33 -04:00
David Robillard
c4a8dfddfe Sync SessionController::remove_marker_at_playhead() with Editor 2021-06-17 11:07:08 -04:00
David Robillard
30f5e50f85 Sync SessionController::toggle_roll() with ARDOUR_UI 2021-06-17 11:05:54 -04:00
David Robillard
125f7ea273 WIP: Add SessionControllerHandleRef
This can be used to ensure that whenever this has a reference to a session, it
also has a session controller set up to use that session.  Towards sharing code
between ARDOUR_UI and SessionController.

WIP: SessionHandleRef|Ptr are not safe abstractions, so this isn't either,
since derived types can and do manually mess around with the session pointer.
Probably lifetime bugs here, and probably a good idea to statically prevent
that, but a /lot/ of existing code uses _session directly.
2021-06-17 11:04:15 -04:00
David Robillard
83626ae637 Move SessionController to libardour 2021-06-17 11:03:11 -04:00
David Robillard
1559829e24 Factor out SessionController from BasicUI
Towards sharing this code with ARDOUR_UI.
2021-06-17 11:02:08 -04:00
David Robillard
8998efa8c8 Move RecordState to ardour/types.h
This allows it to be used without including session.h.  Using this pointless
cast syntax to make it easy to mechanically convert them all when we can
finally use strong enums.
2021-06-17 11:01:05 -04:00
David Robillard
43ea100381 Put BasicUI in namespace ARDOUR 2021-06-17 10:59:32 -04:00
David Robillard
e4163b47e0 Factor out ControlProtocol::get_session() 2021-06-17 10:58:30 -04:00
David Robillard
ab17e1e019 Remove some unnecessary Session dependency in Push2 surface 2021-06-17 10:57:29 -04:00
David Robillard
56fe5b47ae Rename ControlProtocol::session to ControlProtocol::_session
To match ARDOUR_UI, towards finally sharing code here.
2021-06-17 10:57:07 -04:00
David Robillard
927c7328cc Make some calculations const 2021-06-17 10:56:05 -04:00
David Robillard
181ec1e207 Remove null session checks from OSC surface
Control surface lifetime is managed to be shorter than the session lifetime, if
the session does not exist, then the control surface does not exist either.
2021-06-17 10:55:43 -04:00
David Robillard
e70a2dc461 Remove tranzport surface
This has not been possible to build for some time, so if anyone was going to
miss it, they would have already.
2021-06-17 10:51:45 -04:00
David Robillard
3a14559a9a Remove dead code in ContourDesignControlProtocol
These were identical to SessionController::prev_marker() and
SessionController::next_marker(), but weren't actually used.
2021-06-17 09:56:50 -04:00
David Robillard
73ad115486 Remove dead code in BasicUI and ControlProtocol 2021-06-17 09:56:49 -04:00
David Robillard
8adc08adc0 Clean up control_protocol includes
This order (most local first) is better because it's more likely to catch
missing includes.
2021-06-17 09:56:48 -04:00
David Robillard
0fae0055e9 Clean up whitespace 2021-06-17 09:56:47 -04:00
David Robillard
c6bdf8f2ff Factor out duplicated MidiByteArray 2021-06-17 09:56:46 -04:00
Robin Gareus
cc6b58ef00
Fix Windows builds (pthread handle abstraction) 2021-06-17 13:32:10 +02:00
Robin Gareus
0b1d5e4a45
Remove dead assignment 2021-06-16 22:30:09 +02:00
Robin Gareus
f85bbaa97d
Fix C++11ism 2021-06-16 03:03:26 +02:00
Paul Davis
ad9ac0911e remove some timing stats that it seems unlikely we will use 2021-06-15 14:03:55 -06:00
Luciano Iam
04104b68a6 WebSockets: fix surface build for older systems 2021-06-14 14:50:48 +02:00
Luciano Iam
5fffe985bb WebSockets: update some source headers 2021-06-14 14:45:51 +02:00
Luciano Iam
6cc59ad8e6 WebSockets: update some comments in source
Based on feedback from libwebsockets author
https://github.com/warmcat/libwebsockets/issues/2322#issuecomment-860572124
2021-06-14 12:25:29 +02:00
Luciano Iam
f1d7e1759a WebSockets: repeat 8baf275 for JS files
Like ec131fc does
2021-06-14 10:25:45 +02:00
Luciano Iam
ebee3a8010 WebSockets: remove unnecessary code
Leftovers from copy and pasting from test_ui.cc
2021-06-14 10:02:25 +02:00
Luciano Iam
cb73eb350d WebSockets: less invasive version of 5407232
There is no need to connect signals twice, can connect them directly to the
helper UI loop and skip the surface loop. Then let the server decide if it is
necessary to call lws_cancel_service() or not.

Also rename WebsocketsServer::should_request_write() to read_blocks_event_loop()
it makes more sense for the caller now on-demand write logic is completely
implemented by the server class.
2021-06-14 10:02:25 +02:00
Robin Gareus
fc6fd7973f
Reset performance counters along with xrun count
This is mainly relevant after session export, which uses
freewheeling and processing take much longer than running realtime.
2021-06-14 03:14:07 +02:00
Robin Gareus
80c11a763a
Notify GUI of x-run counter resets 2021-06-14 03:09:46 +02:00
Robin Gareus
c06553c2de
Reset x-run counter after disabling freewheeling 2021-06-14 03:09:42 +02:00
Paul Davis
d6a1a64398 remove debug output 2021-06-13 18:36:44 -06:00
Paul Davis
c15e6fd7db fix condition-variable race caused by not holding the request lock when signalling the var 2021-06-13 18:35:33 -06:00
Robin Gareus
21f4598395
Fix DR refill when exporting multiple timespans #8742
In between timespans Ardour disables freewheeling and
only later resumes freewheel. It can happen that
Session::process can summon the butler while start_audio_export()
calls Track::seek.

Just waiting for an earlier Butler::wait_until_finished() does
not prevent the butler from running again later.

This can lead to concurrent calls of DR::refill_audio from both
the butler and start_audio_export(), leading to garbled buffers.
2021-06-14 02:18:54 +02:00
Robin Gareus
ec131fcb70
Set Thread name to aid debugging 2021-06-14 01:29:16 +02:00
Robin Gareus
95f8a3aace
Explicitly prevent unsigned int wrap-around
This is a NOOP (0 - 1) + 2 == (0 + 2) - 1 but avoids
a unsigned int wrap-wrap around for good measure.
2021-06-14 00:43:08 +02:00
Robin Gareus
c8205cc6d9
Fix final export-timespan count
ExportHandler::start_timespan() is also used to stop export
when there are no more timespans to be processed.

This is done because freewheeling has to be stopped from
outside the process cycle.
2021-06-14 00:40:23 +02:00
Luciano Iam
e3569b6469
WebSockets: notify server there are pending client updates
This is an update to the surface ArdourFeedback class that is needed to support
the new event loop integration method.

The various session event callbacks cannot be queued in the surface event loop
because that would create a delay between the time such events are fired and
the time for writing to clients arrive, due to lws_service() blocking while
it waits to read. To solve this issue a helper AbstractUI is created for
catching events as soon as possible and issuing a call to lws_cancel_service().

See WebsocketsServer::glib_idle_callback()
2021-06-13 22:00:29 +02:00
Luciano Iam
b3661af92a
WebSockets: additional method for event loop integration
Some distro repositories offer versions of libwebsockets that have not been
compiled with LWS_WITH_GLIB or LWS_WITH_EXTERNAL_POLL enabled. For such cases
a different event loop integration method is needed.

True for Ubuntu 20.04 as of Jun '21
2021-06-13 22:00:29 +02:00
Luciano Iam
5f504f23ac
WebSockets: reduce server log verbosity 2021-06-13 22:00:28 +02:00
Luciano Iam
373d905a93
Update websockets surface author email in source files 2021-06-13 22:00:28 +02:00
Luciano Iam
12a7480ea3
Move #include inside header guard 2021-06-13 22:00:28 +02:00
Paul Davis
8d1e999be4 libardour: reset perf meters after warmup period is over 2021-06-13 12:21:08 -06:00
Paul Davis
b939b2e68d libardour: provide a global function for resetting performance meters 2021-06-13 12:20:42 -06:00
Paul Davis
e511cd2cb7 JACK backend: "fix" RunLoop timing 2021-06-13 11:11:03 -06:00
Paul Davis
a5f7c793e3 add a new "Run Loop" timing stats for ALSA and JACK backends 2021-06-13 10:28:51 -06:00
Paul Davis
a89ad7a265 add queue-reset method to PBD::TimingStats 2021-06-13 10:28:51 -06:00
Robin Gareus
f196256604
Fix jack2 input-port monitoring
Port_connect must be called with correct order (src, dst),
and may only be called after the client is active.

jack2 reported errors:
> Destination port in attempted (dis)connection of ardour:physical_input_monitor_enable and system:capture_1 is not an input port
> Cannot connect ports owned by inactive clients: "ardour" is not active
2021-06-13 17:41:41 +02:00