v

Dependencies:   SDFileSystem VS1053 mbed

Fork of mp3final by Chaiyaporn Boonyasathian

Files at this revision

API Documentation at this revision

Comitter:
PloyLL
Date:
Mon Dec 05 21:02:07 2016 +0000
Parent:
0:f6ba8cc58bf6
Commit message:
v;

Changed in this revision

VS1053.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r f6ba8cc58bf6 -r 3cde58b32c23 VS1053.lib
--- a/VS1053.lib	Fri Dec 02 19:39:41 2016 +0000
+++ b/VS1053.lib	Mon Dec 05 21:02:07 2016 +0000
@@ -1,1 +1,1 @@
-https://developer.mbed.org/users/cha45689/code/VS1053/#58524d569dfd
+https://developer.mbed.org/users/PloyLL/code/VS1053/#787946147566
diff -r f6ba8cc58bf6 -r 3cde58b32c23 main.cpp
--- a/main.cpp	Fri Dec 02 19:39:41 2016 +0000
+++ b/main.cpp	Mon Dec 05 21:02:07 2016 +0000
@@ -1,23 +1,101 @@
-#include "mbed.h"
-#include "player.h"
+#include"mbed.h"
+#include"player.h"
+#include<time.h>
+#include<stdlib.h>
+
 Player player;
 Ticker t;
 Timer timer;
- 
-extern char list[20][50];            //song list
-extern unsigned char vlume;     //vlume
-extern unsigned char vlumeflag; //set vlume flag
-extern char index;              //song play index
-extern char index_MAX;          //how many song in all
+extern Serial pc;
 extern playerStatetype  playerState;
- 
-int falltime;
+
+extern char listName[50][100];         //song name list
+char listData[50][3];           //song data [0->like, 1->dislike, 2->skip]
+char flag = 0;
+
+char playListName[][50] = {
+    "Sad/Gravity.mp3", "Sad/TaTerMaiRuseuk.mp3", "Sad/NumTaTeHai.mp3", "Sad/MaTanWeLaPord.mp3", "Sad/YaSaeJaiKonDrew.mp3",
+    "Stress/PerJer.mp3", "Stress/YenDTMaiRuJak.mp3", "Stress/Y_Rai.mp3", "Stress/LorLey.mp3", "Stress/NuaGenPaiRuePow.mp3",
+    "Angry/9_Nariga.mp3", "Angry/GluptuaGlupJai.mp3", "Angry/MaiTumMaDa.mp3", "Angry/LaugPee4G.mp3", "Angry/CeakWeeSert.mp3",
+    "Happy/PerJer.mp3", "Happy/Jeep.mp3", "Happy/PoodTumMai.mp3", "Happy/RumSeTow.mp3", "Happy/AO.mp3"
+};
+
+//interrupt 
+/*
+void buttonFunction(){
+    //input main function in keypad and change something that resonable.
+}
+
+uint32_t interruptButton(uint32_t index) {                      //  swap with cbAfterInput() function from keypad.
+    buttonIndex = index;
+    flag = 1;
+    if(buttonIndex == ...) playerState = PS_STOP;     //skip music button
+    return 0;
+}
+
+*/ 
  
 int main() {
-    player.begin();
+    //player.begin();
     while(1)
     {
-        player.playFile(list[index]); 
-   
+        //ploy song
+        //player.playFile("testMusic.mp3");
+        //player.playFile("testMusic2.mp3");
+        //player.playFile("test/testMusic2.mp3");
+        //player.playFile("test2/13 Too Young to Go Steady.mp3");
+        
+        //big song
+        /*
+        player.playFile("Sad/Gravity.mp3");
+        player.playFile("Sad/TaTerMaiRuseuk.mp3");
+        player.playFile("Sad/NumTaTeHai.mp3");
+        player.playFile("Sad/MaTanWeLaPord.mp3");
+        player.playFile("Sad/YaSaeJaiKonDrew.mp3");
+        player.playFile("Stress/PerJer.mp3");
+        player.playFile("Stress/YenDTMaiRuJak.mp3");
+        player.playFile("Stress/Y_Rai.mp3");
+        player.playFile("Stress/LorLey.mp3");
+        player.playFile("Stress/NuaGenPaiRuePow.mp3");
+        player.playFile("Angry/9_Nariga.mp3");
+        player.playFile("Angry/GluptuaGlupJai.mp3");
+        player.playFile("Angry/MaiTumMaDa.mp3");
+        player.playFile("Angry/LaugPee4G.mp3");
+        player.playFile("Angry/CeakWeeSert.mp3");
+        player.playFile("Happy/PerJer.mp3");
+        player.playFile("Happy/Jeep.mp3");
+        player.playFile("Happy/PoodTumMai.mp3");
+        player.playFile("Happy/RumSeTow.mp3");
+        player.playFile("Happy/AO.mp3");
+        */
+       // player.playFile("test/NumTaTeHai.mp3");
+        //player.playFile("Sad/Gravity.mp3");
+        //player.playFile("Sad/TaTerMaiRuseuk.mp3");
+        player.playFile("Sad/NumTaTeHai.mp3");
+        player.playFile("Sad/MaTanWeLaPord.mp3");
+        player.playFile("Sad/YaSaeJaiKonDrew.mp3");
+        player.playFile("Stress/PerJer.mp3");
+        player.playFile("Stress/YenDTMaiRuJak.mp3");
+        player.playFile("Stress/Y_Rai.mp3");
+        player.playFile("Stress/LorLey.mp3");
+        player.playFile("Stress/NuaGenPaiRuePow.mp3");
+        player.playFile("Angry/9_Nariga.mp3");
+        player.playFile("Angry/GluptuaGlupJai.mp3");
+        player.playFile("Angry/MaiTumMaDa.mp3");
+        player.playFile("Angry/LaugPee4G.mp3");
+        player.playFile("Angry/CeakWeeSert.mp3");
+        player.playFile("Happy/PerJer.mp3");
+        player.playFile("Happy/Jeep.mp3");
+        player.playFile("Happy/PoodTumMai.mp3");
+        player.playFile("Happy/RumSeTow.mp3");
+        player.playFile("Happy/AO.mp3");
+
+
+        /*
+        if(flag){
+            buttonFunction(buttonIndex);
+            flag = 0;
+        }
+        */
     }
 }
\ No newline at end of file