View Issue Details

IDProjectCategoryView StatusLast Update
0006180ardourbugspublic2020-04-19 20:17
Reportertlat Assigned Tox42  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Summary0006180: no midnam-custom-device-mode from session
Descriptiongit acd6810

example:

  - new midi track
  - set midnam-custom-device-mode to "General MIDI"
  - save session and quit

    The session file contains the correct

       midnam-custom-device-mode="General MIDI"

    but...

  - start with the saved session

    midnam-custom-device-mode is "MIDI"


`MidiTimeAxisView::model_changed' (gtk2_ardour/midi_time_axis.cc:415)
calls `custom_device_mode_changed' that contains

    set_gui_property(X_("midnam-custom-device-mode"), mode)

but `model_changed' is called before

    custom_device_mode_changed(gui_property(X_("midnam-custom-device-mode")

It means: `set_gui_property' is called before reading the session value
with `gui_property'.

Attached a patch with a possible solution.
TagsNo tags attached.

Activities

2015-02-24 10:03

 

midnum_custom_device_mode.patch (697 bytes)   
diff --git a/gtk2_ardour/midi_time_axis.cc b/gtk2_ardour/midi_time_axis.cc
index 6987680..9c9c339 100644
--- a/gtk2_ardour/midi_time_axis.cc
+++ b/gtk2_ardour/midi_time_axis.cc
@@ -340,8 +340,9 @@ MidiTimeAxisView::set_route (boost::shared_ptr<Route> rt)
 		_midi_controls_box.pack_start (_midnam_custom_device_mode_selector, false, false, 2);
 	} 
 
+	const string midnum_custom_device_mode = gui_property(X_("midnam-custom-device-mode"));
 	model_changed(gui_property(X_("midnam-model-name")));
-	custom_device_mode_changed(gui_property(X_("midnam-custom-device-mode")));
+	custom_device_mode_changed(midnum_custom_device_mode);
 
 	controls_vbox.pack_start(_midi_controls_box, false, false);
 

2015-02-24 12:00

 

midnum_custom_device_mode2.patch (1,193 bytes)   
diff --git a/gtk2_ardour/midi_time_axis.cc b/gtk2_ardour/midi_time_axis.cc
index 6987680..8527bea 100644
--- a/gtk2_ardour/midi_time_axis.cc
+++ b/gtk2_ardour/midi_time_axis.cc
@@ -330,18 +330,22 @@ MidiTimeAxisView::set_route (boost::shared_ptr<Route> rt)
 	
 	_midi_controls_box.pack_start (_channel_status_box, false, false, 10);
 
+	const string midnum_custom_device_mode = gui_property(X_("midnam-custom-device-mode"));
+
 	if (!patch_manager.all_models().empty()) {
 
 		_midnam_model_selector.show ();
 		_midi_controls_box.pack_start (_midnam_model_selector, false, false, 2);
 
-		_midnam_custom_device_mode_selector.show ();
-
-		_midi_controls_box.pack_start (_midnam_custom_device_mode_selector, false, false, 2);
-	} 
+		if (midnum_custom_device_mode != "") {
+			_midnam_custom_device_mode_selector.show ();
+			_midi_controls_box.pack_start (_midnam_custom_device_mode_selector,
+						       false, false, 2);
+		}
+	}
 
 	model_changed(gui_property(X_("midnam-model-name")));
-	custom_device_mode_changed(gui_property(X_("midnam-custom-device-mode")));
+	custom_device_mode_changed(midnum_custom_device_mode);
 
 	controls_vbox.pack_start(_midi_controls_box, false, false);
 

tlat

2015-02-24 14:02

reporter   ~0016370

sorry, the second patch introduces a bug

tlat

2015-02-25 08:45

reporter   ~0016373

The "aesthetic problem" (startup with a horizontal line instead of a
hidden selector when custom-device-mode is "") is probably a bug of
the gui library (at least my lib version). I have tried to hide the
selector in different simple ways but without success. A solution is
to use "Default" instead of "" for custom-device-mode. It also
simplifies the code in `model_changed', by removing the branching to
show/hide `_midnam_custom_device_mode_selector'.

Regardless, the first patch should fix the reported bug.

x42

2020-04-15 01:57

administrator   ~0021351

Fixed in 6.0-pre1-170-g3cd2ad85af

system

2020-04-19 20:17

developer   ~0023407

Issue has been closed automatically, by Trigger Close Plugin.
Feel free to re-open with additional information if you think the issue is not resolved.

Issue History

Date Modified Username Field Change
2015-02-24 10:03 tlat New Issue
2015-02-24 10:03 tlat File Added: midnum_custom_device_mode.patch
2015-02-24 12:00 tlat File Added: midnum_custom_device_mode2.patch
2015-02-24 14:02 tlat Note Added: 0016370
2015-02-25 08:45 tlat Note Added: 0016373
2020-04-15 01:57 x42 Assigned To => x42
2020-04-15 01:57 x42 Status new => resolved
2020-04-15 01:57 x42 Resolution open => fixed
2020-04-15 01:57 x42 Note Added: 0021351
2020-04-19 20:17 system Note Added: 0023407
2020-04-19 20:17 system Status resolved => closed