2 Copyright (C) 2010 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 #include <gtkmm/comboboxtext.h>
20 #include <gtkmm/box.h>
21 #include <gtkmm/spinbutton.h>
22 #include <gtkmm/table.h>
23 #include <gtkmm/treeview.h>
24 #include <gtkmm/liststore.h>
25 #include <gtkmm/treestore.h>
26 #include <gtkmm/notebook.h>
27 #include <gtkmm/cellrenderercombo.h>
28 #include <gtkmm/scale.h>
29 #include <gtkmm/alignment.h>
31 #include "pbd/error.h"
32 #include "pbd/strsplit.h"
34 #include "gtkmm2ext/actions.h"
35 #include "gtkmm2ext/gui_thread.h"
36 #include "gtkmm2ext/utils.h"
38 #include "ardour/audioengine.h"
39 #include "ardour/port.h"
40 #include "ardour/rc_configuration.h"
42 #include "mackie_control_protocol.h"
43 #include "device_info.h"
46 #include "surface_port.h"
52 using namespace ArdourSurface;
53 using namespace Mackie;
56 MackieControlProtocol::get_gui () const
59 const_cast<MackieControlProtocol*>(this)->build_gui ();
61 static_cast<Gtk::Notebook*>(_gui)->show_all();
66 MackieControlProtocol::tear_down_gui ()
69 Gtk::Widget *w = static_cast<Gtk::Widget*>(_gui)->get_parent();
75 delete (MackieControlProtocolGUI*) _gui;
80 MackieControlProtocol::build_gui ()
82 _gui = (void *) new MackieControlProtocolGUI (*this);
85 MackieControlProtocolGUI::MackieControlProtocolGUI (MackieControlProtocol& p)
88 , touch_sensitivity_adjustment (0, 0, 9, 1, 4)
89 , touch_sensitivity_scale (touch_sensitivity_adjustment)
90 , recalibrate_fader_button (_("Recalibrate Faders"))
91 , ipmidi_base_port_adjustment (_cp.ipmidi_base(), 0, 32767, 1, 1000)
92 , discover_button (_("Discover Mackie Devices"))
93 , _device_dependent_widget (0)
96 Gtk::Alignment* align;
99 set_border_width (12);
101 table.set_row_spacings (4);
102 table.set_col_spacings (6);
103 table.set_border_width (12);
104 table.set_homogeneous (false);
106 l = manage (new Gtk::Label (_("Device Type:")));
107 l->set_alignment (1.0, 0.5);
108 table.attach (*l, 0, 1, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions(0));
109 table.attach (_surface_combo, 1, 2, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0);
112 vector<string> surfaces;
114 for (std::map<std::string,DeviceInfo>::iterator i = DeviceInfo::device_info.begin(); i != DeviceInfo::device_info.end(); ++i) {
115 surfaces.push_back (i->first);
117 Gtkmm2ext::set_popdown_strings (_surface_combo, surfaces);
118 _surface_combo.signal_changed().connect (sigc::mem_fun (*this, &MackieControlProtocolGUI::surface_combo_changed));
120 _cp.DeviceChanged.connect (device_change_connection, invalidator (*this), boost::bind (&MackieControlProtocolGUI::device_changed, this), gui_context());
122 ipmidi_base_port_adjustment.signal_value_changed().connect (sigc::mem_fun (*this, &MackieControlProtocolGUI::ipmidi_spinner_changed));
124 /* device-dependent part */
126 device_dependent_row = row;
128 if (_device_dependent_widget) {
129 table.remove (*_device_dependent_widget);
130 _device_dependent_widget = 0;
133 _device_dependent_widget = device_dependent_widget ();
134 table.attach (*_device_dependent_widget, 0, 12, row, row+1, AttachOptions(0), AttachOptions(0), 0, 0);
137 /* back to the boilerplate */
139 RadioButtonGroup rb_group = absolute_touch_mode_button.get_group();
140 touch_move_mode_button.set_group (rb_group);
142 recalibrate_fader_button.signal_clicked().connect (sigc::mem_fun (*this, &MackieControlProtocolGUI::recalibrate_faders));
143 backlight_button.signal_clicked().connect (sigc::mem_fun (*this, &MackieControlProtocolGUI::toggle_backlight));
145 touch_sensitivity_adjustment.signal_value_changed().connect (sigc::mem_fun (*this, &MackieControlProtocolGUI::touch_sensitive_change));
146 touch_sensitivity_scale.set_update_policy (Gtk::UPDATE_DISCONTINUOUS);
148 l = manage (new Gtk::Label (_("Button click")));
149 l->set_alignment (1.0, 0.5);
150 table.attach (*l, 0, 1, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions (0));
151 align = manage (new Alignment);
152 align->set (0.0, 0.5);
153 align->add (relay_click_button);
154 table.attach (*align, 1, 2, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions (0));
157 l = manage (new Gtk::Label (_("Backlight")));
158 l->set_alignment (1.0, 0.5);
159 table.attach (*l, 0, 1, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions (0));
160 align = manage (new Alignment);
161 align->set (0.0, 0.5);
162 align->add (backlight_button);
163 table.attach (*align, 1, 2, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions (0));
166 l = manage (new Gtk::Label (_("Send Fader Position Only When Touched")));
167 l->set_alignment (1.0, 0.5);
168 table.attach (*l, 0, 1, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions (0));
169 align = manage (new Alignment);
170 align->set (0.0, 0.5);
171 align->add (absolute_touch_mode_button);
172 table.attach (*align, 1, 2, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions (0));
175 l = manage (new Gtk::Label (_("Send Fader Position When Moved")));
176 l->set_alignment (1.0, 0.5);
177 table.attach (*l, 0, 1, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions (0));
178 align = manage (new Alignment);
179 align->set (0.0, 0.5);
180 align->add (touch_move_mode_button);
181 table.attach (*align, 1, 2, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions (0));
184 l = manage (new Gtk::Label (_("Fader Touch Sense Sensitivity")));
185 l->set_alignment (1.0, 0.5);
186 table.attach (*l, 0, 1, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions (0));
187 touch_sensitivity_scale.property_digits() = 0;
188 touch_sensitivity_scale.property_draw_value() = false;
189 table.attach (touch_sensitivity_scale, 1, 2, 5, 6, AttachOptions(FILL|EXPAND), AttachOptions (0));
191 table.attach (recalibrate_fader_button, row, row+1, 6, 7, AttachOptions(FILL|EXPAND), AttachOptions (0));
195 table.attach (discover_button, 1, 2, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions (0));
196 discover_button.signal_clicked().connect (sigc::mem_fun (*this, &MackieControlProtocolGUI::discover_clicked));
199 vector<string> profiles;
201 profiles.push_back ("default");
203 for (std::map<std::string,DeviceProfile>::iterator i = DeviceProfile::device_profiles.begin(); i != DeviceProfile::device_profiles.end(); ++i) {
204 profiles.push_back (i->first);
206 Gtkmm2ext::set_popdown_strings (_profile_combo, profiles);
207 _profile_combo.set_active_text (p.device_profile().name());
208 _profile_combo.signal_changed().connect (sigc::mem_fun (*this, &MackieControlProtocolGUI::profile_combo_changed));
210 append_page (table, _("Device Setup"));
213 /* function key editor */
215 VBox* fkey_packer = manage (new VBox);
216 HBox* profile_packer = manage (new HBox);
217 HBox* observation_packer = manage (new HBox);
219 l = manage (new Gtk::Label (_("Profile/Settings:")));
220 profile_packer->pack_start (*l, false, false);
221 profile_packer->pack_start (_profile_combo, true, true);
222 profile_packer->set_spacing (12);
223 profile_packer->set_border_width (12);
225 l = manage (new Gtk::Label (_("* Button available at the original Mackie MCU PRO or current device if enabled (NOT implemented yet). Device specific name presented.")));
226 observation_packer->pack_start (*l, false, false);
228 fkey_packer->pack_start (*profile_packer, false, false);
229 fkey_packer->pack_start (function_key_scroller, true, true);
230 fkey_packer->pack_start (*observation_packer, false, false);
231 fkey_packer->set_spacing (12);
232 function_key_scroller.property_shadow_type() = Gtk::SHADOW_NONE;
233 function_key_scroller.add (function_key_editor);
234 append_page (*fkey_packer, _("Function Keys"));
236 build_available_action_menu ();
237 build_function_key_editor ();
238 refresh_function_key_editor ();
239 fkey_packer->show_all();
243 MackieControlProtocolGUI::device_dependent_widget ()
245 Gtk::Table* dd_table;
249 uint32_t n_surfaces = 1 + _cp.device_info().extenders();
251 if (!_cp.device_info().uses_ipmidi()) {
252 dd_table = Gtk::manage (new Gtk::Table (n_surfaces, 2));
254 dd_table = Gtk::manage (new Gtk::Table (1, 2));
257 dd_table = Gtk::manage (new Gtk::Table (2, n_surfaces));
258 dd_table->set_row_spacings (4);
259 dd_table->set_col_spacings (6);
260 dd_table->set_border_width (12);
262 _surface_combo.set_active_text (_cp.device_info().name());
264 vector<string> midi_inputs;
265 vector<string> midi_outputs;
267 ARDOUR::AudioEngine::instance()->get_ports ("", ARDOUR::DataType::MIDI, ARDOUR::PortFlags (ARDOUR::IsOutput|ARDOUR::IsPhysical), midi_inputs);
268 ARDOUR::AudioEngine::instance()->get_ports ("", ARDOUR::DataType::MIDI, ARDOUR::PortFlags (ARDOUR::IsInput|ARDOUR::IsPhysical), midi_outputs);
271 port_combos.clear ();
273 if (!_cp.device_info().uses_ipmidi()) {
274 for (uint32_t n = 0; n < n_surfaces; ++n) {
277 Gtk::ComboBoxText* input_combo = manage (new Gtk::ComboBoxText);
278 Gtk::ComboBoxText* output_combo = manage (new Gtk::ComboBoxText);
280 port_combos.push_back (input_combo);
281 port_combos.push_back (output_combo);
283 Gtkmm2ext::set_popdown_strings (*output_combo, midi_outputs);
284 Gtkmm2ext::set_popdown_strings (*input_combo, midi_inputs);
286 boost::shared_ptr<Surface> surface = _cp.nth_surface (n);
289 PBD::fatal << string_compose (_("programming error: %1\n"), string_compose ("n=%1 surface not found!", n)) << endmsg;
293 for (vector<string>::iterator s = midi_inputs.begin(); s != midi_inputs.end(); ++s) {
295 if (surface->port().input().connected_to (*s)) {
296 input_combo->set_active_text (*s);
301 for (vector<string>::iterator s = midi_outputs.begin(); s != midi_outputs.end(); ++s) {
302 if (surface->port().output().connected_to (*s)) {
303 output_combo->set_active_text (*s);
309 string receive_string;
311 if (n_surfaces > 1) {
313 send_string = _("Main surface sends via:");
314 receive_string = _("Main surface receives via:");
316 send_string = string_compose (_("Extender %1 sends via:"), n);
317 receive_string = string_compose (_("Extender %1 receives via:"), n);
320 send_string = _("Surface sends via:");
321 receive_string = _("Surface receives via:");
324 l = manage (new Gtk::Label (send_string));
325 l->set_alignment (1.0, 0.5);
326 dd_table->attach (*l, 0, 1, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions(0));
327 dd_table->attach (*input_combo, 1, 2, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0);
330 l = manage (new Gtk::Label (receive_string));
331 l->set_alignment (1.0, 0.5);
332 dd_table->attach (*l, 0, 1, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions(0));
333 dd_table->attach (*output_combo, 1, 2, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0);
339 l = manage (new Gtk::Label (_("ipMIDI Port (lowest)")));
340 l->set_alignment (1.0, 0.5);
342 Gtk::SpinButton* ipmidi_base_port_spinner = manage (new Gtk::SpinButton (ipmidi_base_port_adjustment));
343 dd_table->attach (*l, 0, 1, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions (0));
344 dd_table->attach (*ipmidi_base_port_spinner, 1, 2, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions (0));
352 MackieControlProtocolGUI::make_action_renderer (Glib::RefPtr<TreeStore> model, Gtk::TreeModelColumnBase column)
354 CellRendererCombo* renderer = manage (new CellRendererCombo);
355 renderer->property_model() = model;
356 renderer->property_editable() = true;
357 renderer->property_text_column() = 0;
358 renderer->property_has_entry() = false;
359 renderer->signal_edited().connect (sigc::bind (sigc::mem_fun(*this, &MackieControlProtocolGUI::action_changed), column));
365 MackieControlProtocolGUI::build_available_action_menu ()
367 /* build a model of all available actions (needs to be tree structured
371 available_action_model = TreeStore::create (available_action_columns);
373 vector<string> paths;
374 vector<string> labels;
375 vector<string> tooltips;
377 vector<AccelKey> bindings;
378 typedef std::map<string,TreeIter> NodeMap;
382 ActionManager::get_all_actions (labels, paths, tooltips, keys, bindings);
384 vector<string>::iterator k;
385 vector<string>::iterator p;
386 vector<string>::iterator t;
387 vector<string>::iterator l;
389 available_action_model->clear ();
391 /* Because there are button bindings built in that are not
392 in the key binding map, there needs to be a way to undo
395 TreeModel::Row parent;
396 rowp = available_action_model->append();
398 parent[available_action_columns.name] = _("Remove Binding");
402 rowp = available_action_model->append();
404 parent[available_action_columns.name] = _("Shift");
405 rowp = available_action_model->append();
407 parent[available_action_columns.name] = _("Control");
408 rowp = available_action_model->append();
410 parent[available_action_columns.name] = _("Option");
411 rowp = available_action_model->append();
413 parent[available_action_columns.name] = _("CmdAlt");
416 for (l = labels.begin(), k = keys.begin(), p = paths.begin(), t = tooltips.begin(); l != labels.end(); ++k, ++p, ++t, ++l) {
419 vector<string> parts;
423 split (*p, parts, '/');
429 //kinda kludgy way to avoid displaying menu items as mappable
430 if ( parts[1] == _("Main_menu") )
432 if ( parts[1] == _("JACK") )
434 if ( parts[1] == _("redirectmenu") )
436 if ( parts[1] == _("Editor_menus") )
438 if ( parts[1] == _("RegionList") )
440 if ( parts[1] == _("ProcessorMenu") )
443 if ((r = nodes.find (parts[1])) == nodes.end()) {
445 /* top level is missing */
448 TreeModel::Row parent;
449 rowp = available_action_model->append();
450 nodes[parts[1]] = rowp;
452 parent[available_action_columns.name] = parts[1];
454 row = *(available_action_model->append (parent.children()));
458 row = *(available_action_model->append ((*r->second)->children()));
462 /* add this action */
465 row[available_action_columns.name] = *t;
468 row[available_action_columns.name] = *l;
472 row[available_action_columns.path] = (*p);
477 MackieControlProtocolGUI::build_function_key_editor ()
479 function_key_editor.append_column (_("Key"), function_key_columns.name);
482 CellRendererCombo* renderer;
484 renderer = make_action_renderer (available_action_model, function_key_columns.plain);
485 col = manage (new TreeViewColumn (_("Plain"), *renderer));
486 col->add_attribute (renderer->property_text(), function_key_columns.plain);
487 function_key_editor.append_column (*col);
489 renderer = make_action_renderer (available_action_model, function_key_columns.shift);
490 col = manage (new TreeViewColumn (_("Shift"), *renderer));
491 col->add_attribute (renderer->property_text(), function_key_columns.shift);
492 function_key_editor.append_column (*col);
494 renderer = make_action_renderer (available_action_model, function_key_columns.control);
495 col = manage (new TreeViewColumn (_("Control"), *renderer));
496 col->add_attribute (renderer->property_text(), function_key_columns.control);
497 function_key_editor.append_column (*col);
499 renderer = make_action_renderer (available_action_model, function_key_columns.option);
500 col = manage (new TreeViewColumn (_("Option"), *renderer));
501 col->add_attribute (renderer->property_text(), function_key_columns.option);
502 function_key_editor.append_column (*col);
504 renderer = make_action_renderer (available_action_model, function_key_columns.cmdalt);
505 col = manage (new TreeViewColumn (_("Cmd/Alt"), *renderer));
506 col->add_attribute (renderer->property_text(), function_key_columns.cmdalt);
507 function_key_editor.append_column (*col);
509 renderer = make_action_renderer (available_action_model, function_key_columns.shiftcontrol);
510 col = manage (new TreeViewColumn (_("Shift+Control"), *renderer));
511 col->add_attribute (renderer->property_text(), function_key_columns.shiftcontrol);
512 function_key_editor.append_column (*col);
514 function_key_model = ListStore::create (function_key_columns);
515 function_key_editor.set_model (function_key_model);
519 MackieControlProtocolGUI::refresh_function_key_editor ()
521 function_key_editor.set_model (Glib::RefPtr<TreeModel>());
522 function_key_model->clear ();
524 /* now fill with data */
527 DeviceProfile dp (_cp.device_profile());
530 for (int n = 0; n < Mackie::Button::FinalGlobalButton; ++n) {
532 Mackie::Button::ID bid = (Mackie::Button::ID) n;
534 row = *(function_key_model->append());
535 if (di.global_buttons().find (bid) == di.global_buttons().end()) {
536 row[function_key_columns.name] = Mackie::Button::id_to_name (bid);
538 row[function_key_columns.name] = di.get_global_button_name (bid) + "*";
540 row[function_key_columns.id] = bid;
542 Glib::RefPtr<Gtk::Action> act;
544 const string defstring = "\u2022";
546 action = dp.get_button_action (bid, 0);
547 if (action.empty()) {
548 row[function_key_columns.plain] = defstring;
550 if (action.find ('/') == string::npos) {
551 /* Probably a key alias */
552 row[function_key_columns.plain] = action;
555 act = ActionManager::get_action (action.c_str());
557 row[function_key_columns.plain] = act->get_label();
559 row[function_key_columns.plain] = defstring;
564 action = dp.get_button_action (bid, MackieControlProtocol::MODIFIER_CONTROL);
565 if (action.empty()) {
566 row[function_key_columns.control] = defstring;
568 if (action.find ('/') == string::npos) {
569 /* Probably a key alias */
570 row[function_key_columns.control] = action;
572 act = ActionManager::get_action (action.c_str());
574 row[function_key_columns.control] = act->get_label();
576 row[function_key_columns.control] = defstring;
581 action = dp.get_button_action (bid, MackieControlProtocol::MODIFIER_SHIFT);
582 if (action.empty()) {
583 row[function_key_columns.shift] = defstring;
585 if (action.find ('/') == string::npos) {
586 /* Probably a key alias */
587 row[function_key_columns.shift] = action;
589 act = ActionManager::get_action (action.c_str());
591 row[function_key_columns.shift] = act->get_label();
593 row[function_key_columns.shift] = defstring;
598 action = dp.get_button_action (bid, MackieControlProtocol::MODIFIER_OPTION);
599 if (action.empty()) {
600 row[function_key_columns.option] = defstring;
602 if (action.find ('/') == string::npos) {
603 /* Probably a key alias */
604 row[function_key_columns.option] = action;
606 act = ActionManager::get_action (action.c_str());
608 row[function_key_columns.option] = act->get_label();
610 row[function_key_columns.option] = defstring;
615 action = dp.get_button_action (bid, MackieControlProtocol::MODIFIER_CMDALT);
616 if (action.empty()) {
617 row[function_key_columns.cmdalt] = defstring;
619 if (action.find ('/') == string::npos) {
620 /* Probably a key alias */
621 row[function_key_columns.cmdalt] = action;
623 act = ActionManager::get_action (action.c_str());
625 row[function_key_columns.cmdalt] = act->get_label();
627 row[function_key_columns.cmdalt] = defstring;
632 action = dp.get_button_action (bid, (MackieControlProtocol::MODIFIER_SHIFT|MackieControlProtocol::MODIFIER_CONTROL));
633 if (action.empty()) {
634 row[function_key_columns.shiftcontrol] = defstring;
636 act = ActionManager::get_action (action.c_str());
638 row[function_key_columns.shiftcontrol] = act->get_label();
640 row[function_key_columns.shiftcontrol] = defstring;
645 function_key_editor.set_model (function_key_model);
649 MackieControlProtocolGUI::action_changed (const Glib::ustring &sPath, const Glib::ustring &text, TreeModelColumnBase col)
651 // Remove Binding is not in the action map but still valid
653 if ( text == "Remove Binding") {
656 Gtk::TreePath path(sPath);
657 Gtk::TreeModel::iterator row = function_key_model->get_iter(path);
661 std::map<std::string,std::string>::iterator i = action_map.find (text);
663 if (i == action_map.end()) {
668 Glib::RefPtr<Gtk::Action> act = ActionManager::get_action (i->second.c_str());
671 /* update visible text, using string supplied by
672 available action model so that it matches and is found
676 Glib::ustring dot = "\u2022";
677 (*row).set_value (col.index(), dot);
679 (*row).set_value (col.index(), text);
682 /* update the current DeviceProfile, using the full
688 switch (col.index()) {
690 modifier = MackieControlProtocol::MODIFIER_SHIFT;
693 modifier = MackieControlProtocol::MODIFIER_CONTROL;
696 modifier = MackieControlProtocol::MODIFIER_OPTION;
699 modifier = MackieControlProtocol::MODIFIER_CMDALT;
702 modifier = (MackieControlProtocol::MODIFIER_SHIFT|MackieControlProtocol::MODIFIER_CONTROL);
709 _cp.device_profile().set_button_action ((*row)[function_key_columns.id], modifier, "");
711 _cp.device_profile().set_button_action ((*row)[function_key_columns.id], modifier, i->second);
715 std::cerr << "no such action\n";
721 MackieControlProtocolGUI::surface_combo_changed ()
723 _cp.not_session_load();
724 _cp.set_device (_surface_combo.get_active_text());
728 MackieControlProtocolGUI::device_changed ()
730 if (_device_dependent_widget) {
731 table.remove (*_device_dependent_widget);
732 _device_dependent_widget = 0;
735 _device_dependent_widget = device_dependent_widget ();
736 _device_dependent_widget->show_all ();
738 table.attach (*_device_dependent_widget, 0, 12, device_dependent_row, device_dependent_row+1, AttachOptions(0), AttachOptions(0), 0, 0);
742 MackieControlProtocolGUI::profile_combo_changed ()
744 string profile = _profile_combo.get_active_text();
746 _cp.set_profile (profile);
748 refresh_function_key_editor ();
752 MackieControlProtocolGUI::ipmidi_spinner_changed ()
754 _cp.set_ipmidi_base ((int16_t) lrintf (ipmidi_base_port_adjustment.get_value()));
758 MackieControlProtocolGUI::discover_clicked ()
760 /* this should help to get things started */
765 MackieControlProtocolGUI::recalibrate_faders ()
767 _cp.recalibrate_faders ();
771 MackieControlProtocolGUI::toggle_backlight ()
773 _cp.toggle_backlight ();
777 MackieControlProtocolGUI::touch_sensitive_change ()
779 int sensitivity = (int) touch_sensitivity_adjustment.get_value ();
780 _cp.set_touch_sensitivity (sensitivity);