From 9e1c7ccaf882e9a5d791dc2ec3ad174c931c2520 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 21 Sep 2016 23:07:59 -0500 Subject: push2: don't send ScaleChanged unless something did actually change --- libs/surfaces/push2/push2.cc | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'libs/surfaces') diff --git a/libs/surfaces/push2/push2.cc b/libs/surfaces/push2/push2.cc index 68ec8d7b91..a61ec12d71 100644 --- a/libs/surfaces/push2/push2.cc +++ b/libs/surfaces/push2/push2.cc @@ -1386,12 +1386,28 @@ Push2::set_pad_scale (int root, int octave, MusicalMode::Type mode, bool inkey) /* store state */ - _scale_root = original_root; - _root_octave = octave; - _in_key = inkey; - _mode = mode; + bool changed = false; - ScaleChange (); /* EMIT SIGNAL */ + if (_scale_root != original_root) { + _scale_root = original_root; + changed = true; + } + if (_root_octave != octave) { + _root_octave = octave; + changed = true; + } + if (_in_key != inkey) { + _in_key = inkey; + changed = true; + } + if (_mode != mode) { + _mode = mode; + changed = true; + } + + if (changed) { + ScaleChange (); /* EMIT SIGNAL */ + } } void -- cgit v1.2.3