sdk value field in module window
well thats feels certainly complex but who knows^^..
i got a synth made with sdk with plenty of faders intenally made and drawn on the canvas with rects.
what i would like to acheve is when double clicking on one, have the ability to enter numeric value via keayboard, a bit like usine standard items faders.
I could go and try code this and will probably, but think will be complex. just wondered if there couldn't be some magic wizzard trick to overlay kinda such 'field' boxes,
like a rect with left right top botom settings, but that would get keyboard inputs, on the canvas, and get back string values. dk if make sense.
think i read somewhere keyboard callback would be hard, but maybe a long term idea..
i got a synth made with sdk with plenty of faders intenally made and drawn on the canvas with rects.
what i would like to acheve is when double clicking on one, have the ability to enter numeric value via keayboard, a bit like usine standard items faders.
I could go and try code this and will probably, but think will be complex. just wondered if there couldn't be some magic wizzard trick to overlay kinda such 'field' boxes,
like a rect with left right top botom settings, but that would get keyboard inputs, on the canvas, and get back string values. dk if make sense.
think i read somewhere keyboard callback would be hard, but maybe a long term idea..
altenatively, a maybe simpler workaround might be some more sdkpopup, a bit like when creating a module user can chose on a list box number of IOs,
that would be awesome if we could trig same thing anytime else than creation from the code, and get back a combo box choice integer, and ultimate would be adding a textfield user could enter stuff and module get back the stirng value and make stuff out of it
that would be awesome if we could trig same thing anytime else than creation from the code, and get back a combo box choice integer, and ultimate would be adding a textfield user could enter stuff and module get back the stirng value and make stuff out of it
-
sm_jamieson
- Member
- Posts: 555
- Contact:
I've got a similar User module. I just use a Setting to get the value (so I'm glad my suggested sdkAddSettingsLineString has been added - although it doesn't seem to work yet). Or of course a text parameter input.
But yes, a text input popup direct from the SDK would be great.
You can also use a Usine Popup window containing a text input module and control its position via the X and Y parameters.
Of course you can use the module child window (sdkCreateDeskWindow() etc), but Usine does not draw in there, you have to do it using some other graphic library. I've not used that at all. Also you can set the size of that window but I'm not sure about the position.
But yes, a text input popup direct from the SDK would be great.
You can also use a Usine Popup window containing a text input module and control its position via the X and Y parameters.
Of course you can use the module child window (sdkCreateDeskWindow() etc), but Usine does not draw in there, you have to do it using some other graphic library. I've not used that at all. Also you can set the size of that window but I'm not sure about the position.
-
sm_jamieson
- Member
- Posts: 555
- Contact:
It is quite amazing what you can do with the SDK, but you always want more. I've got C++ classes to do a listbox, sliders, buttons etc. All such things could be put into a C++ library and/or added to the SDK.
I even wondered about taking a general purpose graphic library and mapping or extending it onto the SDK drawing functions.
But you hit the issue that the SDK is really intended for fairly simple graphics and you have to redraw all of it every time the redraw function is called, which limits its efficiency. For example, a proper graphic library includes buffers and clip regions, which means you only have to redraw the bits that need it.
Of course you could just draw all your graphics into the child window, but that would not integrate with the rest of the Usine GUI so well.
Perhaps the sdk redraw function could be extended a bit to include simple clip regions, say the window divided into a number of squares with an indication of which requires redrawing. Or Usine could keep a buffer of the graphic area and allow you to just redraw the bits that have changed.
I must admit I am always in a fight between drawing the graphic items (buttons, sliders, etc) in the user module myself, or using Usine's modules connected to parameter inputs. I know the spirit of Usine is lots of small modules wired up in patches, but sometimes that is a bit limiting.
And the signal flow thing is perfect for audio and midi signal paths etc, but not always so good for creating a complex GUI. For example, if you want your module to fully control a listbox, you need to wire up many input and output parameters and coordinate them all.
I even wondered about taking a general purpose graphic library and mapping or extending it onto the SDK drawing functions.
But you hit the issue that the SDK is really intended for fairly simple graphics and you have to redraw all of it every time the redraw function is called, which limits its efficiency. For example, a proper graphic library includes buffers and clip regions, which means you only have to redraw the bits that need it.
Of course you could just draw all your graphics into the child window, but that would not integrate with the rest of the Usine GUI so well.
Perhaps the sdk redraw function could be extended a bit to include simple clip regions, say the window divided into a number of squares with an indication of which requires redrawing. Or Usine could keep a buffer of the graphic area and allow you to just redraw the bits that have changed.
I must admit I am always in a fight between drawing the graphic items (buttons, sliders, etc) in the user module myself, or using Usine's modules connected to parameter inputs. I know the spirit of Usine is lots of small modules wired up in patches, but sometimes that is a bit limiting.
And the signal flow thing is perfect for audio and midi signal paths etc, but not always so good for creating a complex GUI. For example, if you want your module to fully control a listbox, you need to wire up many input and output parameters and coordinate them all.
yeah i thought about those workarounds, but they imply creating and wiring other modules (not the sdkaddstring tho, good candidate)
^not drastic stuff but yes we always want more^^, was just anticipating a 'vst' like autonomous thing, think the query popups would be a cool in beetween, *sound doable thing, a bit more user friendly than going out ib to a tab setting to set a fader, still a possible solution.. from what ive tried child window just make the module itself in a independant popup window, but have to try back.
ive seen your post about the string, might be wrong but i remember beeing able to get back the pointer value, have to check back.
yea see what ya mean about limited bounding redraw regions, sounds interesting an indeed good idea if was possible. ive been pretty wild drawing hundreds of layers wth apha/dots/squares/bezier curves/faders ect each ms and did not spot problems so far but surely it would be more efficient to redraw only what is needed.
i also face same dilemna, spltting/all internal^^ on the synth tho went internal, felt more modular and less complex than exhanging tons of IOs datas & parameters for that case.
^not drastic stuff but yes we always want more^^, was just anticipating a 'vst' like autonomous thing, think the query popups would be a cool in beetween, *sound doable thing, a bit more user friendly than going out ib to a tab setting to set a fader, still a possible solution.. from what ive tried child window just make the module itself in a independant popup window, but have to try back.
ive seen your post about the string, might be wrong but i remember beeing able to get back the pointer value, have to check back.
yea see what ya mean about limited bounding redraw regions, sounds interesting an indeed good idea if was possible. ive been pretty wild drawing hundreds of layers wth apha/dots/squares/bezier curves/faders ect each ms and did not spot problems so far but surely it would be more efficient to redraw only what is needed.
i also face same dilemna, spltting/all internal^^ on the synth tho went internal, felt more modular and less complex than exhanging tons of IOs datas & parameters for that case.
-
sm_jamieson
- Member
- Posts: 555
- Contact:
I think Senso said keyboard input callbacks in the SDK would be hard as you have to send it to all modules (not like mouse where you only send it when mouse is over a module). The usual way round this is to have keyboard listeners who register if they want input. That could be done at the Init stage when you set ModuleType, DontProcess, etc. You could have a DoKeyboardCallback for example.23fx23 wrote:well thats feels certainly complex but who knows^^..
i got a synth made with sdk with plenty of faders intenally made and drawn on the canvas with rects.
what i would like to acheve is when double clicking on one, have the ability to enter numeric value via keayboard, a bit like usine standard items faders.
I could go and try code this and will probably, but think will be complex. just wondered if there couldn't be some magic wizzard trick to overlay kinda such 'field' boxes,
like a rect with left right top botom settings, but that would get keyboard inputs, on the canvas, and get back string values. dk if make sense.
think i read somewhere keyboard callback would be hard, but maybe a long term idea..
Something that would be a start, that I would find useful would be an SDK dialog popup that includes a text input field.
The existing dialogs are:
int sdkDialogConfirmationYesNoCancel(msg)
int sdkDialogConfirmationYesNo (msg)
int sdkDialogInformationOk (msg )
int sdkDialogConfirmationOKCancel (msg)
Senso might be willing to do something like
AnsiCharPtr sdkDialogTextInput(msg), that just includes the user message, then a text input box, then an OK or ENTER button.
a new dialog will be added in the next SDK release v004 and Usine v155
Code: Select all
inline AnsiCharPtr sdkDialogInputBox(AnsiCharPtr caption, AnsiCharPtr prompt, AnsiCharPtr defaultValue)Olivier Sens
www.brainmodular.com
www.brainmodular.com
Who is online
Users browsing this forum: No registered users and 56 guests
