Extend API for MusicalMode and MusicalScale to expose mode type as a member

This commit is contained in:
Paul Davis 2021-11-08 15:16:57 -07:00
parent 55a0aadc74
commit 1555896d8e
3 changed files with 4 additions and 1 deletions

View File

@ -21,7 +21,7 @@
#include "ardour/mode.h" #include "ardour/mode.h"
class MusicalKey : MusicalMode class MusicalKey : public MusicalMode
{ {
public: public:
MusicalKey (Type t, int root) : MusicalMode (t), _root (root) {} MusicalKey (Type t, int root) : MusicalMode (t), _root (root) {}

View File

@ -68,9 +68,11 @@ class MusicalMode
~MusicalMode (); ~MusicalMode ();
std::vector<float> steps; std::vector<float> steps;
Type type() const { return _type; }
private: private:
static void fill (MusicalMode&, Type); static void fill (MusicalMode&, Type);
Type _type;
}; };
#endif /* __ardour_mode_h__ */ #endif /* __ardour_mode_h__ */

View File

@ -19,6 +19,7 @@
#include "ardour/mode.h" #include "ardour/mode.h"
MusicalMode::MusicalMode (MusicalMode::Type t) MusicalMode::MusicalMode (MusicalMode::Type t)
: _type (t)
{ {
fill (*this, t); fill (*this, t);
} }