Cannot save playlist
-
I am using Qt 5.12 and Visual Studio 2017 to create an audio application. I used a method shown below (CreatePlayList) to create a QMediaPlaylist. I can use the playlist to play and seek without problems. I trying to use the built in save method by calling
QString location = "M/Tools/Language/AudioServer/NewTest.txt";
bool saved = mPlaylist- >save(QUrl::fromLocalFile(location));saved is always false and no file is created.
Any thoughts or suggestions would be greatly appreciate.
Bruce
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
int QtAudioWrapper::CreatePlayList(QString filename)
{
int status = -1;mMediaPlayList.clear(); if (mMediaPlayer != NULL) { mPlaylist = new QMediaPlaylist(mMediaPlayer); if (mPlaylist != NULL) { bool added = mPlaylist->addMedia(QUrl::fromLocalFile(filename)); mMediaPlayList.push_back(filename); mPlaylist->setCurrentIndex(1); status = -1; } } return(status);
}
-
Hi,
Are you sure the path is valid ?
-
@bclay1297 said in Cannot save playlist:
NewTest.txt
I don't think that .txt is a valid playlist format extension.
-
I also tried m3u. Someone posted a comment on another site that said the playlist format was based on a plugin but there was no indication of where or what the plugin might be. I am beginning to think it is another one of those functions not implemented in the Windows version of Qt just like the QMediaRecorder.
-
m3u is available on all platforms.
Look into the plugins folder.