[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43159] trunk/blender/source/blender: add _default versions of sequence sound functions since most of their uses passed along the same args from sequence strips .

Campbell Barton ideasman42 at gmail.com
Thu Jan 5 11:34:57 CET 2012


Revision: 43159
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43159
Author:   campbellbarton
Date:     2012-01-05 10:34:50 +0000 (Thu, 05 Jan 2012)
Log Message:
-----------
add _default versions of sequence sound functions since most of their uses passed along the same args from sequence strips. (no functional changes)

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/BKE_sound.h
    trunk/blender/source/blender/blenkernel/intern/sequencer.c
    trunk/blender/source/blender/blenkernel/intern/sound.c
    trunk/blender/source/blender/blenloader/intern/readfile.c
    trunk/blender/source/blender/editors/space_sequencer/sequencer_edit.c

Modified: trunk/blender/source/blender/blenkernel/BKE_sound.h
===================================================================
--- trunk/blender/source/blender/blenkernel/BKE_sound.h	2012-01-05 10:05:24 UTC (rev 43158)
+++ trunk/blender/source/blender/blenkernel/BKE_sound.h	2012-01-05 10:34:50 UTC (rev 43159)
@@ -94,14 +94,17 @@
 void sound_update_scene_listener(struct Scene *scene);
 
 void* sound_scene_add_scene_sound(struct Scene *scene, struct Sequence* sequence, int startframe, int endframe, int frameskip);
+void* sound_scene_add_scene_sound_defaults(struct Scene *scene, struct Sequence* sequence);
 
 void* sound_add_scene_sound(struct Scene *scene, struct Sequence* sequence, int startframe, int endframe, int frameskip);
+void* sound_add_scene_sound_defaults(struct Scene *scene, struct Sequence* sequence);
 
 void sound_remove_scene_sound(struct Scene *scene, void* handle);
 
 void sound_mute_scene_sound(void* handle, char mute);
 
 void sound_move_scene_sound(struct Scene *scene, void* handle, int startframe, int endframe, int frameskip);
+void sound_move_scene_sound_defaults(struct Scene *scene, struct Sequence *sequence);
 
 void sound_update_scene_sound(void* handle, struct bSound* sound);
 

Modified: trunk/blender/source/blender/blenkernel/intern/sequencer.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/sequencer.c	2012-01-05 10:05:24 UTC (rev 43158)
+++ trunk/blender/source/blender/blenkernel/intern/sequencer.c	2012-01-05 10:34:50 UTC (rev 43159)
@@ -3070,10 +3070,10 @@
 	}
 	else {
 		if(seq->sound) {
-			seq->scene_sound = sound_add_scene_sound(scene, seq, seq->startdisp, seq->enddisp, seq->startofs + seq->anim_startofs);
+			seq->scene_sound = sound_add_scene_sound_defaults(scene, seq);
 		}
 		if(seq->scene) {
-			sound_scene_add_scene_sound(scene, seq, seq->startdisp, seq->enddisp, seq->startofs + seq->anim_startofs);
+			sound_scene_add_scene_sound_defaults(scene, seq);
 		}
 	}
 }
@@ -3227,10 +3227,8 @@
 
 void seq_update_sound_bounds(Scene* scene, Sequence *seq)
 {
-	if(seq->scene_sound) {
-		sound_move_scene_sound(scene, seq->scene_sound, seq->startdisp, seq->enddisp, seq->startofs + seq->anim_startofs);
-		/* mute is set in seq_update_muting_recursive */
-	}
+	sound_move_scene_sound_defaults(scene, seq);
+	/* mute is set in seq_update_muting_recursive */
 }
 
 static void seq_update_muting_recursive(ListBase *seqbasep, Sequence *metaseq, int mute)
@@ -3772,7 +3770,7 @@
 	} else if(seq->type == SEQ_SCENE) {
 		seqn->strip->stripdata = NULL;
 		if(seq->scene_sound)
-			seqn->scene_sound = sound_scene_add_scene_sound(sce_audio, seqn, seq->startdisp, seq->enddisp, seq->startofs + seq->anim_startofs);
+			seqn->scene_sound = sound_scene_add_scene_sound_defaults(sce_audio, seqn);
 	} else if(seq->type == SEQ_MOVIE) {
 		seqn->strip->stripdata =
 				MEM_dupallocN(seq->strip->stripdata);
@@ -3781,7 +3779,7 @@
 		seqn->strip->stripdata =
 				MEM_dupallocN(seq->strip->stripdata);
 		if(seq->scene_sound)
-			seqn->scene_sound = sound_add_scene_sound(sce_audio, seqn, seq->startdisp, seq->enddisp, seq->startofs + seq->anim_startofs);
+			seqn->scene_sound = sound_add_scene_sound_defaults(sce_audio, seqn);
 
 		seqn->sound->id.us++;
 	} else if(seq->type == SEQ_IMAGE) {

Modified: trunk/blender/source/blender/blenkernel/intern/sound.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/sound.c	2012-01-05 10:05:24 UTC (rev 43158)
+++ trunk/blender/source/blender/blenkernel/intern/sound.c	2012-01-05 10:34:50 UTC (rev 43159)
@@ -449,6 +449,13 @@
 	return NULL;
 }
 
+void* sound_scene_add_scene_sound_defaults(struct Scene *scene, struct Sequence* sequence)
+{
+	return sound_scene_add_scene_sound(scene, sequence,
+	                                   sequence->startdisp, sequence->enddisp,
+	                                   sequence->startofs + sequence->anim_startofs);
+}
+
 void* sound_add_scene_sound(struct Scene *scene, struct Sequence* sequence, int startframe, int endframe, int frameskip)
 {
 	void* handle = AUD_addSequence(scene->sound_scene, sequence->sound->playback_handle, startframe / FPS, endframe / FPS, frameskip / FPS);
@@ -459,6 +466,13 @@
 	return handle;
 }
 
