diff options
author | Marcos Perez <pistolario> | 2022-05-19 21:58:55 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2022-05-19 22:05:23 +0300 |
commit | 89106a695afbba3d94b70645b4caaa22c2b58bc3 (patch) | |
tree | e9a57372a31e2a17c9b5ff2399d58b2c991b0909 /release/scripts/startup/bl_ui/space_sequencer.py | |
parent | 9e9895b055d490b0793bc7c5662f50abafce9a24 (diff) |
VSE: Display sound sample rate and channels
Display information about sound media in "Source" category in side panel
similar to movie resolution and framerate.
The specs are stored in the `Sequence` struct, and are extracted at
the moment of struct creation. If the "source file" is changed,
the specs change also.
Reviewed By: ISS
Differential Revision: https://developer.blender.org/D14565
Diffstat (limited to 'release/scripts/startup/bl_ui/space_sequencer.py')
-rw-r--r-- | release/scripts/startup/bl_ui/space_sequencer.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py index 94bad5459c9..3c10f393503 100644 --- a/release/scripts/startup/bl_ui/space_sequencer.py +++ b/release/scripts/startup/bl_ui/space_sequencer.py @@ -1642,6 +1642,24 @@ class SEQUENCER_PT_source(SequencerButtonsPanel, Panel): split.operator("sound.pack", icon='UGLYPACKAGE', text="") layout.prop(sound, "use_memory_cache") + + col = layout.box() + col = col.column(align=True) + split = col.split(factor=0.5, align=False) + split.alignment = 'RIGHT' + split.label(text="Samplerate") + split.alignment = 'LEFT' + if sound.samplerate <= 0: + split.label(text="Unknown") + else: + split.label(text="%d Hz." % sound.samplerate, translate=False) + + split = col.split(factor=0.5, align=False) + split.alignment = 'RIGHT' + split.label(text="Channels") + split.alignment = 'LEFT' + txt_channels = sound.bl_rna.properties["channels"].enum_items[sound.bl_rna.properties["channels"].enum_items.find(sound.channels)].name + split.label(text=txt_channels) else: if strip_type == 'IMAGE': col = layout.column() |