-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Remove CO* constructor to COT. Cleanups. #16
Changes from 20 commits
8afddd3
33dfbf9
bc44569
78af330
e6fdaaa
f16f136
f0cfd08
aac8856
98e895e
8f2c854
059fa5b
ec04156
3df0301
41afff9
c802cef
a099961
56b7709
4523cfd
076f48e
bb707b1
6fab199
e9510b9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,7 +49,7 @@ ControlDoublePrivate::~ControlDoublePrivate() { | |
|
||
// static | ||
ControlDoublePrivate* ControlDoublePrivate::getControl( | ||
const ConfigKey& key, bool bCreate, bool bIgnoreNops, bool bTrack) { | ||
const ConfigKey& key, bool bCreate, bool bIgnoreNops, bool bTrack) { | ||
QMutexLocker locker(&m_sqCOHashMutex); | ||
QHash<ConfigKey, ControlDoublePrivate*>::const_iterator it = m_sqCOHash.find(key); | ||
if (it != m_sqCOHash.end()) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. here you can see th advantage of double indentation line wrap. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yea, this has annoyed me for a long time too but for consistency with the rest of the code I was sticking to 4-space indent. |
||
|
@@ -77,9 +77,12 @@ double ControlDoublePrivate::get() const { | |
return m_value.getValue(); | ||
} | ||
|
||
void ControlDoublePrivate::reset(QObject* pSender) { | ||
void ControlDoublePrivate::reset() { | ||
double defaultValue = m_defaultValue.getValue(); | ||
set(defaultValue, pSender); | ||
// NOTE: pSender = NULL is important. The originator of this action does | ||
// not know the resulting value so it makes sense that we should emit a | ||
// general valueChanged() signal even though we know the originator. | ||
set(defaultValue, NULL); | ||
} | ||
|
||
void ControlDoublePrivate::set(const double& value, QObject* pSender) { | ||
|
@@ -106,9 +109,9 @@ ControlNumericBehavior* ControlDoublePrivate::setBehavior(ControlNumericBehavior | |
return m_pBehavior.fetchAndStoreRelaxed(pBehavior); | ||
} | ||
|
||
void ControlDoublePrivate::setWidgetParameter(double dParam, QObject* pSetter) { | ||
void ControlDoublePrivate::setWidgetParameter(double dParam, QObject* pSender) { | ||
ControlNumericBehavior* pBehavior = m_pBehavior; | ||
set(pBehavior ? pBehavior->widgetParameterToValue(dParam) : dParam, pSetter); | ||
set(pBehavior ? pBehavior->widgetParameterToValue(dParam) : dParam, pSender); | ||
} | ||
|
||
double ControlDoublePrivate::getWidgetParameter() const { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -161,7 +161,7 @@ ControlPushButtonBehavior::ControlPushButtonBehavior(ButtonMode buttonMode, | |
} | ||
|
||
void ControlPushButtonBehavior::setValueFromMidiParameter( | ||
MidiOpCode o, double dParam, ControlDoublePrivate* pControl) { | ||
MidiOpCode o, double dParam, ControlDoublePrivate* pControl) { | ||
// This block makes push-buttons act as power window buttons. | ||
if (m_buttonMode == POWERWINDOW && m_iNumStates == 2) { | ||
if (o == MIDI_NOTE_ON) { | ||
|
@@ -178,8 +178,12 @@ void ControlPushButtonBehavior::setValueFromMidiParameter( | |
} | ||
} else if (m_buttonMode == TOGGLE) { | ||
// This block makes push-buttons act as toggle buttons. | ||
if (m_iNumStates > 2) { //multistate button | ||
if (dParam > 0.) { //looking for NOTE_ON doesn't seem to work... | ||
if (m_iNumStates > 2) { // multistate button | ||
if (dParam > 0.) { // looking for NOTE_ON doesn't seem to work... | ||
// This is a possibly race condition if another writer wants | ||
// to change the value at the same time. We allow the race here, | ||
// because this is possible what the user expects if he changes | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. s/possible/possibly/ |
||
// the same control from different devices. | ||
double value = pControl->get(); | ||
value++; | ||
if (value >= m_iNumStates) { | ||
|
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.
This indentation (8-space indent) doesn't match the rest of Mixxx -- please use 4-space indents.
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.
Please! .. let us (slowly) change this to 8-space indent for line wrap!
Here what other think:
** They wrap at the function parentheses or at 2 x default indention (2) -> 2 x 2 = 4
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.
You're right, it's the right style (if Google style had 4-spaces as default indentation) -- sorry about that.