Commit graph

160 commits

Author SHA1 Message Date
Robin Gareus
f6a2ee0103
Prefer std::regex, and modern C++ string search 2025-11-11 19:04:16 +01:00
Mads Kiilerich
140670541f Use .inc.h for #include files that not are plain headers
Regular .h files *should* be self-contained and independent of previous
includes and guarded to only include once. Make it clear which files
that *doesn't* apply for at all.
2024-10-20 03:11:53 +02:00
Robin Gareus
74c4ca3e52
Reduce reliance on boost - the hard part
the rest from `tools/convert_boost.sh`.

* replace boost::function, boost::bind with std::function and std::bind.

This required some manual fixes, notably std::placeholders,
some static_casts<>, and boost::function::clear -> = {}.
2024-10-19 03:47:21 +02:00
Robin Gareus
88a24ae8e5
Let PBD::Thread set thread-name 2024-09-28 03:16:07 +02:00
Robin Gareus
fa6fbbf810
Fix ctrl surface shutdown sequence
Tear down GUI before stopping event loop, this fixes
a crash on windows (and perhaps a rare crash on other OS).
2024-07-11 19:19:21 +02:00
Robin Gareus
0fd1edd78e
Update well-known ctrl: separate global and per band EQ enum 2024-01-15 15:34:55 +01:00
Robin Gareus
bfb22e2acc
Ctrl Surfaces: update bound controllables
Note: this only affects surfaces that use mapped_controls, and do
not already subscribe to processors_changed/RouteProcessorChange signal.
2024-01-13 17:14:17 +01:00
Robin Gareus
70a0b47cef
Update Ctrl Surfaces: use new well-known-ctrl API 2024-01-13 03:08:51 +01:00
Ben Loftis
2713c40b7d extend midi-controllable params with new well-known-controls 2023-04-06 14:52:09 -05:00
Paul Davis
b35518e212 switch from boost::{shared,weak}_ptr to std::{shared,weak}_ptr
This is mostly a simple lexical search+replace but the absence of operator< for
std::weak_ptr<T> leads to some complications, particularly with Evoral::Sequence
and ExportPortChannel.
2023-03-24 14:19:15 -06:00
Paul Davis
716501defa potential fix for "/bus/... master ..." target in MIDI binding maps failing 2022-12-06 11:11:08 -07:00
Robin Gareus
a6f8f2dd9e
Consolidate search/file-system paths (fixes vst builds)
Keep file-system paths and PBD::Searchpath mostly separate.
This amends 58c2b0a848 libs/fst directly includes relevant
ardour C++ code, so lib/fst must not link against libardour.

The problem was that 58c2b0a848 introduced additional
dependencies on other libardour functions.
2022-11-19 00:48:11 +01:00
Paul Davis
58c2b0a848 move midi maps folders and file extension out of control surfaces library 2022-11-18 14:04:59 -07:00
Robin Gareus
6813884857
Restore custom generic midi settings #9062
DeviceInfo (bindings file) can include explicit motorized
and threshold settings. These values, when specified, are
used during load_bindings() during set_state and overwrote
any user customization.

Furthermore showing the GUI invalidated any prior setting
by explicitly calling binding_changed, which re-applies.
2022-11-02 17:44:00 +01:00
Robin Gareus
9a34d15b3c
Fix crash when disabling generic MIDI surface
The event-loop has to be stopped before unregistering ports
and deleting the instance.
2022-09-30 01:58:24 +02:00
luz paz
47c525315d Fix various typos
Found via `codespell -q 3 -S *.po,./.git,./share/patchfiles,./libs,./msvc_extra_headers,./share/web_surfaces,*.patch  -L ba,buss,busses,discreet,doubleclick,hsi,ontop,ro,scrollin,seh,siz,sord,sur,te,trough,ue`
2022-08-03 12:10:01 -06:00
Paul Davis
75fe2ce095 generic MIDI: extend select function API and make argument be bank-relative, always 2022-06-05 15:37:04 -06:00
Paul Davis
7bf89ce109 Constification: make Stateful::get_state() const, with all other required const-ness added (libs) 2022-04-06 21:56:59 -06:00
Paul Davis
086e48796c surfaces: first round of conversion to use timeline types 2021-08-13 12:51:29 -06:00
David Robillard
74e21e942e Remove unused variables (Wunused-variable) 2021-05-30 20:09:35 -04:00
Robin Gareus
e0a6aba28d
Ignore saved port-name when loading ctrl-surface state
In some cases old and/or conflicting port names were saved
with the session (e.g. "Faderport" for FP1,8). Loading old sessions
then merges this state into the config, which could lead to
port-registration failure when the surfaces was enabled.
2021-04-17 02:07:09 +02:00
Robin Gareus
c212909282
Ctrl-surface: do not name single-channel bundle ports
Follow Session::setup_bundles() lead for single channel
MIDI bundles. This cleans-up the port-matrix display and
removes redundant names. The underlying engine port-name
is not of interest to the user.
2021-04-17 00:43:20 +02:00
Robin Gareus
acfa04d700
Update Ctrl-surface MIDI port list when ports change
This is a better variant of bbb6851468, directly using
the GUI context without indirection.
2021-02-04 06:19:37 +01:00
Robin Gareus
bbb6851468
Subscribe to pretty-port name changes (surfaces) 2021-01-18 03:18:20 +01:00
Robin Gareus
fcd347fe0c
Fix --no-nls, i18n include order in libs -- #8361
Ardour's "pbd/i18n.h" needs to be included last,
after any include that may indirectly pull in getext or libintl.

