diff --git a/include/ServerMainComponent.hpp b/include/ServerMainComponent.hpp index a06ec32..75db7d2 100644 --- a/include/ServerMainComponent.hpp +++ b/include/ServerMainComponent.hpp @@ -109,6 +109,8 @@ class ServerMainComponent : public juce::Component }; friend class LanguageCommandConfigClosed; + static VTVersion get_version_from_setting(std::uint8_t aVersion); + std::size_t number_of_iop_files_in_directory(std::filesystem::path path); void on_change_active_mask_callback(std::shared_ptr affectedWorkingSet, std::uint16_t workingSet, std::uint16_t newMask); diff --git a/src/ServerMainComponent.cpp b/src/ServerMainComponent.cpp index f583fdf..5c625a2 100644 --- a/src/ServerMainComponent.cpp +++ b/src/ServerMainComponent.cpp @@ -718,6 +718,42 @@ void ServerMainComponent::LanguageCommandConfigClosed::operator()(int result) co mParent.popupMenu.reset(); } +ServerMainComponent::VTVersion ServerMainComponent::get_version_from_setting(std::uint8_t aVersion) +{ + VTVersion retVal = VTVersion::Version2OrOlder; + + switch (aVersion) + { + case 3: + { + retVal = VTVersion::Version3; + } + break; + + case 4: + { + retVal = VTVersion::Version4; + } + break; + + case 5: + { + retVal = VTVersion::Version5; + } + break; + + case 6: + { + retVal = VTVersion::Version6; + } + break; + + default: + break; + } + return retVal; +} + std::size_t ServerMainComponent::number_of_iop_files_in_directory(std::filesystem::path path) { std::size_t retVal = 0; @@ -855,7 +891,7 @@ void ServerMainComponent::check_load_settings() languageCommandInterface.set_commanded_volume_units(static_cast(int(firstChild.getProperty("VolumeUnits")))); languageCommandInterface.set_country_code(String(firstChild.getProperty("CountryCode").toString()).toStdString()); languageCommandInterface.set_language_code(String(firstChild.getProperty("LanguageCode").toString()).toStdString()); - versionToReport = static_cast(int(secondChild.getProperty("Version"))); + versionToReport = get_version_from_setting(static_cast(static_cast(secondChild.getProperty("Version")))); } } }