Forum
    • Categories
    • Register
    • Login

    Player and expansion communication......

    Scheduled Pinned Locked Moved General Questions
    10 Posts 3 Posters 48 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.
    • LindonL
      Lindon
      last edited by

      So I have a player, with a list of libraries/instruments that it knows about, I want to be able to load an instrument - but retain this list AND ITS STATE

      Now @Christoph-Hart tells me:
      "and a common shared left tab is not the hardest thing to implement"

      • which is correct - but one that share s open/closed state information is probably quite a lot harder.....

      So the only way I can think of communicating this "state information" between player and instrument is to use a classic file-as-postbox approach ....but but but...

      I have no way of assuring that the write to postbox is complete before opening the requested instrument. Or do I?

      There's no callback for write-to-file-complete, and the write is async I think so it will or wont have happened by the time the expansion is reading the file..so no gtee's there either.

      Anyone put me right or have a better idea on this?

      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 What information does the "state" include?

        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 state is simply "open" or "closed" (0 or 1) for every library (which has categories in it) and Categories(which have instruments in them)

          State needs to be transferable BOTH ways so we start with all libs closed....

          In the player we open LibA, open CatA and load InstrumentAA

          InstrumentAA opens and displays the LibPanel with all libs closed except LibA, and within that CatA is also open...

          In instrumentAA we close LibA and Open LibB, then we close InstrumentAA,

          The player opens with all libs closed except LibB

          HISE Development for hire.
          www.channelrobot.com

          David HealeyD LindonL 2 Replies Last reply Reply Quote 0
          • David HealeyD
            David Healey @Lindon
            last edited by

            @Lindon How does it need to work between multiple instances of the plugin?

            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 --- havent even considered that, any way you want.

              HISE Development for hire.
              www.channelrobot.com

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

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

                @David-Healey state is simply "open" or "closed" (0 or 1) for every library (which has categories in it) and Categories(which have instruments in them)

                State needs to be transferable BOTH ways so we start with all libs closed....

                In the player we open LibA, open CatA and load InstrumentAA

                InstrumentAA opens and displays the LibPanel with all libs closed except LibA, and within that CatA is also open...

                In instrumentAA we close LibA and Open LibB, then we close InstrumentAA,

                The player opens with all libs closed except LibB

                The problem(well theres a truck load of problems..) here is I can see how I can save state (in some file) and read it on plugin(player) load...and as soon as the user requests a load of an instrument we write the current states to the file.

                The instrument reads this state file on load and sets the display correctly. On instrument unload (so the instrument is unloading itself) the instrument saves the new state(assuming its changed) and unloads itself.....

                ..but I dont know how the player now reads this new state file in any efficient manner- meaning not running a timer every 0.5 seconds to re-read the state file......???

                The player never knows the instrument is now unloaded does it? Or can it tell from

                ExpansionHandler.getCurrentExpansion() if it == "" then whatever it loaded is now unloaded... ???

                Or how is the player itself loading/unloading whilst a Full Instrument is in play? I guess I need to know the mechanics of player/instrument load/unload ....do we execute init again? ...@Christoph-Hart !!!

                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 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.

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

                        21

                        Online

                        2.3k

                        Users

                        13.6k

                        Topics

                        118.3k

                        Posts