Bring the note mode menu back from the dead.
authorDavid Robillard <d@drobilla.net>
Sun, 15 Feb 2009 21:19:01 +0000 (21:19 +0000)
committerDavid Robillard <d@drobilla.net>
Sun, 15 Feb 2009 21:19:01 +0000 (21:19 +0000)
Fix percussive note (diamonds) placement.

git-svn-id: svn://localhost/ardour2/branches/3.0@4587 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/canvas-note-event.h
gtk2_ardour/midi_region_view.cc
gtk2_ardour/midi_time_axis.cc
gtk2_ardour/route_time_axis.cc

index 060e4d9fa9627f5f8dea3d22b20e796476facf31..75747bc288d32e7577c664597b7a1b157e87093e 100644 (file)
@@ -92,8 +92,7 @@ public:
 
        const boost::shared_ptr<NoteType> note() const { return _note; }
        
-       inline static uint32_t meter_style_fill_color(uint8_t vel)
-       {
+       inline static uint32_t meter_style_fill_color(uint8_t vel) {
                if (vel < 64) {
                        return UINT_INTERPOLATE(
                                        ARDOUR_UI::config()->canvasvar_MidiNoteMeterColorBase.get(),
@@ -108,8 +107,7 @@ public:
        }
        
        /// calculate outline colors from fill colors of notes
-       inline static uint32_t calculate_outline(uint32_t color) 
-       {
+       inline static uint32_t calculate_outline(uint32_t color) {
                return UINT_INTERPOLATE(color, 0x000000ff, 0.5);
        }
        
index af3203ec9b2a71c723147debb123fb2a721daf7f..919d88eacb118eba950081c1cdf9e75149e3da33 100644 (file)
@@ -743,8 +743,8 @@ MidiRegionView::apply_note_range (uint8_t min, uint8_t max, bool force)
                                                note->property_y1() = y1;
                                                note->property_y2() = y2;
                                        } else if (CanvasHit* hit = dynamic_cast<CanvasHit*>(event)) {
-                                               double x = trackview.editor().frame_to_pixel((nframes64_t)
-                                                               event->note()->time() - _region->start());
+                                               double x = trackview.editor().frame_to_pixel(
+                                                               beats_to_frames(event->note()->time()) - _region->start());
                                                const double diamond_size = midi_stream_view()->note_height() / 2.0;
                                                double y = midi_stream_view()->note_to_y(event->note()->note()) 
                                                                 + ((diamond_size-2.0) / 4.0);
index 3376a9da9fa7709152729c2346f241f7f621d92c..7d78ae4365f60e93dd299afc885ed16d8301600c 100644 (file)
@@ -290,6 +290,8 @@ MidiTimeAxisView::append_extra_display_menu_items ()
                        MidiStreamView::ContentsRange)));
 
        items.push_back (MenuElem (_("Note range"), *range_menu));
+
+       items.push_back (MenuElem (_("Note mode"), *build_note_mode_menu()));
 }
 
 void
index f8b34bd459a5cbaa35661f9f5ff2dd4aee05b8e4..674fb2db71ebc82a156b02de7ce52f69bf1359e7 100644 (file)
@@ -550,14 +550,17 @@ RouteTimeAxisView::build_display_menu ()
 
                if (!Profile->get_sae()) {
                        items.push_back (MenuElem (_("Alignment"), *alignment_menu));
-                       get_diskstream()->AlignmentStyleChanged.connect (mem_fun(*this, &RouteTimeAxisView::align_style_changed));
+                       get_diskstream()->AlignmentStyleChanged.connect (
+                                       mem_fun(*this, &RouteTimeAxisView::align_style_changed));
                        
                        RadioMenuItem::Group mode_group;
-                       items.push_back (RadioMenuElem (mode_group, _("Normal mode"),
-                                                       bind (mem_fun (*this, &RouteTimeAxisView::set_track_mode), ARDOUR::Normal)));
+                       items.push_back (RadioMenuElem (mode_group, _("Normal mode"), bind (
+                                       mem_fun (*this, &RouteTimeAxisView::set_track_mode),
+                                       ARDOUR::Normal)));
                        normal_track_mode_item = dynamic_cast<RadioMenuItem*>(&items.back());
-                       items.push_back (RadioMenuElem (mode_group, _("Tape mode"),
-                                                       bind (mem_fun (*this, &RouteTimeAxisView::set_track_mode), ARDOUR::Destructive)));
+                       items.push_back (RadioMenuElem (mode_group, _("Tape mode"), bind (
+                                       mem_fun (*this, &RouteTimeAxisView::set_track_mode),
+                                       ARDOUR::Destructive)));
                        destructive_track_mode_item = dynamic_cast<RadioMenuItem*>(&items.back());
                        
                        switch (track()->mode()) {
@@ -568,6 +571,7 @@ RouteTimeAxisView::build_display_menu ()
                                normal_track_mode_item->set_active ();
                                break;
                        }
+               }
 
                get_diskstream()->AlignmentStyleChanged.connect (
                                mem_fun(*this, &RouteTimeAxisView::align_style_changed));
@@ -581,7 +585,6 @@ RouteTimeAxisView::build_display_menu ()
                        items.push_back (MenuElem (_("Color Mode"), *color_mode_menu));
                        
                items.push_back (SeparatorElem());
-               }
        }
 
        items.push_back (CheckMenuElem (_("Active"), mem_fun(*this, &RouteUI::toggle_route_active)));