Forum
    • Categories
    • Register
    • Login

    Drag and drop multiple audio files onto a ScriptPanel?

    Scheduled Pinned Locked Moved Scripting
    6 Posts 2 Posters 26 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.
    • CyberGenC
      CyberGen
      last edited by

      Hi everyone,

      I’m building a custom samplemap editor / instrument builder inside a scripted UI. The goal is to let users drag audio samples from Finder onto a ScriptPanel keymap, preview where the zones will land, then drop them to import and map the samples.

      Single-file drag and drop is working well. I’m using:

      Panel.setFileDropCallback("All Callbacks", "*.wav;*.aif;*.aiff", function(f)
      {
          if (f.hover)
          {
              // update keymap preview from f.x / f.y
          }
      
          if (f.drop)
          {
              // import f.fileName
          }
      });
      

      The problem is multi-file drag/drop from Finder. When I select multiple audio files and drag them over the scripted panel, HISE rejects the drag and the files fly back to Finder. The callback does not seem to fire, so I never get a chance to inspect whether f.fileName is an array.

      I tried:

      • *.wav;*.aif;*.aiff
      • *.wav,*.aif,*.aiff
      • *.*
      • *
      • a narrow *.aif test with only .aif files selected

      Single-file drop works, but multi-file drop still gets rejected before the callback. The docs say f.fileName should be an array if more than one matching file is dropped, so I assume this should be possible from script.

      What I’m trying to reproduce is similar to HISE’s native SampleMap Editor behavior: drag multiple samples into the map, then choose a mapping mode like Drop Point, Filename Token Parser, etc. I don’t need to invoke the native dialog directly, but I do need the scripted panel to receive the full dropped file list.

      Questions:

      • Is ScriptPanel.setFileDropCallback() expected to accept multi-file drags from Finder on macOS?
      • Is there a specific wildcard format or callback level required for this?
      • Does multi-file drag only work from HISE’s internal file browser rather than Finder?
      • Is the native SampleMap Editor using a different internal drag/drop path that isn’t exposed to scripting?
      • Is there a workaround, eg. folder drop, Broadcaster, FloatingTile, or using the Sampler/SampleMap editor API?

      Any guidance would be hugely appreciated.

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

        @CyberGen said in Drag and drop multiple audio files onto a ScriptPanel?:

        s there a workaround, eg. folder drop

        Folder drop

        if you want to only allow folders to be dropped, you need to supply the string "{FOLDER}" as wildcard.

        https://docs.hise.audio/scripting/scripting-api/scriptpanel/index.html#setfiledropcallback

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

        CyberGenC 1 Reply Last reply Reply Quote 0
        • CyberGenC
          CyberGen @David Healey
          last edited by

          @David-Healey Can't even get it to accept the folder to tell you truth, only through browser I can import a folder. It's frustrating, I'm not going to lie, because HISE's own samplemap builder does multi file drag and drop. I can only it to accept a single file at a time.

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

            @CyberGen Are you using the latest develop branch?

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

            CyberGenC 1 Reply Last reply Reply Quote 0
            • CyberGenC
              CyberGen @David Healey
              last edited by

              @David-Healey embarasingly no, I'm always afraid to upgrade. I'll try to upgrade.

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

                @CyberGen Actually I just tested and dropping multiple files is working for me.

                HiseSnippet 827.3ocsU8+SSCDE+tAGBSQkD+CnteZPHPKaNkPLBrwjoBr3PhI9CjasWoGb8tl1afKF9e1+Cz201w1jIfKw9Ca26a26SeuOuWaGqbYIIpXDt3w8iXH7SHc5K0A0CnbIpUCD9oDetf4EqhzrDMZ29QzjDlGBim48FevKLKJ84muaWpfJcYCUgPmn3trOwC45gZau8G4BQSpG6Xd3HdWc6VtJYckP0CvyLDaTD08B5YrCoF2JPP6SSBP3UHT2JN11Uq4UoKk10aiMq5ypTqVUmJ9aZWktIsl8l0rq5fvysmGWqh6no.5Q3Y2U40uSf5JYVBNgmv6JXFAGTGHyYpapDdlWQiVT8.tvq8fBUBBtk1CKayjU1dA4.tG+F8CKeOO0f0vHFs.hKLN7lYL3472f2DfDdDHMaFjVhzwMlGoGZwfmGSZI0rXeJzmFEJY9hJ7MLotB7PpWKjdAqYLHbSDkqYaupE7yxaUr35q+Rq1TIS3TDZaI5bAq2ZM3BNioqqBiTRPnboLykLglcbsDltIvsZ.bq5TgnKzsKWxHYcjTzuzpVkVYsUf+76Ic0bkrrp64KW7GEW.RPhRvVKJlC2rN1.MiM3tud4sF3tkRdnRyNRVNMnhWWz5OM46OQalWfXkPvhmnYCsM9tBrrrWXWV7pVWRE8X23HzZFueO2Cqe6lUOGwQkrkjqOJhkKe2DVTdCAN8kVMnZpgvjqC7KhEq4F3favtDFWynOKPZvRtPqhR8MuKhvORmZcwAjKSmDwgTOOIqqh9NBSvmC4pu4v9vgq3d5.ivGvHT.ieVf1HE.RPaWc0flO.gmQ1QHrFp.cadMLQo75In5wGyLKixM.8hw31F9qLgq6O5xp+gYO66b16gBwkHs4Z2fIiwBS.iPW5+AFy2XsHYOeelqdH.mkz7qS65o6I8eV0Sykmc.UGyM7iC6E1A1x6xfrKAVShgOTvvTyjsMxlJPGlzKU3WvStQGiLN2ny.inPpar5T2rIPyNw4S0.XRl98iEHGXjsbPoSkiVmCgUzm55N9Ucq.2XZCrxzFX0oMvWMsAVaZC70Safu49Cz7Ezc5oUgYiMHzAs2KcMFFumjBLvT1J52HaIsgK
                

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

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

                14

                Online

                2.3k

                Users

                13.6k

                Topics

                118.7k

                Posts