From 664429b309ee333895ec4eb984e2235c230c42b2 Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Sun, 26 Apr 2020 16:39:55 +0200 Subject: [PATCH] added GetCategory to CInstPictures class --- ChangeLog | 2 ++ src/util.cpp | 14 ++++++++++++++ src/util.h | 7 ++++--- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index e535cda6..b2cf2524 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ + + 3.5.3git TODO improve input channel mapping and introduce input/output gains with overrange to amplification (separate dialog, replace Pan, etc.) diff --git a/src/util.cpp b/src/util.cpp index d7d6bc7e..6c0fb46a 100755 --- a/src/util.cpp +++ b/src/util.cpp @@ -1006,6 +1006,20 @@ QString CInstPictures::GetName ( const int iInstrument ) } } +CInstPictures::EInstCategory CInstPictures::GetCategory ( const int iInstrument ) +{ + // range check + if ( IsInstIndexInRange ( iInstrument ) ) + { + // return the name of the instrument + return GetTable()[iInstrument].eInstCategory; + } + else + { + return IC_OTHER_INSTRUMENT; + } +} + // Locale management class ----------------------------------------------------- QString CLocale::GetCountryFlagIconsResourceReference ( const QLocale::Country eCountry ) diff --git a/src/util.h b/src/util.h index 99fff348..324059a3 100755 --- a/src/util.h +++ b/src/util.h @@ -761,9 +761,10 @@ public: static int GetNotUsedInstrument() { return 0; } static bool IsNotUsedInstrument ( const int iInstrument ) { return iInstrument == 0; } - static int GetNumAvailableInst() { return GetTable().Size(); } - static QString GetResourceReference ( const int iInstrument ); - static QString GetName ( const int iInstrument ); + static int GetNumAvailableInst() { return GetTable().Size(); } + static QString GetResourceReference ( const int iInstrument ); + static QString GetName ( const int iInstrument ); + static EInstCategory GetCategory ( const int iInstrument ); // TODO make use of instrument category (not yet implemented)