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>2010-02-08 02:41:17 +0300
committerJoerg Mueller <nexyon@gmail.com>2010-02-08 02:41:17 +0300
commit9827a3e9eac70f68db6dc16d03016c51b7ece3f0 (patch)
tree8825b454008d3b97a64018884c179ea94874af44 /source/blender/makesrna
parent2f72b91a54faa7cfbdfd97eff608c8911df1d221 (diff)
2.5 Audio:
- recode of the whole sequencer audio handling - encode audio flag removed, instead you choose None as audio codec, added None for video codec too - ffmpeg formats/codecs: enabled: theora, ogg, vorbis; added: matroska, flac (not working, who can fix?), mp3, wav - sequencer wave drawing - volume animation (now also working when mixing down to a file!) - made sequencer strip position and length values unanimatable
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/intern/rna_scene.c33
-rw-r--r--source/blender/makesrna/intern/rna_sequencer.c24
2 files changed, 25 insertions, 32 deletions
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 11aff7922c7..452745ba364 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -107,6 +107,7 @@ EnumPropertyItem snap_element_items[] = {
#include "BKE_depsgraph.h"
#include "BKE_image.h"
#include "BKE_mesh.h"
+#include "BKE_sound.h"
#include "BLI_threads.h"
#include "BLI_editVert.h"
@@ -287,10 +288,11 @@ static void rna_Scene_preview_range_end_frame_set(PointerRNA *ptr, int value)
data->r.pefra= value;
}
-static void rna_Scene_frame_update(Main *bmain, Scene *unused, PointerRNA *ptr)
+static void rna_Scene_frame_update(bContext *C, PointerRNA *ptr)
{
//Scene *scene= ptr->id.data;
//ED_update_for_newframe(C);
+ sound_seek_scene(C);
}
static int rna_Scene_active_keying_set_editable(PointerRNA *ptr)
@@ -1675,12 +1677,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
#ifdef WITH_FFMPEG
{R_H264, "H264", ICON_FILE_MOVIE, "H.264", ""},
{R_XVID, "XVID", ICON_FILE_MOVIE, "Xvid", ""},
- // XXX broken
-#if 0
-#ifdef WITH_OGG
{R_THEORA, "THEORA", ICON_FILE_MOVIE, "Ogg Theora", ""},
-#endif
-#endif
{R_FFMPEG, "FFMPEG", ICON_FILE_MOVIE, "FFMpeg", ""},
#endif
{R_FRAMESERVER, "FRAMESERVER", ICON_FILE_SCRIPT, "Frame Server", ""},
@@ -1731,16 +1728,15 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
{FFMPEG_DV, "DV", 0, "DV", ""},
{FFMPEG_H264, "H264", 0, "H.264", ""},
{FFMPEG_XVID, "XVID", 0, "Xvid", ""},
- // XXX broken
-#if 0
-#ifdef WITH_OGG
{FFMPEG_OGG, "OGG", 0, "Ogg", ""},
-#endif
-#endif
+ {FFMPEG_MKV, "MKV", 0, "Matroska", ""},
{FFMPEG_FLV, "FLASH", 0, "Flash", ""},
+ {FFMPEG_WAV, "WAV", 0, "Wav", ""},
+ {FFMPEG_MP3, "MP3", 0, "Mp3", ""},
{0, NULL, 0, NULL, NULL}};
-
+
static EnumPropertyItem ffmpeg_codec_items[] = {
+ {CODEC_ID_NONE, "NONE", 0, "None", ""},
{CODEC_ID_MPEG1VIDEO, "MPEG1", 0, "MPEG-1", ""},
{CODEC_ID_MPEG2VIDEO, "MPEG2", 0, "MPEG-2", ""},
{CODEC_ID_MPEG4, "MPEG4", 0, "MPEG-4(divx)", ""},
@@ -1748,18 +1744,18 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
{CODEC_ID_DVVIDEO, "DV", 0, "DV", ""},
{CODEC_ID_H264, "H264", 0, "H.264", ""},
{CODEC_ID_XVID, "XVID", 0, "Xvid", ""},
-#ifdef WITH_OGG
{CODEC_ID_THEORA, "THEORA", 0, "Theora", ""},
-#endif
{CODEC_ID_FLV1, "FLASH", 0, "Flash Video", ""},
{0, NULL, 0, NULL, NULL}};
-
+
static EnumPropertyItem ffmpeg_audio_codec_items[] = {
+ {CODEC_ID_NONE, "NONE", 0, "None", ""},
{CODEC_ID_MP2, "MP2", 0, "MP2", ""},
{CODEC_ID_MP3, "MP3", 0, "MP3", ""},
{CODEC_ID_AC3, "AC3", 0, "AC3", ""},
{CODEC_ID_AAC, "AAC", 0, "AAC", ""},
{CODEC_ID_VORBIS, "VORBIS", 0, "Vorbis", ""},
+ {CODEC_ID_FLAC, "FLAC", 0, "FLAC", ""},
{CODEC_ID_PCM_S16LE, "PCM", 0, "PCM", ""},
{0, NULL, 0, NULL, NULL}};
#endif
@@ -1992,7 +1988,6 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
/* 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_enum_items(prop, ffmpeg_audio_codec_items);
@@ -2005,11 +2000,6 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
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_multiplex_audio", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "ffcodecdata.flags", FFMPEG_MULTIPLEX_AUDIO);
- RNA_def_property_ui_text(prop, "Multiplex Audio", "Interleave audio with the output video");
- 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_range(prop, 8000, 192000);
@@ -2636,6 +2626,7 @@ void RNA_def_scene(BlenderRNA *brna)
RNA_def_property_int_sdna(prop, NULL, "r.cfra");
RNA_def_property_range(prop, MINAFRAME, MAXFRAME);
RNA_def_property_ui_text(prop, "Current Frame", "");
+ RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
RNA_def_property_update(prop, NC_SCENE|ND_FRAME, "rna_Scene_frame_update");
prop= RNA_def_property(srna, "start_frame", PROP_INT, PROP_TIME);
diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c
index 7ffaa4d478b..00a156cf820 100644
--- a/source/blender/makesrna/intern/rna_sequencer.c
+++ b/source/blender/makesrna/intern/rna_sequencer.c
@@ -93,7 +93,7 @@ static void rna_Sequence_frame_change_update(Scene *scene, Sequence *seq)
{
Editing *ed= seq_give_editing(scene, FALSE);
ListBase *seqbase= seq_seqbase(&ed->seqbase, seq);
- calc_sequence_disp(seq);
+ calc_sequence_disp(scene, seq);
if(seq_test_overlap(seqbase, seq)) {
shuffle_seq(seqbase, seq, scene); // XXX - BROKEN!, uses context seqbasep
@@ -351,14 +351,14 @@ static void rna_Sequence_update(Main *bmain, Scene *scene, PointerRNA *ptr)
free_imbuf_seq(scene, &ed->seqbase, FALSE);
if(RNA_struct_is_a(ptr->type, &RNA_SoundSequence))
- seq_update_sound(ptr->data);
+ seq_update_sound(scene, ptr->data);
}
static void rna_Sequence_mute_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
Editing *ed= seq_give_editing(scene, FALSE);
- seq_update_muting(ed);
+ seq_update_muting(scene, ed);
rna_Sequence_update(bmain, scene, ptr);
}
@@ -606,24 +606,28 @@ static void rna_def_sequence(BlenderRNA *brna)
prop= RNA_def_property(srna, "length", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "len");
RNA_def_property_range(prop, 1, MAXFRAME);
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Length", "The length of the contents of this strip before the handles are applied");
RNA_def_property_int_funcs(prop, "rna_Sequence_length_get", "rna_Sequence_length_set",NULL);
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
prop= RNA_def_property(srna, "start_frame", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "start");
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Start Frame", "");
RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_start_frame_set",NULL); // overlap tests and calc_seq_disp
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
prop= RNA_def_property(srna, "start_frame_final", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "startdisp");
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Start Frame", "Start frame displayed in the sequence editor after offsets are applied, setting this is equivilent to moving the handle, not the actual start frame.");
RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_start_frame_final_set", NULL); // overlap tests and calc_seq_disp
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
prop= RNA_def_property(srna, "end_frame_final", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "enddisp");
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "End Frame", "End frame displayed in the sequence editor after offsets are applied.");
RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_end_frame_final_set", NULL); // overlap tests and calc_seq_disp
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
@@ -949,6 +953,12 @@ static void rna_def_sound(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Sound", "Sound datablock used by this sequence.");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
+ prop= RNA_def_property(srna, "volume", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "volume");
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Volume", "Playback volume of the sound");
+ RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
+
prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "strip->stripdata->name");
RNA_def_property_ui_text(prop, "Filename", "");
@@ -961,14 +971,6 @@ static void rna_def_sound(BlenderRNA *brna)
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
rna_def_input(srna);
-
- RNA_def_struct_sdna_from(srna, "SoundHandle", "sound_handle");
-
- prop= RNA_def_property(srna, "volume", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "volume");
- RNA_def_property_range(prop, 0.0f, 1.0f);
- RNA_def_property_ui_text(prop, "Volume", "Playback volume of the sound");
- RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
}
static void rna_def_effect(BlenderRNA *brna)