For that reason "pbd/i18n.h" must not be used in header files either.
2020-08-19 17:39:32 +02:00
Paul Davis
d100c92731 convert GenericMIDI into a real control protocol module, with its own event loop and ports 2019-12-31 12:06:14 -07:00
Paul Davis
007136cc23 remove MIDI Control input and output ports from session-level objects 2019-12-31 12:06:14 -07:00
Robin Gareus
365f6d6337
Update plugins/addons GPL boilerplate and (C) from git log 2019-08-03 15:53:18 +02:00
Robin Gareus
3448f3151e
NO-OP: whitespac 2019-03-23 17:35:26 +01:00
Robin Gareus
73029d45ba
Re-add global lookup for generic-midi ctrl state 2019-03-23 04:24:39 +01:00
Robin Gareus
e9b36f2bea
Update GenericMidiControlProtocol to use shared/weak Controllable pointers
This fixes a race-condition when a controllable is deleted
while sending feedback to the device.

Previously there was a race-condition MIDIControllable::write_feedback()
triggered from rt-thread, processed in Surface-thread and deleting
a route or processor.

This is a first step, currently state-restore is not fully functional
session->controllable_by_id() does not cover all Controllables.
2019-03-23 02:09:39 +01:00
Robin Gareus
baed14c17e
Prepare PBD::Controllable API cleanup (remove only registry user) 2019-03-23 01:41:55 +01:00
Robin Gareus
9a1c22d7e1
Remove unusued API Create/Delete Binding 2019-03-23 01:28:23 +01:00
Robin Gareus
b6b353d452 Handle generic-midi bindings per session.
This allows to special-cases session-specific control-surface state.
e.g. midi-learn.

Only restore midi-learned, session-specific, bindings when loading a
session with generic-midi enabled.

Also dis/re-enable generic-midi resets midi-learned, but no other
session-independent settings.

This also handles the edge case:
 1) load global config, generic-midi = ON, w/ bindings.
    state is remembered as cpi->state
 2) load session-condig, generic-midi = OFF, cpi->state is retained
 3) user enables the surface, cpi->state from (1) is applied.
 -> invalid bindings applied -> fail
2018-10-04 02:30:21 +02:00
Robin Gareus
357361c89d Fix --no-nls (4/5), i18n include order in libs/*
"i18n.h" needs to be included last (after any includes that may indirectly
pull in getext or libintl etc)
2018-09-21 19:05:39 +02:00
Paul Davis
ff03eeab04 fix mixing scope brace 2018-06-25 10:06:57 -04:00
Paul Davis
8725ed5bd1 add Ctl_Dial to get better behaviour when binding a MIDI controller KNOB/DIAL to a toggled controllable.
No intent to change Ctl_Momentary or Ctl_Toggle behaviour, plus I tried to document what they are intended to support
2018-06-21 22:28:11 -04:00
Paul Davis
8a18929d57 remove Session::controllable_by_descriptor() and move code into GenericMIDI code (the only user).
This also removes enums introduced to describe well-known parameters for Mixbus. Lookup now involves string
parsing every time, but this is not likely to be a notable cost.
2018-06-21 13:05:58 -04:00
Jan Lentfer
a2af019c95 generic_midi: add proper handling of midi controll toggles 2018-03-03 14:04:12 +01:00
Robin Gareus
3cb952d7fb Revert "Prototype to allow embedding sysex in midi-map"
This reverts commit 561c8eea0c.
It is rare that a device needs sysex-initialization every time it is
connected, besides a single simple "Sysex" entry without options
is not very flexible.
2017-12-19 17:45:03 +01:00
Robin Gareus
561c8eea0c Prototype to allow embedding sysex in midi-map 2017-12-06 16:33:58 +01:00
Paul Davis
30b087ab3d globally change all use of "frame" to refer to audio into "sample".
Generated by tools/f2s. Some hand-editing will be required in a few places to fix up comments related to timecode
and video in order to keep the legible
2017-09-18 12:39:17 -04:00
Robin Gareus
2fa34614d0 Remove unnecessary tests for touch-state 2017-07-25 20:16:04 +02:00
Tim Mayberry
640d9d355f Use correct property name in generic MIDI surface
Fixes restoring the feedback interval property, but as the mutator/setter
method doesn't seem to be used this change should have no affect.
2017-05-26 08:48:04 +10:00
Tim Mayberry
23eb1fbf01 Use PBD::string_to<bool>() in GenericMidiControlProtocol class
Equivalent to PBD::string_is_affirmative()
2017-04-19 09:36:59 +10:00
Tim Mayberry
3be0170e82 Use XMLNode::get/set_property API in GenericMidiControlProtocol class 2017-04-19 09:36:54 +10:00
Robin Gareus
55cd96df8d Clean up after generic MIDI surface -- #7311
When there are some non-released MIDIControllables, signal are still
delivered to the objects, even if there's no surface thread to handle
the signals anymore.
2017-04-16 19:06:17 +02:00
Robin Gareus
ad6ddf70df Don't allow GMCP to override loading_state_version
- GMPC does not use it directly
- when GMPC was enabled Stateful::loading_state_version was set to 1000
  (the protocol is at 1.0.0)
- it messes up session-loading, particularly various plugin states and
  templates (e.g  Processor::set_state_2X was used)
2017-03-04 17:55:22 +01:00
Paul Davis
93f837b43e generic MIDI: put controllables into touch mode (if appropriate) when data is received 2017-01-23 13:25:56 +01:00
Paul Davis
7daf620a8d add some comments 2017-01-22 19:49:40 +01:00