I think I've worked out a way round this using lists.

First of all the command type will be the first parameter. i.e. Show, Width (n)
etc.

Referring to the attached files, "windowTypes" is a complete list of all the
windows Yoshimi has.
However, as you can see there are lots of duplicate names of windows attached
to different parents (and which can have different visibility and dimensions)

"windowTypesCompact" is the same information, but split into three separate
lists corresponding to the appropriate word out of three. For most windows
only one word is needed to uniquely identify them, so numbers 2 and 3 would be
empty strings.

"Waveform" and "Resonance" are second word to differentiate between Addsynth
Modulator and Padsynth. The other three identify which insert "Freemode" and
"Format" apply to.


In operation the user may enter just the first word as (say) "addsynth", so be
handling just that window. This would be passed on to the GUI and also stored
as the most recent command, or they could have entered "addsynth waveform", and
would go straight there.

If they now just entered "Resonance", this would be compared to the first list
and not found, but as there was a previous valid entry, that would be retained,
and an attempt made to find the word in the second list. This would be found
and would replace the previous entry of "waveform", so the GUI would now see
"addsynth resonance". Also, as the function had changed, the third word would
be made empty if it wasn't.

If however, a word was not found, then the third list would be searched. If it
was still not found, an error would be reported and the system would remain
pointed at the last seen one.

The GUI would get the entire phrase as a single string in MiscMsg.
Section and command would be in the command block as usuual, and for position
and sizes 'value' would be used.

Once you have a valid string you can modify all a window's characteristics just
with the relevant command itself.


Like this, the user has great flexibility and all the work is done in the
CLI. The GUI only sees a complete correct command.
Coding this will be rather interesting of course!




-- 
Will J Godfrey {apparently now an 'elderly'}
https://willgodfrey.bandcamp.com/
http://yoshimi.github.io
Say you have a poem and I have a tune.
Exchange them and we can both have a poem, a tune, and a song.

Attachment: windowTypes
Description: Binary data

Attachment: windowTypesCompact
Description: Binary data

_______________________________________________
Yoshimi-devel mailing list
Yoshimi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/yoshimi-devel

Reply via email to