diff --git a/src/audio_core/common/feature_support.h b/src/audio_core/common/feature_support.h index aa1fff569..919528101 100644 --- a/src/audio_core/common/feature_support.h +++ b/src/audio_core/common/feature_support.h @@ -6,6 +6,8 @@ #include #include #include +#include +#include #include "common/assert.h" #include "common/common_funcs.h" @@ -13,7 +15,7 @@ #include "common/polyfill_ranges.h" namespace AudioCore { -constexpr u32 CurrentRevision = 11; +constexpr u32 CurrentRevision = 12; enum class SupportTags { CommandProcessingTimeEstimatorVersion4, @@ -45,6 +47,10 @@ enum class SupportTags { ReverbChannelMappingChange, I3dl2ReverbChannelMappingChange, + // New features added in revision 12 + EnhancedAudioProcessing, + AdvancedNoiseSuppression, + // Not a real tag, just here to get the count. Size }; @@ -87,20 +93,31 @@ constexpr bool CheckFeatureSupported(SupportTags tag, u32 user_revision) { {SupportTags::DelayChannelMappingChange, 11}, {SupportTags::ReverbChannelMappingChange, 11}, {SupportTags::I3dl2ReverbChannelMappingChange, 11}, + // New features for revision 12 + {SupportTags::EnhancedAudioProcessing, 12}, + {SupportTags::AdvancedNoiseSuppression, 12}, }}; - const auto& feature = - std::ranges::find_if(features, [tag](const auto& entry) { return entry.first == tag; }); + const auto& feature = std::ranges::find_if(features, [tag](const auto& entry) { return entry.first == tag; }); if (feature == features.cend()) { - LOG_ERROR(Service_Audio, "Invalid SupportTag {}!", static_cast(tag)); + std::cerr << "Error: Invalid SupportTag " << static_cast(tag) << "!" << std::endl; return false; } user_revision = GetRevisionNum(user_revision); + if (user_revision > CurrentRevision) { + std::cerr << "Error: Unsupported revision " << user_revision << ". Max supported is " << CurrentRevision << "." << std::endl; + return false; + } return (*feature).second <= user_revision; } constexpr bool CheckValidRevision(u32 user_revision) { - return GetRevisionNum(user_revision) <= CurrentRevision; + user_revision = GetRevisionNum(user_revision); + if (user_revision > CurrentRevision) { + std::cerr << "Error: Invalid revision number " << user_revision << ". Max supported is " << CurrentRevision << "." << std::endl; + return false; + } + return true; }; } // namespace AudioCore