M4L Notes on Enabling/Disabling Functionality on APC40
These notes were copied from the Ableton forums. The original post was from Highmountain. Please feel free to edit this.
First method: Call set_enabled 0 on these components to turn them off and set_enabled 1 to turn them back on.
Session_Control - The matrix, scene launch, clip stop, and bank buttons
Session_Overview - Must be disabled when you individually disable the clip and scene buttons, or it will hose things when you press shift. It's probably a good idea to disable it whenever you disable Session_Control too, but I haven't tested it much.
X_Clip_Slot_Y - The 40 matrix buttons
Scene_X - The 5 scene launch buttons
Mixer - All the faders, xfader, cue knob, all the arm, solo, activate, and track select buttons, all the track control knobs.
Channel_Strip_X - The activate, solo, arm, and track select buttons, the fader, and the knob in the track control section, for track X
Master_Channel_Strip - Master fader, master track select button
Device_Component - The 8 device control knobs. The shift-button functionality is partially disabled (the lights will change, but pressing the buttons does nothing).
Detail_View_Control - The device left/right buttons, the clip/track button, the detail view button.
Transport - Play, stop, record, overdub, rec quant, tempo tap and nudge. I assume also metronome, but my test rig disables that one anyway.
Track_Control_Modes - Pan, Send A, B, and C buttons
The device on/off button is missing from this list.
Second method: There are various set_x_button and set_x_control methods on the components. You can call them with "id" 0 to turn them off, and "id" <id> to turn them back on. Obviously <id> should be the id of the relevant control. Plural ones sometimes take a series of these id/number pairs, but the ones that involve many buttons want something else.
Matrix/scene buttons: More complicated than method 1 and problems with non-obvious arguments to functions. Just do it the other way.
Stop buttons: Session_Control, set_stop_clip_track_buttons. Non-obvious function arguments again. The id 0 pair will turn them all off but I couldn't get them on again. set_stop_all_clip_button only needs one pair and works fine to turn off the 9th button.
Track select buttons: Channel_Strip_X and Master_Channel_Strip, set_select_button, controls are X_Select_Button / Master_Select_Button
Track activate buttons: Channel_Strip_X, set_mute_button, controls are X_Mute_Button
Track solo buttons: Channel_Strip_X, set_solo_button, controls are X_Solo_Button
Track arm buttons: Channel_Strip_X, set_arm_button, controls are X_Arm_Button
Track faders: set_volume_control on Channel_Strip_X and Master_Channel_strip does nothing. No guess on these. I poked around but there's no other apparent way to disable the faders unless you set_enabled 0 the whole strip.
Cue knob: set_prehear_volume_control on Mixer, control is Prehear_Volume_Control
Crossfader: set_crossfader_control on Mixer, control is Crossfader
Play, Record, Stop, Tempo Tap, Tempo Nudge Up/Down, Rec Quant, Overdub, Metronome are all on the Transport component. Use API Explorer, it's obvious which function to use for each button. I know metronome, overdub, and quantization work, but I didn't test the others.
Clip/track, detail view, device +/- are on Detail_View_Control with obvious names.
Device on/off is set_on_off_button on Device_Component. Also, set_shift_button on Device_Component can be used to disable the shift-button functionality that's still partly there when you use set_enable to turn Device_Component off.
The following stuff might need to be set (also or only) on some of the various translation objects instead. I haven't fiddled with those much, but I expect more problems with figuring out the correct list of arguments.
Lower knobs seem to be set_parameter_controls on Device_Component, but it's not clear what arguments it wants.
For the upper knobs it's uncertain. There are set_pan_control and set_send_controls functions on the channel strips. I tried both the normal strips and Selected_Channel_Strip but set_pan_control does not work. I suspect it's set_controls on the Track_Control_Modes object, but once again the arguments it wants are unclear.
Pan and send buttons - Set_modes_buttons on Track_Control_Modes. Similar to set_stop_clip_track_buttons, "id" 0 will turn them off, but it's unclear how to turn them back on.
