Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String Action_TestDialog()
- {
- /* Declare a user input dialog */
- UserInputDialog Dialog("CycleMarkFinder");
- /* Declare some user input fields */
- UserInputField
- Algorithm("Algorithm"),
- Precision("Precision"),
- Lofreq("Low Freq"),
- HiFreq("High Freq");
- /* Delcare some user input buttons */
- UserInputButton
- Run("Run"),
- DeleteMarkers("Delete Markers");
- /* Add the fields to dialog */
- // Output a pointer from these functions
- Dialog.addFields({
- Algorithm.makeDropdown(0, {"Normal", "Refined"}), // default, menu items
- Precision.makeField(8), // default
- LoFreq.makeSlider(0.0, 10000.0, 20.0), // default/min/max
- HiFreq.makeSlider(0.0, 10000.0, 1000.0), // default/min/max
- // sliders are not crucial if it's too annoying right now
- // also, is it possible to give sliders a callback so they,
- // for example, run some code to update something in REAPER?
- });
- /* Add buttons */
- // just stack these horizontally at the bottom
- Dialog.addButtons({
- Run, DeleteMarkers,
- });
- Run.setCallback([&]()
- {
- /* Xen, do you know how to determine type
- by return type? I've done it before. Not crucial.
- I think you have to do a new function for each return
- type: double, int, string, bool */
- int algo = Algorithm.getValue();
- int precision = Precision.getVaue();
- double lofreq = LoFreq.getValue();
- double hiFreq = HiFreq.getValue();
- /* do stuff with values */
- return "status";
- });
- DeleteMarkers.setCallback([&]()
- {
- /* do stuff */
- return "status";
- });
- Dialog.runGUI();
- }
Advertisement
Add Comment
Please, Sign In to add comment