+void* sound_add_scene_sound_defaults(struct Scene *scene, struct Sequence* sequence)
+{
+	return sound_add_scene_sound(scene, sequence,
+	                             sequence->startdisp, sequence->enddisp,
+	                             sequence->startofs + sequence->anim_startofs);
+}
+
 void sound_remove_scene_sound(struct Scene *scene, void* handle)
 {
 	AUD_removeSequence(scene->sound_scene, handle);
@@ -474,6 +488,13 @@
 	AUD_moveSequence(handle, startframe / FPS, endframe / FPS, frameskip / FPS);
 }
 
+void sound_move_scene_sound_defaults(struct Scene *scene, struct Sequence* sequence)
+{
+	sound_move_scene_sound(scene, sequence->scene_sound,
+	                       sequence->startdisp, sequence->enddisp,
+	                       sequence->startofs + sequence->anim_startofs);
+}
+
 void sound_update_scene_sound(void* handle, struct bSound* sound)
 {
 	AUD_updateSequenceSound(handle, sound->playback_handle);
@@ -781,11 +802,13 @@
 void sound_destroy_scene(struct Scene *UNUSED(scene)) {}
 void sound_mute_scene(struct Scene *UNUSED(scene), int UNUSED(muted)) {}
 void* sound_scene_add_scene_sound(struct Scene *UNUSED(scene), struct Sequence* UNUSED(sequence), int UNUSED(startframe), int UNUSED(endframe), int UNUSED(frameskip)) { return NULL; }
+void* sound_scene_add_scene_sound_defaults(struct Scene *UNUSED(scene), struct Sequence* UNUSED(sequence)) { return NULL; }
 void* sound_add_scene_sound(struct Scene *UNUSED(scene), struct Sequence* UNUSED(sequence), int UNUSED(startframe), int UNUSED(endframe), int UNUSED(frameskip)) { return NULL; }
+void* sound_add_scene_sound_defaults(struct Scene *UNUSED(scene), struct Sequence* UNUSED(sequence)) { return NULL; }
 void sound_remove_scene_sound(struct Scene *UNUSED(scene), void* UNUSED(handle)) {}
 void sound_mute_scene_sound(void* UNUSED(handle), char UNUSED(mute)) {}
 void sound_move_scene_sound(struct Scene *UNUSED(scene), void* UNUSED(handle), int UNUSED(startframe), int UNUSED(endframe), int UNUSED(frameskip)) {}
-static void sound_start_play_scene(struct Scene *UNUSED(scene)) {}
+void sound_move_scene_sound_defaults(struct Scene *UNUSED(scene), struct Sequence *UNUSED(sequence)) {}
 void sound_play_scene(struct Scene *UNUSED(scene)) {}
 void sound_stop_scene(struct Scene *UNUSED(scene)) {}
 void sound_seek_scene(struct Main *UNUSED(bmain), struct Scene *UNUSED(scene)) {}

Modified: trunk/blender/source/blender/blenloader/intern/readfile.c
===================================================================
--- trunk/blender/source/blender/blenloader/intern/readfile.c	2012-01-05 10:05:24 UTC (rev 43158)
+++ trunk/blender/source/blender/blenloader/intern/readfile.c	2012-01-05 10:34:50 UTC (rev 43159)
@@ -4739,7 +4739,7 @@
 				if(seq->scene) {
 					seq->scene= newlibadr(fd, sce->id.lib, seq->scene);
 					if(seq->scene) {
-						seq->scene_sound = sound_scene_add_scene_sound(sce, seq, seq->startdisp, seq->enddisp, seq->startofs + seq->anim_startofs);
+						seq->scene_sound = sound_scene_add_scene_sound_defaults(sce, seq);
 					}
 				}
 				if(seq->scene_camera) seq->scene_camera= newlibadr(fd, sce->id.lib, seq->scene_camera);
@@ -4751,7 +4751,7 @@
 						seq->sound= newlibadr(fd, sce->id.lib, seq->sound);
 					if (seq->sound) {
 						seq->sound->id.us++;
-						seq->scene_sound = sound_add_scene_sound(sce, seq, seq->startdisp, seq->enddisp, seq->startofs + seq->anim_startofs);
+						seq->scene_sound = sound_add_scene_sound_defaults(sce, seq);
 					}
 				}
 				seq->anim= NULL;

Modified: trunk/blender/source/blender/editors/space_sequencer/sequencer_edit.c
===================================================================
--- trunk/blender/source/blender/editors/space_sequencer/sequencer_edit.c	2012-01-05 10:05:24 UTC (rev 43158)
+++ trunk/blender/source/blender/editors/space_sequencer/sequencer_edit.c	2012-01-05 10:34:50 UTC (rev 43159)
@@ -2711,8 +2711,8 @@
 	calc_sequence(scene, seq_act);
 	calc_sequence(scene, seq_other);
 
-	if(seq_act->sound)		sound_add_scene_sound(scene, seq_act, seq_act->startdisp, seq_act->enddisp, seq_act->startofs + seq_act->anim_startofs);
-	if(seq_other->sound)	sound_add_scene_sound(scene, seq_other, seq_other->startdisp, seq_other->enddisp, seq_other->startofs + seq_other->anim_startofs);
+	if(seq_act->sound)		sound_add_scene_sound_defaults(scene, seq_act);
+	if(seq_other->sound)	sound_add_scene_sound_defaults(scene, seq_other);
 
 	WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene);
 



More information about the Bf-blender-cvs mailing list