Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Regarding music art in QML
Qt 6.11 is out! See what's new in the release blog

Regarding music art in QML

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
7 Posts 3 Posters 3.0k Views 2 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.
  • Naveen_DN Offline
    Naveen_DN Offline
    Naveen_D
    wrote on last edited by
    #1

    Hi all,
    I am developing a music player in qml, as all common music players have musicart( the particular song poster if available), i also want to have musicart replaced with my common music note image in the music player. but i don't know how to replace the image with the particular musicart automatically for each song which will be selected to play.
    Can anyone please suggest me what i need to do?
    Thanks

    Naveen_D

    1 Reply Last reply
    0
    • p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      @Naveen_D So have you found a way to extract albumart? If yes, then its just the question of changing the image, isn't it ?

      157

      Naveen_DN 1 Reply Last reply
      2
      • p3c0P p3c0

        @Naveen_D So have you found a way to extract albumart? If yes, then its just the question of changing the image, isn't it ?

        Naveen_DN Offline
        Naveen_DN Offline
        Naveen_D
        wrote on last edited by
        #3

        @p3c0

        So have you found a way to extract albumart?

        No, this only i want to know how to extract the albumart, how can i do that ?

        Naveen_D

        p3c0P 1 Reply Last reply
        0
        • B Offline
          B Offline
          BrianDavis
          wrote on last edited by
          #4

          You haven't provided much information about what data is available to your QML object.

          It seems like essentially you would want to bind the musicart file path to the source property of a QML Image{ }

          Image{
             source: dynamicFilePath
          }
          

          You could have your default musicart behind the dynamic musicart, and when the filepath is blank you should see your default music art
          otherwise you can bind the Image's visible property like this

          visible: source!=""
          
          Image{
             source: "defaultMusicArt.jpg"
          }
          Image{
             source: dynamicFilePath
             visible: source!="" //this line is probably not necessary
          }
          

          you could even use a single Image and a ternary operator when setting (binding) the source property

          Image{
             source: dynamicFilePath==""?"defaultMusicArt.jpg":dynamicFilePath
          }
          

          If you require a less vague answer, you must provide a less vague question.

          1 Reply Last reply
          1
          • Naveen_DN Naveen_D

            @p3c0

            So have you found a way to extract albumart?

            No, this only i want to know how to extract the albumart, how can i do that ?

            p3c0P Offline
            p3c0P Offline
            p3c0
            Moderators
            wrote on last edited by
            #5

            @Naveen_D Check this.

            157

            1 Reply Last reply
            4
            • Naveen_DN Offline
              Naveen_DN Offline
              Naveen_D
              wrote on last edited by Naveen_D
              #6

              Hi, how to get the coverartURL for a media or song. i tried with the following piece of code but didn't get the output.

              Commonrectangle {
                              id: musicartrect
                              rectWidth: (musicMainrectangle.width/3)
                              rectHeight: musicMainrectangle.height/2
                              rectColor: "transparent"
                              BorderImage {
                                  id: coverBorder
                                  source: "qrc:/images/cover_overlay.png"
                                  anchors.fill: parent
                                  anchors.margins: 4
                                  border {left: 10; top:10; right:10; bottom: 10}
                                  horizontalTileMode: BorderImage.Stretch
                                  verticalTileMode: BorderImage.Stretch
                                  Image {
                                      id: coverPic
                                      anchors.centerIn: parent
                                      source: musicplayer.metaData.coverArtUrlLarge? musicplayer.metaData.coverArtUrlLarge : "qrc:/images/music_icon.png"
                                      anchors.fill: coverBorder
                                      anchors.margins: 2
                                  }
                              }
                          }
              

              can anyone tell me what is wrong here ? Thanks

              Naveen_D

              1 Reply Last reply
              0
              • Naveen_DN Offline
                Naveen_DN Offline
                Naveen_D
                wrote on last edited by
                #7

                Hi, is there any update on the above thread, Thanks

                Naveen_D

                1 Reply Last reply
                0

                • Login

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