ELEC60013-ES-CW2/lib/knob/knob

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