HISE Logo Forum
    • Categories
    • Register
    • Login

    Download and is server occupied

    Scheduled Pinned Locked Moved Feature Requests
    14 Posts 3 Posters 425 Views
    Loading More Posts
    • 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.
    • d.healeyD
      d.healey @ustk
      last edited by

      @ustk What is isOccupied?

      Libre Wave - Freedom respecting instruments and effects
      My Patreon - HISE tutorials
      YouTube Channel - Public HISE tutorials

      ustkU oskarshO 2 Replies Last reply Reply Quote 0
      • ustkU
        ustk @d.healey
        last edited by ustk

        @d-healey Screenshot 2023-12-06 at 15.05.53.png

        isOccupied is true when a call is made and the server is waiting for the response

        Can't help pressing F5 in the forum...

        1 Reply Last reply Reply Quote 0
        • oskarshO
          oskarsh @d.healey
          last edited by

          You can create a isOccupied whenever you start a download, when you finish the download you clear that state. That is how loading is usually done. Getting the exact loading state is sometimes tricky thats why you often see a fake progress bar that seems to hold the 99% after some time while waiting for the download to finish.

          If you want to display the stuff that is currently loading you can use:

          Link Preview Image
          HISE | Docs

          favicon

          (docs.hise.audio)

          and

          Link Preview Image
          HISE | Docs

          favicon

          (docs.hise.audio)

          ustkU 2 Replies Last reply Reply Quote 0
          • ustkU
            ustk @oskarsh
            last edited by ustk

            @oskarsh yeah that's what I said I did it by tracking inside the downloadFile function, it just would have been nice to have the info in the server CB... But I made my own variable successfully

            getPendingDownload doesn't help much, it's an empty array (which is probably a bug) where you can just get its length as information, but it's not useful once you enter the this.data.success case for instance. WAS NON-SENSE

            Can't help pressing F5 in the forum...

            1 Reply Last reply Reply Quote 0
            • ustkU
              ustk @oskarsh
              last edited by ustk

              @oskarsh Thanks ! In the end it was easier to use getPendingDownloads().length than tracking the number of downloads manually...
              (even if getPendingDownloads() contains nothing, @Christoph-Hart ?)

              Still, triggering the server CB would have fixed another issue for me so the request stays relevant

              Can't help pressing F5 in the forum...

              oskarshO 1 Reply Last reply Reply Quote 0
              • oskarshO
                oskarsh @ustk
                last edited by

                @ustk I believe the getPendingDownload is not empty as you can prove by getting its length. Sometimes HISE cannot print out the content of a complex object such as a Download object or a Path for example.

                You can loop over that array and get the status of each element.

                so basically

                
                for (download in Server.getPendingDownloads() {
                    Console.print(download.isRunning());
                }
                

                code is untested

                Check this part of the docs to learn more about Downloads.

                Link Preview Image
                HISE | Docs

                favicon

                (docs.hise.audio)

                d.healeyD ustkU 2 Replies Last reply Reply Quote 1
                • d.healeyD
                  d.healey @oskarsh
                  last edited by

                  I use a broadcaster to track if currently downloading

                  Libre Wave - Freedom respecting instruments and effects
                  My Patreon - HISE tutorials
                  YouTube Channel - Public HISE tutorials

                  1 Reply Last reply Reply Quote 1
                  • ustkU
                    ustk @oskarsh
                    last edited by

                    @oskarsh Of course, stupid me... I tried to trace the content but the download object are access through the specific methods...

                    Can't help pressing F5 in the forum...

                    d.healeyD 1 Reply Last reply Reply Quote 0
                    • d.healeyD
                      d.healey @ustk
                      last edited by d.healey

                      @ustk

                      This is where I set up the broadcaster - https://codeberg.org/LibreWave/Rhapsody/src/branch/main/Scripts/App.js#L39

                      Then when I start some downloads I set the state - https://codeberg.org/LibreWave/Rhapsody/src/branch/main/Scripts/Downloader.js#L52

                      Then after all downloads complete I reset it - https://codeberg.org/LibreWave/Rhapsody/src/branch/main/Scripts/Downloader.js#L191

                      Libre Wave - Freedom respecting instruments and effects
                      My Patreon - HISE tutorials
                      YouTube Channel - Public HISE tutorials

                      ustkU 1 Reply Last reply Reply Quote 1
                      • ustkU
                        ustk @d.healey
                        last edited by

                        @d-healey I wanted to ask (because I haven't found anything about a broadcaster connected to a download or server task) but you were faster! Nice but the 3 links you kindly posted are the same...

                        Can't help pressing F5 in the forum...

                        d.healeyD 1 Reply Last reply Reply Quote 0
                        • d.healeyD
                          d.healey @ustk
                          last edited by

                          @ustk Oh that's weird. I'll update the post, one moment

                          Libre Wave - Freedom respecting instruments and effects
                          My Patreon - HISE tutorials
                          YouTube Channel - Public HISE tutorials

                          1 Reply Last reply Reply Quote 1
                          • First post
                            Last post

                          33

                          Online

                          1.7k

                          Users

                          11.8k

                          Topics

                          103.0k

                          Posts