From c173a30a94ca47cca9dffb229fce5bb21e9eadc4 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Mon, 17 Nov 2014 01:47:22 +0100 Subject: [PATCH] refs #343, Changed transponder code and volume to int as discussed --- src/blackcore/context_audio.h | 4 ++-- src/blackcore/context_audio_impl.cpp | 9 ++++++--- src/blackcore/context_audio_impl.h | 6 +++--- src/blackcore/context_audio_proxy.cpp | 2 +- src/blackcore/context_audio_proxy.h | 2 +- src/blackmisc/aviotransponder.h | 6 +++--- 6 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/blackcore/context_audio.h b/src/blackcore/context_audio.h index 55c73e266..b99f00b79 100644 --- a/src/blackcore/context_audio.h +++ b/src/blackcore/context_audio.h @@ -83,7 +83,7 @@ namespace BlackCore // KB: Is see some potential changes here, which we should do when we have the new 2.0 vatlib // 1. volume integrated in voice room? // 2. Value object for volumes CVolume / CVolumeList? - void changedAudioVolumes(qint32 com1Volume, qint32 com2Volume); + void changedAudioVolumes(int com1Volume, int com2Volume); //! Mute changed void changedMute(bool muted); @@ -156,7 +156,7 @@ namespace BlackCore virtual void setVolumes(const BlackMisc::Aviation::CComSystem &com1, const BlackMisc::Aviation::CComSystem &com2) = 0; //! Set the volumes (0..100) - virtual void setVolumes(qint32 volumeCom1, qint32 volumeCom2) = 0; + virtual void setVolumes(int volumeCom1, int volumeCom2) = 0; //! Set mute state virtual void setMute(bool mute) = 0; diff --git a/src/blackcore/context_audio_impl.cpp b/src/blackcore/context_audio_impl.cpp index 50e3a1d92..2c8fcb70e 100644 --- a/src/blackcore/context_audio_impl.cpp +++ b/src/blackcore/context_audio_impl.cpp @@ -193,7 +193,7 @@ namespace BlackCore this->setVolumes(vol1, vol2); } - void CContextAudio::setVolumes(qint32 com1Volume, qint32 com2Volume) + void CContextAudio::setVolumes(int com1Volume, int com2Volume) { if (m_channelCom1->getVolume() == com1Volume && m_channelCom2->getVolume() == com2Volume) { return; } @@ -224,8 +224,11 @@ namespace BlackCore bool adjusted = false; qint32 v1 = this->m_channelCom1->getVolume(); qint32 v2 = this->m_channelCom2->getVolume(); - if (this->m_channelCom1->getVolume() < MinUnmuteVolume) { v1 = MinUnmuteVolume; adjusted = true; } - if (this->m_channelCom2->getVolume() < MinUnmuteVolume) { v2 = MinUnmuteVolume; adjusted = true; } + //! \todo rectify int/qint/quint mess + int channelV1 = static_cast(this->m_channelCom1->getVolume()); + int channelV2 = static_cast(this->m_channelCom2->getVolume()); + if (channelV1 < MinUnmuteVolume) { v1 = MinUnmuteVolume; adjusted = true; } + if (channelV2 < MinUnmuteVolume) { v2 = MinUnmuteVolume; adjusted = true; } if (adjusted) { this->setVolumes(v1, v2); } } diff --git a/src/blackcore/context_audio_impl.h b/src/blackcore/context_audio_impl.h index be68c976e..4edcaaf3c 100644 --- a/src/blackcore/context_audio_impl.h +++ b/src/blackcore/context_audio_impl.h @@ -89,7 +89,7 @@ namespace BlackCore virtual void setVolumes(const BlackMisc::Aviation::CComSystem &com1, const BlackMisc::Aviation::CComSystem &com2) override; //!\copydoc IContext::setVolumes - virtual void setVolumes(qint32 com1Volume, qint32 com2Volume) override; + virtual void setVolumes(int com1Volume, int com2Volume) override; //! \copydoc ICOntext::setMute virtual void setMute(bool muted) override; @@ -157,8 +157,8 @@ namespace BlackCore void ps_initNotificationSounds(); private: - const qint32 MinUnmuteVolume = 20; //!< minimum volume when unmuted - const qint32 VoiceRoomEnabledVolume = 95; //!< voice room volume when enabled + const int MinUnmuteVolume = 20; //!< minimum volume when unmuted + const int VoiceRoomEnabledVolume = 95; //!< voice room volume when enabled //! Connection in transition bool inTransitionState() const; diff --git a/src/blackcore/context_audio_proxy.cpp b/src/blackcore/context_audio_proxy.cpp index e2e838ca0..1c0943d59 100644 --- a/src/blackcore/context_audio_proxy.cpp +++ b/src/blackcore/context_audio_proxy.cpp @@ -216,7 +216,7 @@ namespace BlackCore /* * Volumes */ - void CContextAudioProxy::setVolumes(qint32 com1Volume, qint32 com2Volume) + void CContextAudioProxy::setVolumes(int com1Volume, int com2Volume) { this->m_dBusInterface->callDBus(QLatin1Literal("setVolumes"), com1Volume, com2Volume); } diff --git a/src/blackcore/context_audio_proxy.h b/src/blackcore/context_audio_proxy.h index c66a9fb22..3f7e3fc89 100644 --- a/src/blackcore/context_audio_proxy.h +++ b/src/blackcore/context_audio_proxy.h @@ -94,7 +94,7 @@ namespace BlackCore virtual void setVolumes(const BlackMisc::Aviation::CComSystem &com1, const BlackMisc::Aviation::CComSystem &com2) override; //!\copydoc IContextAudio::setVolumes - virtual void setVolumes(qint32 com1Volume, qint32 com2Volume) override; + virtual void setVolumes(int com1Volume, int com2Volume) override; //! \copydoc IContextAudio::setMute virtual void setMute(bool muted) override; diff --git a/src/blackmisc/aviotransponder.h b/src/blackmisc/aviotransponder.h index a12e44454..e59d9577f 100644 --- a/src/blackmisc/aviotransponder.h +++ b/src/blackmisc/aviotransponder.h @@ -85,7 +85,7 @@ namespace BlackMisc //! Transponder mode as string QString getModeAsString() const { - return CTransponder::modeAsString(this->getTransponderMode()); + return modeAsString(this->getTransponderMode()); } //! Transponder mode as string @@ -104,7 +104,7 @@ namespace BlackMisc static const QString &modeAsString(TransponderMode mode); //! Transponder code - qint32 getTransponderCode() const + int getTransponderCode() const { return this->m_transponderCode; } @@ -163,7 +163,7 @@ namespace BlackMisc private: BLACK_ENABLE_TUPLE_CONVERSION(CTransponder) - qint32 m_transponderCode; //!< Transponder code + int m_transponderCode; //!< Transponder code TransponderMode m_transponderMode; //!< Transponder mode };