mirror of
https://github.com/supleed2/ELEC60013-ES-CW2.git
synced 2024-12-23 06:05:51 +00:00
25 lines
517 B
Plaintext
25 lines
517 B
Plaintext
#ifndef KNOB_H
|
|
#define KNOB_H
|
|
|
|
class Knob {
|
|
private:
|
|
int rotation, rotationInternal;
|
|
int minimum, maximum, previousRotation;
|
|
bool A, B;
|
|
enum PrevRot {
|
|
NONE,
|
|
CW,
|
|
ACW,
|
|
};
|
|
|
|
public:
|
|
Knob(int minimum, int maximum, int initialRotation);
|
|
Knob(int minimum, int maximum) : Knob(minimum, maximum, minimum) {} // Delegate to full constructor, using minimum as initial rotation
|
|
|
|
int getRotation();
|
|
|
|
void updateRotation(bool ANew, bool BNew);
|
|
void changeLimitsVolume(int newMinimum, int newMaximum);
|
|
};
|
|
|
|
#endif |