Changeset 192 for winamp-musepack/trunk/winamp-musepack/mpc_player.cpp
- Timestamp:
- 12/25/06 23:45:24 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
winamp-musepack/trunk/winamp-musepack/mpc_player.cpp
r191 r192 27 27 28 28 #include <tag.h> 29 30 using namespace winamp_musepack; 29 #include <vcclr.h> 30 31 31 32 32 mpc_player::mpc_player(In_Module * in_mod) … … 271 271 } 272 272 273 void mpc_player::loadTags(mpc_info ^ infoBox) 274 { 275 if(tag_file == 0) 276 tag_file = new TagLib::FileRef(lastfn, false); 277 278 if (!tag_file->isNull() && tag_file->tag()) { 279 TagLib::Tag *tag = tag_file->tag(); 280 infoBox->txtTitle->Text = gcnew String(tag->title().toCString(true)); 281 infoBox->txtArtist->Text = gcnew String(tag->artist().toCString(true)); 282 infoBox->txtAlbum->Text = gcnew String(tag->album().toCString(true)); 283 infoBox->txtYear->Text = ""; 284 infoBox->txtYear->Text += tag->year(); 285 infoBox->txtTrack->Text = ""; 286 infoBox->txtTrack->Text += tag->track(); 287 infoBox->comboGenre->Text = gcnew String(tag->genre().toCString(true)); 288 infoBox->txtComment->Text = gcnew String(tag->comment().toCString(true)); 289 } 290 } 291 292 void mpc_player::writeTags(mpc_info ^ infoBox) 293 { 294 if (!tag_file->isNull() && tag_file->tag()) { 295 TagLib::Tag *tag = tag_file->tag(); 296 297 pin_ptr<const wchar_t> wch = PtrToStringChars(infoBox->txtTitle->Text); 298 tag->setTitle(wch); 299 300 wch = PtrToStringChars(infoBox->txtArtist->Text); 301 tag->setArtist(wch); 302 303 wch = PtrToStringChars(infoBox->txtAlbum->Text); 304 tag->setAlbum(wch); 305 306 wch = PtrToStringChars(infoBox->txtYear->Text); 307 TagLib::String year(wch); 308 tag->setYear(year.toInt()); 309 310 wch = PtrToStringChars(infoBox->txtTrack->Text); 311 TagLib::String track(wch); 312 tag->setTrack(track.toInt()); 313 314 wch = PtrToStringChars(infoBox->comboGenre->Text); 315 tag->setGenre(wch); 316 317 wch = PtrToStringChars(infoBox->txtComment->Text); 318 tag->setComment(wch); 319 320 tag_file->save(); // FIXME : make all crash 321 } 322 } 323 273 324 int mpc_player::infoDlg(HWND hwnd) 274 325 { 275 mpc_info infoBox ;326 mpc_info infoBox(this); 276 327 System::String ^ tmp; 277 328 … … 299 350 infoBox.lblStreamInfo->Text = tmp; 300 351 301 302 if(tag_file == 0) 303 tag_file = new TagLib::FileRef(lastfn, false); 304 305 if (!tag_file->isNull() && tag_file->tag()) { 306 TagLib::Tag *tag = tag_file->tag(); 307 infoBox.txtTitle->Text = gcnew String(tag->title().toCString(true)); 308 infoBox.txtArtist->Text = gcnew String(tag->artist().toCString(true)); 309 infoBox.txtAlbum->Text = gcnew String(tag->album().toCString(true)); 310 infoBox.txtYear->Text += tag->year(); 311 infoBox.txtTrack->Text += tag->track(); 312 infoBox.comboGenre->Text = gcnew String(tag->genre().toCString(true)); 313 infoBox.txtComment->Text = gcnew String(tag->comment().toCString(true)); 314 } 352 loadTags(% infoBox); 315 353 316 354 infoBox.ShowDialog();
Note: See TracChangeset
for help on using the changeset viewer.