Subject:Where are my custom templates save?
Posted by: D-Slam
Date:7/28/2006 6:01:53 AM
I have several custom "save templates" which I'd like to bundle with my scripts to distribute to the rest of my team. But I don't see them showing up in the Preset Manager. How can I share these? Or are they just local to my machine. Do I have to dump the save preset's raw data and build / call them "in line" in the code? thanks as always... |
Subject:RE: Where are my custom templates saved?
Reply by: D-Slam
Date:7/31/2006 5:20:03 PM
Since my last post, I found them cleverly hiding in the presets files one imports with Preset Manager. I suppose my desire/question now is: ...I'd like to automated that install process for the team. I assume there are not only locations but also registry settings involved in installing presets. no? Can you share where those live and how I can get them there without using the Preset Manager, - OR - Can I automated the Preset Manager from C# or a dos command line? - ds |
Subject:RE: Where are my custom templates saved?
Reply by: _TJ
Date:8/7/2006 10:19:25 AM
Sorry, Preset Mannager cannot be automated. and while you could in theory update presets by writing directly to registry keys, and saving files into relevant directories, this would NOT work reliably if you did it while Sound Forge was running. Your better solution is to not reference non-default named presets in your scripts. Instead, imbed the preset data itself into your script, or into some configuration file that only your script knows about. You can get the data for a preset as a byte array by using the following code. string strFxName = "Normalize"; ISfGenericEffect fx = app.FindEffect(strFxName); ISfGenericPreset preset0 = fx.ChoosePreset(IntPtr.Zero, 0); byte[] abData = preset0.Bytes; // save the byte array into some external storage of your choice. You can then load the byte array and create a preset from it in your running script. ISfGenericPreset presetA = new SoundForge.SfGenericPreset("Name of Preset", fx, abData); This is the technique that the Batch Converter uses. tj Message last edited on8/7/2006 10:20:23 AM by_TJ. |