Changeset 254
- Timestamp:
- 03/29/07 15:42:31 (18 years ago)
- Location:
- winamp-musepack/trunk
- Files:
-
- 5 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 } -
winamp-musepack/trunk/mpc_player.h
r250 r254 21 21 22 22 #include <mpc/mpcdec.h> 23 #include < taglib/fileref.h>23 #include <fileref.h> 24 24 25 25 // post this to the main window at end of file (after playback as stopped) 26 26 #define WM_WA_EOF WM_USER+2 27 27 28 #define NO_GENRES 149 28 29 29 30 class mpc_player … … 51 52 private: 52 53 char lastfn[MAX_PATH]; // currently playing file (used for getting info on the current file) 54 static const char* GenreList[NO_GENRES]; 53 55 mpc_streaminfo si; 54 56 mpc_reader reader; -
winamp-musepack/trunk/resource.h
r250 r254 10 10 #define IDC_GENRE 1004 11 11 #define IDC_ALBUM 1005 12 #define IDC_BUTTON1 100613 12 #define IDC_CANCEL 1006 14 13 #define IDC_YEAR 1007 … … 17 16 #define IDC_TRACK 1010 18 17 #define IDC_COMMENT 1011 18 #define IDC_EDIT1 1012 19 #define IDC_FILE 1012 19 20 #define IDC_STATIC -1 20 21 … … 25 26 #define _APS_NEXT_RESOURCE_VALUE 102 26 27 #define _APS_NEXT_COMMAND_VALUE 40001 27 #define _APS_NEXT_CONTROL_VALUE 10 0728 #define _APS_NEXT_CONTROL_VALUE 1013 28 29 #define _APS_NEXT_SYMED_VALUE 101 29 30 #endif -
winamp-musepack/trunk/winamp-musepack.rc
r250 r254 57 57 // 58 58 59 IDD_INFO_BOX DIALOGEX 0, 0, 406, 18659 IDD_INFO_BOX DIALOGEX 0, 0, 406, 202 60 60 STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU 61 61 CAPTION "Musepack file information" 62 62 FONT 8, "MS Shell Dlg", 0, 0, 0x0 63 63 BEGIN 64 GROUPBOX "Stream",IDC_STATIC,264,0,138,180,BS_FLAT 65 LTEXT "C'est juste un test.\nPour voir si tout va bien.", 66 IDC_STREAM_INFO,270,11,126,163 67 GROUPBOX "Tag",IDC_STATIC,6,0,252,180,BS_FLAT 68 EDITTEXT IDC_TITLE,54,12,198,12,ES_AUTOHSCROLL 69 RTEXT "Title",IDC_STATIC,12,14,36,8 70 EDITTEXT IDC_ARTIST,54,30,198,12,ES_AUTOHSCROLL 71 RTEXT "Artist",IDC_STATIC,12,32,36,8 72 EDITTEXT IDC_ALBUM,54,48,198,12,ES_AUTOHSCROLL 73 RTEXT "Album",IDC_STATIC,12,50,36,8 74 EDITTEXT IDC_YEAR,54,66,42,12,ES_AUTOHSCROLL | ES_NUMBER 75 RTEXT "Year",IDC_STATIC,12,68,36,8 76 EDITTEXT IDC_TRACK,228,66,24,12,ES_AUTOHSCROLL | ES_NUMBER 77 RTEXT "Track",IDC_STATIC,162,68,60,8 78 COMBOBOX IDC_GENRE,54,84,198,18,CBS_DROPDOWN | CBS_SORT | 64 GROUPBOX "Stream",IDC_STATIC,264,18,138,180,BS_FLAT 65 LTEXT "",IDC_STREAM_INFO,270,29,126,163 66 GROUPBOX "Tag",IDC_STATIC,6,18,252,180,BS_FLAT 67 EDITTEXT IDC_TITLE,54,30,198,12,ES_AUTOHSCROLL 68 RTEXT "Title",IDC_STATIC,12,32,36,8 69 EDITTEXT IDC_ARTIST,54,48,198,12,ES_AUTOHSCROLL 70 RTEXT "Artist",IDC_STATIC,12,50,36,8 71 EDITTEXT IDC_ALBUM,54,66,198,12,ES_AUTOHSCROLL 72 RTEXT "Album",IDC_STATIC,12,68,36,8 73 EDITTEXT IDC_YEAR,54,84,42,12,ES_AUTOHSCROLL | ES_NUMBER 74 RTEXT "Year",IDC_STATIC,12,86,36,8 75 EDITTEXT IDC_TRACK,228,84,24,12,ES_AUTOHSCROLL | ES_NUMBER 76 RTEXT "Track",IDC_STATIC,162,86,60,8 77 COMBOBOX IDC_GENRE,54,102,198,18,CBS_DROPDOWN | CBS_SORT | 79 78 WS_VSCROLL | WS_TABSTOP 80 RTEXT "Genre",IDC_STATIC,12,86,36,8 81 EDITTEXT IDC_COMMENT,54,102,198,54,ES_MULTILINE | ES_AUTOHSCROLL 82 RTEXT "Comment",IDC_STATIC,12,104,36,8 83 PUSHBUTTON "Cancel",IDC_CANCEL,186,162,66,12 84 PUSHBUTTON "Reload",IDC_RELOAD,99,162,66,12 85 PUSHBUTTON "Save",IDC_SAVE,12,162,66,12 79 RTEXT "Genre",IDC_STATIC,12,104,36,8 80 EDITTEXT IDC_COMMENT,54,120,198,54,ES_MULTILINE | ES_AUTOHSCROLL 81 RTEXT "Comment",IDC_STATIC,12,122,36,8 82 PUSHBUTTON "Cancel",IDC_CANCEL,186,180,66,12 83 PUSHBUTTON "Reload",IDC_RELOAD,99,180,66,12 84 PUSHBUTTON "Save",IDC_SAVE,12,180,66,12 85 EDITTEXT IDC_FILE,24,6,378,12,ES_AUTOHSCROLL | ES_READONLY 86 RTEXT "File",IDC_STATIC,6,8,12,8 86 87 END 87 88 … … 100 101 RIGHTMARGIN, 399 101 102 TOPMARGIN, 7 102 BOTTOMMARGIN, 1 79103 BOTTOMMARGIN, 195 103 104 END 104 105 END -
winamp-musepack/trunk/winamp-musepack.vcproj
r249 r254 21 21 Name="VCCLCompilerTool" 22 22 Optimization="0" 23 AdditionalIncludeDirectories=""C:\Program Files\taglib\include ";"$(SolutionDir)\..\libmpc\include""23 AdditionalIncludeDirectories=""C:\Program Files\taglib\include\taglib";"$(SolutionDir)\..\libmpc\include"" 24 24 PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;WINAMPMUSEPACK_EXPORTS" 25 25 MinimalRebuild="TRUE" … … 72 72 <Tool 73 73 Name="VCCLCompilerTool" 74 AdditionalIncludeDirectories=""C:\Program Files\taglib\include ";"$(SolutionDir)\..\libmpc\include""74 AdditionalIncludeDirectories=""C:\Program Files\taglib\include\taglib";"$(SolutionDir)\..\libmpc\include"" 75 75 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;WINAMPMUSEPACK_EXPORTS" 76 76 RuntimeLibrary="2"
Note: See TracChangeset
for help on using the changeset viewer.