Changeset 250
- Timestamp:
- 03/28/07 19:19:56 (18 years ago)
- Location:
- winamp-musepack/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
winamp-musepack/trunk/mpc_player.cpp
r249 r250 144 144 } 145 145 WaitForSingleObject(wait_event, 100); // give a little CPU time back to the system. 146 } else if (mod->outMod->CanWrite() >= ( MPC_FRAME_LENGTH * sizeof(short) * si.channels)*(mod->dsp_isactive()?2:1)) {146 } else if (mod->outMod->CanWrite() >= (int)((MPC_FRAME_LENGTH * sizeof(short) * si.channels)*(mod->dsp_isactive()?2:1))) { 147 147 // CanWrite() returns the number of bytes you can write, so we check that 148 148 // to the block size. the reason we multiply the block size by two if … … 255 255 // dividing by 1000 for the first parameter of setinfo makes it 256 256 // display 'H'... for hundred.. i.e. 14H Kbps. 257 mod->SetInfo( si.average_bitrate / 1000, si.sample_freq / 1000, si.channels, 1);257 mod->SetInfo((int)(si.average_bitrate / 1000), si.sample_freq / 1000, si.channels, 1); 258 258 259 259 // initialize visualization stuff … … 273 273 } 274 274 275 //void mpc_player::loadTags(mpc_info ^ infoBox) 276 //{ 277 // if(tag_file == 0) 278 // tag_file = new TagLib::FileRef(lastfn, false); 279 // 280 // if (!tag_file->isNull() && tag_file->tag()) { 281 // TagLib::Tag *tag = tag_file->tag(); 282 // infoBox->txtTitle->Text = gcnew String(tag->title().toCString(true), 0, strlen(tag->title().toCString(true)), System::Text::Encoding::UTF8); 283 // infoBox->txtArtist->Text = gcnew String(tag->artist().toCString(true), 0, strlen(tag->artist().toCString(true)), System::Text::Encoding::UTF8); 284 // infoBox->txtAlbum->Text = gcnew String(tag->album().toCString(true), 0, strlen(tag->album().toCString(true)), System::Text::Encoding::UTF8); 285 // infoBox->txtYear->Text = ""; 286 // infoBox->txtYear->Text += tag->year(); 287 // infoBox->txtTrack->Text = ""; 288 // infoBox->txtTrack->Text += tag->track(); 289 // infoBox->comboGenre->Text = gcnew String(tag->genre().toCString(true), 0, strlen(tag->genre().toCString(true)), System::Text::Encoding::UTF8); 290 // infoBox->txtComment->Text = gcnew String(tag->comment().toCString(true), 0, strlen(tag->comment().toCString(true)), System::Text::Encoding::UTF8); 291 // } 292 //} 293 294 //void mpc_player::writeTags(mpc_info ^ infoBox) 295 //{ 296 // if (!tag_file->isNull() && tag_file->tag()) { 297 // TagLib::Tag *tag = tag_file->tag(); 298 // 299 // pin_ptr<const wchar_t> wch = PtrToStringChars(infoBox->txtTitle->Text); 300 // tag->setTitle(wch); 301 // 302 // wch = PtrToStringChars(infoBox->txtArtist->Text); 303 // tag->setArtist(wch); 304 // 305 // wch = PtrToStringChars(infoBox->txtAlbum->Text); 306 // tag->setAlbum(wch); 307 // 308 // wch = PtrToStringChars(infoBox->txtYear->Text); 309 // TagLib::String year(wch); 310 // tag->setYear(year.toInt()); 311 // 312 // wch = PtrToStringChars(infoBox->txtTrack->Text); 313 // TagLib::String track(wch); 314 // tag->setTrack(track.toInt()); 315 // 316 // wch = PtrToStringChars(infoBox->comboGenre->Text); 317 // tag->setGenre(wch); 318 // 319 // wch = PtrToStringChars(infoBox->txtComment->Text); 320 // tag->setComment(wch); 321 // 322 // tag_file->save(); // FIXME : make all crash 323 // } 324 //} 275 void mpc_player::writeTags(HWND hDlg) 276 { 277 if (!tag_file->isNull() && tag_file->tag()) { 278 TagLib::Tag *tag = tag_file->tag(); 279 280 //tag->setTitle(wch); 281 //tag->setArtist(wch); 282 //tag->setAlbum(wch); 283 284 //TagLib::String year(wch); 285 //tag->setYear(year.toInt()); 286 287 //TagLib::String track(wch); 288 //tag->setTrack(track.toInt()); 289 290 //tag->setGenre(wch); 291 //tag->setComment(wch); 292 293 tag_file->save(); // FIXME : make all crash 294 } 295 } 325 296 326 297 void mpc_player::initDlg(HWND hDlg) … … 328 299 std::ostringstream tmp; 329 300 330 tmp << "Streamversion "; 331 tmp << si.stream_version; 332 tmp << "\nEncoder : "; 333 tmp << si.encoder; 334 tmp << "\nProfile : "; 335 tmp << si.profile_name; 301 tmp << "Streamversion " << si.stream_version; 302 tmp << "\nEncoder : " << si.encoder; 303 tmp << "\nProfile : " << si.profile_name; 336 304 tmp << "\nPNS : "; 337 305 if (si.pns) tmp << "on"; … … 340 308 if (si.is_true_gapless) tmp << "on"; 341 309 else tmp << "off"; 342 tmp << "\nAverage bitrate : "; 343 tmp << floor(si.average_bitrate * 1.e-3 + .5); 344 tmp << " Kbps \nSamplerate : "; 345 tmp << si.sample_freq; 346 tmp << "\nChannels : "; 347 tmp << si.channels; 348 tmp << "\nFile size : "; 349 tmp << si.total_file_length; 350 tmp << " Bytes"; 351 //// FIXME : add replay gain info 310 tmp << "\nAverage bitrate : " << floor(si.average_bitrate * 1.e-3 + .5) << " Kbps"; 311 tmp << "\nSamplerate : " << si.sample_freq; 312 tmp << "\nChannels : " << si.channels; 313 tmp << "\nFile size : " << si.total_file_length << " Bytes"; 314 //// FIXME : add replay gain info, lenth (min:sec), sample number 352 315 353 316 SetDlgItemText(hDlg, IDC_STREAM_INFO, tmp.str().c_str()); 317 318 if(tag_file == 0) 319 tag_file = new TagLib::FileRef(lastfn, false); 320 321 if (!tag_file->isNull() && tag_file->tag()) { 322 TagLib::Tag *tag = tag_file->tag(); 323 SetDlgItemText(hDlg, IDC_TITLE, tag->title().toCString(true)); 324 SetDlgItemText(hDlg, IDC_ARTIST, tag->artist().toCString(true)); 325 SetDlgItemText(hDlg, IDC_ALBUM, tag->album().toCString(true)); 326 tmp.str(""); 327 tmp << tag->year(); 328 SetDlgItemText(hDlg, IDC_YEAR, tmp.str().c_str()); 329 tmp.str(""); 330 tmp << tag->track(); 331 SetDlgItemText(hDlg, IDC_TRACK, tmp.str().c_str()); 332 SetDlgItemText(hDlg, IDC_GENRE, tag->genre().toCString(true)); 333 SetDlgItemText(hDlg, IDC_COMMENT, tag->comment().toCString(true)); 334 } 354 335 } 355 336 … … 360 341 { 361 342 case WM_INITDIALOG: 343 SetWindowLong(hDlg, DWL_USER, lParam); 362 344 ((mpc_player *) lParam)->initDlg(hDlg); 363 345 return TRUE; 364 346 365 347 case WM_COMMAND: 366 if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) 367 { 348 if (LOWORD(wParam) == IDC_CANCEL || LOWORD(wParam) == IDCANCEL) { 349 EndDialog(hDlg, LOWORD(wParam)); 350 return TRUE; 351 } else if (LOWORD(wParam) == IDC_RELOAD) { 352 // FIXME : this will not work on X64 353 ((mpc_player*)GetWindowLong(hDlg, DWL_USER))->initDlg(hDlg); 354 } else if (LOWORD(wParam) == IDC_SAVE) { 355 ((mpc_player*)GetWindowLong(hDlg, DWL_USER))->writeTags(hDlg); 368 356 EndDialog(hDlg, LOWORD(wParam)); 369 357 return TRUE; -
winamp-musepack/trunk/mpc_player.h
r249 r250 38 38 39 39 void getFileInfo(char *title, int *length_in_ms); 40 int getLength(void) {return si.samples * 1000 / si.sample_freq;}41 int getOutputTime(void) {return decode_pos_sample * 1000 / si.sample_freq;}40 int getLength(void) {return (int)(si.samples * 1000 / si.sample_freq);} 41 int getOutputTime(void) {return (int)(decode_pos_sample * 1000 / si.sample_freq);} 42 42 43 43 void setOutputTime(int time_in_ms); … … 45 45 int infoDlg(HWND hwnd); 46 46 void initDlg(HWND hDlg); 47 void writeTags(HWND hDlg); 47 48 48 49 int paused; // are we paused? -
winamp-musepack/trunk/resource.h
r249 r250 6 6 #define IDD_INFO_BOX 101 7 7 #define IDC_STREAM_INFO 1001 8 #define IDC_TITLE 1002 9 #define IDC_ARTIST 1003 10 #define IDC_GENRE 1004 11 #define IDC_ALBUM 1005 12 #define IDC_BUTTON1 1006 13 #define IDC_CANCEL 1006 14 #define IDC_YEAR 1007 15 #define IDC_RELOAD 1008 16 #define IDC_SAVE 1009 17 #define IDC_TRACK 1010 18 #define IDC_COMMENT 1011 8 19 #define IDC_STATIC -1 9 20 … … 12 23 #ifdef APSTUDIO_INVOKED 13 24 #ifndef APSTUDIO_READONLY_SYMBOLS 14 #define _APS_NEXT_RESOURCE_VALUE 10 125 #define _APS_NEXT_RESOURCE_VALUE 102 15 26 #define _APS_NEXT_COMMAND_VALUE 40001 16 #define _APS_NEXT_CONTROL_VALUE 100 227 #define _APS_NEXT_CONTROL_VALUE 1007 17 28 #define _APS_NEXT_SYMED_VALUE 101 18 29 #endif -
winamp-musepack/trunk/winamp-musepack.rc
r249 r250 57 57 // 58 58 59 IDD_INFO_BOX DIALOGEX 0, 0, 4 24, 24659 IDD_INFO_BOX DIALOGEX 0, 0, 406, 186 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 "File stream informations",IDC_STATIC,264,0,156,240, 65 BS_FLAT 64 GROUPBOX "Stream",IDC_STATIC,264,0,138,180,BS_FLAT 66 65 LTEXT "C'est juste un test.\nPour voir si tout va bien.", 67 IDC_STREAM_INFO,270,11,144,228 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 | 79 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 68 86 END 69 87 … … 80 98 BEGIN 81 99 LEFTMARGIN, 7 82 RIGHTMARGIN, 417100 RIGHTMARGIN, 399 83 101 TOPMARGIN, 7 84 BOTTOMMARGIN, 239102 BOTTOMMARGIN, 179 85 103 END 86 104 END
Note: See TracChangeset
for help on using the changeset viewer.