Daiki Kato / EasyPlayback

Dependents:   GR-PEACH_Audio_WAV_PwmOut GR-Boards_Audio_WAV

Revision:
1:fdd79b99ba73
Parent:
0:9956e2ed09da
Child:
2:6c46c61630b3
diff -r 9956e2ed09da -r fdd79b99ba73 EasyPlayback.h
--- a/EasyPlayback.h	Mon Oct 30 07:04:30 2017 +0000
+++ b/EasyPlayback.h	Tue Jul 03 05:12:29 2018 +0000
@@ -21,11 +21,17 @@
 #include <map>
 #include "EasyDecoder.h"
 #include "AUDIO_GRBoard.h"
+#include "FATFileSystem.h"
 
 class EasyPlayback
 {
 public:
-    EasyPlayback();
+    typedef enum {
+        AUDIO_TPYE_SSIF,
+        AUDIO_TPYE_SPDIF
+    } audio_type_t;
+
+    EasyPlayback(audio_type_t type = AUDIO_TPYE_SSIF);
     ~EasyPlayback();
     bool get_tag(const char* filename, char* p_title, char* p_artist, char* p_album, uint16_t tag_size);
     bool play(const char* filename);
@@ -41,16 +47,18 @@
     }
 
 private:
-    #define AUDIO_WRITE_BUFF_SIZE  (4096)
     #define AUDIO_WRITE_BUFF_NUM   (8)
     #define AUDIO_MSK_RING_BUFF    (AUDIO_WRITE_BUFF_NUM - 1)
-    AUDIO_GRBoard audio;
+    AUDIO_GRBoard * _audio_ssif;
+    AUDIO_RBSP * _audio;
     int _buff_index;
+    audio_type_t _type;
     bool _skip;
     bool _pause;
     bool _init_end;
+    uint32_t _audio_buff_size;
     uint8_t *_heap_buf;
-    uint8_t (*_audio_buf)[AUDIO_WRITE_BUFF_SIZE];
+    uint8_t *_audio_buf;
     std::map<std::string, EasyDecoder*(*)()> m_lpDecoders;
 
     EasyDecoder * create_decoer_class(const char* filename);