diff options
author | Joerg Mueller <nexyon@gmail.com> | 2011-04-11 02:40:37 +0400 |
---|---|---|
committer | Joerg Mueller <nexyon@gmail.com> | 2011-04-11 02:40:37 +0400 |
commit | e37dc17991668d696497b5af70ad8133db71b107 (patch) | |
tree | cb80a2968f4141426b72c68dc1b1220ac26de7ee /source | |
parent | 2afae38019d9031f683f52046c23bd5ae896685b (diff) |
Fix for [#26652] "Audio Muted" in Time Line Editor is not working
-> The feature was completely missing o_O
Also fixed an ffmpeg seeking bug.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/BKE_sound.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/sound.c | 8 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 20 |
3 files changed, 28 insertions, 2 deletions
diff --git a/source/blender/blenkernel/BKE_sound.h b/source/blender/blenkernel/BKE_sound.h index acd4718a65a..04597fd666e 100644 --- a/source/blender/blenkernel/BKE_sound.h +++ b/source/blender/blenkernel/BKE_sound.h @@ -78,6 +78,8 @@ void sound_create_scene(struct Scene *scene); void sound_destroy_scene(struct Scene *scene); +void sound_mute_scene(struct Scene *scene, int muted); + void* sound_scene_add_scene_sound(struct Scene *scene, struct Sequence* sequence, int startframe, int endframe, int frameskip); void* sound_add_scene_sound(struct Scene *scene, struct Sequence* sequence, int startframe, int endframe, int frameskip); diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 52e1faaabee..e0e456a371e 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -347,7 +347,7 @@ AUD_Device* sound_mixdown(struct Scene *scene, AUD_DeviceSpecs specs, int start, void sound_create_scene(struct Scene *scene) { - scene->sound_scene = AUD_createSequencer(scene, (AUD_volumeFunction)&sound_get_volume); + scene->sound_scene = AUD_createSequencer(scene->audio.flag & AUDIO_MUTE, scene, (AUD_volumeFunction)&sound_get_volume); } void sound_destroy_scene(struct Scene *scene) @@ -358,6 +358,12 @@ void sound_destroy_scene(struct Scene *scene) AUD_destroySequencer(scene->sound_scene); } +void sound_mute_scene(struct Scene *scene, int muted) +{ + if(scene->sound_scene) + AUD_setSequencerMuted(scene->sound_scene, muted); +} + void* sound_scene_add_scene_sound(struct Scene *scene, struct Sequence* sequence, int startframe, int endframe, int frameskip) { if(scene != sequence->scene) diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 331d9cfa957..35177daeb9b 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -912,6 +912,24 @@ static void rna_Scene_simplify_update(Main *bmain, Scene *scene, PointerRNA *ptr rna_Scene_use_simplify_update(bmain, scene, ptr); } +static int rna_Scene_use_audio_get(PointerRNA *ptr) +{ + Scene *scene= (Scene*)ptr->data; + return scene->audio.flag & AUDIO_MUTE; +} + +static void rna_Scene_use_audio_set(PointerRNA *ptr, int value) +{ + Scene *scene= (Scene*)ptr->data; + + if(value) + scene->audio.flag |= AUDIO_MUTE; + else + scene->audio.flag &= ~AUDIO_MUTE; + + sound_mute_scene(scene, value); +} + static int rna_Scene_sync_mode_get(PointerRNA *ptr) { Scene *scene= (Scene*)ptr->data; @@ -3350,7 +3368,7 @@ void RNA_def_scene(BlenderRNA *brna) /* Audio Settings */ prop= RNA_def_property(srna, "use_audio", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "audio.flag", AUDIO_MUTE); + RNA_def_property_boolean_funcs(prop, "rna_Scene_use_audio_get", "rna_Scene_use_audio_set"); RNA_def_property_ui_text(prop, "Audio Muted", "Play back of audio from Sequence Editor will be muted"); RNA_def_property_update(prop, NC_SCENE, NULL); |