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:
authorJoerg Mueller <nexyon@gmail.com>2011-07-28 17:58:59 +0400
committerJoerg Mueller <nexyon@gmail.com>2011-07-28 17:58:59 +0400
commitbd6ca0570e089afc1d29b4f18b8bb6cc086545ea (patch)
tree30b512203aa9c5e73eb88fcb5e7a2afaf94770b9 /source/blender/makesrna/intern/rna_scene.c
parent90b64737f12f749b93e6a609b1b3680938ef6b85 (diff)
3D Audio GSoC:
Implemented basic audio animation. * AnimatableProperty: Propper cache writing and spline interpolation for reading (the solution for stair steps in audio animation) * Animatable properties so far are: volume, pitch, panning * Users note: Changing the pitch of a sound results in wrong seeking, due to the resulting playback length difference. * Users note: Panning only works for mono sources, values are in the range [-2..2], this basically controls the angle of the sound, 0 is front, -1 left, 1 right and 2 and -2 are back. Typical stereo panning only supports [-1..1]. * Disabled animation of audio related ffmpeg output parameters. * Scene Audio Panel: 3D Listener settings also for Renderer, new Volume property (animatable!), Update/Bake buttons for animation problems, moved sampling rate and channel count here
Diffstat (limited to 'source/blender/makesrna/intern/rna_scene.c')
-rw-r--r--source/blender/makesrna/intern/rna_scene.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 3a3a805f3ce..8f24048bc04 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -337,6 +337,15 @@ static void rna_Scene_fps_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *
sound_update_fps(scene);
}
+static void rna_Scene_volume_set(PointerRNA *ptr, float value)
+{
+ Scene *scene= (Scene*)(ptr->data);
+
+ scene->audio.volume = value;
+ if(scene->sound_scene)
+ sound_set_scene_volume(scene, value);
+}
+
static void rna_Scene_framelen_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr))
{
scene->r.framelen= (float)scene->r.framapto/(float)scene->r.images;
@@ -2469,30 +2478,35 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
/* FFMPEG Audio*/
prop= RNA_def_property(srna, "ffmpeg_audio_codec", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.audio_codec");
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_items(prop, ffmpeg_audio_codec_items);
RNA_def_property_ui_text(prop, "Audio Codec", "FFMpeg audio codec to use");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "ffmpeg_audio_bitrate", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.audio_bitrate");
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 32, 384);
RNA_def_property_ui_text(prop, "Bitrate", "Audio bitrate(kb/s)");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "ffmpeg_audio_mixrate", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.audio_mixrate");
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 8000, 192000);
RNA_def_property_ui_text(prop, "Samplerate", "Audio samplerate(samples/s)");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "ffmpeg_audio_volume", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ffcodecdata.audio_volume");
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Volume", "Audio volume");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "ffmpeg_audio_channels", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "ffcodecdata.audio_channels");
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_items(prop, audio_channel_items);
RNA_def_property_ui_text(prop, "Audio Channels", "Sets the audio channel count");
#endif
@@ -3464,6 +3478,13 @@ void RNA_def_scene(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Distance Model", "Distance model for distance attenuation calculation");
RNA_def_property_update(prop, NC_SCENE, NULL);
+ prop= RNA_def_property(srna, "audio_volume", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "audio.volume");
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Volume", "Audio volume");
+ RNA_def_property_update(prop, NC_SCENE, NULL);
+ RNA_def_property_float_funcs(prop, NULL, "rna_Scene_volume_set", NULL);
+
/* Game Settings */
prop= RNA_def_property(srna, "game_settings", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);