From 5ca8427840ac8b40393faf61073402f01808d4d2 Mon Sep 17 00:00:00 2001 From: jules Date: Wed, 17 Jan 2018 13:48:32 +0000 Subject: [PATCH] Minor fix for VS2017 in the MPETest project --- examples/MPETest/Source/ZoneColourPicker.h | 28 +++++++++------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/examples/MPETest/Source/ZoneColourPicker.h b/examples/MPETest/Source/ZoneColourPicker.h index 9c927e9f18..3382733edb 100644 --- a/examples/MPETest/Source/ZoneColourPicker.h +++ b/examples/MPETest/Source/ZoneColourPicker.h @@ -31,11 +31,7 @@ class ZoneColourPicker { public: - //============================================================================== - ZoneColourPicker() - : legacyModeEnabled (false) - { - } + ZoneColourPicker() {} //============================================================================== Colour getColourForMidiChannel (int midiChannel) const noexcept @@ -46,13 +42,10 @@ public: if (zoneLayout.getNumZones() == 0) return Colours::transparentBlack; - MPEZone* zone = zoneLayout.getZoneByChannel (midiChannel); - - if (zone == nullptr) - return Colours::transparentBlack; - - return getColourForZoneIndex (std::distance (zoneLayout.getZoneByIndex (0), zone)); + if (auto* zone = zoneLayout.getZoneByChannel (midiChannel)) + return getColourForZoneIndex (std::distance (zoneLayout.getZoneByIndex (0), zone)); + return Colours::transparentBlack; } //============================================================================== @@ -64,7 +57,8 @@ public: if (zoneIndex >= zoneLayout.getNumZones()) return Colours::transparentBlack; - static const std::array colours = { + static const std::array colours = + { Colours::red, Colours::yellow, Colours::blue, @@ -79,13 +73,13 @@ public: } //============================================================================== - void setZoneLayout (MPEZoneLayout layout) noexcept { zoneLayout = layout; } - void setLegacyModeEnabled (bool shouldBeEnabled) noexcept { legacyModeEnabled = shouldBeEnabled; } + void setZoneLayout (MPEZoneLayout layout) noexcept { zoneLayout = layout; } + void setLegacyModeEnabled (bool shouldBeEnabled) noexcept { legacyModeEnabled = shouldBeEnabled; } private: //============================================================================== - JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ZoneColourPicker) - MPEZoneLayout zoneLayout; - bool legacyModeEnabled; + bool legacyModeEnabled = false; + + JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ZoneColourPicker) };