diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-01-05 14:34:50 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-01-05 14:34:50 +0400 |
commit | 472396945ec01f42f35a5ae90be08a95696b952f (patch) | |
tree | c1e1d87abd2e914c5adc7dbcdee4164bbd977db9 /source | |
parent | 8a9650e620e8f9af4954cfe9d5607d19b36e5796 (diff) |
add _default versions of sequence sound functions since most of their uses passed along the same args from sequence strips. (no functional changes)
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/BKE_sound.h | 3 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/sequencer.c | 14 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/sound.c | 25 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_edit.c | 4 |
5 files changed, 37 insertions, 13 deletions
diff --git a/source/blender/blenkernel/BKE_sound.h b/source/blender/blenkernel/BKE_sound.h index 57746f3a68f..fdf1d09559d 100644 --- a/source/blender/blenkernel/BKE_sound.h +++ b/source/blender/blenkernel/BKE_sound.h @@ -94,14 +94,17 @@ void sound_update_fps(struct Scene *scene); 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); diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index cc4b8917a32..6da9199ddc4 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -3070,10 +3070,10 @@ void seq_sound_init(Scene *scene, Sequence *seq) } 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_all(Scene *scene) 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 @@ static Sequence *seq_dupli(struct Scene *scene, struct Scene *scene_to, Sequence } 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 @@ static Sequence *seq_dupli(struct Scene *scene, struct Scene *scene_to, Sequence 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) { diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index ceaba2502d9..80485c12b1a 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -449,6 +449,13 @@ void* sound_scene_add_scene_sound(struct Scene *scene, struct Sequence* sequence 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 @@ void* sound_add_scene_sound(struct Scene *scene, struct Sequence* sequence, int 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 @@ void sound_move_scene_sound(struct Scene *scene, void* handle, int startframe, i 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_create_scene(struct Scene *UNUSED(scene)) {} 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)) {} diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 787a3f9357c..27a0ddd09cd 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -4739,7 +4739,7 @@ static void lib_link_scene(FileData *fd, Main *main) 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 @@ static void lib_link_scene(FileData *fd, Main *main) 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; diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index 5fd3d3b45d6..56c2e0ee4d1 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -2711,8 +2711,8 @@ static int sequencer_swap_data_exec(bContext *C, wmOperator *op) 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); |