/** * Handler for Blocked Areas * $Id$ * $HeadURL$ * $Author$ * Created by gr, SLSE, 2018-07-02 */ #pragma once #include #include #include #include #include #include #include #include // HTTP Request #include namespace CesArtillerySound { class HandlerArtillerieSound final : public QObject { Q_OBJECT public: explicit HandlerArtillerieSound(const std::shared_ptr &ddsHandler, const std::shared_ptr &buildingDataHandler, QObject *parent); ~HandlerArtillerieSound(); bool init(); private Q_SLOTS: void onExplosionSingleChanged(const AreaEffectSimulation::ExplosionSingle &data, DataModification modType); void onTechnicalAreaChanged(const AreaEffectSimulation::TechnicalArea &data, DataModification modType); void httpFinished(); private: void playSound(QString &user, QString &passwd, const QString &host, int &sound, qreal &volume); void startRequest(const QUrl &requestedUrl); private: // attributes std::shared_ptr m_ddsHandler; ///< Pointer to DDS handler std::shared_ptr m_handlerBuildingData; QHash m_explosionSingleState; // key = id, value = state QHash m_technicalAreas; QHash m_centerSoundArea; // key: TechnicalAreaId, value Center of SoundArea QHash m_egcus; QHash m_ogcus; QNetworkAccessManager m_qnam; bool m_httpRequestAborted = false; CentralEffectSimulation::LOGGER_T &m_logger; ///< Interface to the Logging-Facility }; } // namespace CesArtillerySound