Mercurial > hg > touchkeys
comparison Source/Mappings/KeyDivision/TouchkeyKeyDivisionMappingFactory.cpp @ 44:73576f49ad1c
Trying out a new method for parsing OSC emulation strings which may be more Windows-friendly. Also added basic support for keyboard divisions on the display.
author | Andrew McPherson <andrewm@eecs.qmul.ac.uk> |
---|---|
date | Sat, 23 Aug 2014 23:46:38 +0100 |
parents | 0deac2806a7b |
children | 003236a1e29b |
comparison
equal
deleted
inserted
replaced
43:fa39caec190b | 44:73576f49ad1c |
---|---|
21 which triggers different actions or pitches depending on where the key | 21 which triggers different actions or pitches depending on where the key |
22 was struck. | 22 was struck. |
23 */ | 23 */ |
24 | 24 |
25 #include "TouchkeyKeyDivisionMappingFactory.h" | 25 #include "TouchkeyKeyDivisionMappingFactory.h" |
26 #include "../../Display/KeyboardDisplay.h" | |
26 | 27 |
27 // Yarman-24 Turkish microtonal tuning: | 28 // Yarman-24 Turkish microtonal tuning: |
28 /* 1/1 RAST C | 29 /* 1/1 RAST C |
29 84.360 Nim Zengule C#/Db | 30 84.360 Nim Zengule C#/Db |
30 145.112 Zengule Cᵻ/Dƀ | 31 145.112 Zengule Cᵻ/Dƀ |
122 retriggerKeepsVelocity_(true), | 123 retriggerKeepsVelocity_(true), |
123 referenceNote_(0), globalOffsetCents_(0) | 124 referenceNote_(0), globalOffsetCents_(0) |
124 { | 125 { |
125 //setName("/touchkeys/segmentpitch"); | 126 //setName("/touchkeys/segmentpitch"); |
126 setBendParameters(); | 127 setBendParameters(); |
128 | |
129 KeyboardDisplay *display = keyboard_.gui(); | |
130 if(display != 0) { | |
131 display->addKeyDivision(this, segment.noteRange().first, segment.noteRange().second, numSegmentsPerKey_); | |
132 } | |
133 } | |
134 | |
135 TouchkeyKeyDivisionMappingFactory::~TouchkeyKeyDivisionMappingFactory() { | |
136 // Remove the divisions from the keys, if this mapping has added them | |
137 KeyboardDisplay *display = keyboard_.gui(); | |
138 if(display != 0) | |
139 display->removeKeyDivision(this); | |
127 } | 140 } |
128 | 141 |
129 void TouchkeyKeyDivisionMappingFactory::setName(const string& name) { | 142 void TouchkeyKeyDivisionMappingFactory::setName(const string& name) { |
130 TouchkeyBaseMappingFactory<TouchkeyKeyDivisionMapping>::setName(name); | 143 TouchkeyBaseMappingFactory<TouchkeyKeyDivisionMapping>::setName(name); |
131 setBendParameters(); | 144 setBendParameters(); |