meta_player is my media player objext
Signal:
connect(meta_player, SIGNAL(metaDataChanged()), SLOT(metadata_capture()));
Code of capture:
if((meta_player->isMetaDataAvailable()) &&( inc < file_list.length()))
{
qDebug() << "Meta info available"<<endl;
QStringList list = meta_player->availableMetaData();
qDebug() << " Meta Data ="<<list.count()<<endl;
for(int i=0;i<list.count();i++){
qDebug() << list.at(i) << " = "<< meta_player->metaData(list.at(i)).toString();
}
qDebug()<<"**********************************************************************************";
inc++;
qDebug()<<"After Icrement "<<inc;
qDebug()<<"File Name"<<file_list.at(inc);
meta_player->setMedia(QUrl::fromLocalFile(file_list.at(inc)));
qDebug()<<"File Name"<<file_list.at(inc);
}
The Signal meta_player->setMedia(QUrl::fromLocalFile(file_list.at(inc))); is not emitted properly. For example when I add 6 songs i get met info for two songs. The result is ambiguous, its not constant.