• 0 Votes
    20 Posts
    443 Views
    trillbillyT

    @d-healey When I use Console.print it does seem the SampleDropper is performing BEFORE the Viewport.

    Interface: Object 0x8371f570 (SampleDropper)
    Interface: 50.0 (Samplemap)

    I've got the Viewport calling for samplemaps in oninit. I've got the SampleDropper contained to the SampleLoadSave.js.

    I guess I assumed that oninit was processed first and then the other .js files.

    How do I go about switching the order in which their callbacks trigger?

  • 0 Votes
    5 Posts
    249 Views
    trillbillyT

    @Lindon said in User Specified Sample Folder per Sampler?:

    FileSystem.browseForDirectory(var startFolder, var callback)

    Yes, thank you. I have added this to the SampleLoadSave.js of the CustomSampleImport project. On Right Click, it opens the directory browser twice. I can select a folder but it does not load the samples in the folder or randomize the folder.

    SampleDropper.setMouseCallback(function(event) { // Clear the sample on double click if(event.doubleClick) { Sampler1.clearSampleMap(); return; } this.data.hover = event.hover; // Show a directory browser on right click if(event.rightClick) { FileSystem.browseForDirectory(FileSystem.Samples, loadSample); return; this.repaint(); } });

    Here is how I am randomizing some components in case I need something here. I know there is a way to reduce the script, I just don't know it.

    const sampleMapsRAN = Sampler.getSampleMapList(); inline function onShuffleSamplebtn1Control(component, value) { if (value) { local index = Math.randInt(0, sampleMapsRAN.length); local sampleMap = sampleMapsRAN[index]; Sampler1.loadSampleMap(sampleMap); SampleViewer1.setValue(index); SampleName1.setValue(list[index]); } }; Content.getComponent("ShuffleSamplebtn1").setControlCallback(onShuffleSamplebtn1Control);

    Thanks again.

  • 0 Votes
    2 Posts
    143 Views
    trillbillyT

    Bizzump...