View Issue Details

IDProjectCategoryView StatusLast Update
0003319ardourotherpublic2020-04-19 20:14
Reporterlincoln Assigned Tocth103  
PrioritynormalSeveritytweakReproducibilityN/A
Status closedResolutionfixed 
Target Version3.0-beta1 
Summary0003319: [PATCH] Range and Rec Box visual tweaks
DescriptionI am attaching a patch that makes the range selection box not display trim handles but makes the box trimable along all the edge.

The patch also cleans up the record box rendering.
TagsNo tags attached.

Activities

2010-07-15 23:21

 

range-recbox-visual-tweaks.patch (8,520 bytes)   
Index: gtk2_ardour/streamview.cc
===================================================================
--- gtk2_ardour/streamview.cc	(revision 7422)
+++ gtk2_ardour/streamview.cc	(working copy)
@@ -568,7 +568,7 @@
 	}
 
 	for (vector<RecBoxInfo>::iterator i = rec_rects.begin(); i != rec_rects.end(); ++i) {
-		i->rectangle->property_y2() = height - 1.0;
+		i->rectangle->property_y2() = height;
 	}
 }

Index: gtk2_ardour/audio_streamview.cc
===================================================================
--- gtk2_ardour/audio_streamview.cc	(revision 7422)
+++ gtk2_ardour/audio_streamview.cc	(working copy)
@@ -121,7 +121,10 @@
 		if (recording) {
 			region_view = new AudioRegionView (_canvas_group, _trackview, region,
 					_samples_per_unit, region_color, recording, TimeAxisViewItem::Visibility(
-							TimeAxisViewItem::ShowFrame | TimeAxisViewItem::HideFrameRight));
+							TimeAxisViewItem::ShowFrame | 
+							TimeAxisViewItem::HideFrameRight |
+							TimeAxisViewItem::HideFrameLeft |
+							TimeAxisViewItem::HideFrameTB));
 		} else {
 			region_view = new AudioRegionView (_canvas_group, _trackview, region,
 					_samples_per_unit, region_color);
@@ -160,6 +163,7 @@
 AudioStreamView::add_region_view_internal (boost::shared_ptr<Region> r, bool wait_for_waves, bool recording)
 {
 	RegionView *region_view = create_region_view (r, wait_for_waves, recording);
+	
 	if (region_view == 0) {
 		return 0;
 	}
@@ -486,7 +490,7 @@
 				assert(region);
 				region->block_property_changes ();
 				region->set_position (_trackview.session()->transport_frame(), this);
-				rec_regions.push_back (make_pair(region, (RegionView*)0));
+				rec_regions.push_back (make_pair(region, (RegionView*) 0));
 			}
 
 			/* start a new rec box */
@@ -521,8 +525,8 @@
 			rec_rect->property_y1() = 1.0;
 			rec_rect->property_x2() = xend;
 			rec_rect->property_y2() = child_height ();
+			rec_rect->property_outline_what() = 0x0; //0x1 | 0x2 | 0x4 | 0x8;
 			rec_rect->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_TimeAxisFrame.get();
-			rec_rect->property_outline_what() = 0x1 | 0x2 | 0x4 | 0x8;
 			rec_rect->property_fill_color_rgba() = fill_color;
 			rec_rect->lower_to_bottom();
 
@@ -640,6 +644,7 @@
 			}
 
 			boost::shared_ptr<AudioRegion> region = boost::dynamic_pointer_cast<AudioRegion>(iter->first);
