HISE Logo Forum
    • Categories
    • Register
    • Login

    Preset browser double click

    Scheduled Pinned Locked Moved C++ Development
    8 Posts 3 Posters 382 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

      I'm using the broadcaster to check if the user double clicks a preset. The idea is I want to load the preset and close the browser on double click, but keep the browser open on single click.

      However the double click doesn't work reliably because it's loading the preset twice.

      I had a look in the source and can see the doubleClick parameter of the selectionChanged function is commented out. I uncommented and also added a check for the number of clicks in this section.

      if (listener != nullptr && !e.mouseWasDraggedSinceMouseDown())
          listener->selectionChanged(index, row, entries[row], e.getNumberOfClicks() == 2);
      

      But it's like it just sees it as two single clicks and no double click is coming through.

      @Christoph-Hart Any hints?

      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

        @Christoph-Hart I saw the broadcasters were getting some love today. Any suggestions for this one?

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

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

          @d-healey I am using double click preset browser in my plugin this works for me:

          const var presetBrowserWatcher = Engine.createBroadcaster({
          	"id": "presetBrowserOnClickStatus",
          	"args": ["component", "event"]
          });
          presetBrowserWatcher.attachToComponentMouseEvents("FloatingTile2", "All Callbacks", "Mouse Listener for PresetBrowser");
          
          presetBrowserWatcher.addListener("RefreshFunction", "Delays the closing of the Preset Browser",function(component, event)
          {
              if(event.doubleClick) {
                         // close the presetbrowser
          	}
          });
          

          This is just copied from my project, there is room for improvement instead of using All Callbacks we should be using only mouse clicks.

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

            @oskarsh Doesn't that trigger a double loading of the preset?

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

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

              @d-healey

              • maybe in the single click check the time since last click to find if its actually a double click?

              HISE Development for hire.
              www.channelrobot.com

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

                @d-healey unfortunately yes, in my case this did not produce any issues since the presets are loaded quickly. But I can see how this could become an problem for larger plugins.

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

                  @oskarsh Yeah I'm loading samples with the preset, but I think you've given me an idea. I could simply check if the new preset is the same as the last preset, and if it is I skip loading the samples again. I'll let you know how I get on.

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

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

                    It will work :) I'm going to combine it with Lindon's timer idea because I also have a pre-loading screen that pops up and prevents the second click being registered, a time will solve that.

                    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

                    25

                    Online

                    1.7k

                    Users

                    11.8k

                    Topics

                    103.0k

                    Posts