init member variables of CEnvelope on declaration

This commit is contained in:
marmare314 2023-10-05 23:19:19 +02:00
parent 08b825439e
commit 283226ef59
2 changed files with 5 additions and 16 deletions

View file

@ -29,14 +29,7 @@ const CEnvPointBezier *CEnvelope::CEnvelopePointAccess::GetBezier(int Index) con
} }
CEnvelope::CEnvelope(EType Type) : CEnvelope::CEnvelope(EType Type) :
m_PointsAccess(&m_vPoints) m_PointsAccess(&m_vPoints), m_Type(Type) {}
{
m_Type = Type;
m_aName[0] = '\0';
m_Bottom = 0;
m_Top = 0;
m_Synchronized = false;
}
CEnvelope::CEnvelope(int NumChannels) : CEnvelope::CEnvelope(int NumChannels) :
m_PointsAccess(&m_vPoints) m_PointsAccess(&m_vPoints)
@ -55,11 +48,6 @@ CEnvelope::CEnvelope(int NumChannels) :
default: default:
dbg_assert(false, "invalid number of channels for envelope"); dbg_assert(false, "invalid number of channels for envelope");
} }
m_aName[0] = '\0';
m_Bottom = 0;
m_Top = 0;
m_Synchronized = false;
} }
void CEnvelope::Resort() void CEnvelope::Resort()

View file

@ -21,9 +21,10 @@ class CEnvelope
public: public:
std::vector<CEnvPoint_runtime> m_vPoints; std::vector<CEnvPoint_runtime> m_vPoints;
CEnvelopePointAccess m_PointsAccess; CEnvelopePointAccess m_PointsAccess;
char m_aName[32]; char m_aName[32] = "";
float m_Bottom, m_Top; float m_Bottom = 0;
bool m_Synchronized; float m_Top = 0;
bool m_Synchronized = false;
enum class EType enum class EType
{ {