×
Namespaces

Variants
Actions

Talk:Using Qt Mobility to get metadata from media files

From Nokia Developer Wiki
Jump to: navigation, search

Swarit - In Qt 5.0 how to get metadata info of a song in Qt 5.0

in Qt 5.0 following code is not working. QtMediaServices is not there,it seems.please someone help me how to get metadata info of a song in Qt 5.0


void MediaMetaDataExample::GetMetaData()

 {
   // Get the list of keys there is metadata available for
   QList<QtMediaServices::MetaData> metadatalist = player->availableMetaData();

   // Get the size of the list
   int list_size = metadatalist.size();

   // Define variables to store metadata key and value    
   QtMediaServices::MetaData metadata_key;
   QVariant var_data;

   for (int indx = 0; indx < list_size; indx++) {
     // Get the key from the list
     metadata_key = metadatalist.at(indx);

     // Get the value for the key
     var_data = player->metaData(metadata_key);

     switch(metadata_key) {
       case QtMediaServices::Title:
         // Retrieve title (using var_data.toString())
         break;
       case QtMediaServices::SubTitle:
         // Retrieve subtitle
         break;
       case QtMediaServices::Author:
         // Retrieve author
         break;

       // ... see QtMediaServices for rest of the values

       default:
         break;
     }
   }
}

swarit 19:21, 18 November 2012 (EET)

Hamishwillee - No idea

Nokia devices use Qt 4.x so I don't think there will many people who will know the answer to this. I've updated the Qt compatibility to Qt 4.x above. You might want to check out the new module QMultimedia

hamishwillee 06:05, 20 November 2012 (EET)

 

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×