Changeset 2:422f3cb3614b
- Timestamp:
- 08/01/08 21:17:15 (4 years ago)
- Branch:
- default
- convert_revision:
- svn:d0a2da98-017c-47d2-8c43-22b54484806d/trunk@3
- Location:
- music2
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
music2/koedec.cc
r0 r2 34 34 #include"music.h" 35 35 #include"system/file.h" 36 #include"system/file_impl.h" 36 37 37 38 using namespace std; … … 86 87 return koe_cache.Find(file_number, index); 87 88 }; 88 89 extern int ogg_get_rate(FILE*); 89 90 AvgKoeInfo AvgKoeCache::Find(int file_number, int index) { 90 91 AvgKoeInfo info; … … 109 110 arcinfo = file_searcher.Find(FILESEARCH::KOE,fname,".ovk"); 110 111 } 112 if (arcinfo == 0) { 113 DIRFILE* koedir = (DIRFILE*) file_searcher.MakeARCFILE((FILESEARCH::ARCTYPE)0, "koe"); 114 sprintf(fname, "%04d", file_number); 115 koedir = new DIRFILE(koedir->SearchFile(fname)); 116 sprintf(fname, "z%04d%05d.ogg", file_number, index); 117 arcinfo = koedir->Find(fname, ".ogg"); 118 delete koedir; 119 120 if (arcinfo == 0) return info; 121 FILE* stream = arcinfo->OpenFile(); 122 info.rate = ogg_get_rate(stream); 123 fseek(stream, 0L, SEEK_END); 124 info.length = ftell(stream); 125 fseek(stream, 0L, SEEK_CUR); 126 info.type = koe_ogg; 127 info.stream = stream; 128 return info; 129 } 111 130 if (arcinfo == 0) return info; 112 131 FILE* stream = arcinfo->OpenFile(); … … 142 161 type = from.type; 143 162 } 163 144 164 AvgKoeHead::AvgKoeHead(FILE* _s, int _file_number, KoeType _type) { 145 165 char head[0x20]; -
music2/koedec_ogg.cc
r0 r2 99 99 return 0; 100 100 } 101 int ogg_get_rate(FILE *stream) 102 { 103 OggVorbis_File vf; 104 ov_open(stream, &vf, NULL, 0); 105 return vf.vi->rate; 106 } 101 107 102 108 extern char* decode_koe_ogg(AvgKoeInfo info, int* dest_len) { -
music2/music.h
r0 r2 16 16 #define DEFAULT_AUDIOBUF 4096 17 17 18 enum KoeType { koe_unknown, koe_nwk, koe_ovk };18 enum KoeType { koe_unknown, koe_nwk, koe_ovk, koe_ogg}; 19 19 typedef struct { 20 20 FILE* stream;
![(please configure the [header_logo] section in trac.ini)](/otakunoraifu/chrome/site/your_project_logo.png)