Forum
    • Categories
    • Register
    • Login

    Player and expansion communication......

    Scheduled Pinned Locked Moved General Questions
    16 Posts 3 Posters 80 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.
    • David HealeyD
      David Healey @Lindon
      last edited by

      @Lindon If you set the current expansion to "" that will trigger the unload action, so you can respond to that. I'm not sure if that reruns the player's on init but you could test.

      I think a timer and polling on the message thread is the way to go, the timer won't run when the interface is minimised anyway.

      Free HISE Bootcamp Full Course for beginners.
      YouTube Channel - Public HISE tutorials
      My Patreon - HISE tutorials

      LindonL 1 Reply Last reply Reply Quote 0
      • LindonL
        Lindon @David Healey
        last edited by

        @David-Healey said in Player and expansion communication......:

        @Lindon If you set the current expansion to "" that will trigger the unload action, so you can respond to that. I'm not sure if that reruns the player's on init but you could test.

        I think a timer and polling on the message thread is the way to go, the timer won't run when the interface is minimised anyway.

        Yeah its the expansion that will be setting the current expansion to "" - so I'm not sure how the player responds to that....I cant see a expansion changed callback or listener...

        HISE Development for hire.
        www.channelrobot.com

        David HealeyD 1 Reply Last reply Reply Quote 0
        • David HealeyD
          David Healey @Lindon
          last edited by

          @Lindon said in Player and expansion communication......:

          cant see a expansion changed callback

          ExpansionHandler.setExpansionCallback() Not sure if it works in this scenario the way you need but give it a try.

          Free HISE Bootcamp Full Course for beginners.
          YouTube Channel - Public HISE tutorials
          My Patreon - HISE tutorials

          Christoph HartC 1 Reply Last reply Reply Quote 0
          • Christoph HartC
            Christoph Hart @David Healey
            last edited by

            Long time that I worked on this, but setting an empty expansion in a full player plugin should get you back to the shell - it's onInit callback should be compiled too again.

            LindonL 1 Reply Last reply Reply Quote 1
            • LindonL
              Lindon @Christoph Hart
              last edited by

              @Christoph-Hart said in Player and expansion communication......:

              Long time that I worked on this, but setting an empty expansion in a full player plugin should get you back to the shell - it's onInit callback should be compiled too again.

              Im not sure I understand what you mean, no actually I clearly dont understand what you mean....

              I load the player - its init executes,
              I load an Full instrument expansion from the player - its init executes
              I unload the instrument, from within the instrument, the player reloads.... does its init execute? Or does it some how magically retain its own state ?

              HISE Development for hire.
              www.channelrobot.com

              David HealeyD 1 Reply Last reply Reply Quote 0
              • David HealeyD
                David Healey @Lindon
                last edited by

                @Lindon said in Player and expansion communication......:

                does its init execute?

                We think yes but try it and see

                Free HISE Bootcamp Full Course for beginners.
                YouTube Channel - Public HISE tutorials
                My Patreon - HISE tutorials

                LindonL 1 Reply Last reply Reply Quote 0
                • LindonL
                  Lindon @David Healey
                  last edited by Lindon

                  @David-Healey Ok will do but assuming YES...

                  Problem #2:

                  Just before I unload I save a file....so this:

                  myFile.saveObject(myJSON);
                  myExpansionHandler.getCurrentExpansion("");
                  
                  

                  What happens?
                  Is the file save async? or better still blocking?
                  is it running in a differnt thread?
                  will it even happen?
                  Will it get aborted?
                  How will I know when its finished?

                  HISE Development for hire.
                  www.channelrobot.com

                  LindonL 1 Reply Last reply Reply Quote 0
                  • LindonL
                    Lindon @Lindon
                    last edited by Lindon

                    @Lindon or do I have to do this....

                    myFile.saveObject(myJSON);
                    runSomeShittyTimerToDoTheUnload();
                    
                    

                    As you may surmise - I dont find it "elegant"

                    HISE Development for hire.
                    www.channelrobot.com

                    David HealeyD 1 Reply Last reply Reply Quote 0
                    • David HealeyD
                      David Healey @Lindon
                      last edited by David Healey

                      @Lindon Pretty sure it's synchronous because it's calling JUCE's replaceWithText function and returning a bool.

                      So you could probably do something like

                      if (f.writeObject(myJson))
                          unloadTheExpansion
                      

                      Free HISE Bootcamp Full Course for beginners.
                      YouTube Channel - Public HISE tutorials
                      My Patreon - HISE tutorials

                      Christoph HartC 1 Reply Last reply Reply Quote 1
                      • Christoph HartC
                        Christoph Hart @David Healey
                        last edited by

                        @David-Healey yup sync

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

                        8

                        Online

                        2.3k

                        Users

                        13.6k

                        Topics

                        118.3k

                        Posts