Changeset 254 for winamp-musepack/trunk/mpc_player.cpp
- Timestamp:
- 03/29/07 15:42:31 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
winamp-musepack/trunk/mpc_player.cpp
r253 r254 29 29 #include <mpc/minimax.h> 30 30 31 #include <taglib/tag.h> 32 #include <taglib/tfile.h> 33 31 #include <tag.h> 32 #include <tfile.h> 33 34 const char* mpc_player::GenreList [NO_GENRES] = { 35 "", "Blues", "Classic Rock", "Country", "Dance", "Disco", "Funk", 36 "Grunge", "Hip-Hop", "Jazz", "Metal", "New Age", "Oldies", 37 "Other", "Pop", "R&B", "Rap", "Reggae", "Rock", 38 "Techno", "Industrial", "Alternative", "Ska", "Death Metal", "Pranks", 39 "Soundtrack", "Euro-Techno", "Ambient", "Trip-Hop", "Vocal", "Jazz+Funk", 40 "Fusion", "Trance", "Classical", "Instrumental", "Acid", "House", 41 "Game", "Sound Clip", "Gospel", "Noise", "AlternRock", "Bass", 42 "Soul", "Punk", "Space", "Meditative", "Instrumental Pop", "Instrumental Rock", 43 "Ethnic", "Gothic", "Darkwave", "Techno-Industrial", "Electronic", "Pop-Folk", 44 "Eurodance", "Dream", "Southern Rock", "Comedy", "Cult", "Gangsta", 45 "Top 40", "Christian Rap", "Pop/Funk", "Jungle", "Native American", "Cabaret", 46 "New Wave", "Psychadelic", "Rave", "Showtunes", "Trailer", "Lo-Fi", 47 "Tribal", "Acid Punk", "Acid Jazz", "Polka", "Retro", "Musical", 48 "Rock & Roll", "Hard Rock", "Folk", "Folk/Rock", "National Folk", "Swing", 49 "Fast-Fusion", "Bebob", "Latin", "Revival", "Celtic", "Bluegrass", "Avantgarde", 50 "Gothic Rock", "Progressive Rock", "Psychedelic Rock", "Symphonic Rock", "Slow Rock", "Big Band", 51 "Chorus", "Easy Listening", "Acoustic", "Humour", "Speech", "Chanson", 52 "Opera", "Chamber Music", "Sonata", "Symphony", "Booty Bass", "Primus", 53 "Po""rn Groove", "Satire", "Slow Jam", "Club", "Tango", "Samba", 54 "Folklore", "Ballad", "Power Ballad", "Rhythmic Soul", "Freestyle", "Duet", 55 "Punk Rock", "Drum Solo", "A capella", "Euro-House", "Dance Hall", 56 "Goa", "Drum & Bass", "Club House", "Ha""rd""co""re", "Terror", 57 "Indie", "BritPop", "NegerPunk", "Polsk Punk", "Beat", 58 "Christian Gangsta", "Heavy Metal", "Black Metal", "Crossover", "Contemporary C", 59 "Christian Rock", "Merengue", "Salsa", "Thrash Metal", "Anime", "JPop", 60 "SynthPop", 61 }; 34 62 35 63 mpc_player::mpc_player(In_Module * in_mod) … … 58 86 wait_event = 0; 59 87 tag_file = 0; 88 89 TagLib::FileRef fileRef; 90 fileRef.file()->useWinAnsiCP(true); 60 91 } 61 92 … … 189 220 if (length_in_ms) *length_in_ms = getLength(); 190 221 if (title) { 191 if (tag_file == 0) {222 if (tag_file == 0) 192 223 tag_file = new TagLib::FileRef(lastfn, false); 193 (tag_file->file())->useWinAnsiCP(true);194 }195 224 196 225 if (tag_file->isNull() || !tag_file->tag()) { … … 201 230 TagLib::Tag *tag = tag_file->tag(); 202 231 sprintf(title, "%s - %s", tag->artist().toCString(), tag->title().toCString()); 203 //tag->artist()204 //tag->album()205 //tag->year()206 //tag->comment()207 //tag->track()208 //tag->genre()209 232 } 210 233 } … … 281 304 TagLib::Tag *tag = tag_file->tag(); 282 305 283 //tag->setTitle(wch); 284 //tag->setArtist(wch); 285 //tag->setAlbum(wch); 286 287 //TagLib::String year(wch); 288 //tag->setYear(year.toInt()); 289 290 //TagLib::String track(wch); 291 //tag->setTrack(track.toInt()); 292 293 //tag->setGenre(wch); 294 //tag->setComment(wch); 295 296 tag_file->save(); // FIXME : make all crash 306 WCHAR buf[2048]; 307 308 GetDlgItemTextW(hDlg, IDC_TITLE, buf, 2048); 309 tag->setTitle(buf); 310 GetDlgItemTextW(hDlg, IDC_ARTIST, buf, 2048); 311 tag->setArtist(buf); 312 GetDlgItemTextW(hDlg, IDC_ALBUM, buf, 2048); 313 tag->setAlbum(buf); 314 GetDlgItemTextW(hDlg, IDC_YEAR, buf, 2048); 315 TagLib::String year(buf); 316 tag->setYear(year.toInt()); 317 GetDlgItemTextW(hDlg, IDC_TRACK, buf, 2048); 318 TagLib::String track(buf); 319 tag->setTrack(track.toInt()); 320 GetDlgItemTextW(hDlg, IDC_GENRE, buf, 2048); 321 tag->setGenre(buf); 322 GetDlgItemTextW(hDlg, IDC_COMMENT, buf, 2048); 323 tag->setComment(buf); 324 325 tag_file->save(); 297 326 } 298 327 } … … 324 353 SetDlgItemText(hDlg, IDC_STREAM_INFO, tmp.str().c_str()); 325 354 326 if(tag_file == 0) { 355 SetDlgItemText(hDlg, IDC_FILE, lastfn); 356 357 if (tag_file == 0) 327 358 tag_file = new TagLib::FileRef(lastfn, false); 328 (tag_file->file())->useWinAnsiCP(true);329 }330 359 331 360 if (!tag_file->isNull() && tag_file->tag()) { … … 350 379 SetDlgItemTextW(hDlg, IDC_COMMENT, buf); 351 380 } 381 382 HWND hGenre = GetDlgItem ( hDlg, IDC_GENRE ); 383 for ( int n = 0; n < NO_GENRES; n++ ) 384 SendMessage ( hGenre, CB_ADDSTRING, 0, (LONG)(LPSTR)GenreList[n] ); 352 385 } 353 386 … … 358 391 { 359 392 case WM_INITDIALOG: 360 SetWindowLong (hDlg, DWL_USER, lParam);393 SetWindowLongPtr(hDlg, DWLP_USER, lParam); 361 394 ((mpc_player *) lParam)->initDlg(hDlg); 362 395 return TRUE; … … 367 400 return TRUE; 368 401 } else if (LOWORD(wParam) == IDC_RELOAD) { 369 // FIXME : this will not work on X64 370 ((mpc_player*)GetWindowLong(hDlg, DWL_USER))->initDlg(hDlg); 402 ((mpc_player*)GetWindowLongPtr(hDlg, DWLP_USER))->initDlg(hDlg); 371 403 } else if (LOWORD(wParam) == IDC_SAVE) { 372 ((mpc_player*)GetWindowLong (hDlg, DWL_USER))->writeTags(hDlg);404 ((mpc_player*)GetWindowLongPtr(hDlg, DWLP_USER))->writeTags(hDlg); 373 405 EndDialog(hDlg, LOWORD(wParam)); 374 406 return TRUE; … … 382 414 { 383 415 DialogBoxParam(mod->hDllInstance, (LPCTSTR)IDD_INFO_BOX, hwnd, (DLGPROC)About, (LPARAM) this); 384 385 //loadTags(% infoBox);386 387 //infoBox.ShowDialog();388 416 return 0; 389 417 }
Note: See TracChangeset
for help on using the changeset viewer.