Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--release/scripts/startup/bl_ui/space_sequencer.py43
-rw-r--r--source/blender/makesrna/intern/rna_sequencer.c15
2 files changed, 45 insertions, 13 deletions
diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py
index 30115618f3d..be669b1fe86 100644
--- a/release/scripts/startup/bl_ui/space_sequencer.py
+++ b/release/scripts/startup/bl_ui/space_sequencer.py
@@ -1659,7 +1659,7 @@ class SEQUENCER_PT_adjust_sound(SequencerButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
- layout.use_property_split = True
+ layout.use_property_split = False
st = context.space_data
strip = context.active_sequence_strip
@@ -1667,20 +1667,39 @@ class SEQUENCER_PT_adjust_sound(SequencerButtonsPanel, Panel):
layout.active = not strip.mute
- col = layout.column()
-
- col.prop(strip, "volume", text="Volume")
- col.prop(strip, "pitch")
-
- col = layout.column()
- col.prop(strip, "pan")
- col.enabled = sound is not None and sound.use_mono
-
if sound is not None:
col = layout.column()
+
+ split = col.split(factor=0.4)
+ split.label(text="")
+ split.prop(sound, "use_mono")
if st.waveform_display_type == 'DEFAULT_WAVEFORMS':
- col.prop(strip, "show_waveform")
- col.prop(sound, "use_mono")
+ split = col.split(factor=0.4)
+ split.label(text="")
+ split.prop(strip, "show_waveform")
+
+ col = layout.column()
+
+ split = col.split(factor=0.4)
+ split.alignment = 'RIGHT'
+ split.label(text="Volume")
+ split.prop(strip, "volume", text="")
+
+ split = col.split(factor=0.4)
+ split.alignment = 'RIGHT'
+ split.label(text="Pitch")
+ split.prop(strip, "pitch", text="")
+
+ split = col.split(factor=0.4)
+ split.alignment = 'RIGHT'
+ split.label(text="Pan")
+ audio_channels = context.scene.render.ffmpeg.audio_channels
+ pan_text = ""
+ if audio_channels != 'MONO' and audio_channels != 'STEREO':
+ pan_text = "%.2f°" % (strip.pan * 90)
+ split.prop(strip, "pan", text=pan_text)
+ split.enabled = sound.use_mono and audio_channels != 'MONO'
+
class SEQUENCER_PT_adjust_comp(SequencerButtonsPanel, Panel):
diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c
index d9837f21833..cd87e4d10c1 100644
--- a/source/blender/makesrna/intern/rna_sequencer.c
+++ b/source/blender/makesrna/intern/rna_sequencer.c
@@ -845,6 +845,17 @@ static void rna_Sequence_audio_update(Main *UNUSED(bmain), Scene *scene, Pointer
DEG_id_tag_update(&scene->id, ID_RECALC_SEQUENCER_STRIPS);
}
+static void rna_Sequence_pan_range(
+ PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
+{
+ Scene *scene = (Scene *)ptr->owner_id;
+
+ *min = -FLT_MAX;
+ *max = FLT_MAX;
+ *softmax = 1 + (int)(scene->r.ffcodecdata.audio_channels > 2);
+ *softmin = -*softmax;
+}
+
static int rna_Sequence_input_count_get(PointerRNA *ptr)
{
Sequence *seq = (Sequence *)(ptr->data);
@@ -2559,8 +2570,10 @@ static void rna_def_sound(BlenderRNA *brna)
prop = RNA_def_property(srna, "pan", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "pan");
- RNA_def_property_range(prop, -2.0f, 2.0f);
+ RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
+ RNA_def_property_ui_range(prop, -2, 2, 1, 2);
RNA_def_property_ui_text(prop, "Pan", "Playback panning of the sound (only for Mono sources)");
+ RNA_def_property_float_funcs(prop, NULL, NULL, "rna_Sequence_pan_range");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_audio_update");
prop = RNA_def_property(srna, "show_waveform", PROP_BOOLEAN, PROP_NONE);