void PlaylistManager::parseAndAddFolder(const QString &dir, bool recursive)
{
QStringList filters;
-// filters << "*.mp3";
QStringList files = QDir (dir).entryList(filters);
qDebug () << "Parsing folder " << dir;
- //settings.setValue("LastFolder", dir);
int index = items.size();
foreach (QString string, files)
{
items.append(PlaylistItem (PlaylistItem (fname)));
}
}
-// if (!items.isEmpty())
if (items.size () > index)
{
metaInformationResolver->setCurrentSource(items.at(index).source);
items.append(PlaylistItem (string));
}
}
-// if (!items.isEmpty())
if (items.size () > index)
{
metaInformationResolver->setCurrentSource(items.at(index).source);
void PlaylistManager::metaStateChanged(Phonon::State newState, Phonon::State oldState)
{
qDebug () << "Meta state now " << newState << " old state " << oldState;
- // This is an ugly hack, since the metaInformationResolver doesn't properly load the assigned source when it's in the error state
+ // NOTE: This is an ugly hack, since the metaInformationResolver doesn't properly load the assigned source when it's in the error state
// In order to properly read the next file we have to set it as current source again when the resolver entered the stopped state after the error
static bool wasError = false;
if (wasError && newState == Phonon::StoppedState)
}
int index = lastMetaRead;
- qDebug () << "Reading meta info of " << metaInformationResolver->currentSource().fileName() << " => " << index;
QMap<QString, QString> metaData = metaInformationResolver->metaData();
items[index].genre = metaData.value("GENRE");
qDebug () << "Meta " << metaData;
qDebug () << "Info is: " << items[index].year << " - " << items[index].genre;*/
- if (metaData.isEmpty())
- qDebug () << "Detected to be empty: " << items[index].uri;
- else
+ if (!metaData.isEmpty())
items[index].playable = true;
emit itemUpdated (index);
}
{
items.clear();
emit playlistChanged(0);
-/* while (musicTable->rowCount())
- musicTable->removeRow(0);
- mediaObject->clear();*/
}
QStringList PlaylistManager::playlistStrings() const
items[i - 1] = items[i];
items[i] = tmp;
return true;
-// emit playlistChanged(i - 1);
}
return false;
}
items[i + 1] = items[i];
items[i] = tmp;
return true;
-// emit playlistChanged(i - 1);
}
return false;
}