3D Audio GSoC:
* Pepper depends on ffmpeg 0.7.1 or higher now, windows and mac build systems set to ffmpeg-0.8 * Fixed orientation retrieval in OpenAL device code. * Added stopAll() method to AUD_IDevice (also for Python) and call it on BGE exit * Changed BGE to use audaspace via native C++ instead over the C API. * Made AUD_SequencerFactory and AUD_SequencerEntry thread safe. * Changed sound caching into a flag which fixes problems on file loading, especially with undo. * Removed unused parameter from sound_mute_scene_sound * Fixed bug: changing FPS didn't update the sequencer sound positions. * Fixed bug: Properties of sequencer strips weren't set correctly. * Minor warning fixes.
This commit is contained in:
@@ -282,8 +282,9 @@ void free_imbuf_seq(struct Scene *scene, struct ListBase * seqbasep, int check_m
|
||||
struct Sequence *seq_dupli_recursive(struct Scene *scene, struct Scene *scene_to, struct Sequence * seq, int dupe_flag);
|
||||
int seq_swap(struct Sequence *seq_a, struct Sequence *seq_b, const char **error_str);
|
||||
|
||||
void seq_update_sound_bounds_all(struct Scene *scene);
|
||||
void seq_update_sound_bounds(struct Scene* scene, struct Sequence *seq);
|
||||
void seq_update_muting(struct Scene* scene, struct Editing *ed);
|
||||
void seq_update_muting(struct Editing *ed);
|
||||
void seq_update_sound(struct Scene *scene, struct bSound *sound);
|
||||
void seqbase_sound_reload(struct Scene *scene, ListBase *seqbase);
|
||||
void seqbase_unique_name_recursive(ListBase *seqbasep, struct Sequence *seq);
|
||||
|
||||
@@ -62,9 +62,9 @@ struct bSound* sound_new_limiter(struct bContext *C, struct bSound *source, floa
|
||||
|
||||
void sound_delete(struct bContext *C, struct bSound* sound);
|
||||
|
||||
void sound_cache(struct bSound* sound, int ignore);
|
||||
void sound_cache(struct bSound* sound);
|
||||
|
||||
void sound_cache_notifying(struct Main* main, struct bSound* sound, int ignore);
|
||||
void sound_cache_notifying(struct Main* main, struct bSound* sound);
|
||||
|
||||
void sound_delete_cache(struct bSound* sound);
|
||||
|
||||
@@ -92,7 +92,7 @@ void* sound_add_scene_sound(struct Scene *scene, struct Sequence* sequence, int
|
||||
|
||||
void sound_remove_scene_sound(struct Scene *scene, void* handle);
|
||||
|
||||
void sound_mute_scene_sound(struct Scene *scene, void* handle, char mute);
|
||||
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);
|
||||
|
||||
|
||||
@@ -3145,6 +3145,28 @@ int shuffle_seq_time(ListBase * seqbasep, Scene *evil_scene)
|
||||
return offset? 0:1;
|
||||
}
|
||||
|
||||
void seq_update_sound_bounds_all(Scene *scene)
|
||||
{
|
||||
Editing *ed = scene->ed;
|
||||
|
||||
if(ed)
|
||||
{
|
||||
Sequence *seq;
|
||||
|
||||
for(seq = ed->seqbase.first; seq; seq = seq->next)
|
||||
{
|
||||
if(seq->type == SEQ_META)
|
||||
{
|
||||
seq_update_sound_bounds_recursive(scene, seq);
|
||||
}
|
||||
else if(ELEM(seq->type, SEQ_SOUND, SEQ_SCENE))
|
||||
{
|
||||
seq_update_sound_bounds(scene, seq);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void seq_update_sound_bounds(Scene* scene, Sequence *seq)
|
||||
{
|
||||
if(seq->scene_sound)
|
||||
@@ -3154,7 +3176,7 @@ void seq_update_sound_bounds(Scene* scene, Sequence *seq)
|
||||
}
|
||||
}
|
||||
|
||||
static void seq_update_muting_recursive(Scene *scene, ListBase *seqbasep, Sequence *metaseq, int mute)
|
||||
static void seq_update_muting_recursive(ListBase *seqbasep, Sequence *metaseq, int mute)
|
||||
{
|
||||
Sequence *seq;
|
||||
int seqmute;
|
||||
@@ -3170,26 +3192,26 @@ static void seq_update_muting_recursive(Scene *scene, ListBase *seqbasep, Sequen
|
||||
if(seq == metaseq)
|
||||
seqmute= 0;
|
||||
|
||||
seq_update_muting_recursive(scene, &seq->seqbase, metaseq, seqmute);
|
||||
seq_update_muting_recursive(&seq->seqbase, metaseq, seqmute);
|
||||
}
|
||||
else if(ELEM(seq->type, SEQ_SOUND, SEQ_SCENE)) {
|
||||
if(seq->scene_sound) {
|
||||
sound_mute_scene_sound(scene, seq->scene_sound, seqmute);
|
||||
sound_mute_scene_sound(seq->scene_sound, seqmute);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void seq_update_muting(Scene *scene, Editing *ed)
|
||||
void seq_update_muting(Editing *ed)
|
||||
{
|
||||
if(ed) {
|
||||
/* mute all sounds up to current metastack list */
|
||||
MetaStack *ms= ed->metastack.last;
|
||||
|
||||
if(ms)
|
||||
seq_update_muting_recursive(scene, &ed->seqbase, ms->parseq, 1);
|
||||
seq_update_muting_recursive(&ed->seqbase, ms->parseq, 1);
|
||||
else
|
||||
seq_update_muting_recursive(scene, &ed->seqbase, NULL, 0);
|
||||
seq_update_muting_recursive(&ed->seqbase, NULL, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3469,7 +3491,7 @@ void seq_load_apply(Scene *scene, Sequence *seq, SeqLoadInfo *seq_load)
|
||||
|
||||
if(seq_load->flag & SEQ_LOAD_SOUND_CACHE) {
|
||||
if(seq->sound)
|
||||
sound_cache(seq->sound, 0);
|
||||
sound_cache(seq->sound);
|
||||
}
|
||||
|
||||
seq_load->tot_success++;
|
||||
|
||||
@@ -91,6 +91,7 @@ void sound_free(struct bSound* sound)
|
||||
if(sound->cache)
|
||||
{
|
||||
AUD_unload(sound->cache);
|
||||
sound->cache = NULL;
|
||||
}
|
||||
#endif // WITH_AUDASPACE
|
||||
}
|
||||
@@ -250,23 +251,25 @@ void sound_delete(struct bContext *C, struct bSound* sound)
|
||||
}
|
||||
}
|
||||
|
||||
void sound_cache(struct bSound* sound, int ignore)
|
||||
void sound_cache(struct bSound* sound)
|
||||
{
|
||||
if(sound->cache && !ignore)
|
||||
sound->flags |= SOUND_FLAGS_CACHING;
|
||||
if(sound->cache)
|
||||
AUD_unload(sound->cache);
|
||||
|
||||
sound->cache = AUD_bufferSound(sound->handle);
|
||||
sound->playback_handle = sound->cache;
|
||||
}
|
||||
|
||||
void sound_cache_notifying(struct Main* main, struct bSound* sound, int ignore)
|
||||
void sound_cache_notifying(struct Main* main, struct bSound* sound)
|
||||
{
|
||||
sound_cache(sound, ignore);
|
||||
sound_cache(sound);
|
||||
sound_update_sequencer(main, sound);
|
||||
}
|
||||
|
||||
void sound_delete_cache(struct bSound* sound)
|
||||
{
|
||||
sound->flags &= ~SOUND_FLAGS_CACHING;
|
||||
if(sound->cache)
|
||||
{
|
||||
AUD_unload(sound->cache);
|
||||
@@ -279,6 +282,12 @@ void sound_load(struct Main *bmain, struct bSound* sound)
|
||||
{
|
||||
if(sound)
|
||||
{
|
||||
if(sound->cache)
|
||||
{
|
||||
AUD_unload(sound->cache);
|
||||
sound->cache = NULL;
|
||||
}
|
||||
|
||||
if(sound->handle)
|
||||
{
|
||||
AUD_unload(sound->handle);
|
||||
@@ -330,6 +339,11 @@ void sound_load(struct Main *bmain, struct bSound* sound)
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
if(sound->flags & SOUND_FLAGS_CACHING)
|
||||
{
|
||||
sound->cache = AUD_bufferSound(sound->handle);
|
||||
}
|
||||
|
||||
if(sound->cache)
|
||||
sound->playback_handle = sound->cache;
|
||||
else
|
||||
@@ -400,7 +414,12 @@ void* sound_scene_add_scene_sound(struct Scene *scene, struct Sequence* sequence
|
||||
|
||||
void* sound_add_scene_sound(struct Scene *scene, struct Sequence* sequence, int startframe, int endframe, int frameskip)
|
||||
{
|
||||
return AUD_addSequence(scene->sound_scene, sequence->sound->playback_handle, startframe / FPS, endframe / FPS, frameskip / FPS);
|
||||
void* handle = AUD_addSequence(scene->sound_scene, sequence->sound->playback_handle, startframe / FPS, endframe / FPS, frameskip / FPS);
|
||||
AUD_muteSequence(handle, (sequence->flag & SEQ_MUTE) != 0);
|
||||
AUD_setSequenceAnimData(handle, AUD_AP_VOLUME, CFRA, &sequence->volume, 0);
|
||||
AUD_setSequenceAnimData(handle, AUD_AP_PITCH, CFRA, &sequence->pitch, 0);
|
||||
AUD_setSequenceAnimData(handle, AUD_AP_PANNING, CFRA, &sequence->pan, 0);
|
||||
return handle;
|
||||
}
|
||||
|
||||
void sound_remove_scene_sound(struct Scene *scene, void* handle)
|
||||
@@ -408,7 +427,7 @@ void sound_remove_scene_sound(struct Scene *scene, void* handle)
|
||||
AUD_removeSequence(scene->sound_scene, handle);
|
||||
}
|
||||
|
||||
void sound_mute_scene_sound(struct Scene *scene, void* handle, char mute)
|
||||
void sound_mute_scene_sound(void* handle, char mute)
|
||||
{
|
||||
AUD_muteSequence(handle, mute);
|
||||
}
|
||||
@@ -612,7 +631,7 @@ void sound_force_device(int UNUSED(device)) {}
|
||||
void sound_init_once(void) {}
|
||||
void sound_init(struct Main *UNUSED(bmain)) {}
|
||||
void sound_exit(void) {}
|
||||
void sound_cache(struct bSound* UNUSED(sound), int UNUSED(ignore)) { }
|
||||
void sound_cache(struct bSound* UNUSED(sound)) { }
|
||||
void sound_delete_cache(struct bSound* UNUSED(sound)) {}
|
||||
void sound_load(struct Main *UNUSED(bmain), struct bSound* UNUSED(sound)) {}
|
||||
void sound_create_scene(struct Scene *UNUSED(scene)) {}
|
||||
@@ -621,7 +640,7 @@ 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_add_scene_sound(struct Scene *UNUSED(scene), struct Sequence* UNUSED(sequence), int UNUSED(startframe), int UNUSED(endframe), int UNUSED(frameskip)) { return NULL; }
|
||||
void sound_remove_scene_sound(struct Scene *UNUSED(scene), void* UNUSED(handle)) {}
|
||||
void sound_mute_scene_sound(struct Scene *UNUSED(scene), void* UNUSED(handle), char UNUSED(mute)) {}
|
||||
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_play_scene(struct Scene *UNUSED(scene)) {}
|
||||
|
||||
Reference in New Issue
Block a user