diff Source/Mappings/Control/TouchkeyControlMappingShortEditor.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 5f25a9b0139e
line wrap: on
line diff
--- a/Source/Mappings/Control/TouchkeyControlMappingShortEditor.cpp	Sat Dec 07 18:44:48 2013 +0000
+++ b/Source/Mappings/Control/TouchkeyControlMappingShortEditor.cpp	Sun Feb 09 18:40:51 2014 +0000
@@ -251,15 +251,22 @@
     if(!inputRangeLowEditor->hasKeyboardFocus(true)) {
         float value = factory_.getRangeInputMin();
         char st[16];
+#ifdef _MSC_VER
+		_snprintf_s(st, 16, _TRUNCATE, "%.2f", value);
+#else
         snprintf(st, 16, "%.2f", value);
-
+#endif
         inputRangeLowEditor->setText(st);
     }
 
     if(!inputRangeHighEditor->hasKeyboardFocus(true)) {
         float value = factory_.getRangeInputMax();
         char st[16];
+#ifdef _MSC_VER
+		_snprintf_s(st, 16, _TRUNCATE, "%.2f", value);
+#else
         snprintf(st, 16, "%.2f", value);
+#endif
 
         inputRangeHighEditor->setText(st);
     }