Welcome to %s forums

BrainModular Users Forum

Login Register

sdk value field in module window

Tell us what you'd like Usine to do
Post Reply
23fx23
Member
Posts: 2545
Contact:

Unread post by 23fx23 » 07 Dec 2017, 20:23

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..

23fx23
Member
Posts: 2545
Contact:

Unread post by 23fx23 » 07 Dec 2017, 20:26

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

sm_jamieson
Member
Posts: 555
Contact:

Unread post by sm_jamieson » 07 Dec 2017, 21:28

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.

sm_jamieson
Member
Posts: 555
Contact:

Unread post by sm_jamieson » 07 Dec 2017, 22:10

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.

23fx23
Member
Posts: 2545
Contact:

Unread post by 23fx23 » 07 Dec 2017, 22:32

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.

sm_jamieson
Member
Posts: 555
Contact:

Unread post by sm_jamieson » 14 Dec 2017, 00:27

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..
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.

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.

User avatar
senso
Site Admin
Posts: 4424
Location: France
Contact:

Unread post by senso » 30 Dec 2017, 14:32

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)

23fx23
Member
Posts: 2545
Contact:

Unread post by 23fx23 » 30 Dec 2017, 22:16

yessss sounds awesomee! thanks!!

Post Reply

Who is online

Users browsing this forum: No registered users and 69 guests