Opening Actual File Location
-
Hey Gang,
I've figured out how to open file locations via the Filesystem directory. Cool. My issue is, how do I open the actual file location via the users OS instead of opening the File location WITHIN Hise?
I have a bunch of WAV samples i'd like the user to be able to preview before loading into the sampler (Custom Sample Import). My easiest solution was the Filesystem opens and user can simply double click a sound to play via their Audio Player on OS (Windows Media Player, Quicktime, etc). Opening a file within the Filestystem though does not do the trick as it acts like it wants to open the file in HISE rather than play the audio.
Is there an easier way to do this? Is there a way I could list the files in a viewport and allow for preview there somehow directly in the plugin?
-
@trillbilly said in Opening Actual File Location:
My issue is, how do I open the actual file location via the users OS instead of opening the File location WITHIN Hise?
File.show();
Is there a way I could list the files in a viewport and allow for preview there somehow directly in the plugin?
Yes. Use the File and FileSystem API to get a list of files from the selected folder and display that list in the viewport. In the viewport callback you can load the selected file into an audio loop player (or sampler) and trigger the playback.
-
@d-healey Thanks. I watched your video about
toString
but am confused on how to string the filenames via viewport vs. stringing the directory like you do in the video. I've tried once before as well with now luck.As for triggering the Audio Loop Player, this is a good idea. I'll test it out once I'm able to get the AudioFiles folder to display the WAVs in viewport.
-
@trillbilly Both directories and files are represented as File objects in HISE. So to use
.toString()
is the same for both. -
@d-healey I think I'm just slow then. I can't get them to list. I'll post my code when I get back to studio tonight.
-
@trillbilly You might want to check out the HISE project here - https://e1.pcloud.link/publink/show?code=kZA6OLZO9JGj78xI5JHncJbuMrS4HugJ2x7
For context - https://vi-control.net/community/threads/simple-sample-player.128248/
-
@d-healey Hey, thanks! Thats super cool and useful!