00001 #ifndef _SONGITEM_H_ 00002 #define _SONGITEM_H_ 00003 00004 #include "InputStream.h" 00005 #include "OutputStream.h" 00006 #include "ListTools.h" 00007 #define SEGMENT_SIZE 128 //資料庫歌曲的片段長度 00008 //Q: note中的時間單位是1/64秒,轉換後的單位是resampleRate/64秒=4/64秒=1/16秒 00009 //Q:因此唱進來的歌是8秒,應該會有8*16=128點資料 00010 00015 class TSongItem //資料庫中一首歌的型別 00016 { 00017 public: 00018 TMyStringList *Fields; 00019 int start; 00020 unsigned char *note; 00021 int noteSize; 00022 int *mid; 00023 int midSize; 00024 float score; 00025 int *noteIndex; 00026 int noteIndexSize; 00027 int bestSegment; 00028 int *refrainIndex; 00029 int refrainIndexSize; 00030 int *midRefrainIndex; 00031 00032 TSongItem(); 00033 ~TSongItem(); 00034 void SetProperty(char *); 00035 bool Read(TInputStream *, int); 00036 void Write(TOutputStream *, TOutputStream *); 00037 void NoteToMid(int, int); //將note轉換成mid 00038 void FreeMid(void); //將中介格式釋放掉 00039 void FreeRefrain(void); //將複歌釋放掉 00040 void Ready(int); 00041 }; 00042 00043 #endif 00044