+			
 			if (!region) {
 				iter = tmp;
 				continue;
Index: gtk2_ardour/time_axis_view_item.cc
===================================================================
--- gtk2_ardour/time_axis_view_item.cc	(revision 7422)
+++ gtk2_ardour/time_axis_view_item.cc	(working copy)
@@ -131,8 +131,7 @@
 
 void
 TimeAxisViewItem::init (
-	const string& it_name, double spu, Gdk::Color const & base_color, nframes64_t start, nframes64_t duration, Visibility vis, bool wide, bool high
-	)
+	const string& it_name, double spu, Gdk::Color const & base_color, nframes64_t start, nframes64_t duration, Visibility vis, bool wide, bool high)
 {
 	item_name = it_name;
 	samples_per_unit = spu;
@@ -164,38 +163,31 @@
 
 	if (visibility & ShowFrame) {
 		frame = new ArdourCanvas::SimpleRect (*group, 0.0, 1.0, trackview.editor().frame_to_pixel(duration), trackview.current_height());
+		
 		frame->property_outline_pixels() = 1;
 		frame->property_outline_what() = 0xF;
-		frame->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_TimeAxisFrame.get();
-
-		/* by default draw all 4 edges */
-
-		uint32_t outline_what = 0x1|0x2|0x4|0x8;
-
-		if (visibility & HideFrameLeft) {
-			outline_what &= ~(0x1);
+		
+		if(_recregion){
+			frame->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_RecordingRect.get();
 		}
-
-		if (visibility & HideFrameRight) {
-			outline_what &= ~(0x2);
+		else {
+			frame->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_TimeAxisFrame.get();
 		}
+		
+		frame->property_outline_what() = 0x1|0x2|0x4|0x8;
 
-		if (visibility & HideFrameTB) {
-			outline_what &= ~(0x4 | 0x8);
-		}
-
-		frame->property_outline_what() = outline_what;
-
 	} else {
 		frame = 0;
 	}
 
 	if (visibility & ShowNameHighlight) {
+		
 		if (visibility & FullWidthNameHighlight) {
 			name_highlight = new ArdourCanvas::SimpleRect (*group, 0.0, trackview.editor().frame_to_pixel(item_duration), trackview.current_height() - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE, trackview.current_height() - 1);
 		} else {
 			name_highlight = new ArdourCanvas::SimpleRect (*group, 1.0, trackview.editor().frame_to_pixel(item_duration) - 1, trackview.current_height() - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE, trackview.current_height() - 1);
 		}
+		
 		name_highlight->set_data ("timeaxisviewitem", this);
 
 	} else {
Index: gtk2_ardour/time_axis_view.cc
===================================================================
--- gtk2_ardour/time_axis_view.cc	(revision 7422)
+++ gtk2_ardour/time_axis_view.cc	(working copy)
@@ -379,19 +379,53 @@
 void
 TimeAxisView::step_height (bool bigger)
 {
-	static const uint32_t step = 20;
+	static const uint32_t step = 25;
 
 	if (bigger) {
-		set_height (height + step);
+		if (height == preset_height(HeightSmall)) {
+			set_height (preset_height(HeightSmaller));
+		} 
+		else if (height == preset_height(HeightSmaller)) {
+			set_height (preset_height(HeightNormal));
+		} 
+		else {
+			set_height (height + step);
+		}
+
 	} else {
-		if (height > step) {
-			set_height (std::max (height - step, preset_height (HeightSmall)));
-		} else if (height != preset_height (HeightSmall)) {
-			set_height (HeightSmall);
+		if ( height == preset_height(HeightSmall)){
+			return;
 		}
+		if (height == preset_height (HeightSmaller)) {
+			set_height (preset_height(HeightSmall));
+		}
+		else if (height > step) {	
+			
+			if ( height <= preset_height (HeightNormal) && height > preset_height (HeightSmaller)){
+				set_height (preset_height(HeightSmaller));
+			}
+			else {
+				set_height (height - step);
+			}
+		} 
 	}
 }
-
+/*
+	switch (h) {
+	case HeightLargest:
+		return extra_height + 48 + 250;
+	case HeightLarger:
+		return extra_height + 48 + 150;
+	case HeightLarge:
+		return extra_height + 48 + 50;
+	case HeightNormal:
+		return extra_height + 48;
+	case HeightSmall:
+		return 27;
+	case HeightSmaller:
+		return smaller_height;
+	}
+*/
 void
 TimeAxisView::set_heights (uint32_t h)
 {
@@ -714,12 +748,12 @@
 			rect->start_trim->property_x1() = x1;
 			rect->start_trim->property_y1() = 1.0;
 			rect->start_trim->property_x2() = x1 + trim_handle_size;
-			rect->start_trim->property_y2() = 1.0 + trim_handle_size;
+			rect->start_trim->property_y2() = y2;
 
 			rect->end_trim->property_x1() = x2 - trim_handle_size;
 			rect->end_trim->property_y1() = 1.0;
 			rect->end_trim->property_x2() = x2;
-			rect->end_trim->property_y2() = 1.0 + trim_handle_size;
+			rect->end_trim->property_y2() = y2;
 
 			rect->start_trim->show();
 			rect->end_trim->show();
@@ -815,24 +849,22 @@
 		rect = new SelectionRect;
 
 		rect->rect = new SimpleRect (*selection_group);
+		rect->rect->property_outline_what() = 0x0;
 		rect->rect->property_x1() = 0.0;
 		rect->rect->property_y1() = 0.0;
 		rect->rect->property_x2() = 0.0;
 		rect->rect->property_y2() = 0.0;
 		rect->rect->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_SelectionRect.get();
-		rect->rect->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_Selection.get();
 
 		rect->start_trim = new SimpleRect (*selection_group);
+		rect->start_trim->property_outline_what() = 0x0;
 		rect->start_trim->property_x1() = 0.0;
 		rect->start_trim->property_x2() = 0.0;
-		rect->start_trim->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_Selection.get();
-		rect->start_trim->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_Selection.get();
-
+		
 		rect->end_trim = new SimpleRect (*selection_group);
+		rect->end_trim->property_outline_what() = 0x0;
 		rect->end_trim->property_x1() = 0.0;
 		rect->end_trim->property_x2() = 0.0;
-		rect->end_trim->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_Selection.get();
-		rect->end_trim->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_Selection.get();
 
 		free_selection_rects.push_front (rect);
 
@@ -1034,7 +1066,7 @@
 	const int border_width = 2;
 	extra_height = (2 * border_width)
 		//+ 2   // 2 pixels for the hseparator between TimeAxisView control areas
-		+ 10; // resizer button (3 x 2 pixel elements + 2 x 2 pixel gaps)
+		+ 6; // resizer button (3 x 2 pixel elements + 2 x 2 pixel gaps)
 
 	window.add (one_row_table);
 

2010-07-15 23:21

 

ardour-range-box.png (204,968 bytes)   
ardour-range-box.png (204,968 bytes)   

2010-07-15 23:22

 

ardour-rec-box.png (205,717 bytes)   
ardour-rec-box.png (205,717 bytes)   

cth103

2010-07-16 20:03

administrator   ~0008451

Applied to SVN@7431. Thanks!

system

2020-04-19 20:14

developer   ~0022159

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
2010-07-15 23:21 lincoln New Issue
2010-07-15 23:21 lincoln File Added: range-recbox-visual-tweaks.patch
2010-07-15 23:21 lincoln File Added: ardour-range-box.png
2010-07-15 23:22 lincoln File Added: ardour-rec-box.png
2010-07-16 10:07 cth103 cost => 0.00
2010-07-16 10:07 cth103 Target Version => 3.0-beta1
2010-07-16 10:07 cth103 Summary Range and Rec Box visual tweaks => [PATCH] Range and Rec Box visual tweaks
2010-07-16 20:03 cth103 Note Added: 0008451
2010-07-16 20:03 cth103 Status new => resolved
2010-07-16 20:03 cth103 Resolution open => fixed
2010-07-16 20:03 cth103 Assigned To => cth103
2020-04-19 20:14 system Note Added: 0022159
2020-04-19 20:14 system Status resolved => closed