/** * @RDE_HEADER@ * Helper class for SoundAreas. * $Id$ * $HeadURL$ * $Author$ * Created by Filip Biedziak, NLE, 2020-08-10 */ #pragma once #include #include namespace NGL { class INGLLogger; } namespace EffectManagement { using SoundKey = QPair; /** * @brief The SoundAreaHelper class provides utility functions for Infrastructure and Sound * Management. Connections to the ISM-DTC and SOM-DTC are used. */ class SoundAreaHelper { public: explicit SoundAreaHelper(SoundAreaHelper *helper); explicit SoundAreaHelper(std::shared_ptr &ismDtc, std::shared_ptr &somDtc); public: std::shared_ptr ismDtc() const { return m_ismDtc; } std::shared_ptr somDtc() const { return m_somDtc; } /** * @brief soundCategories returns a list with the SoundCategory enum from the Sound Management. * @return a vector with all SoundCategory */ static QVector soundCategories(); /** * @brief categoryName returns the display name of a SoundCategory. * @param category element of SoundCategory enum from Sound Management * @return name of the SoundCategory */ static QString categoryName(SoundManagement::SoundCategory category); /** * @brief categoryName returns the display name of a SoundCategory. * @param category integer corresponding to a SoundCategory enum element from Sound Management * @return name of the SoundCategory */ static QString categoryName(const int32_t &category); /** * @brief soundName returns the display name of a Sound. * @param category SoundCategory of the Sound * @param id index of the Sound * @return name of the Sound */ static QString soundName(SoundManagement::SoundCategory category, const int &id); /** * @brief soundName returns the display name of a Sound. * @param category integer corresponding to a SoundCategory enum element from Sound Management * @param id index of the Sound * @return name of the Sound */ static QString soundName(const int &category, const int &id); /** * @brief soundDuration returns the duration of a Sound when played once. * @param category SoundCategory of the Sound * @param id ID of the Sound within its category * @return duration of the Sound */ int soundDuration(SoundManagement::SoundCategory category, const int &id) const; /** * @brief soundDuraiton returns the duration of a Sound when played once. * @param category SoundCategory of the Sound * @param id ID of the Sound within its category * @return duration of the Sound */ int soundDuration(const int &category, const int &id) const; /** * @brief egcuName returns the display name of an EGCU. * @param id index of the EGCU * @return name of the EGCU */ QString egcuName(const int &id) const; /** * @brief soundCategoryTextColor returns a QColor as background color of a SoundCategory. * @param category integer corresponding to the SoundCategory enum value * @return color of the SoundCategory background */ static QColor soundCategoryTextColor(const int32_t &category); /** * @brief soundCategoryTextColor returns a QColor as text color of a SoundCategory. * @param category integer corresponding to the SoundCategory enum value * @return color of the SoundCategory text */ static QColor soundCategoryBackgroundColor(const int32_t &category); /** * @brief soundCategory returns the index of a SoundCategory as a SoundCategory enum value. * @param i integer index of a SoundCategory * @return corresponding SoundCategory enum value */ static SoundManagement::SoundCategory soundCategory(const int &i); private: std::shared_ptr m_ismDtc; std::shared_ptr m_somDtc; QMap m_egcuNames; QMap m_soundDuration; NGL::INGLLogger &m_logger; }; // class SoundManagementHelper } // namespace EffectManagement