Merge lp:~loadstar81/mixxx/features_softstep into lp:~mixxxdevelopers/mixxx/trunk

Proposed by Tom Mast
Status: Merged
Merged at revision: 2695
Proposed branch: lp:~loadstar81/mixxx/features_softstep
Merge into: lp:~mixxxdevelopers/mixxx/trunk
Diff against target: 119 lines (+53/-6)
3 files modified
mixxx/res/keyboard/Standard.kbd.cfg (+2/-0)
mixxx/src/controlpotmeter.cpp (+44/-5)
mixxx/src/controlpotmeter.h (+7/-1)
To merge this branch: bzr merge lp:~loadstar81/mixxx/features_softstep
Reviewer Review Type Date Requested Status
RJ Skerry-Ryan Approve
Review via email: mp+54943@code.launchpad.net

Description of the change

This change modifies the ControlPotmeter functionality to add a smaller step size, specifically 1/100 compared to the normal 1/10 size. Added are two functions incSmallValue() and decSmallValue() which are connected to the ControlPushButtons read from the config with "_up_small" and "_down_small." Also added is a function setSmallStep() which calculates the smaller step size and stores it in the new variable m_dSmallStep.

To post a comment you must log in.
Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

Looks good to me -- thanks Tom!

I'll add you to the contributor list as "Tom Mast". Is that ok?

review: Approve
Revision history for this message
Tom Mast (loadstar81) wrote :

That's great!

On Sat, Mar 26, 2011 at 10:03 PM, RJ Ryan <email address hidden> wrote:

