CVCenterPreferences:
Filter:
Classes (extension) | GUI | Conductor | External Control > MIDI | External Control > OSC

CVCenterPreferences : Object
ExtensionExtension

A class implementing persistant settings for CVCenter resp. CVWidgets

Description

CVCenterPreferences implements persistant preferences for CVCenter and parts of CVWidget (respectively its subclassses CVWidgetKnob, CVWidget2D and CVWidgetMS). Preferences may either be set via GUI or programmatically. They are stored in a file named CVCenterPreferences in the same directory as the classfile.

Class Methods

CVCenterPreferences.dialog

Opens the GUI that lets user edit the preferences.

Returns:

this (CVCenterPreferences)

CVCenterPreferences.window

The Window holding all elements of the dialog.

Returns:

CVCenterPreferences.writePreferences(saveGuiProperties, guiProperties, saveClassVars, midiMode, midiResolution, midiMean, softWithin, ctrlButtonBank, removeResponders, initMidiOnStartUp, shortcuts, globalShortcuts, keyCodesAndMods, informString)

lets the user set any of the following settings programmatically.

Arguments:

saveGuiProperties

can be one of the following Integers

0don't save GUI-properties (left, top, width, height) on shutdown, recompilation of the class-library or when the CVCenter-GUI gets closed
1save the current GUI-properties on close, recompilation of the class-library or when SuperCollider quits.
2set the GUI-properties to fixed values. If this option is chosen the user will also have to provide appropriate values for the argument 'guiProperties'.
guiProperties

a Rect an Array providing left, top, width, height - will be ignored if 'saveProperties is set to 0 or 1

saveClassVars

a Boolean or an Integer ( 0 or 1), indicating whether CVCenter's classvars midiMode, midiResolution, midiMean, softWithin, ctrlButtonBank. All these classvars have equivalent instancevars in CVWidget that will override CVCenter's classvars if set. Thus the user may set global values here and tweak them within each CVWidget created in CVCenter. If set to 0 the arguments midiMode, midiResolution, midiMean, softWithin and ctrlButtonBank will be ignored.

midiMode
0MIDI-controllers that yield values from 0-127
1MIDI-controller that yield de-/incremental values
midiResolution

a Float - only applies when midiMode is set to 1 - lower values result in a higher resolution and vice versa.

midiMean

an Integer - only applies when midiMode is set to 1 - default: 64. The value stands for the value a MIDI-slider will output in neutral position.

softWithin

a Float - only applies when midiMode is set to 0 - default: 0.1. A threshold for a MIDI-slider to react. Only if the slider comes close to the CV's actual value +/- softWithin a new value will be set. This avoids sudden jumps if a slider gets moved but the actual value of the CV differs much. A value =< 0 will prevent the snap-to.

ctrlButtonBank

CVCenter was written with a Doepfer Pocket Dial in mind which provides 16 fader-knobs and 4 different banks which sums up to 64 different slider-slots. However, it is not obvious which slider has to be moved to trigger a CCResponder initialised for controller nr. 37. Setting this argument to 16 (the number of knobs) will display controller nr. 37 as 3:5 (knob number 5 in bank 3).

removeResponders

a Boolean or an Integer ( 0 or 1). This argument sets CVWidget: *removeResponders, indicating whether MIDI- and OSC-responders shall be removed upon hitting Cmd/Ctrl-period. If it is set to 0 or false unreferenced ghost-responders are left that may be hard to remove.

initMidiOnStartUp

a Boolean or an Integer, defining whether MIDI will get started on start-up.

shortcuts

shortcuts as passed in from the dialog:

In the above code cvCenterEditor, cvWidgetEditor, cvwidgeteditor represent the KeyDownActionsEditors, each kept in a tab of a TabbedView2. Calling result returns three IdentityDictionarys containing the regarding GUI's shortcuts. Currently shortcuts can be edited for CVCenter, CVWidgetEditor and CVWidget. More information about editing shortcuts with the editor: CVCenterShortcutsEditor.

globalShortcuts

global shortcuts work from whereever you call them - whether IDE, the SClang or any other application is currently the frontmost one does not matter. When global shortcuts are enabled a synth that listens to the users keystrokes will be created at server-boot (every key with an action mapped to it takes one UGen). By default the shortcut (fn)+F1 will front all SClang windows and open CVCenter - can be deactivated at any time.

keyCodesAndMods

key-mappings differ from platform to platform and may not be consitant accross all keyboards. As a consequence keycode- and modifier-mappings are made editable. At least on Linux and MacOSX things should work instantly. Windows-users may have to adjust the mappings in the editor (ideally edit and send me a copy so I can update them in the distribution).

informString

a String, used as alternative inform-message (optional)

Returns:

this (CVCenterPreferences)

CVCenterPreferences.readPreferences( ... args)

Reads the above set values.

Arguments:

... args

if no arguments are set all values in the current preferences are returened, otherwise those that have been requested (argument-names equal those used in writePreferences).

Returns:

an Event containing the current preferences if they exist.

Inherited class methods

Instance Methods

Inherited instance methods