[Bf-blender-cvs] [633e93e] master: VSE sound strips: draw either the waveform or text label, not both.

Sybren A. Stüvel noreply at git.blender.org
Fri Aug 5 09:36:53 CEST 2016


Commit: 633e93e2709699c97cde0ba29fc5a421271d0f60
Author: Sybren A. Stüvel
Date:   Thu Aug 4 21:59:35 2016 +0200
Branches: master
https://developer.blender.org/rB633e93e2709699c97cde0ba29fc5a421271d0f60

VSE sound strips: draw either the waveform or text label, not both.

Drawing both text and the wave onto a sound strip makes both hard to read,
which is a concrete issue for Hjalti at the moment. This was the simplest
fix I could think of to give him control over what he sees.

===================================================================

M	source/blender/editors/space_sequencer/sequencer_draw.c

===================================================================

diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c
index adb7cf4..e1768e4 100644
--- a/source/blender/editors/space_sequencer/sequencer_draw.c
+++ b/source/blender/editors/space_sequencer/sequencer_draw.c
@@ -471,7 +471,7 @@ static void draw_seq_handle(View2D *v2d, Sequence *seq, const float handsize_cla
 }
 
 /* draw info text on a sequence strip */
-static void draw_seq_text(View2D *v2d, Sequence *seq, float x1, float x2, float y1, float y2, const unsigned char background_col[3])
+static void draw_seq_text(View2D *v2d, SpaceSeq *sseq, Sequence *seq, float x1, float x2, float y1, float y2, const unsigned char background_col[3])
 {
 	rctf rect;
 	char str[32 + FILE_MAX];
@@ -540,7 +540,12 @@ static void draw_seq_text(View2D *v2d, Sequence *seq, float x1, float x2, float
 		                       name, seq->len);
 	}
 	else if (seq->type == SEQ_TYPE_SOUND_RAM) {
-		if (seq->sound) {
+		/* If a waveform is drawn, we don't want to overlay it with text,
+		 * as it would make both hard to read. */
+		if ((sseq->flag & SEQ_ALL_WAVEFORMS) || (seq->flag & SEQ_AUDIO_DRAW_WAVEFORM)) {
+			str[0] = 0;
+			str_len = 0;
+		} else if (seq->sound) {
 			str_len = BLI_snprintf(str, sizeof(str), "%s: %s | %d",
 			                       name, seq->sound->name, seq->len);
 		}
@@ -870,7 +875,7 @@ static void draw_seq_strip(const bContext *C, SpaceSeq *sseq, Scene *scene, AReg
 
 	/* nice text here would require changing the view matrix for texture text */
 	if ((x2 - x1) / pixelx > 32) {
-		draw_seq_text(v2d, seq, x1, x2, y1, y2, background_col);
+		draw_seq_text(v2d, sseq, seq, x1, x2, y1, y2, background_col);
 	}
 }




More information about the Bf-blender-cvs mailing list