How do HISE Snippets Work?
-
Hey!
I’m curious, how do HISE snippets work? Is it like a “preset” encoded into base64 format?
Thanks!
-
{ MainController::ScopedEmbedAllResources sd(bp); ValueTree v = bp->getMainSynthChain()->exportAsValueTree(); MemoryOutputStream mos; v.writeToStream(mos); MemoryOutputStream mos2; GZIPCompressorOutputStream zipper(&mos2, 9); zipper.write(mos.getData(), mos.getDataSize()); zipper.flush(); String data = "HiseSnippet " + mos2.getMemoryBlock().toBase64Encoding(); SystemClipboard::copyTextToClipboard(data); if (!MainController::inUnitTestMode()) { PresetHandler::showMessageWindow("Preset copied as compressed snippet", "You can paste the clipboard content to share this preset", PresetHandler::IconType::Info); } }
-
@Dan-Korneff ooh thats interesting! Thanks!