~keithsalisbury/mixxx/features_key_preferences

« back to all changes in this revision

Viewing changes to mixxx/src/soundsource.cpp

  • Committer: RJ Ryan
  • Date: 2012-01-07 06:19:12 UTC
  • Revision ID: rryan@mit.edu-20120107061912-mh129pv4hkdxp1fl
Maybe add a composer parser for MP4 metadata. Also add an alternate BPM format I saw somewhere and a stub for replaygain.

Show diffs side-by-side

added added

removed removed

Lines of Context:
430
430
    if (s_bDebugMetadata) {
431
431
        for(TagLib::MP4::ItemListMap::ConstIterator it = mp4->itemListMap().begin();
432
432
            it != mp4->itemListMap().end(); ++it) {
433
 
            qDebug() << "MP4" << TStringToQString((*it).first) << "-" << TStringToQString((*it).second.toStringList().toString());
 
433
            qDebug() << "MP4" << TStringToQString((*it).first) << "-"
 
434
                     << TStringToQString((*it).second.toStringList().toString());
434
435
        }
435
436
    }
436
437
 
437
438
    // Get BPM
438
439
    if (mp4->itemListMap().contains("tmpo")) {
439
 
        QString sBpm = TStringToQString(mp4->itemListMap()["tmpo"].toStringList().toString());
440
 
        processBpmString("MP4", sBpm);
441
 
    }
 
440
        QString sBpm = TStringToQString(
 
441
            mp4->itemListMap()["tmpo"].toStringList().toString());
 
442
        processBpmString("MP4", sBpm);
 
443
    } else if (mp4->itemListMap().contains("----:com.apple.iTunes:BPM")) {
 
444
        // This is an alternate way of storing BPM.
 
445
        QString sBpm = TStringToQString(mp4->itemListMap()[
 
446
            "----:com.apple.iTunes:BPM"].toStringList().toString());
 
447
        processBpmString("MP4", sBpm);
 
448
    }
 
449
 
 
450
    // Get Composer
 
451
    if (mp4->itemListMap().contains("\251wrt")) {
 
452
        // rryan 1/2012 I believe this is technically a list of composers. We
 
453
        // don't support multiple composers in Mixxx, so just use them joined.
 
454
        QString composer = TStringToQString(
 
455
            mp4->itemListMap()["\251wrt"].toStringList().toString());
 
456
    }
 
457
 
442
458
    // Get KEY (conforms to Rapid Evolution)
443
459
    if (mp4->itemListMap().contains("----:com.apple.iTunes:KEY")) {
444
 
        QString key = TStringToQString(mp4->itemListMap()["----:com.apple.iTunes:KEY"].toStringList().toString());
 
460
        QString key = TStringToQString(
 
461
            mp4->itemListMap()["----:com.apple.iTunes:KEY"].toStringList().toString());
445
462
        setKey(key);
446
463
    }
447
464
 
 
465
    // Apparently iTunes stores replaygain in this property.
 
466
    if (mp4->itemListMap().contains(
 
467
        "----:com.apple.iTunes:replaygain_track_gain")) {
 
468
        // TODO(XXX) find tracks with this property and check what it looks
 
469
        // like.
 
470
 
 
471
        //QString replaygain = TStringToQString(mp4->itemListMap()["----:com.apple.iTunes:replaygain_track_gain"].toStringList().toString());
 
472
    }
 
473
 
448
474
    return true;
449
475
}
450
476