From c284725a1a69be3f9a80d88e17be922e6ce63f72 Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Thu, 4 Aug 2011 07:12:03 +0000 Subject: 3D Audio GSoC: * versioning stuff for btheme->tv3d.speaker * separating object.c speaker functions in own source file Thanks Brecht for the suggestions. --- source/blender/blenkernel/intern/library.c | 1 + source/blender/blenkernel/intern/object.c | 95 +------------------- source/blender/blenkernel/intern/speaker.c | 139 +++++++++++++++++++++++++++++ 3 files changed, 141 insertions(+), 94 deletions(-) create mode 100644 source/blender/blenkernel/intern/speaker.c (limited to 'source/blender/blenkernel/intern') diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 85f87992c28..8668168936b 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -109,6 +109,7 @@ #include "BKE_particle.h" #include "BKE_gpencil.h" #include "BKE_fcurve.h" +#include "BKE_speaker.h" #include "RNA_access.h" diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 66bf4ea208b..a615bc42f66 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -56,7 +56,6 @@ #include "DNA_sequence_types.h" #include "DNA_sound_types.h" #include "DNA_space_types.h" -#include "DNA_speaker_types.h" #include "DNA_view3d_types.h" #include "DNA_world_types.h" @@ -98,6 +97,7 @@ #include "BKE_sca.h" #include "BKE_scene.h" #include "BKE_sequencer.h" +#include "BKE_speaker.h" #include "BKE_softbody.h" #include "BKE_material.h" @@ -977,99 +977,6 @@ void free_lamp(Lamp *la) la->id.icon_id = 0; } -void *add_speaker(const char *name) -{ - Speaker *spk; - - spk= alloc_libblock(&G.main->speaker, ID_SPK, name); - - spk->attenuation = 1.0f; - spk->cone_angle_inner = 360.0f; - spk->cone_angle_outer = 360.0f; - spk->cone_volume_outer = 1.0f; - spk->distance_max = FLT_MAX; - spk->distance_reference = 1.0f; - spk->flag = 0; - spk->pitch = 1.0f; - spk->sound = NULL; - spk->volume = 1.0f; - spk->volume_max = 1.0f; - spk->volume_min = 0.0f; - - return spk; -} - -Speaker *copy_speaker(Speaker *spk) -{ - Speaker *spkn; - - spkn= copy_libblock(spk); - if(spkn->sound) - spkn->sound->id.us++; - - return spkn; -} - -void make_local_speaker(Speaker *spk) -{ - Main *bmain= G.main; - Object *ob; - int local=0, lib=0; - - /* - only lib users: do nothing - * - only local users: set flag - * - mixed: make copy - */ - - if(spk->id.lib==NULL) return; - if(spk->id.us==1) { - spk->id.lib= NULL; - spk->id.flag= LIB_LOCAL; - new_id(&bmain->speaker, (ID *)spk, NULL); - return; - } - - ob= bmain->object.first; - while(ob) { - if(ob->data==spk) { - if(ob->id.lib) lib= 1; - else local= 1; - } - ob= ob->id.next; - } - - if(local && lib==0) { - spk->id.lib= NULL; - spk->id.flag= LIB_LOCAL; - new_id(&bmain->speaker, (ID *)spk, NULL); - } - else if(local && lib) { - Speaker *spkn= copy_speaker(spk); - spkn->id.us= 0; - - ob= bmain->object.first; - while(ob) { - if(ob->data==spk) { - - if(ob->id.lib==NULL) { - ob->data= spkn; - spkn->id.us++; - spk->id.us--; - } - } - ob= ob->id.next; - } - } -} - -void free_speaker(Speaker *spk) -{ - if(spk->sound) - spk->sound->id.us--; - - BKE_free_animdata((ID *)spk); -} - /* *************************************************** */ static void *add_obdata_from_type(int type) diff --git a/source/blender/blenkernel/intern/speaker.c b/source/blender/blenkernel/intern/speaker.c new file mode 100644 index 00000000000..200dbd41899 --- /dev/null +++ b/source/blender/blenkernel/intern/speaker.c @@ -0,0 +1,139 @@ +/* speaker.c + * + * + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): Jörg Müller. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +/** \file blender/blenkernel/intern/speaker.c + * \ingroup bke + */ + +#include "DNA_object_types.h" +#include "DNA_sound_types.h" +#include "DNA_speaker_types.h" + +#include "BLI_math.h" + +#include "BKE_animsys.h" +#include "BKE_global.h" +#include "BKE_library.h" +#include "BKE_main.h" +#include "BKE_speaker.h" + +void *add_speaker(const char *name) +{ + Speaker *spk; + + spk= alloc_libblock(&G.main->speaker, ID_SPK, name); + + spk->attenuation = 1.0f; + spk->cone_angle_inner = 360.0f; + spk->cone_angle_outer = 360.0f; + spk->cone_volume_outer = 1.0f; + spk->distance_max = FLT_MAX; + spk->distance_reference = 1.0f; + spk->flag = 0; + spk->pitch = 1.0f; + spk->sound = NULL; + spk->volume = 1.0f; + spk->volume_max = 1.0f; + spk->volume_min = 0.0f; + + return spk; +} + +Speaker *copy_speaker(Speaker *spk) +{ + Speaker *spkn; + + spkn= copy_libblock(spk); + if(spkn->sound) + spkn->sound->id.us++; + + return spkn; +} + +void make_local_speaker(Speaker *spk) +{ + Main *bmain= G.main; + Object *ob; + int local=0, lib=0; + + /* - only lib users: do nothing + * - only local users: set flag + * - mixed: make copy + */ + + if(spk->id.lib==NULL) return; + if(spk->id.us==1) { + spk->id.lib= NULL; + spk->id.flag= LIB_LOCAL; + new_id(&bmain->speaker, (ID *)spk, NULL); + return; + } + + ob= bmain->object.first; + while(ob) { + if(ob->data==spk) { + if(ob->id.lib) lib= 1; + else local= 1; + } + ob= ob->id.next; + } + + if(local && lib==0) { + spk->id.lib= NULL; + spk->id.flag= LIB_LOCAL; + new_id(&bmain->speaker, (ID *)spk, NULL); + } + else if(local && lib) { + Speaker *spkn= copy_speaker(spk); + spkn->id.us= 0; + + ob= bmain->object.first; + while(ob) { + if(ob->data==spk) { + + if(ob->id.lib==NULL) { + ob->data= spkn; + spkn->id.us++; + spk->id.us--; + } + } + ob= ob->id.next; + } + } +} + +void free_speaker(Speaker *spk) +{ + if(spk->sound) + spk->sound->id.us--; + + BKE_free_animdata((ID *)spk); +} -- cgit v1.2.3 From 900928f8bf47b8f1bbb1b2cd863d2d9649c940a0 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Thu, 4 Aug 2011 14:13:05 +0000 Subject: Bassam Feature Request: "Auto Clamped" handles can now be set per handle/key This used to be a weird per-curve setting which would happen to get applied/work correctly if handles were set to "auto", and was a source of constant confusion for both old and new animators. The main effect of this handle-type/option was really to just ensure that auto-handles stayed horizontal, instead of tilting as the keys were moved. This commit simply changes this from a per-curve to per keyframe/handle setting. --- source/blender/blenkernel/intern/curve.c | 10 +++++----- source/blender/blenkernel/intern/fcurve.c | 11 ++++------- source/blender/blenkernel/intern/ipo.c | 13 ++++++++++++- source/blender/blenkernel/intern/nla.c | 4 ++-- 4 files changed, 23 insertions(+), 15 deletions(-) (limited to 'source/blender/blenkernel/intern') diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index eb364af6ff8..2f1a85c57b3 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -2473,7 +2473,7 @@ void calchandleNurb(BezTriple *bezt, BezTriple *prev, BezTriple *next, int mode) if(len2==0.0f) len2=1.0f; - if(bezt->h1==HD_AUTO || bezt->h2==HD_AUTO) { /* auto */ + if(ELEM(bezt->h1,HD_AUTO,HD_AUTO_ANIM) || ELEM(bezt->h2,HD_AUTO,HD_AUTO_ANIM)) { /* auto */ vx= dx1/len2 + dx/len1; vy= dy1/len2 + dy/len1; vz= dz1/len2 + dz/len1; @@ -2484,13 +2484,13 @@ void calchandleNurb(BezTriple *bezt, BezTriple *prev, BezTriple *next, int mode) if(len1>5.0f*len2) len1= 5.0f*len2; if(len2>5.0f*len1) len2= 5.0f*len1; - if(bezt->h1==HD_AUTO) { + if(ELEM(bezt->h1,HD_AUTO,HD_AUTO_ANIM)) { len1/=len; *(p2-3)= *p2-vx*len1; *(p2-2)= *(p2+1)-vy*len1; *(p2-1)= *(p2+2)-vz*len1; - if(mode==2 && next && prev) { // keep horizontal if extrema + if((bezt->h1==HD_AUTO_ANIM) && next && prev) { // keep horizontal if extrema float ydiff1= prev->vec[1][1] - bezt->vec[1][1]; float ydiff2= next->vec[1][1] - bezt->vec[1][1]; if( (ydiff1 <= 0.0f && ydiff2 <= 0.0f) || (ydiff1 >= 0.0f && ydiff2 >= 0.0f) ) { @@ -2512,13 +2512,13 @@ void calchandleNurb(BezTriple *bezt, BezTriple *prev, BezTriple *next, int mode) } } } - if(bezt->h2==HD_AUTO) { + if(ELEM(bezt->h2,HD_AUTO,HD_AUTO_ANIM)) { len2/=len; *(p2+3)= *p2+vx*len2; *(p2+4)= *(p2+1)+vy*len2; *(p2+5)= *(p2+2)+vz*len2; - if(mode==2 && next && prev) { // keep horizontal if extrema + if((bezt->h2==HD_AUTO_ANIM) && next && prev) { // keep horizontal if extrema float ydiff1= prev->vec[1][1] - bezt->vec[1][1]; float ydiff2= next->vec[1][1] - bezt->vec[1][1]; if( (ydiff1 <= 0.0f && ydiff2 <= 0.0f) || (ydiff1 >= 0.0f && ydiff2 >= 0.0f) ) { diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index aa8f817ae3c..28f17b3cf86 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -792,13 +792,10 @@ void calchandles_fcurve (FCurve *fcu) if (bezt->vec[2][0] < bezt->vec[1][0]) bezt->vec[2][0]= bezt->vec[1][0]; /* calculate auto-handles */ - if (fcu->flag & FCURVE_AUTO_HANDLES) - calchandleNurb(bezt, prev, next, 2); /* 2==special autohandle && keep extrema horizontal */ - else - calchandleNurb(bezt, prev, next, 1); /* 1==special autohandle */ + calchandleNurb(bezt, prev, next, 1); /* 1==special autohandle */ /* for automatic ease in and out */ - if ((bezt->h1==HD_AUTO) && (bezt->h2==HD_AUTO)) { + if (ELEM(bezt->h1,HD_AUTO,HD_AUTO_ANIM) && ELEM(bezt->h2,HD_AUTO,HD_AUTO_ANIM)) { /* only do this on first or last beztriple */ if ((a == 0) || (a == fcu->totvert-1)) { /* set both handles to have same horizontal value as keyframe */ @@ -846,9 +843,9 @@ void testhandles_fcurve (FCurve *fcu) /* one or two handles selected only */ if (ELEM(flag, 0, 7)==0) { /* auto handles become aligned */ - if (bezt->h1==HD_AUTO) + if (ELEM(bezt->h1, HD_AUTO, HD_AUTO_ANIM)) bezt->h1= HD_ALIGN; - if (bezt->h2==HD_AUTO) + if (ELEM(bezt->h2, HD_AUTO, HD_AUTO_ANIM)) bezt->h2= HD_ALIGN; /* vector handles become 'free' when only one half selected */ diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index 104ce2b3b32..d41a3a36b2d 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -1157,7 +1157,6 @@ static void icu_to_fcurves (ID *id, ListBase *groups, ListBase *list, IpoCurve * if (icu->flag & IPO_ACTIVE) fcu->flag |= FCURVE_ACTIVE; if (icu->flag & IPO_MUTE) fcu->flag |= FCURVE_MUTED; if (icu->flag & IPO_PROTECT) fcu->flag |= FCURVE_PROTECTED; - if (icu->flag & IPO_AUTO_HORIZ) fcu->flag |= FCURVE_AUTO_HANDLES; /* set extrapolation */ switch (icu->extrap) { @@ -1242,6 +1241,12 @@ static void icu_to_fcurves (ID *id, ListBase *groups, ListBase *list, IpoCurve * /* 'hide' flag is now used for keytype - only 'keyframes' existed before */ dst->hide= BEZT_KEYTYPE_KEYFRAME; + /* auto-handles - per curve to per handle */ + if (icu->flag & IPO_AUTO_HORIZ) { + if (dst->h1 == HD_AUTO) dst->h1 = HD_AUTO_ANIM; + if (dst->h2 == HD_AUTO) dst->h2 = HD_AUTO_ANIM; + } + /* correct values, by checking if the flag of interest is set */ if ( ((int)(dst->vec[1][1])) & (abp->bit) ) dst->vec[0][1]= dst->vec[1][1]= dst->vec[2][1] = 1.0f; @@ -1292,6 +1297,12 @@ static void icu_to_fcurves (ID *id, ListBase *groups, ListBase *list, IpoCurve * /* 'hide' flag is now used for keytype - only 'keyframes' existed before */ dst->hide= BEZT_KEYTYPE_KEYFRAME; + + /* auto-handles - per curve to per handle */ + if (icu->flag & IPO_AUTO_HORIZ) { + if (dst->h1 == HD_AUTO) dst->h1 = HD_AUTO_ANIM; + if (dst->h2 == HD_AUTO) dst->h2 = HD_AUTO_ANIM; + } /* correct values for euler rotation curves * - they were degrees/10 diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index 8391e9f6ab1..f2ce8e4e6f1 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -1185,7 +1185,7 @@ void BKE_nlastrip_validate_fcurves (NlaStrip *strip) BLI_addtail(&strip->fcurves, fcu); /* set default flags */ - fcu->flag = (FCURVE_VISIBLE|FCURVE_AUTO_HANDLES|FCURVE_SELECTED); + fcu->flag = (FCURVE_VISIBLE|FCURVE_SELECTED); /* store path - make copy, and store that */ fcu->rna_path= BLI_strdupn("influence", 9); @@ -1206,7 +1206,7 @@ void BKE_nlastrip_validate_fcurves (NlaStrip *strip) BLI_addtail(&strip->fcurves, fcu); /* set default flags */ - fcu->flag = (FCURVE_VISIBLE|FCURVE_AUTO_HANDLES|FCURVE_SELECTED); + fcu->flag = (FCURVE_VISIBLE|FCURVE_SELECTED); /* store path - make copy, and store that */ fcu->rna_path= BLI_strdupn("strip_time", 10); -- cgit v1.2.3 From dca090abc87fc57cb0a98bbe07ea8868f04f8c97 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 5 Aug 2011 11:23:28 +0000 Subject: Assorted loose ends for auto-clamped handles work * Tweaked order of handle types to make it easier to find Auto/Auto- clamped in the list * Fixed a number of places which were still just checking for auto- handles when they should have included auto-clamped too, including handle rotation --- source/blender/blenkernel/intern/curve.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source/blender/blenkernel/intern') diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index 2f1a85c57b3..b1beb6c449a 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -2674,15 +2674,15 @@ void testhandlesNurb(Nurb *nu) if(bezt->f1 & SELECT) flag++; if(bezt->f2 & SELECT) flag += 2; if(bezt->f3 & SELECT) flag += 4; - + if( !(flag==0 || flag==7) ) { - if(bezt->h1==HD_AUTO) { /* auto */ + if(ELEM(bezt->h1, HD_AUTO, HD_AUTO_ANIM)) { /* auto */ bezt->h1= HD_ALIGN; } - if(bezt->h2==HD_AUTO) { /* auto */ + if(ELEM(bezt->h2, HD_AUTO, HD_AUTO_ANIM)) { /* auto */ bezt->h2= HD_ALIGN; } - + if(bezt->h1==HD_VECT) { /* vector */ if(flag < 4) bezt->h1= 0; } @@ -2692,7 +2692,7 @@ void testhandlesNurb(Nurb *nu) } bezt++; } - + calchandlesNurb(nu); } -- cgit v1.2.3 From 2d884fc035d403d43c7a18e3e61cd56ccdfbec2b Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Sun, 7 Aug 2011 11:54:58 +0000 Subject: 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. --- source/blender/blenkernel/intern/sequencer.c | 36 ++++++++++++++++++++++------ source/blender/blenkernel/intern/sound.c | 35 ++++++++++++++++++++------- 2 files changed, 56 insertions(+), 15 deletions(-) (limited to 'source/blender/blenkernel/intern') diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 9ff3ce7afe2..93e0c920745 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -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++; diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 59f5cdb678e..890fc114e68 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -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)) {} -- cgit v1.2.3 From 022e815fbd6d81f9b1baa177cce1abf2f42bcb21 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sun, 7 Aug 2011 12:27:20 +0000 Subject: Sound clip NLA Strips for Nexyon These are basically just for specifying when a speaker should fire off it's soundclip, and as such, many NLA operations are irrelevant for it. They can only be specified on object-level for speaker objects. I've still got some UI tweaks I'll need to work on in order for these to be able to be added even when the speaker doesn't have any NLA tracks yet. (EDIT: while typing this, I had an idea for how to do this, but that'll be for next commit). In the mean time, you'll need to add a single keyframe for the object, snowflake that action and delete the NLA strip before you can start editing. --- source/blender/blenkernel/intern/anim_sys.c | 3 +++ source/blender/blenkernel/intern/nla.c | 40 +++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) (limited to 'source/blender/blenkernel/intern') diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index a43cdc8143e..832d13c9c2f 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -1921,6 +1921,9 @@ void nlastrip_evaluate (PointerRNA *ptr, ListBase *channels, ListBase *modifiers case NLASTRIP_TYPE_META: /* meta */ nlastrip_evaluate_meta(ptr, channels, modifiers, nes); break; + + default: /* do nothing */ + break; } /* clear temp recursion safe-check */ diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index f2ce8e4e6f1..dad49646622 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -46,6 +46,8 @@ #include "DNA_anim_types.h" #include "DNA_scene_types.h" +#include "DNA_sound_types.h" +#include "DNA_speaker_types.h" #include "BKE_action.h" #include "BKE_fcurve.h" @@ -53,6 +55,9 @@ #include "BKE_global.h" #include "BKE_library.h" +#ifdef WITH_AUDASPACE +# include "AUD_C-API.h" +#endif #include "RNA_access.h" #include "nla_private.h" @@ -337,6 +342,41 @@ NlaStrip *add_nlastrip_to_stack (AnimData *adt, bAction *act) return strip; } +/* Add a NLA Strip referencing the given speaker's sound */ +NlaStrip *add_nla_soundstrip (Scene *scene, Speaker *speaker) +{ + NlaStrip *strip = MEM_callocN(sizeof(NlaStrip), "NlaSoundStrip"); + + /* if speaker has a sound, set the strip length to the length of the sound, + * otherwise default to length of 10 frames + */ +#ifdef WITH_AUDASPACE + if (speaker->sound) + { + AUD_SoundInfo info = AUD_getInfo(speaker->sound->playback_handle); + + strip->end = ceil(info.length * FPS); + } + else +#endif + { + strip->end = 10.0f; + } + + /* general settings */ + strip->type = NLASTRIP_TYPE_SOUND; + + strip->flag = NLASTRIP_FLAG_SELECT; + strip->extendmode = NLASTRIP_EXTEND_NOTHING; /* nothing to extend... */ + + /* strip should be referenced as-is */ + strip->scale= 1.0f; + strip->repeat = 1.0f; + + /* return this strip */ + return strip; +} + /* *************************************************** */ /* NLA Evaluation <-> Editing Stuff */ -- cgit v1.2.3 From 13249b925eda7752b65a36d8270a3af3bdc02981 Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Tue, 9 Aug 2011 08:38:14 +0000 Subject: 3D Audio GSoC: Speaker objects fully functional! Minor changes: * Fixed three memory bugs found via valgrind. * Fixed bug with jack transport crashing after file loading. * Sound NLA Strips now start at CFRA instead of 0. --- source/blender/blenkernel/intern/blender.c | 3 + source/blender/blenkernel/intern/library.c | 2 +- source/blender/blenkernel/intern/scene.c | 3 + source/blender/blenkernel/intern/sound.c | 88 +++++++++++++++++++++++++++++- 4 files changed, 94 insertions(+), 2 deletions(-) (limited to 'source/blender/blenkernel/intern') diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index a3a4c5b555b..5f33059e117 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -82,6 +82,7 @@ #include "BKE_scene.h" #include "BKE_screen.h" #include "BKE_sequencer.h" +#include "BKE_sound.h" #include "BLO_undofile.h" @@ -247,6 +248,8 @@ static void setup_app_data(bContext *C, BlendFileData *bfd, const char *filepath G.main= bfd->main; CTX_data_main_set(C, G.main); + + sound_init_main(G.main); if (bfd->user) { diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 8668168936b..c362f3eb2fe 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -533,7 +533,6 @@ int set_listbasepointers(Main *main, ListBase **lb) lb[a++]= &(main->latt); lb[a++]= &(main->lamp); lb[a++]= &(main->camera); - lb[a++]= &(main->speaker); lb[a++]= &(main->text); lb[a++]= &(main->sound); @@ -541,6 +540,7 @@ int set_listbasepointers(Main *main, ListBase **lb) lb[a++]= &(main->brush); lb[a++]= &(main->script); lb[a++]= &(main->particle); + lb[a++]= &(main->speaker); lb[a++]= &(main->world); lb[a++]= &(main->screen); diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 74126fd57a1..12e81e8296e 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -966,6 +966,9 @@ static void scene_update_tagged_recursive(Main *bmain, Scene *scene, Scene *scen /* scene drivers... */ scene_update_drivers(bmain, scene); + + /* update sound system animation */ + sound_update_scene(bmain, scene); } /* this is called in main loop, doing tagged updates before redraw */ diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 890fc114e68..17df6ba23cb 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -13,13 +13,16 @@ #include "MEM_guardedalloc.h" #include "BLI_blenlib.h" +#include "BLI_math.h" #include "DNA_anim_types.h" +#include "DNA_object_types.h" #include "DNA_scene_types.h" #include "DNA_sequence_types.h" #include "DNA_packedFile_types.h" #include "DNA_screen_types.h" #include "DNA_sound_types.h" +#include "DNA_speaker_types.h" #ifdef WITH_AUDASPACE # include "AUD_C-API.h" @@ -175,7 +178,12 @@ void sound_init(struct Main *bmain) if(!AUD_init(device, specs, buffersize)) AUD_init(AUD_NULL_DEVICE, specs, buffersize); - + + sound_init_main(bmain); +} + +void sound_init_main(struct Main *bmain) +{ #ifdef WITH_JACK AUD_setSyncCallback(sound_sync_callback, bmain); #else @@ -617,6 +625,84 @@ int sound_get_channels(struct bSound* sound) return info.specs.channels; } +void sound_update_scene(struct Main* bmain, struct Scene* scene) +{ + Object* ob; + NlaTrack* track; + NlaStrip* strip; + Speaker* speaker; + + void* new_set = AUD_createSet(); + void* handle; + float quat[4]; + + for(ob = bmain->object.first; ob; ob = ob->id.next) + { + if(ob->type == OB_SPEAKER) + { + if(ob->adt) + { + for(track = ob->adt->nla_tracks.first; track; track = track->next) + { + for(strip = track->strips.first; strip; strip = strip->next) + { + if(strip->type == NLASTRIP_TYPE_SOUND) + { + speaker = (Speaker*)ob->data; + + if(AUD_removeSet(scene->speaker_handles, strip->speaker_handle)) + { + AUD_moveSequence(strip->speaker_handle, strip->start / FPS, -1, 0); + } + else + { + if(speaker && speaker->sound) + { + strip->speaker_handle = AUD_addSequence(scene->sound_scene, speaker->sound->playback_handle, strip->start / FPS, -1, 0); + AUD_setRelativeSequence(strip->speaker_handle, 0); + } + } + + if(strip->speaker_handle) + { + AUD_addSet(new_set, strip->speaker_handle); + AUD_updateSequenceData(strip->speaker_handle, speaker->volume_max, + speaker->volume_min, speaker->distance_max, + speaker->distance_reference, speaker->attenuation, + speaker->cone_angle_outer, speaker->cone_angle_inner, + speaker->cone_volume_outer); + + mat4_to_quat(quat, ob->obmat); + AUD_setSequenceAnimData(strip->speaker_handle, AUD_AP_LOCATION, CFRA, ob->obmat[3], 1); + AUD_setSequenceAnimData(strip->speaker_handle, AUD_AP_ORIENTATION, CFRA, quat, 1); + AUD_setSequenceAnimData(strip->speaker_handle, AUD_AP_VOLUME, CFRA, &speaker->volume, 1); + AUD_setSequenceAnimData(strip->speaker_handle, AUD_AP_PITCH, CFRA, &speaker->pitch, 1); + AUD_updateSequenceSound(strip->speaker_handle, speaker->sound->playback_handle); + AUD_muteSequence(strip->speaker_handle, ((strip->flag & NLASTRIP_FLAG_MUTED) != 0) || ((speaker->flag & SPK_MUTED) != 0)); + } + } + } + } + } + } + } + + while((handle = AUD_getSet(scene->speaker_handles))) + { + AUD_removeSequence(scene->sound_scene, handle); + } + + if(scene->camera) + { + mat4_to_quat(quat, scene->camera->obmat); + AUD_setSequencerAnimData(scene->sound_scene, AUD_AP_LOCATION, CFRA, scene->camera->obmat[3], 1); + AUD_setSequencerAnimData(scene->sound_scene, AUD_AP_ORIENTATION, CFRA, quat, 1); + } + + AUD_destroySet(scene->speaker_handles); + scene->speaker_handles = new_set; +} + void* sound_get_factory(void* sound) { return ((struct bSound*) sound)->playback_handle; -- cgit v1.2.3 From a672ab5e737202bede956a88357a96cf2728df15 Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Tue, 9 Aug 2011 14:10:32 +0000 Subject: 3D Audio GSoC: Improved waveform drawing in the sequencer. * Drawing the waveform of a sequencer strip is now independent from whether the sound is cached or not. * Improved drawing of the waveform in the sequencer (especially speed!). * Making it possible to vertically zoom more in the sequencer to better see the waveform for lipsync. * Fixed a bug which crashed blender on loading a sound file via ffmpeg. --- source/blender/blenkernel/intern/sound.c | 35 +++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) (limited to 'source/blender/blenkernel/intern') diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 17df6ba23cb..888c719a304 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -24,6 +24,7 @@ #include "DNA_sound_types.h" #include "DNA_speaker_types.h" +#define WITH_AUDASPACE #ifdef WITH_AUDASPACE # include "AUD_C-API.h" #endif @@ -96,6 +97,8 @@ void sound_free(struct bSound* sound) AUD_unload(sound->cache); sound->cache = NULL; } + + sound_free_waveform(sound); #endif // WITH_AUDASPACE } @@ -608,12 +611,34 @@ int sound_scene_playing(struct Scene *scene) return -1; } -int sound_read_sound_buffer(struct bSound* sound, float* buffer, int length, float start, float end) +void sound_free_waveform(struct bSound* sound) +{ + if(sound->waveform) + { + MEM_freeN(((SoundWaveform*)sound->waveform)->data); + MEM_freeN(sound->waveform); + } + + sound->waveform = NULL; +} + +void sound_read_waveform(struct bSound* sound) { - AUD_Sound* limiter = AUD_limitSound(sound->cache, start, end); - int ret= AUD_readSound(limiter, buffer, length); - AUD_unload(limiter); - return ret; + AUD_SoundInfo info; + + info = AUD_getInfo(sound->playback_handle); + + if(info.length > 0) + { + SoundWaveform* waveform = MEM_mallocN(sizeof(SoundWaveform), "SoundWaveform");; + int length = info.length * SOUND_WAVE_SAMPLES_PER_SECOND; + + waveform->data = MEM_mallocN(length * sizeof(float) * 3, "SoundWaveform.samples"); + waveform->length = AUD_readSound(sound->playback_handle, waveform->data, length, SOUND_WAVE_SAMPLES_PER_SECOND); + + sound_free_waveform(sound); + sound->waveform = waveform; + } } int sound_get_channels(struct bSound* sound) -- cgit v1.2.3 From 8655385c9edb5e61416018406f8a3fe3b8e7d141 Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Tue, 9 Aug 2011 14:34:42 +0000 Subject: Fix for last commit: MSVC dislikes ;; --- source/blender/blenkernel/intern/sound.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/blenkernel/intern') diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 888c719a304..80cb2072357 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -630,7 +630,7 @@ void sound_read_waveform(struct bSound* sound) if(info.length > 0) { - SoundWaveform* waveform = MEM_mallocN(sizeof(SoundWaveform), "SoundWaveform");; + SoundWaveform* waveform = MEM_mallocN(sizeof(SoundWaveform), "SoundWaveform"); int length = info.length * SOUND_WAVE_SAMPLES_PER_SECOND; waveform->data = MEM_mallocN(length * sizeof(float) * 3, "SoundWaveform.samples"); -- cgit v1.2.3 From ef40d8e4f0c69f4a2da24ea6bd8ce560aa3b180a Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Tue, 9 Aug 2011 17:37:12 +0000 Subject: Another error in last bigger commit. --- source/blender/blenkernel/intern/sound.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source/blender/blenkernel/intern') diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 80cb2072357..1b09db84125 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -24,7 +24,6 @@ #include "DNA_sound_types.h" #include "DNA_speaker_types.h" -#define WITH_AUDASPACE #ifdef WITH_AUDASPACE # include "AUD_C-API.h" #endif -- cgit v1.2.3 From fee7337249342c3d5a332358883af9afe961f38d Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Thu, 11 Aug 2011 11:41:24 +0000 Subject: 3D Audio GSoC: Adding a mono flag to mixdown non-mono sounds for 3D audio. * Added mono sound loading. * Bugfix: AUD_COMPARE_SPECS usage was wrong. * Bugfix: JOS resampler = instead of ==. * Bugfix: Change of a sound should apply settings in AUD_SequencerHandle. * Bugfix: Memory leak when canceling open sound operator. --- source/blender/blenkernel/intern/sound.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source/blender/blenkernel/intern') diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 1b09db84125..9c62b92a924 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -349,6 +349,13 @@ void sound_load(struct Main *bmain, struct bSound* sound) break; } #endif + if(sound->flags & SOUND_FLAGS_MONO) + { + void* handle = AUD_monoSound(sound->handle); + AUD_unload(sound->handle); + sound->handle = handle; + } + if(sound->flags & SOUND_FLAGS_CACHING) { sound->cache = AUD_bufferSound(sound->handle); -- cgit v1.2.3 From db72192c22787fdf99bc7b20c6864b37b8e871f4 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 12 Aug 2011 07:20:49 +0000 Subject: Bye bye vile relics of extinct version control systems, Causing a flurry of refresh file prompts post-commit, Confusing local diffs and causing merge conflicts, Stating the obvious; redundant and useless... We shall not miss thou, blasted expand $keywords$ --- source/blender/blenkernel/intern/action.c | 2 -- source/blender/blenkernel/intern/anim.c | 6 +----- source/blender/blenkernel/intern/anim_sys.c | 2 -- source/blender/blenkernel/intern/armature.c | 2 -- source/blender/blenkernel/intern/constraint.c | 2 -- source/blender/blenkernel/intern/fcurve.c | 2 -- source/blender/blenkernel/intern/fmodifier.c | 2 -- source/blender/blenkernel/intern/gpencil.c | 2 -- source/blender/blenkernel/intern/ipo.c | 5 +---- source/blender/blenkernel/intern/nla.c | 2 -- 10 files changed, 2 insertions(+), 25 deletions(-) (limited to 'source/blender/blenkernel/intern') diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index a6539f00605..9c2467505cd 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c index 7ddb078ef8e..b965d14af00 100644 --- a/source/blender/blenkernel/intern/anim.c +++ b/source/blender/blenkernel/intern/anim.c @@ -1,8 +1,4 @@ -/* anim.c - * - * - * $Id$ - * +/* * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 832d13c9c2f..1c4746b1828 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index 0b31e51d62e..62ce184a2d7 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index a321e718bbb..91091d3880f 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index 28f17b3cf86..2e532222d5b 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/blenkernel/intern/fmodifier.c b/source/blender/blenkernel/intern/fmodifier.c index dcf81c19479..64e51023816 100644 --- a/source/blender/blenkernel/intern/fmodifier.c +++ b/source/blender/blenkernel/intern/fmodifier.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c index db0c9d2735f..c2e94cc97db 100644 --- a/source/blender/blenkernel/intern/gpencil.c +++ b/source/blender/blenkernel/intern/gpencil.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index d41a3a36b2d..0d3f3cc5ae4 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -1,7 +1,4 @@ -/* ipo.c - * - * $Id$ - * +/* * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index dad49646622..463f3bdd5cb 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or -- cgit v1.2.3 From a458de88b65c5fcb0f11c005c040163d3cf76cec Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Mon, 15 Aug 2011 21:50:09 +0000 Subject: 3D Audio GSoC: High quality resampling on mixdown, linear for playback. * Lots of improvements and fixes for the JOS resampler, now it works fine! * High quality filter coefficients for the JOS resampler (sorry for the 5 MB source file). * Fix for GE orientation bug. Note: moto uses x,y,z,w quaternion storage, while rest of blender uses w,x,y,z. * Minor changes/fixes. --- source/blender/blenkernel/intern/sound.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'source/blender/blenkernel/intern') diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 9c62b92a924..d7385a86105 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -372,14 +372,7 @@ void sound_load(struct Main *bmain, struct bSound* sound) AUD_Device* sound_mixdown(struct Scene *scene, AUD_DeviceSpecs specs, int start, float volume) { - AUD_Device* mixdown = AUD_openReadDevice(specs); - - AUD_setDeviceVolume(mixdown, volume); - - AUD_setSequencerSpecs(scene->sound_scene, specs.specs); - AUD_freeHandle(AUD_playDevice(mixdown, scene->sound_scene, start / FPS)); - - return mixdown; + return AUD_openMixdownDevice(specs, scene->sound_scene, volume, start / FPS); } void sound_create_scene(struct Scene *scene) -- cgit v1.2.3 From a67562e73cbc2f4a9641fbc4d1147b4b2cc935c4 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Tue, 16 Aug 2011 01:02:26 +0000 Subject: Bugfix [#28267] keyframed values for shapekeys of copied objects are linked Shapekey actions weren't getting copied when their owner data was. This was due to the IMO totally convoluted way in which the duplicate action flags have been set up: - the function to copy animdata takes a param to specify whether actions are copied or not, but this is never touched (i.e. this always just gets FALSE passed in) - instead, we jump around in hoops later figuring out whether the userpref wants copying to occur, then fixing up the links IIRC, part of this may be due to a desire/need to not duplicate actions when dealing with NodeTree copies for multi-threaded rendering, but at the expense of complicating everything else. --- source/blender/blenkernel/intern/anim_sys.c | 2 +- source/blender/blenkernel/intern/fmodifier.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/blenkernel/intern') diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 1c4746b1828..3c6daf8b39d 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -287,7 +287,7 @@ int BKE_copy_animdata_id (ID *id_to, ID *id_from, const short do_action) return 1; } -void BKE_copy_animdata_id_action(struct ID *id) +void BKE_copy_animdata_id_action(ID *id) { AnimData *adt= BKE_animdata_from_id(id); if (adt) { diff --git a/source/blender/blenkernel/intern/fmodifier.c b/source/blender/blenkernel/intern/fmodifier.c index 64e51023816..42554679795 100644 --- a/source/blender/blenkernel/intern/fmodifier.c +++ b/source/blender/blenkernel/intern/fmodifier.c @@ -604,7 +604,7 @@ static float fcm_cycles_time (FCurve *fcu, FModifier *fcm, float UNUSED(cvalue), /* calculate the 'number' of the cycle */ cycle= ((float)side * (evaltime - ofs) / cycdx); - + /* calculate the time inside the cycle */ cyct= fmod(evaltime - ofs, cycdx); -- cgit v1.2.3 From 06ae5e48258dacc5598b23286d46891be32a08e5 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Mon, 22 Aug 2011 02:14:39 +0000 Subject: Reshuffling DopeSheet filter icons so that they appear more obviously related to each other --- source/blender/blenkernel/intern/fmodifier.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/blenkernel/intern') diff --git a/source/blender/blenkernel/intern/fmodifier.c b/source/blender/blenkernel/intern/fmodifier.c index 42554679795..95c0aa60991 100644 --- a/source/blender/blenkernel/intern/fmodifier.c +++ b/source/blender/blenkernel/intern/fmodifier.c @@ -629,11 +629,11 @@ static float fcm_cycles_time (FCurve *fcu, FModifier *fcm, float UNUSED(cvalue), cycyofs = (float)ceil((evaltime - ofs) / cycdx); cycyofs *= cycdy; } - + /* special case for cycle start/end */ if(cyct == 0.0f) { evaltime = (side == 1 ? lastkey[0] : prevkey[0]); - + if((mode == FCM_EXTRAPOLATE_MIRROR) && ((int)cycle % 2)) evaltime = (side == 1 ? prevkey[0] : lastkey[0]); } -- cgit v1.2.3 From ee40894c05b1d5f07eda671bad74f18605cde0b6 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Mon, 22 Aug 2011 11:51:23 +0000 Subject: Bugfix [#28217] Moving multiple selected action strips causes strips to scale towards zero This is an attempted bugfix for a bug which seems to be very fickle to reproduce (it only happens sporadically after quickly jerking the strips around in a certain way). So far when testing, I haven't had any more problems after applying this fix, though it may just be unreliable testing. --- source/blender/blenkernel/intern/nla.c | 35 +++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) (limited to 'source/blender/blenkernel/intern') diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index 0235724c69c..25f824bba19 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -851,34 +851,35 @@ void BKE_nlameta_flush_transforms (NlaStrip *mstrip) /* for each child-strip, calculate new start/end points based on this new info */ for (strip= mstrip->strips.first; strip; strip= strip->next) { if (scaleChanged) { - PointerRNA ptr; - float p1, p2, nStart, nEnd; + float p1, p2; /* compute positions of endpoints relative to old extents of strip */ p1= (strip->start - oStart) / oLen; p2= (strip->end - oStart) / oLen; - /* compute the new strip endpoints using the proportions */ - nStart= (p1 * nLen) + mstrip->start; - nEnd= (p2 * nLen) + mstrip->start; - - /* firstly, apply the new positions manually, then apply using RNA - * - first time is to make sure no truncation errors from one endpoint not being - * set yet occur - * - second time is to make sure scale is computed properly... - */ - strip->start= nStart; - strip->end= nEnd; - - RNA_pointer_create(NULL, &RNA_NlaStrip, strip, &ptr); - RNA_float_set(&ptr, "frame_start", nStart); - RNA_float_set(&ptr, "frame_end", nEnd); + /* apply new strip endpoints using the proportions, then wait for second pass to flush scale properly */ + strip->start= (p1 * nLen) + mstrip->start; + strip->end= (p2 * nLen) + mstrip->start; } else { /* just apply the changes in offset to both ends of the strip */ strip->start += offset; strip->end += offset; } + } + + /* apply a second pass over child strips, to finish up unfinished business */ + for (strip= mstrip->strips.first; strip; strip= strip->next) { + /* only if scale changed, need to perform RNA updates */ + if (scaleChanged) { + PointerRNA ptr; + + /* use RNA updates to compute scale properly */ + RNA_pointer_create(NULL, &RNA_NlaStrip, strip, &ptr); + + RNA_float_set(&ptr, "frame_start", strip->start); + RNA_float_set(&ptr, "frame_end", strip->end); + } /* finally, make sure the strip's children (if it is a meta-itself), get updated */ BKE_nlameta_flush_transforms(strip); -- cgit v1.2.3 From ff8daca1f117b34c92462f4ab3bbe2aa50f95166 Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Tue, 23 Aug 2011 11:44:24 +0000 Subject: Bugfix: Removing a sound from a speaker resulted in a crash. --- source/blender/blenkernel/intern/sound.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'source/blender/blenkernel/intern') diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index d7385a86105..a364f860255 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -676,11 +676,17 @@ void sound_update_scene(struct Main* bmain, struct Scene* scene) if(AUD_removeSet(scene->speaker_handles, strip->speaker_handle)) { - AUD_moveSequence(strip->speaker_handle, strip->start / FPS, -1, 0); + if(speaker->sound) + AUD_moveSequence(strip->speaker_handle, strip->start / FPS, -1, 0); + else + { + AUD_removeSequence(scene->sound_scene, strip->speaker_handle); + strip->speaker_handle = NULL; + } } else { - if(speaker && speaker->sound) + if(speaker->sound) { strip->speaker_handle = AUD_addSequence(scene->sound_scene, speaker->sound->playback_handle, strip->start / FPS, -1, 0); AUD_setRelativeSequence(strip->speaker_handle, 0); -- cgit v1.2.3 From 8e12b7b054c3c4e95a23f26db232d99ff18e2b90 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sun, 28 Aug 2011 11:39:18 +0000 Subject: Assorted comment clarification in response to code review notes --- source/blender/blenkernel/intern/anim_sys.c | 2 +- source/blender/blenkernel/intern/depsgraph.c | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'source/blender/blenkernel/intern') diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 3c6daf8b39d..b690c9b4a91 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -1168,7 +1168,7 @@ static short animsys_write_rna_setting (PointerRNA *ptr, char *path, int array_i * for we know that which the updates in RNA were really just for * flushing property editing via UI/Py */ - if (RNA_struct_is_a(new_ptr.type, &RNA_PoseBone)) { + if (new_ptr.type == &RNA_PoseBone) { /* bone transforms - update pose (i.e. tag depsgraph) */ skip_updates_hack = 1; } diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c index 4802601307a..6f27a104144 100644 --- a/source/blender/blenkernel/intern/depsgraph.c +++ b/source/blender/blenkernel/intern/depsgraph.c @@ -2062,8 +2062,19 @@ static short animdata_use_time(AnimData *adt) return 1; } - /* experimental check: if we have drivers, more likely than not, on a frame change + /* If we have drivers, more likely than not, on a frame change * they'll need updating because their owner changed + * + * This is kindof a hack to get around a whole host of problems + * involving drivers using non-object datablock data (which the + * depsgraph currently has no way of representing let alone correctly + * dependency sort+tagging). By doing this, at least we ensure that + * some commonly attempted drivers (such as scene -> current frame; + * see "Driver updates fail" thread on Bf-committers dated July 2) + * will work correctly, and that other non-object datablocks will have + * their drivers update at least on frame change. + * + * -- Aligorith, July 4 2011 */ if (adt->drivers.first) return 1; -- cgit v1.2.3 From b4b046995b21d59e315eb71ed08fc1ae066c891b Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Sun, 28 Aug 2011 14:21:44 +0000 Subject: * Removing mocap GSoC (is an addon already). * Fixing ffmpeg-0.8 errors. * Fixing Ketsji paths. * Removing DoSound from BGE. * Fixing audio scene update to use only current scene objects. --- source/blender/blenkernel/intern/scene.c | 2 +- source/blender/blenkernel/intern/sequencer.c | 15 +++++---------- source/blender/blenkernel/intern/sound.c | 7 +++++-- 3 files changed, 11 insertions(+), 13 deletions(-) (limited to 'source/blender/blenkernel/intern') diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 12e81e8296e..d6003a44a7d 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -968,7 +968,7 @@ static void scene_update_tagged_recursive(Main *bmain, Scene *scene, Scene *scen scene_update_drivers(bmain, scene); /* update sound system animation */ - sound_update_scene(bmain, scene); + sound_update_scene(scene); } /* this is called in main loop, doing tagged updates before redraw */ diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 4cec086aad4..bfbaa223a99 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -3150,18 +3150,14 @@ void seq_update_sound_bounds_all(Scene *scene) { Editing *ed = scene->ed; - if(ed) - { + if(ed) { Sequence *seq; - for(seq = ed->seqbase.first; seq; seq = seq->next) - { - if(seq->type == SEQ_META) - { + 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)) - { + else if(ELEM(seq->type, SEQ_SOUND, SEQ_SCENE)) { seq_update_sound_bounds(scene, seq); } } @@ -3170,8 +3166,7 @@ void seq_update_sound_bounds_all(Scene *scene) void seq_update_sound_bounds(Scene* scene, Sequence *seq) { - if(seq->scene_sound) - { + 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 */ } diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index a364f860255..842923e63d0 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -24,6 +24,7 @@ #include "DNA_sound_types.h" #include "DNA_speaker_types.h" +#define WITH_AUDASPACE #ifdef WITH_AUDASPACE # include "AUD_C-API.h" #endif @@ -649,9 +650,10 @@ int sound_get_channels(struct bSound* sound) return info.specs.channels; } -void sound_update_scene(struct Main* bmain, struct Scene* scene) +void sound_update_scene(struct Scene* scene) { Object* ob; + Base* base; NlaTrack* track; NlaStrip* strip; Speaker* speaker; @@ -660,8 +662,9 @@ void sound_update_scene(struct Main* bmain, struct Scene* scene) void* handle; float quat[4]; - for(ob = bmain->object.first; ob; ob = ob->id.next) + for(base = FIRSTBASE; base; base=base->next) { + ob = base->object; if(ob->type == OB_SPEAKER) { if(ob->adt) -- cgit v1.2.3 From 5bac37f6d4d2e8d584ae0ec6bafd2808c47fbb25 Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Mon, 29 Aug 2011 15:01:55 +0000 Subject: * Reverting Titlecard commit r37537 * Reverting update recent files commit r37155 * Turning reference counts into unsigned ints * Minor things --- source/blender/blenkernel/intern/seqeffects.c | 135 -------------------------- source/blender/blenkernel/intern/sequencer.c | 3 +- source/blender/blenkernel/intern/sound.c | 1 - 3 files changed, 1 insertion(+), 138 deletions(-) (limited to 'source/blender/blenkernel/intern') diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c index 7e760319e70..34748c64efb 100644 --- a/source/blender/blenkernel/intern/seqeffects.c +++ b/source/blender/blenkernel/intern/seqeffects.c @@ -40,11 +40,8 @@ #include "BLI_dynlib.h" #include "BLI_math.h" /* windows needs for M_PI */ -#include "BLI_string.h" #include "BLI_utildefines.h" -#include "BLF_api.h" - #include "DNA_scene_types.h" #include "DNA_sequence_types.h" #include "DNA_anim_types.h" @@ -2807,130 +2804,6 @@ static struct ImBuf * do_solid_color( return out; } -/* ********************************************************************** - TITLE CARD - ********************************************************************** */ - -static void init_title_card(Sequence *seq) -{ - TitleCardVars *tv; - - if(seq->effectdata)MEM_freeN(seq->effectdata); - seq->effectdata = MEM_callocN(sizeof(struct TitleCardVars), "titlecard"); - - tv = (TitleCardVars *)seq->effectdata; - - BLI_strncpy(tv->titlestr, "Title goes here", sizeof(tv->titlestr)); - tv->fgcol[0] = tv->fgcol[1] = tv->fgcol[2] = 1.0f; /* white */ -} - -static int num_inputs_titlecard(void) -{ - return 0; -} - -static void free_title_card(Sequence *seq) -{ - if(seq->effectdata)MEM_freeN(seq->effectdata); - seq->effectdata = NULL; -} - -static void copy_title_card(Sequence *dst, Sequence *src) -{ - dst->effectdata = MEM_dupallocN(src->effectdata); -} - -static int early_out_titlecard(struct Sequence *UNUSED(seq), - float UNUSED(facf0), float UNUSED(facf1)) -{ - return -1; -} - -static struct ImBuf * do_title_card( - SeqRenderData context, Sequence *seq, float cfra, - float facf0, float facf1, - struct ImBuf *ibuf1, struct ImBuf *ibuf2, - struct ImBuf *ibuf3) -{ - TitleCardVars *tv = (TitleCardVars *)seq->effectdata; - - SolidColorVars cv = {{0}}; - struct ImBuf *out; - - int titleFontId = blf_default_font_render; // XXX: bad design! - - int width = context.rectx; - int height = context.recty; - float w, h; - int x, y; - - /* use fake solid-color vars to get backdrop (and an out buffer at the same time) */ - VECCOPY(cv.col, tv->bgcol); - seq->effectdata = &cv; - - out = do_solid_color(context, seq, cfra, - facf0, facf1, - ibuf1, ibuf2, ibuf3); - - seq->effectdata = tv; - - /* draw text */ - /* FIXME: imbuf out->rect is unsigned int NOT unsigned char, but without passing this pointer - * this drawing code doesn't work. This cast really masks some potential bugs though... - */ - BLF_buffer(titleFontId, out->rect_float, (unsigned char *)out->rect, width, height, 4); - - if (tv->titlestr[0]) { - /* automatic scale - these formulae have been derived experimentally: - * - base size is based on 40pt at 960 width - * - each 26 characters, size jumps down one step, - * but this decrease needs to be exponential to fit everything - */ - float lfac = strlen(tv->titlestr) / 26.0f; - float size = (width * 0.06f) * (1.0f - 0.1f*lfac*lfac); - - BLF_size(titleFontId, size, 72); - BLF_buffer_col(titleFontId, tv->fgcol[0], tv->fgcol[1], tv->fgcol[2], 1.0); - - BLF_width_and_height(titleFontId, tv->titlestr, &w, &h); - x = width/2.0f - w/2.0f; - if (tv->subtitle[0]) - y = height/2.0f + h; - else - y = height/2.0f; - - BLF_position(titleFontId, x, y, 0.0); - BLF_draw_buffer(titleFontId, tv->titlestr); - } - - if (tv->subtitle[0]) { - /* automatic scale - these formulae have been derived experimentally (as above): - * - base size is based on 20pt at 960 width - * - size steps aren't quite as refined here. Need a slower-growing curve! - */ - float lfac = strlen(tv->subtitle) / 36.0f; - float size = (width * 0.03f) * (1.0f - 0.1f*lfac*lfac*log(lfac)); - - BLF_size(titleFontId, size, 72); - BLF_buffer_col(titleFontId, tv->fgcol[0], tv->fgcol[1], tv->fgcol[2], 1.0); - - BLF_width_and_height(titleFontId, tv->subtitle, &w, &h); - x = width/2.0f - w/2.0f; - if (tv->titlestr[0]) - y = height/2.0f - h; - else - y = height/2.0f; - - BLF_position(titleFontId, x, y, 0.0); - BLF_draw_buffer(titleFontId, tv->subtitle); - } - - /* cleanup the buffer. */ - BLF_buffer(UIFONT_DEFAULT, NULL, NULL, 0, 0, 0); - - return out; -} - /* ********************************************************************** MULTICAM ********************************************************************** */ @@ -3470,14 +3343,6 @@ static struct SeqEffectHandle get_sequence_effect_impl(int seq_type) rval.early_out = early_out_adjustment; rval.execute = do_adjustment; break; - case SEQ_TITLECARD: - rval.init = init_title_card; - rval.num_inputs = num_inputs_titlecard; - rval.early_out = early_out_titlecard; - rval.free = free_title_card; - rval.copy = copy_title_card; - rval.execute = do_title_card; - break; } return rval; diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index bfbaa223a99..023a10b3103 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -903,7 +903,6 @@ static const char *give_seqname_by_type(int type) case SEQ_MULTICAM: return "Multicam"; case SEQ_ADJUSTMENT: return "Adjustment"; case SEQ_SPEED: return "Speed"; - case SEQ_TITLECARD: return "Title Card"; default: return NULL; } @@ -3029,7 +3028,7 @@ Sequence *seq_foreground_frame_get(Scene *scene, int frame) if(seq->flag & SEQ_MUTE || seq->startdisp > frame || seq->enddisp <= frame) continue; /* only use elements you can see - not */ - if (ELEM6(seq->type, SEQ_IMAGE, SEQ_META, SEQ_SCENE, SEQ_MOVIE, SEQ_COLOR, SEQ_TITLECARD)) { + if (ELEM5(seq->type, SEQ_IMAGE, SEQ_META, SEQ_SCENE, SEQ_MOVIE, SEQ_COLOR)) { if (seq->machine > best_machine) { best_seq = seq; best_machine = seq->machine; diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 842923e63d0..abead8d43dd 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -24,7 +24,6 @@ #include "DNA_sound_types.h" #include "DNA_speaker_types.h" -#define WITH_AUDASPACE #ifdef WITH_AUDASPACE # include "AUD_C-API.h" #endif -- cgit v1.2.3 From 5b5e600db6f529ad7e1af9d4bb3a193be2265342 Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Tue, 30 Aug 2011 07:57:55 +0000 Subject: Last bunch of minor fixes before merge. * Use NULL in AUD_Reference.h * Use SETLOOPER in sound.c * Move flags to the end of Speaker struct. --- source/blender/blenkernel/intern/sound.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/blender/blenkernel/intern') diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index abead8d43dd..985fef974d3 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -37,6 +37,7 @@ #include "BKE_packedFile.h" #include "BKE_animsys.h" #include "BKE_sequencer.h" +#include "BKE_scene.h" // evil global ;-) static int sound_cfra; @@ -656,12 +657,13 @@ void sound_update_scene(struct Scene* scene) NlaTrack* track; NlaStrip* strip; Speaker* speaker; + Scene* sce_it; void* new_set = AUD_createSet(); void* handle; float quat[4]; - for(base = FIRSTBASE; base; base=base->next) + for(SETLOOPER(scene, sce_it, base)) { ob = base->object; if(ob->type == OB_SPEAKER) -- cgit v1.2.3