+
+string
+MidiAutomationLine::get_verbose_cursor_string (double fraction) const
+{
+ using namespace MIDI::Name;
+
+ if (_parameter.type() != ARDOUR::MidiCCAutomation) {
+ return AutomationLine::get_verbose_cursor_string(fraction);
+ }
+
+ MidiTimeAxisView* const mtv = dynamic_cast<MidiTimeAxisView*>(trackview.get_parent());
+ if (!mtv) {
+ return AutomationLine::get_verbose_cursor_string(fraction);
+ }
+
+ boost::shared_ptr<MasterDeviceNames> device_names(mtv->get_device_names());
+ if (!device_names) {
+ return AutomationLine::get_verbose_cursor_string(fraction);
+ }
+
+ const std::string& device_mode = mtv->gui_property(X_("midnam-custom-device-mode"));
+ const uint8_t channel = mtv->get_channel_for_add();
+
+ boost::shared_ptr<const ValueNameList> value_names = device_names->value_name_list_by_control(
+ device_mode, channel, _parameter.id());
+ if (!value_names) {
+ return AutomationLine::get_verbose_cursor_string(fraction);
+ }
+
+ const uint16_t cc_value = floor(std::max(std::min(fraction * 127.0, 127.0), 0.0));
+
+ boost::shared_ptr<const Value> value = value_names->max_value_below(cc_value);
+ if (!value) {
+ return AutomationLine::get_verbose_cursor_string(fraction);
+ }
+
+ return value->name();
+}
+