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
path: root/source
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2010-01-21 13:28:19 +0300
committerJoshua Leung <aligorith@gmail.com>2010-01-21 13:28:19 +0300
commit9d54d6ba4e78e83350742b40f9f14ffb5cb8d2f1 (patch)
tree15eb7cc73f097206d2250f09a013b1ad68b2a8e8 /source
parentda3abc78a24e572baa61a0b7eb24dc6b031958ae (diff)
Patch #20693: add parameters for FPS and wait timer for screen cast
This patch by Guillaume Lecocq (lguillaume) adds user preference settings for setting the playback frame-rate and delay between captured frames for the screencasting feature. -- I've made a few tweaks for a few minor issues - Made DNA vars for these settings shorts instead of ints, reducing the number of unnecessary extra pad vars - Added version patching to ensure that these settings are initialised by default - Made tooltips for the settings more descriptive
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/interface/resources.c4
-rw-r--r--source/blender/editors/screen/screendump.c6
-rw-r--r--source/blender/makesdna/DNA_userdef_types.h5
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c10
4 files changed, 22 insertions, 3 deletions
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c
index 67f3870461a..8fa925a9c54 100644
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@ -1373,6 +1373,10 @@ void init_userdef_do_versions(void)
if (U.anim_player_preset == 0) {
U.anim_player_preset =1 ;
}
+ if (U.scrcastfps == 0) {
+ U.scrcastfps = 10;
+ U.scrcastwait = 50;
+ }
/* funny name, but it is GE stuff, moves userdef stuff to engine */
// XXX space_set_commmandline_options();
diff --git a/source/blender/editors/screen/screendump.c b/source/blender/editors/screen/screendump.c
index 7fea28304ba..a756eff8c11 100644
--- a/source/blender/editors/screen/screendump.c
+++ b/source/blender/editors/screen/screendump.c
@@ -38,6 +38,7 @@
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
+#include "DNA_userdef_types.h"
#include "BKE_context.h"
#include "BKE_global.h"
@@ -226,7 +227,7 @@ static void screenshot_startjob(void *sjv, short *stop, short *do_update)
int cfra= 1;
/* we need this as local variables for renderdata */
- rd.frs_sec= 10;
+ rd.frs_sec= U.scrcastfps;
rd.frs_sec_base= 1.0f;
if(BKE_imtype_is_movie(rd.imtype)) {
@@ -279,9 +280,10 @@ static void screenshot_startjob(void *sjv, short *stop, short *do_update)
*do_update= 1;
cfra++;
+
}
else
- PIL_sleep_ms(50);
+ PIL_sleep_ms(U.scrcastwait);
}
if(mh)
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index fc7b41871d4..55eba879865 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -341,7 +341,10 @@ typedef struct UserDef {
short ndof_pan, ndof_rotate;
short curssize, ipo_new;
short color_picker_type;
- short pad2[3];
+ short pad2;
+
+ short scrcastfps; /* frame rate for screencast to be played back */
+ short scrcastwait; /* milliseconds between screencast snapshots */
char versemaster[160];
char verseuser[160];
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 4e3e6cb336d..22ab36d5b2a 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -2322,6 +2322,16 @@ static void rna_def_userdef_system(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Audio Channels", "Sets the audio channel count.");
RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
+ prop= RNA_def_property(srna, "screencast_fps", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "scrcastfps");
+ RNA_def_property_range(prop, 10, 50);
+ RNA_def_property_ui_text(prop, "FPS", "Frame rate for the screencast to be played back.");
+
+ prop= RNA_def_property(srna, "screencast_wait_time", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "scrcastwait");
+ RNA_def_property_range(prop, 50, 1000);
+ RNA_def_property_ui_text(prop, "Wait Timer (ms)", "Time in milliseconds between each frame recorded for screencast.");
+
#if 0
prop= RNA_def_property(srna, "verse_master", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "versemaster");