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:
Diffstat (limited to 'source/blender/makesrna/intern/rna_sequencer.c')
-rw-r--r--source/blender/makesrna/intern/rna_sequencer.c178
1 files changed, 153 insertions, 25 deletions
diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c
index 4171189d928..627c2274965 100644
--- a/source/blender/makesrna/intern/rna_sequencer.c
+++ b/source/blender/makesrna/intern/rna_sequencer.c
@@ -43,6 +43,7 @@
#include "BKE_animsys.h"
#include "BKE_global.h"
#include "BKE_sequencer.h"
+#include "BKE_sound.h"
#include "MEM_guardedalloc.h"
@@ -51,16 +52,6 @@
#ifdef RNA_RUNTIME
-static float to_dB(float x)
-{
- return logf(x * x + 1e-30f) * 4.34294480f;
-}
-
-static float from_dB(float x)
-{
- return expf(x * 0.11512925f);
-}
-
/* build a temp referene to the parent */
static void meta_tmp_ref(Sequence *seq_par, Sequence *seq)
{
@@ -245,6 +236,10 @@ static void rna_Sequence_use_proxy_set(PointerRNA *ptr, int value)
seq->flag |= SEQ_USE_PROXY;
if(seq->strip->proxy == NULL) {
seq->strip->proxy = MEM_callocN(sizeof(struct StripProxy), "StripProxy");
+ seq->strip->proxy->quality = 90;
+ seq->strip->proxy->build_tc_flags = SEQ_PROXY_TC_ALL;
+ seq->strip->proxy->build_size_flags
+ = SEQ_PROXY_IMAGE_SIZE_25;
}
} else {
seq->flag ^= SEQ_USE_PROXY;
@@ -511,18 +506,31 @@ static int rna_Sequence_proxy_filepath_length(PointerRNA *ptr)
return strlen(path)+1;
}
-static float rna_Sequence_attenuation_get(PointerRNA *ptr)
+static void rna_Sequence_volume_set(PointerRNA *ptr, float value)
+{
+ Sequence *seq= (Sequence*)(ptr->data);
+
+ seq->volume = value;
+ if(seq->scene_sound)
+ sound_set_scene_sound_volume(seq->scene_sound, value, (seq->flag & SEQ_AUDIO_VOLUME_ANIMATED) != 0);
+}
+
+static void rna_Sequence_pitch_set(PointerRNA *ptr, float value)
{
Sequence *seq= (Sequence*)(ptr->data);
- return to_dB(seq->volume);
+ seq->pitch = value;
+ if(seq->scene_sound)
+ sound_set_scene_sound_pitch(seq->scene_sound, value, (seq->flag & SEQ_AUDIO_PITCH_ANIMATED) != 0);
}
-static void rna_Sequence_attenuation_set(PointerRNA *ptr, float value)
+static void rna_Sequence_pan_set(PointerRNA *ptr, float value)
{
Sequence *seq= (Sequence*)(ptr->data);
- seq->volume = from_dB(value);
+ seq->pan = value;
+ if(seq->scene_sound)
+ sound_set_scene_sound_pan(seq->scene_sound, value, (seq->flag & SEQ_AUDIO_PAN_ANIMATED) != 0);
}
@@ -556,9 +564,6 @@ static void rna_Sequence_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *p
Editing *ed= seq_give_editing(scene, FALSE);
free_imbuf_seq(scene, &ed->seqbase, FALSE, TRUE);
-
- if(RNA_struct_is_a(ptr->type, &RNA_SoundSequence))
- seq_update_sound(scene, ptr->data);
}
static void rna_Sequence_update_reopen_files(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
@@ -568,14 +573,14 @@ static void rna_Sequence_update_reopen_files(Main *UNUSED(bmain), Scene *scene,
free_imbuf_seq(scene, &ed->seqbase, FALSE, FALSE);
if(RNA_struct_is_a(ptr->type, &RNA_SoundSequence))
- seq_update_sound(scene, ptr->data);
+ seq_update_sound_bounds(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(scene, ed);
+ seq_update_muting(ed);
rna_Sequence_update(bmain, scene, ptr);
}
@@ -587,6 +592,34 @@ static void rna_Sequence_filepath_update(Main *bmain, Scene *scene, PointerRNA *
rna_Sequence_update(bmain, scene, ptr);
}
+static int seqproxy_seq_cmp_cb(Sequence *seq, void *arg_pt)
+{
+ struct { Sequence *seq; void *seq_proxy; } *data= arg_pt;
+
+ if(seq->strip && seq->strip->proxy == data->seq_proxy) {
+ data->seq= seq;
+ return -1; /* done so bail out */
+ }
+ return 1;
+}
+
+static void rna_Sequence_tcindex_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+ Editing *ed= seq_give_editing(scene, FALSE);
+ Sequence *seq;
+
+ struct { Sequence *seq; void *seq_proxy; } data;
+
+ data.seq= NULL;
+ data.seq_proxy = ptr->data;
+
+ seqbase_recursive_apply(&ed->seqbase, seqproxy_seq_cmp_cb, &data);
+ seq= data.seq;
+
+ reload_sequence_new_file(scene, seq, FALSE);
+ rna_Sequence_frame_change_update(scene, seq);
+}
+
/* do_versions? */
static float rna_Sequence_opacity_get(PointerRNA *ptr)
{
@@ -680,6 +713,23 @@ static void rna_SequenceEditor_overlay_frame_set(PointerRNA *ptr, int value)
ed->over_ofs= value;
}
+
+static void rna_WipeSequence_angle_set(PointerRNA *ptr, float value)
+{
+ Sequence *seq= (Sequence *)(ptr->data);
+ value= RAD2DEGF(value);
+ CLAMP(value, -90.0f, 90.0f);
+ ((WipeVars *)seq->effectdata)->angle= value;
+}
+
+static float rna_WipeSequence_angle_get(PointerRNA *ptr)
+{
+ Sequence *seq= (Sequence *)(ptr->data);
+
+ return DEG2RADF(((WipeVars *)seq->effectdata)->angle);
+}
+
+
#else
static void rna_def_strip_element(BlenderRNA *brna)
@@ -772,6 +822,19 @@ static void rna_def_strip_proxy(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
+
+ static const EnumPropertyItem seq_tc_items[]= {
+ {SEQ_PROXY_TC_NONE, "NONE", 0, "No TC in use", ""},
+ {SEQ_PROXY_TC_RECORD_RUN, "RECORD_RUN", 0, "Record Run",
+ "use images in the order as they are recorded"},
+ {SEQ_PROXY_TC_FREE_RUN, "FREE_RUN", 0, "Free Run",
+ "use global timestamp written by recording device"},
+ {SEQ_PROXY_TC_INTERP_REC_DATE_FREE_RUN, "FREE_RUN_REC_DATE",
+ 0, "Free Run (rec date)",
+ "interpolate a global timestamp using the "
+ "record date and time written by recording "
+ "device"},
+ {0, NULL, 0, NULL, NULL}};
srna = RNA_def_struct(brna, "SequenceProxy", NULL);
RNA_def_struct_ui_text(srna, "Sequence Proxy", "Proxy parameters for a sequence strip");
@@ -787,6 +850,46 @@ static void rna_def_strip_proxy(BlenderRNA *brna)
RNA_def_property_string_funcs(prop, "rna_Sequence_proxy_filepath_get", "rna_Sequence_proxy_filepath_length", "rna_Sequence_proxy_filepath_set");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
+
+ prop= RNA_def_property(srna, "build_25", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "build_size_flags", SEQ_PROXY_IMAGE_SIZE_25);
+ RNA_def_property_ui_text(prop, "25%", "Build 25% proxy resolution");
+
+ prop= RNA_def_property(srna, "build_50", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "build_size_flags", SEQ_PROXY_IMAGE_SIZE_50);
+ RNA_def_property_ui_text(prop, "50%", "Build 50% proxy resolution");
+
+ prop= RNA_def_property(srna, "build_75", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "build_size_flags", SEQ_PROXY_IMAGE_SIZE_75);
+ RNA_def_property_ui_text(prop, "75%", "Build 75% proxy resolution");
+
+ prop= RNA_def_property(srna, "build_100", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "build_size_flags", SEQ_PROXY_IMAGE_SIZE_100);
+ RNA_def_property_ui_text(prop, "100%", "Build 100% proxy resolution");
+
+ prop= RNA_def_property(srna, "build_record_run", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "build_tc_flags", SEQ_PROXY_TC_RECORD_RUN);
+ RNA_def_property_ui_text(prop, "Rec Run", "Build record run time code index");
+
+ prop= RNA_def_property(srna, "build_free_run", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "build_tc_flags", SEQ_PROXY_TC_FREE_RUN);
+ RNA_def_property_ui_text(prop, "Free Run", "Build free run time code index");
+
+ prop= RNA_def_property(srna, "build_free_run_rec_date", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "build_tc_flags", SEQ_PROXY_TC_INTERP_REC_DATE_FREE_RUN);
+ RNA_def_property_ui_text(prop, "Free Run (Rec Date)", "Build free run time code index using Record Date/Time");
+
+ prop= RNA_def_property(srna, "quality", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_int_sdna(prop, NULL, "quality");
+ RNA_def_property_ui_text(prop, "Quality", "JPEG Quality of proxies to build");
+ RNA_def_property_ui_range(prop, 1, 100, 1, 0);
+
+ prop= RNA_def_property(srna, "timecode", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "tc");
+ RNA_def_property_enum_items(prop, seq_tc_items);
+ RNA_def_property_ui_text(prop, "Timecode", "");
+ RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_tcindex_update");
+
}
static void rna_def_strip_color_balance(BlenderRNA *brna)
@@ -931,6 +1034,11 @@ static void rna_def_sequence(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Lock", "Lock strip so that it can't be transformed");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
+ prop= RNA_def_property(srna, "waveform", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_AUDIO_DRAW_WAVEFORM);
+ RNA_def_property_ui_text(prop, "Draw Waveform", "Whether to draw the sound's waveform.");
+ RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
+
/* strip positioning */
prop= RNA_def_property(srna, "frame_final_duration", PROP_INT, PROP_TIME);
@@ -1191,7 +1299,7 @@ static void rna_def_proxy(StructRNA *srna)
prop= RNA_def_property(srna, "use_proxy", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_PROXY);
- RNA_def_property_ui_text(prop, "Use Proxy", "Use a preview proxy for this strip");
+ RNA_def_property_ui_text(prop, "Use Proxy / Timecode", "Use a preview proxy and/or timecode index for this strip");
RNA_def_property_boolean_funcs(prop, NULL, "rna_Sequence_use_proxy_set");
prop= RNA_def_property(srna, "proxy", PROP_POINTER, PROP_NONE);
@@ -1313,6 +1421,12 @@ static void rna_def_movie(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "MPEG Preseek", "For MPEG movies, preseek this many frames");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
+ prop= RNA_def_property(srna, "streamindex", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "streamindex");
+ RNA_def_property_range(prop, 0, 20);
+ RNA_def_property_ui_text(prop, "Streamindex", "For files with several movie streams, use the stream with the given index");
+ RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update_reopen_files");
+
prop= RNA_def_property(srna, "elements", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "strip->stripdata", NULL);
RNA_def_property_struct_type(prop, "SequenceElement");
@@ -1348,13 +1462,21 @@ static void rna_def_sound(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "volume");
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Volume", "Playback volume of the sound");
+ RNA_def_property_float_funcs(prop, NULL, "rna_Sequence_volume_set", NULL);
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "attenuation", PROP_FLOAT, PROP_NONE);
- RNA_def_property_range(prop, -100.0f, +40.0f);
- RNA_def_property_ui_text(prop, "Attenuation/dB", "Attenuation in decibel");
- RNA_def_property_float_funcs(prop, "rna_Sequence_attenuation_get", "rna_Sequence_attenuation_set", NULL);
+ prop= RNA_def_property(srna, "pitch", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "pitch");
+ RNA_def_property_range(prop, 0.1f, 10.0f);
+ RNA_def_property_ui_text(prop, "Pitch", "Playback pitch of the sound");
+ RNA_def_property_float_funcs(prop, NULL, "rna_Sequence_pitch_set", NULL);
+ RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
+ 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_ui_text(prop, "Pan", "Playback panning of the sound (only for Mono sources)");
+ RNA_def_property_float_funcs(prop, NULL, "rna_Sequence_pan_set", NULL);
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
@@ -1460,10 +1582,16 @@ static void rna_def_wipe(BlenderRNA *brna)
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Blur Width", "Width of the blur edge, in percentage relative to the image size");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
-
+
+#if 1 /* expose as radians */
+ prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
+ RNA_def_property_float_funcs(prop, "rna_WipeSequence_angle_get", "rna_WipeSequence_angle_set", NULL);
+ RNA_def_property_range(prop, DEG2RAD(-90.0), DEG2RAD(90.0));
+#else
prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "angle");
RNA_def_property_range(prop, -90.0f, 90.0f);
+#endif
RNA_def_property_ui_text(prop, "Angle", "Edge angle");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");