> Review: Approve
> Looks good to me -- thanks Tom!
>
> I'll add you to the contributor list as "Tom Mast". Is that ok?
> --
>
> https://code.launchpad.net/~thomasomast/mixxx/features_softstep/+merge/54943
> You are the owner of lp:~thomasomast/mixxx/features_softstep.
>

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'mixxx/res/keyboard/Standard.kbd.cfg'
--- mixxx/res/keyboard/Standard.kbd.cfg 2010-12-01 20:39:53 +0000
+++ mixxx/res/keyboard/Standard.kbd.cfg 2011-03-26 04:30:49 +0000
@@ -1,6 +1,8 @@
1[Master]1[Master]
2crossfader_up h2crossfader_up h
3crossfader_down g3crossfader_down g
4crossfader_up_small Shift+h
5crossfader_down_small Shift+g
46
5[Channel1]7[Channel1]
6play d8play d
79
=== modified file 'mixxx/src/controlpotmeter.cpp'
--- mixxx/src/controlpotmeter.cpp 2009-05-20 02:14:46 +0000
+++ mixxx/src/controlpotmeter.cpp 2011-03-26 04:30:49 +0000
@@ -31,12 +31,17 @@
31{31{
32 setRange(dMinValue,dMaxValue);32 setRange(dMinValue,dMaxValue);
33 setStep(m_dValueRange/10.f);33 setStep(m_dValueRange/10.f);
34 setSmallStep(m_dValueRange/100.f);
3435
35 ControlPushButton * p;36 ControlPushButton * p;
36 p = new ControlPushButton(ConfigKey(key.group, QString(key.item)+"_up"));37 p = new ControlPushButton(ConfigKey(key.group, QString(key.item)+"_up"));
37 connect(p, SIGNAL(valueChanged(double)), this, SLOT(incValue(double)));38 connect(p, SIGNAL(valueChanged(double)), this, SLOT(incValue(double)));
38 p = new ControlPushButton(ConfigKey(key.group, QString(key.item)+"_down"));39 p = new ControlPushButton(ConfigKey(key.group, QString(key.item)+"_down"));
39 connect(p, SIGNAL(valueChanged(double)), this, SLOT(decValue(double)));40 connect(p, SIGNAL(valueChanged(double)), this, SLOT(decValue(double)));
41 p = new ControlPushButton(ConfigKey(key.group, QString(key.item)+"_up_small"));
42 connect(p, SIGNAL(valueChanged(double)), this, SLOT(incSmallValue(double)));
43 p = new ControlPushButton(ConfigKey(key.group, QString(key.item)+"_down_small"));
44 connect(p, SIGNAL(valueChanged(double)), this, SLOT(decSmallValue(double)));
40}45}
4146
42ControlPotmeter::~ControlPotmeter()47ControlPotmeter::~ControlPotmeter()
@@ -58,6 +63,11 @@
58 m_dStep = dValue;63 m_dStep = dValue;
59}64}
6065
66void ControlPotmeter::setSmallStep(double dValue)
67{
68 m_dSmallStep = dValue;
69}
70
61void ControlPotmeter::setRange(double dMinValue, double dMaxValue)71void ControlPotmeter::setRange(double dMinValue, double dMaxValue)
62{72{
63 m_dMinValue = dMinValue;73 m_dMinValue = dMinValue;
@@ -141,8 +151,37 @@
141 m_dValue -= m_dStep;151 m_dValue -= m_dStep;
142 emit(valueChanged(m_dValue));152 emit(valueChanged(m_dValue));
143153
144 // incValue will be activated by assosiated _up or _down ControlObject, and thus it is safe to update all proxies.154 // decValue will be activated by assosiated _up or _down ControlObject, and thus it is safe to update all proxies.
145 updateProxies(0);155 updateProxies(0);
146 }156 }
147}157}
148158
159void ControlPotmeter::incSmallValue(double keypos)
160{
161 if (keypos>0)
162 {
163 if (m_dValue+m_dSmallStep>m_dMaxValue)
164 m_dValue = m_dMaxValue;
165 else
166 m_dValue += m_dSmallStep;
167 emit(valueChanged(m_dValue));
168
169 // incSmallValue will be activated by assosiated _up_small or _down_small ControlObject, and thus it is safe to update all proxies.
170 updateProxies(0);
171 }
172}
173
174void ControlPotmeter::decSmallValue(double keypos)
175{
176 if (keypos>0)
177 {
178 if (m_dValue-m_dSmallStep<m_dMinValue)
179 m_dValue = m_dMinValue;
180 else
181 m_dValue -= m_dSmallStep;
182 emit(valueChanged(m_dValue));
183
184 // decSmallValue will be activated by assosiated _up_small or _down_small ControlObject, and thus it is safe to update all proxies.
185 updateProxies(0);
186 }
187}
149188
=== modified file 'mixxx/src/controlpotmeter.h'
--- mixxx/src/controlpotmeter.h 2007-04-06 22:09:23 +0000
+++ mixxx/src/controlpotmeter.h 2011-03-26 04:30:49 +0000
@@ -38,6 +38,8 @@
38 double getMax();38 double getMax();
39 /** Sets the step size of the associated PushButtons */39 /** Sets the step size of the associated PushButtons */
40 void setStep(double);40 void setStep(double);
41 /** Sets the small step size of the associated PushButtons */
42 void setSmallStep(double);
41 /** Sets the minimum and maximum allowed value. The control value is reset when calling43 /** Sets the minimum and maximum allowed value. The control value is reset when calling
42 * this method */44 * this method */
43 void setRange(double dMinValue, double dMaxValue);45 void setRange(double dMinValue, double dMaxValue);
@@ -52,11 +54,15 @@
52 void incValue(double);54 void incValue(double);
53 /** Decreases the value. This method is called from an associated PushButton control */55 /** Decreases the value. This method is called from an associated PushButton control */
54 void decValue(double);56 void decValue(double);
57 /** Increases the value by smaller step. */
58 void incSmallValue(double);
59 /** Decreases the value by smaller step. */
60 void decSmallValue(double);
5561
56protected:62protected:
57 void setValueFromMidi(MidiCategory c, double v);63 void setValueFromMidi(MidiCategory c, double v);
58 64
59 double m_dMaxValue, m_dMinValue, m_dValueRange, m_dStep;65 double m_dMaxValue, m_dMinValue, m_dValueRange, m_dStep, m_dSmallStep;
6066
61#define maxPosition 12767#define maxPosition 127
62#define minPosition 068#define minPosition 0