summaryrefslogtreecommitdiff
path: root/libs/surfaces
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2016-09-21 23:07:59 -0500
committerPaul Davis <paul@linuxaudiosystems.com>2016-09-27 14:59:31 -0500
commit9e1c7ccaf882e9a5d791dc2ec3ad174c931c2520 (patch)
treef3380ffe014385fe78bfd54c51ab437b6a180fd7 /libs/surfaces
parent33713d6f68934739fea7d48b04077409bf6a0966 (diff)
push2: don't send ScaleChanged unless something did actually change
Diffstat (limited to 'libs/surfaces')
-rw-r--r--libs/surfaces/push2/push2.cc26
1 files changed, 21 insertions, 5 deletions
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