Refactored and current playstatus is now received from device
This commit is contained in:
@@ -2,4 +2,9 @@
|
||||
|
||||
namespace avrcp {
|
||||
void init();
|
||||
bool is_playing();
|
||||
|
||||
void play_pause();
|
||||
void forward();
|
||||
void backward();
|
||||
}
|
||||
|
||||
@@ -6,3 +6,17 @@
|
||||
const char* addr_to_str(esp_bd_addr_t bda);
|
||||
const char* connection_state_to_str(esp_a2d_connection_state_t state);
|
||||
|
||||
class MultiPurposeButton {
|
||||
public:
|
||||
MultiPurposeButton(void(*short_press)(), void(*long_press)(), uint8_t threshold = 5);
|
||||
|
||||
void tick(bool current);
|
||||
|
||||
private:
|
||||
void(*short_press)();
|
||||
void(*long_press)();
|
||||
uint8_t threshold = 5;
|
||||
bool previous = false;
|
||||
uint8_t counter = 0;
|
||||
bool acted = false;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user