projects
/
ardour.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Preference Dropdown to limit Automatable Parameters
[ardour.git]
/
gtk2_ardour
/
automation_controller.cc
diff --git
a/gtk2_ardour/automation_controller.cc
b/gtk2_ardour/automation_controller.cc
index 5502cf50017f137364f0b3e1e40698d991b75a99..c7860c53cb5f5e89179ea8cc96980cc4dbae5731 100644
(file)
--- a/
gtk2_ardour/automation_controller.cc
+++ b/
gtk2_ardour/automation_controller.cc
@@
-70,6
+70,7
@@
AutomationController::AutomationController(boost::shared_ptr<AutomationControl>
, _controllable(ac)
, _adjustment(adj)
, _ignore_change(false)
, _controllable(ac)
, _adjustment(adj)
, _ignore_change(false)
+ , _grabbed(false)
{
if (ac->toggled()) {
ArdourButton* but = manage(new ArdourButton());
{
if (ac->toggled()) {
ArdourButton* but = manage(new ArdourButton());
@@
-165,6
+166,13
@@
AutomationController::display_effective_value ()
{
double const interface_value = _controllable->internal_to_interface(_controllable->get_value());
{
double const interface_value = _controllable->internal_to_interface(_controllable->get_value());
+ if (_grabbed) {
+ /* we cannot use _controllable->touching() here
+ * because that's only set in Write or Touch mode.
+ * Besides ctrl-surfaces may also set touching()
+ */
+ return;
+ }
if (_adjustment->get_value () != interface_value) {
_ignore_change = true;
_adjustment->set_value (interface_value);
if (_adjustment->get_value () != interface_value) {
_ignore_change = true;
_adjustment->set_value (interface_value);
@@
-177,7
+185,10
@@
void
AutomationController::value_adjusted ()
{
if (!_ignore_change) {
AutomationController::value_adjusted ()
{
if (!_ignore_change) {
- _controllable->set_value (_controllable->interface_to_internal(_adjustment->get_value()), Controllable::NoGroup);
+ const double new_val = _controllable->interface_to_internal(_adjustment->get_value());
+ if (_controllable->user_double() != new_val) {
+ _controllable->set_value (new_val, Controllable::NoGroup);
+ }
}
/* A bar controller will automatically follow the adjustment, but for a
}
/* A bar controller will automatically follow the adjustment, but for a
@@
-194,6
+205,7
@@
AutomationController::value_adjusted ()
void
AutomationController::start_touch()
{
void
AutomationController::start_touch()
{
+ _grabbed = true;
_controllable->start_touch (_controllable->session().transport_sample());
}
_controllable->start_touch (_controllable->session().transport_sample());
}
@@
-201,6
+213,10
@@
void
AutomationController::end_touch ()
{
_controllable->stop_touch (_controllable->session().transport_sample());
AutomationController::end_touch ()
{
_controllable->stop_touch (_controllable->session().transport_sample());
+ if (_grabbed) {
+ _grabbed = false;
+ display_effective_value ();
+ }
}
bool
}
bool