Added serial command ids; id-to-folder mapping now works.

This commit is contained in:
2019-11-13 06:51:38 +01:00
parent 0531b599fe
commit e20e6b7d3e
4 changed files with 45 additions and 32 deletions

View File

@ -24,6 +24,7 @@ private:
String _serial_buffer = String();
void _execute_serial_command(String cmd);
void _execute_command_ls(String path);
void _execute_command_ids();
void _execute_command_help();
unsigned long _button_last_pressed_at[NUM_BUTTONS];
bool _check_button(uint8_t btn);

View File

@ -8,6 +8,7 @@
#define SCI_MODE 0x00
#define SCI_STATUS 0x01
#define SCI_BASS 0x02
#define SCI_CLOCKF 0x03
#define SCI_DECODE_TIME 0x04
#define SCI_AUDATA 0x05
@ -16,6 +17,7 @@
#define SCI_WRAM 0x06
#define SCI_HDAT0 0x08
#define SCI_HDAT1 0x09
#define SCI_AIADDR 0x0A
#define SCI_AICTRL0 0x0C
#define SCI_AICTRL1 0x0D
#define SCI_AICTRL2 0x0E
@ -28,14 +30,10 @@
#define SM_RESET 0x0004
#define SM_CANCEL 0x0008
#define SM_SDINEW 0x0800
#define SM_ADPCM 0x1000
#define SS_DO_NOT_JUMP 0x8000
struct ID_to_Folder_Map {
const char* id;
const char* folder;
};
class Player {
private:
enum state { uninitialized, idle, playing, stopping,
@ -96,8 +94,9 @@ private:
uint32_t _skip_to;
SPIMaster* _spi;
unsigned long _stopped_at;
std::list<ID_to_Folder_Map> _id_to_folder_map;
public:
std::map<String, String> id_to_folder_map;
Player(SPIMaster* s);
void vol_up();
void vol_down();