Mercurial > audlegacy-plugins
comparison src/modplug/modplugbmp.cxx @ 1545:1047d8a70a6c
Correct title generation, use that tuple builder.
author | Tony Vroon <chainsaw@gentoo.org> |
---|---|
date | Sat, 01 Sep 2007 01:00:13 +0100 |
parents | 0cfbecddb647 |
children | 58f03e54b97a |
comparison
equal
deleted
inserted
replaced
1544:0cfbecddb647 | 1545:1047d8a70a6c |
---|---|
325 mStopped = true; | 325 mStopped = true; |
326 } | 326 } |
327 | 327 |
328 void ModplugXMMS::PlayFile(const string& aFilename, InputPlayback *ipb) | 328 void ModplugXMMS::PlayFile(const string& aFilename, InputPlayback *ipb) |
329 { | 329 { |
330 int32 aLength; | |
331 char *aModName; | |
330 mStopped = true; | 332 mStopped = true; |
331 mPaused = false; | 333 mPaused = false; |
332 | 334 |
333 //open and mmap the file | 335 //open and mmap the file |
334 mArchive = OpenArchive(aFilename); | 336 mArchive = OpenArchive(aFilename); |
409 ( | 411 ( |
410 (uchar*)mArchive->Map(), | 412 (uchar*)mArchive->Map(), |
411 mArchive->Size() | 413 mArchive->Size() |
412 ); | 414 ); |
413 mPlayed = 0; | 415 mPlayed = 0; |
414 | 416 |
415 bool useFilename = mModProps.mUseFilename; | 417 Tuple* ti = GetSongTuple( aFilename ); |
416 | 418 if ( ti ) |
417 if(!useFilename) | 419 aModName = format_and_free_ti( ti, &aLength ); |
418 { | 420 |
419 strncpy(mModName, mSoundFile->GetTitle(), 100); | |
420 | |
421 for(int i = 0; mModName[i] == ' ' || mModName[i] == 0; i++) | |
422 { | |
423 if(mModName[i] == 0) | |
424 { | |
425 useFilename = true; //mod name is blank -- use filename | |
426 break; | |
427 } | |
428 } | |
429 } | |
430 | |
431 if(useFilename) | |
432 { | |
433 strncpy(mModName, strrchr(aFilename.c_str(), '/') + 1, 100); | |
434 char* ext = strrchr(mModName, '.'); | |
435 if(ext) *ext = '\0'; | |
436 } | |
437 | |
438 mInPlug->set_info | 421 mInPlug->set_info |
439 ( | 422 ( |
440 mModName, | 423 aModName, |
441 mSoundFile->GetSongTime() * 1000, | 424 aLength, |
442 mSoundFile->GetNumChannels() * 1000, | 425 mSoundFile->GetNumChannels() * 1000, |
443 mModProps.mFrequency, | 426 mModProps.mFrequency, |
444 mModProps.mChannels | 427 mModProps.mChannels |
445 ); | 428 ); |
446 | 429 |