refs #343, Changed transponder code and volume to int as discussed

This commit is contained in:
Klaus Basan
2014-11-17 01:47:22 +01:00
committed by Roland Winklmeier
parent 4fab9a2fad
commit c173a30a94
6 changed files with 16 additions and 13 deletions

View File

@@ -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 // 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? // 1. volume integrated in voice room?
// 2. Value object for volumes CVolume / CVolumeList? // 2. Value object for volumes CVolume / CVolumeList?
void changedAudioVolumes(qint32 com1Volume, qint32 com2Volume); void changedAudioVolumes(int com1Volume, int com2Volume);
//! Mute changed //! Mute changed
void changedMute(bool muted); void changedMute(bool muted);
@@ -156,7 +156,7 @@ namespace BlackCore
virtual void setVolumes(const BlackMisc::Aviation::CComSystem &com1, const BlackMisc::Aviation::CComSystem &com2) = 0; virtual void setVolumes(const BlackMisc::Aviation::CComSystem &com1, const BlackMisc::Aviation::CComSystem &com2) = 0;
//! Set the volumes (0..100) //! Set the volumes (0..100)
virtual void setVolumes(qint32 volumeCom1, qint32 volumeCom2) = 0; virtual void setVolumes(int volumeCom1, int volumeCom2) = 0;
//! Set mute state //! Set mute state
virtual void setMute(bool mute) = 0; virtual void setMute(bool mute) = 0;

View File

@@ -193,7 +193,7 @@ namespace BlackCore
this->setVolumes(vol1, vol2); 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; } if (m_channelCom1->getVolume() == com1Volume && m_channelCom2->getVolume() == com2Volume) { return; }
@@ -224,8 +224,11 @@ namespace BlackCore
bool adjusted = false; bool adjusted = false;
qint32 v1 = this->m_channelCom1->getVolume(); qint32 v1 = this->m_channelCom1->getVolume();
qint32 v2 = this->m_channelCom2->getVolume(); qint32 v2 = this->m_channelCom2->getVolume();
if (this->m_channelCom1->getVolume() < MinUnmuteVolume) { v1 = MinUnmuteVolume; adjusted = true; } //! \todo rectify int/qint/quint mess
if (this->m_channelCom2->getVolume() < MinUnmuteVolume) { v2 = MinUnmuteVolume; adjusted = true; } int channelV1 = static_cast<int>(this->m_channelCom1->getVolume());
int channelV2 = static_cast<int>(this->m_channelCom2->getVolume());
if (channelV1 < MinUnmuteVolume) { v1 = MinUnmuteVolume; adjusted = true; }
if (channelV2 < MinUnmuteVolume) { v2 = MinUnmuteVolume; adjusted = true; }
if (adjusted) { this->setVolumes(v1, v2); } if (adjusted) { this->setVolumes(v1, v2); }
} }

View File

@@ -89,7 +89,7 @@ namespace BlackCore
virtual void setVolumes(const BlackMisc::Aviation::CComSystem &com1, const BlackMisc::Aviation::CComSystem &com2) override; virtual void setVolumes(const BlackMisc::Aviation::CComSystem &com1, const BlackMisc::Aviation::CComSystem &com2) override;
//!\copydoc IContext::setVolumes //!\copydoc IContext::setVolumes
virtual void setVolumes(qint32 com1Volume, qint32 com2Volume) override; virtual void setVolumes(int com1Volume, int com2Volume) override;
//! \copydoc ICOntext::setMute //! \copydoc ICOntext::setMute
virtual void setMute(bool muted) override; virtual void setMute(bool muted) override;
@@ -157,8 +157,8 @@ namespace BlackCore
void ps_initNotificationSounds(); void ps_initNotificationSounds();
private: private:
const qint32 MinUnmuteVolume = 20; //!< minimum volume when unmuted const int MinUnmuteVolume = 20; //!< minimum volume when unmuted
const qint32 VoiceRoomEnabledVolume = 95; //!< voice room volume when enabled const int VoiceRoomEnabledVolume = 95; //!< voice room volume when enabled
//! Connection in transition //! Connection in transition
bool inTransitionState() const; bool inTransitionState() const;

View File

@@ -216,7 +216,7 @@ namespace BlackCore
/* /*
* Volumes * Volumes
*/ */
void CContextAudioProxy::setVolumes(qint32 com1Volume, qint32 com2Volume) void CContextAudioProxy::setVolumes(int com1Volume, int com2Volume)
{ {
this->m_dBusInterface->callDBus(QLatin1Literal("setVolumes"), com1Volume, com2Volume); this->m_dBusInterface->callDBus(QLatin1Literal("setVolumes"), com1Volume, com2Volume);
} }

View File

@@ -94,7 +94,7 @@ namespace BlackCore
virtual void setVolumes(const BlackMisc::Aviation::CComSystem &com1, const BlackMisc::Aviation::CComSystem &com2) override; virtual void setVolumes(const BlackMisc::Aviation::CComSystem &com1, const BlackMisc::Aviation::CComSystem &com2) override;
//!\copydoc IContextAudio::setVolumes //!\copydoc IContextAudio::setVolumes
virtual void setVolumes(qint32 com1Volume, qint32 com2Volume) override; virtual void setVolumes(int com1Volume, int com2Volume) override;
//! \copydoc IContextAudio::setMute //! \copydoc IContextAudio::setMute
virtual void setMute(bool muted) override; virtual void setMute(bool muted) override;

View File

@@ -85,7 +85,7 @@ namespace BlackMisc
//! Transponder mode as string //! Transponder mode as string
QString getModeAsString() const QString getModeAsString() const
{ {
return CTransponder::modeAsString(this->getTransponderMode()); return modeAsString(this->getTransponderMode());
} }
//! Transponder mode as string //! Transponder mode as string
@@ -104,7 +104,7 @@ namespace BlackMisc
static const QString &modeAsString(TransponderMode mode); static const QString &modeAsString(TransponderMode mode);
//! Transponder code //! Transponder code
qint32 getTransponderCode() const int getTransponderCode() const
{ {
return this->m_transponderCode; return this->m_transponderCode;
} }
@@ -163,7 +163,7 @@ namespace BlackMisc
private: private:
BLACK_ENABLE_TUPLE_CONVERSION(CTransponder) BLACK_ENABLE_TUPLE_CONVERSION(CTransponder)
qint32 m_transponderCode; //!< Transponder code int m_transponderCode; //!< Transponder code
TransponderMode m_transponderMode; //!< Transponder mode TransponderMode m_transponderMode; //!< Transponder mode
}; };