[Bf-blender-cvs] [bf99607] terrible_consequencer: Gooseberry request, option to turn all waveform display on/off.
Antony Riakiotakis
noreply at git.blender.org
Mon Sep 22 15:29:35 CEST 2014
Commit: bf996074bb65438970f471c93cc2b5b11b013466
Author: Antony Riakiotakis
Date: Mon Sep 22 15:29:22 2014 +0200
Branches: terrible_consequencer
https://developer.blender.org/rBbf996074bb65438970f471c93cc2b5b11b013466
Gooseberry request, option to turn all waveform display on/off.
===================================================================
M release/scripts/startup/bl_ui/space_sequencer.py
M source/blender/editors/space_sequencer/sequencer_draw.c
M source/blender/makesdna/DNA_space_types.h
M source/blender/makesrna/intern/rna_space.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py
index 98d23f9..6c4e0eb 100644
--- a/release/scripts/startup/bl_ui/space_sequencer.py
+++ b/release/scripts/startup/bl_ui/space_sequencer.py
@@ -716,6 +716,7 @@ class SEQUENCER_PT_sound(SequencerButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
+ st = context.space_data
strip = act_strip(context)
sound = strip.sound
@@ -734,7 +735,10 @@ class SEQUENCER_PT_sound(SequencerButtonsPanel, Panel):
row.prop(sound, "use_memory_cache")
- layout.prop(strip, "show_waveform")
+ layout.prop(st, "waveform_draw", text="")
+ if st.waveform_draw == 'DEFAULT_WAVEFORMS':
+ layout.prop(strip, "show_waveform")
+
layout.prop(strip, "volume")
layout.prop(strip, "pitch")
layout.prop(strip, "pan")
diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c
index 830e47b..5baacb1 100644
--- a/source/blender/editors/space_sequencer/sequencer_draw.c
+++ b/source/blender/editors/space_sequencer/sequencer_draw.c
@@ -175,14 +175,14 @@ static void get_seq_color3ubv(Scene *curscene, Sequence *seq, unsigned char col[
}
}
-static void drawseqwave(Scene *scene, Sequence *seq, float x1, float y1, float x2, float y2, float stepsize)
+static void drawseqwave(SpaceSeq *sseq, Scene *scene, Sequence *seq, float x1, float y1, float x2, float y2, float stepsize)
{
/*
* x1 is the starting x value to draw the wave,
* x2 the end x value, same for y1 and y2
* stepsize is width of a pixel.
*/
- if (seq->flag & SEQ_AUDIO_DRAW_WAVEFORM) {
+ if ((sseq->flag & SEQ_ALL_WAVEFORMS) || (seq->flag & SEQ_AUDIO_DRAW_WAVEFORM)) {
int i, j, pos;
int length = floor((x2 - x1) / stepsize) + 1;
float ymid = (y1 + y2) / 2;
@@ -807,7 +807,7 @@ static void draw_shaded_cuddly_strip(Sequence *seq, unsigned char col[3])
* ARegion is currently only used to get the windows width in pixels
* so wave file sample drawing precision is zoom adjusted
*/
-static void draw_seq_strip(Scene *scene, ARegion *ar, Sequence *seq, int outline_tint, float pixelx, float aspect)
+static void draw_seq_strip(SpaceSeq *sseq, Scene *scene, ARegion *ar, Sequence *seq, int outline_tint, float pixelx, float aspect)
{
View2D *v2d = &ar->v2d;
float x1, x2, y1, y2, xchild;
@@ -852,8 +852,8 @@ static void draw_seq_strip(Scene *scene, ARegion *ar, Sequence *seq, int outline
generate_strip_vertices(x1, y1, x2, y2, aspect);
/* draw sound wave */
- if (seq->type == SEQ_TYPE_SOUND_RAM) {
- drawseqwave(scene, seq, x1, y1, x2, y2, BLI_rctf_size_x(&ar->v2d.cur) / ar->winx);
+ if ((seq->type == SEQ_TYPE_SOUND_RAM) && !(sseq->flag & SEQ_NO_WAVEFORMS)) {
+ drawseqwave(sseq, scene, seq, x1, y1, x2, y2, BLI_rctf_size_x(&ar->v2d.cur) / ar->winx);
}
/* draw lock */
@@ -1516,6 +1516,7 @@ static void draw_seq_strips(const bContext *C, Editing *ed, ARegion *ar, float a
{
Scene *scene = CTX_data_scene(C);
View2D *v2d = &ar->v2d;
+ SpaceSeq *sseq = CTX_wm_space_seq(C);
Sequence *last_seq = BKE_sequencer_active_get(scene);
int sel = 0, j;
float pixelx = BLI_rctf_size_x(&v2d->cur) / BLI_rcti_size_x(&v2d->mask);
@@ -1538,7 +1539,7 @@ static void draw_seq_strips(const bContext *C, Editing *ed, ARegion *ar, float a
else if (seq->machine > v2d->cur.ymax) continue;
/* strip passed all tests unscathed... so draw it now */
- draw_seq_strip(scene, ar, seq, outline_tint, pixelx, aspect);
+ draw_seq_strip(sseq, scene, ar, seq, outline_tint, pixelx, aspect);
}
/* draw selected next time round */
@@ -1547,7 +1548,7 @@ static void draw_seq_strips(const bContext *C, Editing *ed, ARegion *ar, float a
/* draw the last selected last (i.e. 'active' in other parts of Blender), removes some overlapping error */
if (last_seq)
- draw_seq_strip(scene, ar, last_seq, 120, pixelx, aspect);
+ draw_seq_strip(sseq, scene, ar, last_seq, 120, pixelx, aspect);
glDisableClientState(GL_VERTEX_ARRAY);
}
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index e6e2df5..d78b28a 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -525,6 +525,8 @@ typedef enum eSpaceSeq_Flag {
SEQ_SHOW_GPENCIL = (1 << 4),
SEQ_NO_DRAW_CFRANUM = (1 << 5),
SEQ_USE_ALPHA = (1 << 6), /* use RGBA display mode for preview */
+ SEQ_ALL_WAVEFORMS = (1 << 7), /* draw all waveforms */
+ SEQ_NO_WAVEFORMS = (1 << 8), /* draw no waveforms */
} eSpaceSeq_Flag;
/* sseq->view */
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 764fbfc..68b4c6f 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -2508,6 +2508,16 @@ static void rna_def_space_sequencer(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}
};
+ static EnumPropertyItem waveform_draw_items[] = {
+ {SEQ_NO_WAVEFORMS, "NO_WAVEFORMS", 0, "Waveforms Off",
+ "No waveforms drawn for all sound strips"},
+ {SEQ_ALL_WAVEFORMS, "ALL_WAVEFORMS", 0, "Waveforms On",
+ "Waveforms drawn for all sound strips"},
+ {0, "DEFAULT_WAVEFORMS", 0, "Use Strip Option",
+ "Waveforms drawn according to strip setting"},
+ {0, NULL, 0, NULL, NULL}
+ };
+
srna = RNA_def_struct(brna, "SpaceSequenceEditor", "Space");
RNA_def_struct_sdna(srna, "SpaceSeq");
RNA_def_struct_ui_text(srna, "Space Sequence Editor", "Sequence editor space data");
@@ -2577,6 +2587,12 @@ static void rna_def_space_sequencer(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Draw Channels", "Channels of the preview to draw");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
+ prop = RNA_def_property(srna, "waveform_draw", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
+ RNA_def_property_enum_items(prop, waveform_draw_items);
+ RNA_def_property_ui_text(prop, "Waveform Drawing", "How Waveforms are drawn");
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
+
prop = RNA_def_property(srna, "draw_overexposed", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "zebra");
RNA_def_property_ui_text(prop, "Show Overexposed", "Show overexposed areas with zebra stripes");
More information about the Bf-blender-cvs
mailing list