From 22d73333c62957ec9d3ecfb47849c4e2048e2e3f Mon Sep 17 00:00:00 2001 From: Hans Baier Date: Mon, 29 Dec 2008 01:02:41 +0000 Subject: [PATCH] * fixed missing track color mode persistence git-svn-id: svn://localhost/ardour2/branches/3.0@4357 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/midi_time_axis.cc | 11 ++++++++++- gtk2_ardour/midi_time_axis.h | 2 +- gtk2_ardour/route_time_axis.cc | 2 -- libs/ardour/enums.cc | 6 ++++++ 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/gtk2_ardour/midi_time_axis.cc b/gtk2_ardour/midi_time_axis.cc index 709f740bf0..0911b7198e 100644 --- a/gtk2_ardour/midi_time_axis.cc +++ b/gtk2_ardour/midi_time_axis.cc @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -181,6 +182,13 @@ MidiTimeAxisView::MidiTimeAxisView (PublicEditor& ed, Session& sess, boost::shar _channel_selector.mode_changed.connect( mem_fun(*midi_track()->midi_diskstream(), &MidiDiskstream::set_channel_mode)); + XMLProperty *prop; + if ((prop = xml_node->property ("color-mode")) != 0) { + _color_mode = ColorMode (string_2_enum(prop->value(), _color_mode)); + if (_color_mode == ChannelColors) { + _channel_selector.set_channel_colors(CanvasNoteEvent::midi_channel_colors); + } + } } MidiTimeAxisView::~MidiTimeAxisView () @@ -306,7 +314,7 @@ MidiTimeAxisView::build_automation_action_menu () } Gtk::Menu* -MidiTimeAxisView::build_mode_menu() +MidiTimeAxisView::build_note_mode_menu() { using namespace Menu_Helpers; @@ -377,6 +385,7 @@ MidiTimeAxisView::set_color_mode(ColorMode mode) } _color_mode = mode; + xml_node->add_property ("color-mode", enum_2_string(_color_mode)); _view->redisplay_diskstream(); } } diff --git a/gtk2_ardour/midi_time_axis.h b/gtk2_ardour/midi_time_axis.h index 54fe47a555..f535fd6322 100644 --- a/gtk2_ardour/midi_time_axis.h +++ b/gtk2_ardour/midi_time_axis.h @@ -94,7 +94,7 @@ class MidiTimeAxisView : public RouteTimeAxisView void append_extra_display_menu_items (); void build_automation_action_menu (); - Gtk::Menu* build_mode_menu(); + Gtk::Menu* build_note_mode_menu(); Gtk::Menu* build_color_mode_menu(); void set_note_mode (ARDOUR::NoteMode mode); diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc index 17ed5c9133..460213759a 100644 --- a/gtk2_ardour/route_time_axis.cc +++ b/gtk2_ardour/route_time_axis.cc @@ -575,8 +575,6 @@ RouteTimeAxisView::build_display_menu () if (mode_menu) items.push_back (MenuElem (_("Mode"), *mode_menu)); - items.push_back (SeparatorElem()); - color_mode_menu = build_color_mode_menu(); if (color_mode_menu) items.push_back (MenuElem (_("Color Mode"), *color_mode_menu)); diff --git a/libs/ardour/enums.cc b/libs/ardour/enums.cc index 350c6dba9a..0c307d0605 100644 --- a/libs/ardour/enums.cc +++ b/libs/ardour/enums.cc @@ -50,6 +50,7 @@ setup_enum_writer () TrackMode _TrackMode; NoteMode _NoteMode; ChannelMode _ChannelMode; + ColorMode _ColorMode; MeterFalloff _MeterFalloff; MeterHold _MeterHold; EditMode _EditMode; @@ -163,6 +164,11 @@ setup_enum_writer () REGISTER_ENUM (ForceChannel); REGISTER (_ChannelMode); + REGISTER_ENUM (MeterColors); + REGISTER_ENUM (ChannelColors); + REGISTER_ENUM (TrackColor); + REGISTER (_ColorMode); + REGISTER_ENUM (MeterFalloffOff); REGISTER_ENUM (MeterFalloffSlowest); REGISTER_ENUM (MeterFalloffSlow);