HISE Logo Forum
    • Categories
    • Register
    • Login

    [feature request] Preset Browser broadcasters

    Scheduled Pinned Locked Moved Feature Requests
    preset browserbroadcasterfeature request
    24 Posts 3 Posters 1.3k 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
      last edited by

      @Christoph-Hart I think I was getting the segfault because my ScriptEditors were missing the new ScriptFile tag. I've added this into the XML and HISE is opening now.

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

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

        A little example for anyone who wants to use this. fltPresetBrowser is the id of my preset browser floating tile.

            // Broadcaster
            const bc = Engine.createBroadcaster({"id": "PresetBrowser", "args": [component, obj]});
            
            bc.attachToComponentMouseEvents(["fltPresetBrowser"], "Clicks Only", "");
            
            bc.addListener("mouseAction", "Mouse action for preset browser", function(component, obj)
            {
                Console.print(trace(obj));
            });
        

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

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

          @Christoph-Hart

          I've added a couple of properties:

          int selectedRow = lb->getSelectedRow();
          String file = column->getFileForIndex(rowNumber).getFileName();
          

          For file I had to add the getFileForIndex() function in presetBrowserComponents.h.

          This works, but what I'd really like is for the file to actually be the file object instead of a filename/path. But when I try that I get an error:

          error: cannot convert ‘juce::File’ to ‘const juce::var&’
            955 |                                 dyn->setProperty("file", file);
                |                                                          ^~~~
                |                                                          |
                |                                                          juce::File
          
          

          Any idea how I can handle the conversion?

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

          Christoph HartC 1 Reply Last reply Reply Quote 0
          • Christoph HartC
            Christoph Hart @d.healey
            last edited by

            @d-healey the preset browser can't create scripting file objects (also the JSON object should only contain Strings or primitive values), but if you use File::getFullPathName() you can create a file object with FileSystem.fromAbsolutePath() in your script function.

            d.healeyD 2 Replies Last reply Reply Quote 0
            • d.healeyD
              d.healey @Christoph Hart
              last edited by

              @Christoph-Hart Ah that's a good idea, thanks for the explanation.

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

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

                @Christoph-Hart bool selected = lb->isRowSelected(rowNumber); is always returning true, even for the expansion column, any suggestion?

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

                Christoph HartC 1 Reply Last reply Reply Quote 0
                • Christoph HartC
                  Christoph Hart @d.healey
                  last edited by

                  @d-healey well after you clicked on it, it‘s selected, no?

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

                    @Christoph-Hart Not for the expansions column, you can click again to deselect

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

                    DanHD 1 Reply Last reply Reply Quote 0
                    • DanHD
                      DanH @d.healey
                      last edited by

                      @d-healey didn't we discuss having a 'Factory' folder in the Expansions column so users could navigate back to the 'Factory' presets rather than clicking the expansion name again?

                      DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                      https://dhplugins.com/ | https://dcbreaks.com/
                      London, UK

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

                        @DanH Yeah that's another way to do it. But in my case I don't want any factory presets.

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

                        Christoph HartC 1 Reply Last reply Reply Quote 0
                        • Christoph HartC
                          Christoph Hart @d.healey
                          last edited by

                          Actually I'm not sure if the juce::ListBox class can have a "deselect" action, so you would need to hack around in there.

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

                            @Christoph-Hart I think I'll just track the selected index in my script and if the index is the same as the last index I know it's been deselected :)

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

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

                              Am I being silly or is the favourite button state obj.buttonState inverted? Aha! It triggers on mouse up not mouse down :)

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

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

                              16

                              Online

                              1.7k

                              Users

                              11.8k

                              Topics

                              102.6k

                              Posts