esmp3/include/controller.h

28 lines
567 B
C++

#pragma once
#include <Arduino.h>
#include <MFRC522v2.h>
#include <MFRC522Debug.h>
#include "esmp3.h"
#include "playlist.h"
class Controller {
private:
void handle_buttons();
void handle_rfid();
bool is_button_pressed(uint8_t pin);
Playlist current_playlist;
bool is_rfid_present = false;
unsigned long last_rfid_check = 0;
uint8_t button_pressed = 0;
unsigned long button_pressed_since = 0;
bool button_already_processed = false;
public:
void handle();
void next_track();
void prev_track();
void play();
void play(String rfid_id);
void stop();
};