Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Cannot save playlist

Cannot save playlist

Scheduled Pinned Locked Moved Solved General and Desktop
playlist
7 Posts 2 Posters 569 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bclay1297
    wrote on 24 Sept 2021, 20:44 last edited by
    #1

    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);
    

    }

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 25 Sept 2021, 19:07 last edited by
      #2

      Hi,

      Are you sure the path is valid ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • B Offline
        B Offline
        bclay1297
        wrote on 28 Sept 2021, 00:17 last edited by
        #3

        Yes. I have tried both absolute paths and relative paths neither worked. I could not tell from the documentation if the location is supposed to be a file name or directory name

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 28 Sept 2021, 21:05 last edited by
          #4

          @bclay1297 said in Cannot save playlist:

          NewTest.txt

          I don't think that .txt is a valid playlist format extension.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • B Offline
            B Offline
            bclay1297
            wrote on 28 Sept 2021, 23:25 last edited by
            #5

            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.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 30 Sept 2021, 18:47 last edited by
              #6

              m3u is available on all platforms.

              Look into the plugins folder.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • B Offline
                B Offline
                bclay1297
                wrote on 1 Oct 2021, 21:51 last edited by
                #7

                Thank you for your help I was looking in the wrong place for the plugin. It is working now

                1 Reply Last reply
                0

                1/7

                24 Sept 2021, 20:44

                • Login

                • Login or register to search.
                1 out of 7
                • First post
                  1/7
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved