diff --git a/src/blackcore/fsd/addpilot.h b/src/blackcore/fsd/addpilot.h index 8e3765863..573b81051 100644 --- a/src/blackcore/fsd/addpilot.h +++ b/src/blackcore/fsd/addpilot.h @@ -25,7 +25,7 @@ namespace BlackCore class BLACKCORE_EXPORT AddPilot : public MessageBase { public: - // Constructor + //! Constructor AddPilot(const QString &callsign, const QString &cid, const QString &password, PilotRating rating, int protocolRevision, SimType simType, const QString &realName); //! Get user cid diff --git a/src/blackcore/fsd/atcdataupdate.cpp b/src/blackcore/fsd/atcdataupdate.cpp index 5188590bb..3d01b866d 100644 --- a/src/blackcore/fsd/atcdataupdate.cpp +++ b/src/blackcore/fsd/atcdataupdate.cpp @@ -52,7 +52,7 @@ namespace BlackCore { BlackMisc::CLogMessage(static_cast(nullptr)).warning(u"Wrong number of arguments."); return {}; - }; + } AtcDataUpdate packet(tokens[0], tokens[1].toInt() + 100000, fromQString(tokens[2]), tokens[3].toInt(), fromQString(tokens[4]), tokens[5].toDouble(), tokens[6].toDouble(), tokens[7].toInt()); diff --git a/src/blackcore/fsd/atcdataupdate.h b/src/blackcore/fsd/atcdataupdate.h index 44d380b87..c4d80be0f 100644 --- a/src/blackcore/fsd/atcdataupdate.h +++ b/src/blackcore/fsd/atcdataupdate.h @@ -24,6 +24,8 @@ namespace BlackCore //! FSD Message: ATC data update class BLACKCORE_EXPORT AtcDataUpdate : public MessageBase { + friend bool operator==(const AtcDataUpdate &, const AtcDataUpdate &); + public: //! Constructor AtcDataUpdate(const QString &sender, int frequencykHz, BlackMisc::Network::CFacilityType facility, int visibleRange, AtcRating rating, @@ -35,18 +37,21 @@ namespace BlackCore //! Construct from tokens static AtcDataUpdate fromTokens(const QStringList &tokens); - //! PDU identifier - static QString pdu() { return "%"; } - + //! Properties @{ int m_frequencykHz = 0.0; BlackMisc::Network::CFacilityType m_facility; int m_visibleRange = 0.0; AtcRating m_rating = AtcRating::Unknown; - double m_latitude = 0.0; + double m_latitude = 0.0; double m_longitude = 0.0; int m_elevation = 0.0; + //! @} + + //! PDU identifier + static QString pdu() { return "%"; } private: + //! Ctor AtcDataUpdate(); }; diff --git a/src/blackcore/fsd/authresponse.h b/src/blackcore/fsd/authresponse.h index 7da11d99b..7bb250a8a 100644 --- a/src/blackcore/fsd/authresponse.h +++ b/src/blackcore/fsd/authresponse.h @@ -34,7 +34,7 @@ namespace BlackCore //! PDU identifier static QString pdu() { return QStringLiteral("$ZR"); } - QString m_response; + QString m_response; //!< response private: AuthResponse(); diff --git a/src/blackcore/fsd/clientidentification.h b/src/blackcore/fsd/clientidentification.h index 7d54e7354..dae9a1d35 100644 --- a/src/blackcore/fsd/clientidentification.h +++ b/src/blackcore/fsd/clientidentification.h @@ -37,6 +37,7 @@ namespace BlackCore //! PDU identifier static QString pdu() { return "$ID"; } + //! Properties @{ std::uint16_t m_clientId = 0; QString m_clientName; int m_clientVersionMajor = BlackConfig::CBuildConfig::getVersion().majorVersion(); @@ -44,6 +45,7 @@ namespace BlackCore QString m_userCid; QString m_sysUid; QString m_initialChallenge; + //! @} private: ClientIdentification(); diff --git a/src/blackcore/fsd/clientresponse.h b/src/blackcore/fsd/clientresponse.h index 3b2bbc25e..eef680478 100644 --- a/src/blackcore/fsd/clientresponse.h +++ b/src/blackcore/fsd/clientresponse.h @@ -25,6 +25,7 @@ namespace BlackCore //! Constructor ClientResponse(const QString &sender, const QString &receiver, ClientQueryType queryType, const QStringList &responseData); + //! Unknow query? bool isUnknownQuery() const { return m_queryType == ClientQueryType::Unknown; } //! Message converted to tokens @@ -36,8 +37,10 @@ namespace BlackCore //! PDU identifier static QString pdu() { return "$CR"; } + //! Properties @{ ClientQueryType m_queryType; - QStringList m_responseData; + QStringList m_responseData; + //! @} private: ClientResponse(); diff --git a/src/blackcore/fsd/enums.h b/src/blackcore/fsd/enums.h index 7f18600c0..2a17cdea5 100644 --- a/src/blackcore/fsd/enums.h +++ b/src/blackcore/fsd/enums.h @@ -171,12 +171,13 @@ namespace BlackCore AircraftConfig = (1 << 8) }; + //! Operators @{ inline Capabilities operator | (Capabilities lhs, Capabilities rhs) { return static_cast(static_cast(lhs) | static_cast(rhs)); } - inline Capabilities& operator |= (Capabilities& lhs, Capabilities rhs) + inline Capabilities &operator |= (Capabilities &lhs, Capabilities rhs) { lhs = lhs | rhs; return lhs; @@ -186,7 +187,9 @@ namespace BlackCore { return static_cast(lhs) & static_cast(rhs); } + //! @} + //! ATIS line type enum class AtisLineType { Unknown, diff --git a/src/blackcore/fsd/flightplan.h b/src/blackcore/fsd/flightplan.h index 2995fb6f6..f6b5c8642 100644 --- a/src/blackcore/fsd/flightplan.h +++ b/src/blackcore/fsd/flightplan.h @@ -37,6 +37,7 @@ namespace BlackCore //! PDU identifier static QString pdu() { return "$FP"; } + //! Properties @{ FlightType m_flightType; QString m_aircraftIcaoType; int m_trueCruisingSpeed = 0; @@ -52,6 +53,7 @@ namespace BlackCore QString m_altAirport; QString m_remarks; QString m_route; + //! @ protected: FlightPlan(); diff --git a/src/blackcore/fsd/messagebase.h b/src/blackcore/fsd/messagebase.h index ec18ea049..76d8d1d42 100644 --- a/src/blackcore/fsd/messagebase.h +++ b/src/blackcore/fsd/messagebase.h @@ -56,7 +56,6 @@ namespace BlackCore //! Constructor MessageBase(const QString &sender, const QString &receiver); - virtual ~MessageBase() {} //! Set callsign void setCallsign(const QString &sender) { m_sender = sender; } diff --git a/src/blacksound/dsp/SimpleComp.h b/src/blacksound/dsp/SimpleComp.h index 99d28de68..aa350b5a0 100644 --- a/src/blacksound/dsp/SimpleComp.h +++ b/src/blacksound/dsp/SimpleComp.h @@ -55,7 +55,7 @@ namespace chunkware_simple //! @{ get parameters virtual double getThresh(void) const { return threshdB_; } virtual double getRatio(void) const { return ratio_; } - double getMakeUpGain(void) const { return makeUpGain_; } + double getMakeUpGain(void) const { return makeUpGain_; } //! @} //! Init runtime @@ -79,9 +79,7 @@ namespace chunkware_simple }; // end SimpleComp class - //------------------------------------------------------------- - // simple compressor with RMS detection - //------------------------------------------------------------- + //! Simple compressor with RMS detection class SimpleCompRms : public SimpleComp { public: diff --git a/src/blacksound/dsp/SimpleEnvelope.h b/src/blacksound/dsp/SimpleEnvelope.h index e7914f2c5..5cd514fb1 100644 --- a/src/blacksound/dsp/SimpleEnvelope.h +++ b/src/blacksound/dsp/SimpleEnvelope.h @@ -42,13 +42,16 @@ namespace chunkware_simple // USE: // 1. init envelope state to DC_OFFSET before processing // 2. add to input before envelope runtime function - static const double DC_OFFSET = 1.0E-25; + static constexpr double DC_OFFSET = 1.0E-25; - //! envelope detector + //! Envelope detector class EnvelopeDetector { public: + //! Ctor EnvelopeDetector(double ms = 1.0, double sampleRate = 44100.0); + + //! Dtor virtual ~EnvelopeDetector() {} //! set time constant @@ -70,34 +73,40 @@ namespace chunkware_simple } protected: + //! Set coefficients + virtual void setCoef(void); //!< coef calculation double sampleRate_; //!< sample rate double ms_; //!< time constant in ms double coef_; //!< runtime coefficient - virtual void setCoef(void); //!< coef calculation - }; // end SimpleComp class //! attack/release envelope class AttRelEnvelope { public: + //! Ctor AttRelEnvelope(double att_ms = 10.0, double rel_ms = 100.0, double sampleRate = 44100.0); + + //! Dtor virtual ~AttRelEnvelope() {} - // attack time constant + //! Attack time constant @{ virtual void setAttack(double ms); virtual double getAttack(void) const { return att_.getTc(); } + //! @} - // release time constant + //! Release time constant @{ virtual void setRelease(double ms); virtual double getRelease(void) const { return rel_.getTc(); } + //! @} - // sample rate dependencies + //! Sample rate dependencies @{ virtual void setSampleRate(double sampleRate); virtual double getSampleRate(void) const { return att_.getSampleRate(); } + //! @} - // runtime function + //! Runtime function INLINE void run(double in, double &state) { @@ -114,7 +123,6 @@ namespace chunkware_simple } private: - EnvelopeDetector att_; EnvelopeDetector rel_; diff --git a/src/blacksound/dsp/SimpleGate.h b/src/blacksound/dsp/SimpleGate.h index f73489207..a469dfc5c 100644 --- a/src/blacksound/dsp/SimpleGate.h +++ b/src/blacksound/dsp/SimpleGate.h @@ -28,8 +28,8 @@ */ -#ifndef __SIMPLE_GATE_H__ -#define __SIMPLE_GATE_H__ +#ifndef chunkware__SIMPLE_GATE_H +#define chunkware__SIMPLE_GATE_H #include "SimpleHeader.h" // common header #include "SimpleEnvelope.h" // for base class @@ -53,11 +53,13 @@ namespace chunkware_simple //! get threshold virtual double getThresh(void) const { return threshdB_; } - // init runtime - virtual void initRuntime(void); // call before runtime (in resume()) + //! Init runtime + //! \remark call before runtime (in resume()) + virtual void initRuntime(void); //! Process audio - void process(double &in1, double &in2); // gate runtime process + //! \remark gate runtime process + void process(double &in1, double &in2); //! Process audio stereo-linked void process(double &in1, double &in2, double keyLinked); // with stereo-linked key in @@ -71,7 +73,7 @@ namespace chunkware_simple double env_; //!< over-threshold envelope (linear) }; - //! simple gate with RMS detection + //! Simple gate with RMS detection class SimpleGateRms : public SimpleGate { public: diff --git a/src/blacksound/dsp/SimpleLimit.h b/src/blacksound/dsp/SimpleLimit.h index 3792fb3e9..c82cc80cb 100644 --- a/src/blacksound/dsp/SimpleLimit.h +++ b/src/blacksound/dsp/SimpleLimit.h @@ -28,8 +28,8 @@ */ -#ifndef __SIMPLE_LIMIT_H__ -#define __SIMPLE_LIMIT_H__ +#ifndef chunkware_SIMPLE_LIMIT_H +#define chunkware_SIMPLE_LIMIT_H #include "SimpleHeader.h" // common header #include "SimpleEnvelope.h" // for base class of FastEnvelope @@ -76,18 +76,21 @@ namespace chunkware_simple protected: - //! class for faster attack/release + //! Class for faster attack/release class FastEnvelope : public EnvelopeDetector { public: + //! Ctor FastEnvelope(double ms = 1.0, double sampleRate = 44100.0) : EnvelopeDetector(ms, sampleRate) {} - virtual ~FastEnvelope() {} + + //! Dtor + virtual ~FastEnvelope() override {} protected: - // override setCoef() - coefficient calculation - virtual void setCoef(void); + //! Override setCoef() - coefficient calculation + virtual void setCoef(void) override; }; private: @@ -123,4 +126,4 @@ namespace chunkware_simple // include inlined process function #include "SimpleLimitProcess.inl" -#endif // end __SIMPLE_LIMIT_H__ +#endif // guard