HISE Logo Forum
    • Categories
    • Register
    • Login

    Get Names of Expansion?

    Scheduled Pinned Locked Moved Scripting
    6 Posts 4 Posters 246 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.
    • CasmatC
      Casmat
      last edited by

      Hey!

      Got a silly question! Heres my code:

      const var expansionList = Engine.getExpansionList();
      
      const var vptExpansion = Content.getComponent("vptExpansions");
      vptExpansion.set("items", expansionList.join("\n"));
      

      I'm showing the list of expansions as a viewport list. How do I change the values in the array from "Objectx#####" to the name of the expansion?

      Thanks!

      i make music

      ustkU 1 Reply Last reply Reply Quote 0
      • Dan KorneffD
        Dan Korneff
        last edited by

        I believe you use the trace() function to see the contents of an array.

        trace(expansionList)
        

        Dan Korneff - Producer / Mixer / Audio Nerd

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

          @Casmat @Dan-Korneff I'm not familiar with expansions, but wouldn't expansion.getProperties() have the name somewhere inside?

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

          Dan KorneffD 1 Reply Last reply Reply Quote 0
          • Dan KorneffD
            Dan Korneff @ustk
            last edited by

            @ustk it's been a while since I've worked with expansions so you're probably closer to the answer than me. I just saw Array and Object and thought of the trace function.

            Dan Korneff - Producer / Mixer / Audio Nerd

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

              You should use an expansion handler instead of the old Engine expansion stuff.

              const expHandler = Engine.createExpansionHandler();
              const expList = expansionHandler.getExpansionList();
              const expNames = [];
              
              for (e in expList)
                  expNames.push(e.getProperties().Name);
              
              

              I have a lot of expansion stuff in my repo that you might find interesting - https://codeberg.org/LibreWave/RhapsodyBoilerplate/src/branch/main/includes/Expansions.js

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

              CasmatC 1 Reply Last reply Reply Quote 3
              • CasmatC
                Casmat @d.healey
                last edited by

                @d-healey Thanks everyone!

                i make music

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

                26

                Online

                1.8k

                Users

                12.0k

                Topics

                104.6k

                Posts