comparison Source/Mappings/PitchBend/TouchkeyPitchBendMappingShortEditor.cpp @ 20:dfff66c07936

Lots of minor changes to support building on Visual Studio. A few MSVC-specific #ifdefs to eliminate things Visual Studio doesn't like. This version now compiles on Windows (provided liblo, Juce and pthread are present) but the TouchKeys device support is not yet enabled. Also, the code now needs to be re-checked on Mac and Linux.
author Andrew McPherson <andrewm@eecs.qmul.ac.uk>
date Sun, 09 Feb 2014 18:40:51 +0000
parents 3580ffe87dc8
children 114427cb39f0
comparison
equal deleted inserted replaced
19:5d91c6f5aa90 20:dfff66c07936
185 { 185 {
186 // Update the editors to reflect the current status 186 // Update the editors to reflect the current status
187 if(!rangeEditor->hasKeyboardFocus(true)) { 187 if(!rangeEditor->hasKeyboardFocus(true)) {
188 float value = factory_.getBendRange(); 188 float value = factory_.getBendRange();
189 char st[16]; 189 char st[16];
190 #ifdef _MSC_VER
191 _snprintf_s(st, 16, _TRUNCATE, "%.2f", value);
192 #else
190 snprintf(st, 16, "%.2f", value); 193 snprintf(st, 16, "%.2f", value);
194 #endif
191 195
192 rangeEditor->setText(st); 196 rangeEditor->setText(st);
193 } 197 }
194 198
195 if(!thresholdEditor->hasKeyboardFocus(true)) { 199 if(!thresholdEditor->hasKeyboardFocus(true)) {
196 float value = factory_.getBendThresholdKeyLength(); 200 float value = factory_.getBendThresholdKeyLength();
197 char st[16]; 201 char st[16];
202 #ifdef _MSC_VER
203 _snprintf_s(st, 16, _TRUNCATE, "%.2f", value);
204 #else
198 snprintf(st, 16, "%.2f", value); 205 snprintf(st, 16, "%.2f", value);
206 #endif
199 207
200 thresholdEditor->setText(st); 208 thresholdEditor->setText(st);
201 } 209 }
202 210
203 endpointsComboBox->setSelectedId(factory_.getBendMode(), dontSendNotification); 211 endpointsComboBox->setSelectedId(factory_.getBendMode(), dontSendNotification);