clap

CLAP Audio Plugin API
Log | Files | Refs | README | LICENSE

commit eba55005bb9b3b7212835e0d72c2cc2aeeab4a5d
parent 2a1417871ee8915b4da389597cc41ddc146bee51
Author: Alexandre BIQUE <bique.alexandre@gmail.com>
Date:   Wed, 15 Sep 2021 17:56:56 +0200

Oups

Diffstat:
Mexamples/plugins/core-plugin.cc | 2+-
Mexamples/plugins/gui/transport-proxy.cc | 43++++++++++++++++++++++---------------------
Mexamples/plugins/remote-gui.cc | 2+-
3 files changed, 24 insertions(+), 23 deletions(-)

diff --git a/examples/plugins/core-plugin.cc b/examples/plugins/core-plugin.cc @@ -198,7 +198,7 @@ namespace clap { if (!_hasTransportCopy) { if (process->transport) { _hasTransport = true; - memcpy(&_transportCopy, &process->transport, sizeof(_transportCopy)); + _transportCopy = *process->transport; } else _hasTransport = false; diff --git a/examples/plugins/gui/transport-proxy.cc b/examples/plugins/gui/transport-proxy.cc @@ -26,30 +26,31 @@ void TransportProxy::update(bool hasTransport, const clap_event_transport &t) { t.flags & CLAP_TRANSPORT_IS_WITHIN_PRE_ROLL, &TransportProxy::isWithinPreRollChanged); - update(_songPositionBeats, - t.song_pos_beats / double(CLAP_BEATTIME_FACTOR), - &TransportProxy::songPositionBeatsChanged); - update(_songPositionSeconds, - t.song_pos_seconds / double(CLAP_SECTIME_FACTOR), - &TransportProxy::songPositionSecondsChanged); + update<double>(_songPositionBeats, + t.song_pos_beats / double(CLAP_BEATTIME_FACTOR), + &TransportProxy::songPositionBeatsChanged); + update<double>(_songPositionSeconds, + t.song_pos_seconds / double(CLAP_SECTIME_FACTOR), + &TransportProxy::songPositionSecondsChanged); - update(_tempo, t.tempo, &TransportProxy::tempoChanged); + update<double>(_tempo, t.tempo, &TransportProxy::tempoChanged); - update(_barStart, t.bar_start / double(CLAP_BEATTIME_FACTOR), &TransportProxy::barStartChanged); - update(_barNumber, t.bar_number, &TransportProxy::barNumberChanged); + update<double>( + _barStart, t.bar_start / double(CLAP_BEATTIME_FACTOR), &TransportProxy::barStartChanged); + update<int>(_barNumber, t.bar_number, &TransportProxy::barNumberChanged); - update(_loopStartBeats, - t.loop_start_beats / double(CLAP_BEATTIME_FACTOR), - &TransportProxy::loopStartBeatsChanged); - update(_loopEndBeats, - t.loop_end_beats / double(CLAP_BEATTIME_FACTOR), - &TransportProxy::loopEndBeatsChanged); - update(_loopStartSeconds, - t.loop_start_seconds / double(CLAP_SECTIME_FACTOR), - &TransportProxy::loopStartSecondsChanged); - update(_loopEndSeconds, - t.loop_end_seconds / double(CLAP_SECTIME_FACTOR), - &TransportProxy::loopEndSecondsChanged); + update<double>(_loopStartBeats, + t.loop_start_beats / double(CLAP_BEATTIME_FACTOR), + &TransportProxy::loopStartBeatsChanged); + update<double>(_loopEndBeats, + t.loop_end_beats / double(CLAP_BEATTIME_FACTOR), + &TransportProxy::loopEndBeatsChanged); + update<double>(_loopStartSeconds, + t.loop_start_seconds / double(CLAP_SECTIME_FACTOR), + &TransportProxy::loopStartSecondsChanged); + update<double>(_loopEndSeconds, + t.loop_end_seconds / double(CLAP_SECTIME_FACTOR), + &TransportProxy::loopEndSecondsChanged); update<int>(_timeSignatureNumerator, t.tsig_num, &TransportProxy::timeSignatureNumeratorChanged); update<int>( diff --git a/examples/plugins/remote-gui.cc b/examples/plugins/remote-gui.cc @@ -217,7 +217,7 @@ namespace clap { }); if (_isTransportSubscribed && _plugin._hasTransportCopy) { - messages::UpdateTransportRequest rq{_plugin._hasTransport, _plugin._hasTransportCopy}; + messages::UpdateTransportRequest rq{_plugin._hasTransport, _plugin._transportCopy}; _channel->sendRequestAsync(rq); _plugin._hasTransportCopy = false; }