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. isMetaDataAvailable() isn'twork..
Forum Updated to NodeBB v4.3 + New Features

isMetaDataAvailable() isn'twork..

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 418 Views 1 Watching
  • 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.
  • PadawanP Offline
    PadawanP Offline
    Padawan
    wrote on last edited by Padawan
    #1

    So i'm basically working on a music player and i have a line of code that checks if a music file has metadata associated with it so it can get some data of the music file but it doesn't work and the issue is that isMetaDataAvailable() evaluates to false even when the music file has metadata. As you can see i used an application to check if the music file has metadata and it does so why does isMetaDataAvailable() evaluate to false
    24c553c8-ccf2-4ee4-8a4d-7cc9ab327542-image.png
    Here is the code:
    9b3676e4-507a-4928-869c-cfadcfe16814-image.png

    Ningen

    jsulmJ 1 Reply Last reply
    0
    • PadawanP Padawan

      So i'm basically working on a music player and i have a line of code that checks if a music file has metadata associated with it so it can get some data of the music file but it doesn't work and the issue is that isMetaDataAvailable() evaluates to false even when the music file has metadata. As you can see i used an application to check if the music file has metadata and it does so why does isMetaDataAvailable() evaluate to false
      24c553c8-ccf2-4ee4-8a4d-7cc9ab327542-image.png
      Here is the code:
      9b3676e4-507a-4928-869c-cfadcfe16814-image.png

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Padawan From https://doc.qt.io/qt-5/qmediaplayer.html#setMedia :
      "Note: This function returns immediately after recording the specified source of the media. It does not wait for the media to finish loading and does not check for errors. Listen for the mediaStatusChanged() and error() signals to be notified when the media is loaded and when an error occurs during loading.".
      I suggest you call isMetaDataAvailable in a slot connected to mediaStatusChanged().

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      PadawanP 1 Reply Last reply
      3
      • jsulmJ jsulm

        @Padawan From https://doc.qt.io/qt-5/qmediaplayer.html#setMedia :
        "Note: This function returns immediately after recording the specified source of the media. It does not wait for the media to finish loading and does not check for errors. Listen for the mediaStatusChanged() and error() signals to be notified when the media is loaded and when an error occurs during loading.".
        I suggest you call isMetaDataAvailable in a slot connected to mediaStatusChanged().

        PadawanP Offline
        PadawanP Offline
        Padawan
        wrote on last edited by
        #3

        @jsulm thanks, it worked, i made a slot that connects to that signal and checks if the media is in a BufferedMedia State and it works fine now

        Ningen

        1 Reply Last reply
        0
        • PadawanP Offline
          PadawanP Offline
          Padawan
          wrote on last edited by
          #4

          For anyone wanting to know, i connected a slot function to the mediaStatusChanged() signal and the function checks if it's in a BufferedMedia state which would mean it would have finished loading the media fully and it would possess the metadata(if the media has one) and it works as i intended now;
          447274a2-40f2-4574-b678-c8eb9e87d7ed-image.png
          87fd7588-8fe1-4b6d-becf-9a470da7ef76-image.png
          afc45c2c-cee2-43fc-8374-43a65d84f520-image.png

          Ningen

          1 Reply Last reply
          1

          • Login

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