mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 20:15:35 +08:00
refs #343, Changed transponder code and volume to int as discussed
This commit is contained in:
committed by
Roland Winklmeier
parent
4fab9a2fad
commit
c173a30a94
@@ -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;
|
||||
|
||||
@@ -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<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); }
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user