-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add default default octave depending on KK model #12
base: develop
Are you sure you want to change the base?
Conversation
src/devices/ni/KompleteKontrol.cpp
Outdated
KompleteKontrolBase::KompleteKontrolBase(const NUM_KEYS numKeys) | ||
: m_numKeys(static_cast<unsigned>(numKeys)) | ||
, m_ledsKeysSize(m_numKeys * 3U) | ||
, m_ledsKeys(new uint8_t[m_ledsKeysSize]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c style array creation, since you're using pointers for data writing I didn't change this to a vector
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe a shared_ptr with the array is an option here
src/devices/ni/KompleteKontrol.cpp
Outdated
@@ -311,6 +332,7 @@ KompleteKontrolBase::KompleteKontrolBase() | |||
|
|||
KompleteKontrolBase::~KompleteKontrolBase() | |||
{ | |||
delete[] m_ledsKeys; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete based destruction. A bit ugly, maybe there's a better way to do this
src/devices/ni/KompleteKontrol.cpp
Outdated
@@ -22,6 +22,23 @@ const uint8_t kKK_ledsDataSize = 25; | |||
|
|||
const uint8_t kKK_epOut = 0x02; | |||
const uint8_t kKK_epInput = 0x84; | |||
|
|||
size_t getInitialOctave(const sl::cabl::KompleteKontrolBase::NUM_KEYS numKeys) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe there's a better name for this
…the default octave
Removes the concept of templated KKS1 child class. The number of keys is an argument of the base class
This is done in order to initialize the
m_firstOctave
to the default keyboard value depending (which depends on the size)This change is