Commit Graph

272 Commits

Author SHA1 Message Date
b58dfc7f0f
Resolve microseconds_t ambiguity 1/2
This resolves a PBD vs ARDOUR namespace error for some compilers:
```
error: reference to 'microseconds_t' is ambiguous
libs/pbd/pbd/microseconds.h:29:19: error: candidates are: typedef uint64_t PBD::microseconds_t
libs/ardour/ardour/types.h:81:29: error:                  typedef PBD::microseconds_t ARDOUR::microseconds_t
```
2021-06-27 17:33:05 +02:00
db1821a363
Fix crash when removing plugin with mapped controllable #8756
MidiControlUI drops the reference to a given controllable in
its own thread. This can happen after the plugin is already
destroyed (even though the PBD::Controllable still exists).
2021-06-21 05:27:11 +02:00
74e21e942e Remove unused variables (Wunused-variable) 2021-05-30 20:09:35 -04:00
4d815554dd Various Control Surfaces: Fix one off in calculation of fader position
MIDI pitch bend holds 14 bits (16384) which gives values of 0 to 16383.
2021-05-07 18:02:44 -05:00
5957e14259
Remove unused #include<> (2/2)
PBD::stacktrace() is not used nor needed by default.
It should be used sparingly.
2021-05-05 17:57:16 +02:00
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
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
John Emmas
d2cb383965 MSVC changes to support the new code modules (Tabbable API stuff) 2021-02-24 14:32:23 +00:00
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
bbb6851468
Subscribe to pretty-port name changes (surfaces) 2021-01-18 03:18:20 +01:00
ddcf3eb684 Generic Midi encoders fixed 2020-10-24 16:06:04 -07:00
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
9398a6f60a
Fix generic MIDI encoder off by one
Increment for CC values > 0x40, decrement control for values <= 40.
 - 0x41 increment by one
 - 0x40 decrement by one

previously: 0x3f decremented by one, 0x3e by two, .. 0x00 by 64,
but 0x40 also by 64.
2020-06-06 17:10:31 +02:00
43bed39d30
Reset MIDI-control when a given ctrl is not available
This fixes an issue with "/route/eq/freq/0 S1":
When a newly select strip that does not have a EQ
(e.g. mixbus or master), the control from the previously
selected strip is used.  -- Reported by tavasti on IRC.
2020-02-20 19:13:58 +01:00
06b2eb1c27
Explicitly use OSX
Previously this was inherited via PBD.

On MacOS/X,  this adds
  "-undefined dynamic_lookup -flat_namespace"
and various "-framework .." options to linkflags

Without this flag, .dylibs fail to link usually because
of missing `-lintl` (Undefined symbols: "_libintl_dgettext")

On other systems this is a NO-OP:
CFLAGS_OSX, CXXFLAGS_OSX and LINKFLAGS_OSX
are only set on the darwin platform.
2020-01-25 04:07:41 +01:00
d100c92731 convert GenericMIDI into a real control protocol module, with its own event loop and ports 2019-12-31 12:06:14 -07:00
007136cc23 remove MIDI Control input and output ports from session-level objects 2019-12-31 12:06:14 -07:00
365f6d6337
Update plugins/addons GPL boilerplate and (C) from git log 2019-08-03 15:53:18 +02:00
9ac18a8e0f
Generic-MIDI ctrl: tweak pitch-bend message behavior
Add support for smoothing, ignore message when controllers are
not in sync to avoid discontinuous jumps.

This is mainly useful for Mackie-like devices that use pitch-bend
messages for faders.

see also https://discourse.ardour.org/t/feature-lazy-sliders/100961
2019-05-09 16:06:00 +02:00
5bde8f4456
Tweak initial generic-midi sync/smoothing
"last_controllable_value" is using midi value range (0..127).
It is used to compare received midi-value with the actual controllable
for non-motorized surfaces, and this change allows the first
event to already be in_sync.

Previously the first MIDI-event was usually ignored (because
last_controllable_value was out of bounds or didn't match the 0..127
range.
2019-05-05 02:49:53 +02:00
3448f3151e
NO-OP: whitespac 2019-03-23 17:35:26 +01:00
c97116083f
Fix generic-midi controllable race-condition
Continued work after e9b36f2bea. Prefer a shared_ptr<>.

MIDIControllable::write_feedback() runs in realtime context, directly
from the main process-thread. Synchronizing weak-pointers and deletion
across threads does not work reliably. Retaining a shared_ptr<> for
controllables that are in use can solve this.
2019-03-23 16:32:48 +01:00
73029d45ba
Re-add global lookup for generic-midi ctrl state 2019-03-23 04:24:39 +01:00
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
baed14c17e
Prepare PBD::Controllable API cleanup (remove only registry user) 2019-03-23 01:41:55 +01:00
9a1c22d7e1
Remove unusued API Create/Delete Binding 2019-03-23 01:28:23 +01:00
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
b519434744 Adapt our remaining MSVC projects for 'boost::atomic' (in case it later gets extended to the other libs)
Stage 2 of 3 (more to follow)
2018-09-30 09:06:25 +01:00
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
79f01bc889 Initial changes needed for building Mixbus (with MSVC) as version 5
(Mixbus itself will probably need extra changes)
2018-09-10 07:14:59 +01:00
ff03eeab04 fix mixing scope brace 2018-06-25 10:06:57 -04:00
d7ac5792b8 Accommodate recently removed source(s) in our MSVC project (libardour)
(this also needs ardour_genericmidi to link to both evoral and boost-regex)
2018-06-25 12:11:10 +01:00
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
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
3cd79cd80f Sort generic-midi bindings alphabetically 2018-03-13 16:18:03 +01:00
Jan Lentfer
a2af019c95 generic_midi: add proper handling of midi controll toggles 2018-03-03 14:04:12 +01:00
b9c9777b9a When building with MSVC, allow for the fact that Mixbus and Ardour can be using different versions of the SESSION_FILE format 2018-02-15 09:03:32 +00:00
6f019faaa0 Accommodate the change from libtimecode to libtemporal 2018-02-14 10:02:11 +00:00
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
561c8eea0c Prototype to allow embedding sysex in midi-map 2017-12-06 16:33:58 +01:00
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
2fa34614d0 Remove unnecessary tests for touch-state 2017-07-25 20:16:04 +02:00
567c0a8f53 Switch to PBD control-math and prefer Controllable API
Note: Control-surfaces should always use interface_to_internal()
and internal_to_interface().
2017-06-21 18:12:04 +02:00
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
eb3f50e15c change the way ControlProtocols (control surfaces) are notified and handle Stripable selection changes
The Editor continues to notify them, but via a direct call to ControlProtocolManager, not a signal.
The CP Manager calls the ControlProtocol static method to set up static data structures holding
selection info for all surfaces and then notifies each surface/protocol that selection has changed.
2017-05-12 14:51:39 +01:00
23eb1fbf01 Use PBD::string_to<bool>() in GenericMidiControlProtocol class
Equivalent to PBD::string_is_affirmative()
2017-04-19 09:36:59 +10:00
f82cb87f0c Use XMLNode::get/set_property API in MIDIControllable class 2017-04-19 09:36:54 +10:00
3be0170e82 Use XMLNode::get/set_property API in GenericMidiControlProtocol class 2017-04-19 09:36:54 +10:00
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
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