diff options
author | Joerg Mueller <nexyon@gmail.com> | 2009-08-06 17:40:44 +0400 |
---|---|---|
committer | Joerg Mueller <nexyon@gmail.com> | 2009-08-06 17:40:44 +0400 |
commit | 0596724fbb5bebdfaae83a95c19ff49d21601cc0 (patch) | |
tree | aab2b786d207c6c774657385db5a8a1e7bd70e39 | |
parent | b27f89d3d2fbeff7471fd785f6429e9d0d173d72 (diff) |
Code cleanup for the merge.
40 files changed, 40 insertions, 1190 deletions
diff --git a/intern/audaspace/OpenAL/AUD_OpenALDevice.cpp b/intern/audaspace/OpenAL/AUD_OpenALDevice.cpp index 4021df7d9c7..e4c286c1aa4 100644 --- a/intern/audaspace/OpenAL/AUD_OpenALDevice.cpp +++ b/intern/audaspace/OpenAL/AUD_OpenALDevice.cpp @@ -38,6 +38,8 @@ #include <unistd.h> #endif +#define AUD_OPENAL_CYCLE_BUFFERS 3 + /// Saves the data for playback. struct AUD_OpenALHandle : AUD_Handle { @@ -57,7 +59,7 @@ struct AUD_OpenALHandle : AUD_Handle ALuint source; /// OpenAL buffers. - ALuint buffers[3]; + ALuint buffers[AUD_OPENAL_CYCLE_BUFFERS]; /// The first buffer to be read next. int current; @@ -193,7 +195,8 @@ void AUD_OpenALDevice::updateStreams() break; } - sound->current = (sound->current+1) % 3; + sound->current = (sound->current+1) % + AUD_OPENAL_CYCLE_BUFFERS; } else break; @@ -325,7 +328,7 @@ AUD_OpenALDevice::~AUD_OpenALDevice() if(!sound->isBuffered) { delete sound->reader; AUD_DELETE("reader") - alDeleteBuffers(3, sound->buffers); + alDeleteBuffers(AUD_OPENAL_CYCLE_BUFFERS, sound->buffers); } delete sound; AUD_DELETE("handle") m_playingSounds->erase(m_playingSounds->begin()); @@ -339,7 +342,7 @@ AUD_OpenALDevice::~AUD_OpenALDevice() if(!sound->isBuffered) { delete sound->reader; AUD_DELETE("reader") - alDeleteBuffers(3, sound->buffers); + alDeleteBuffers(AUD_OPENAL_CYCLE_BUFFERS, sound->buffers); } delete sound; AUD_DELETE("handle") m_pausedSounds->erase(m_pausedSounds->begin()); @@ -615,7 +618,7 @@ AUD_Handle* AUD_OpenALDevice::play(AUD_IFactory* factory, bool keep) // OpenAL playback code try { - alGenBuffers(3, sound->buffers); + alGenBuffers(AUD_OPENAL_CYCLE_BUFFERS, sound->buffers); if(alGetError() != AL_NO_ERROR) AUD_THROW(AUD_ERROR_OPENAL); @@ -624,7 +627,7 @@ AUD_Handle* AUD_OpenALDevice::play(AUD_IFactory* factory, bool keep) sample_t* buf; int length; - for(int i=0; i<3; i++) + for(int i = 0; i < AUD_OPENAL_CYCLE_BUFFERS; i++) { length = m_buffersize; reader->read(length, buf); @@ -640,7 +643,8 @@ AUD_Handle* AUD_OpenALDevice::play(AUD_IFactory* factory, bool keep) try { - alSourceQueueBuffers(sound->source, 3, sound->buffers); + alSourceQueueBuffers(sound->source, AUD_OPENAL_CYCLE_BUFFERS, + sound->buffers); if(alGetError() != AL_NO_ERROR) AUD_THROW(AUD_ERROR_OPENAL); } @@ -652,7 +656,7 @@ AUD_Handle* AUD_OpenALDevice::play(AUD_IFactory* factory, bool keep) } catch(AUD_Exception e) { - alDeleteBuffers(3, sound->buffers); + alDeleteBuffers(AUD_OPENAL_CYCLE_BUFFERS, sound->buffers); throw; } } @@ -734,7 +738,7 @@ bool AUD_OpenALDevice::stop(AUD_Handle* handle) if(!sound->isBuffered) { delete sound->reader; AUD_DELETE("reader") - alDeleteBuffers(3, sound->buffers); + alDeleteBuffers(AUD_OPENAL_CYCLE_BUFFERS, sound->buffers); } delete *i; AUD_DELETE("handle") m_playingSounds->erase(i); @@ -752,7 +756,7 @@ bool AUD_OpenALDevice::stop(AUD_Handle* handle) if(!sound->isBuffered) { delete sound->reader; AUD_DELETE("reader") - alDeleteBuffers(3, sound->buffers); + alDeleteBuffers(AUD_OPENAL_CYCLE_BUFFERS, sound->buffers); } delete *i; AUD_DELETE("handle") m_pausedSounds->erase(i); @@ -825,14 +829,16 @@ bool AUD_OpenALDevice::seek(AUD_Handle* handle, float position) if(info != AL_STOPPED) alSourceStop(alhandle->source); - alSourceUnqueueBuffers(alhandle->source, 3, alhandle->buffers); + alSourceUnqueueBuffers(alhandle->source, + AUD_OPENAL_CYCLE_BUFFERS, + alhandle->buffers); if(alGetError() == AL_NO_ERROR) { sample_t* buf; int length; AUD_Specs specs = alhandle->reader->getSpecs(); - for(int i=0; i<3; i++) + for(int i = 0; i < AUD_OPENAL_CYCLE_BUFFERS; i++) { length = m_buffersize; alhandle->reader->read(length, buf); @@ -844,7 +850,8 @@ bool AUD_OpenALDevice::seek(AUD_Handle* handle, float position) break; } - alSourceQueueBuffers(alhandle->source, 3, + alSourceQueueBuffers(alhandle->source, + AUD_OPENAL_CYCLE_BUFFERS, alhandle->buffers); } diff --git a/source/blender/blenkernel/BKE_packedFile.h b/source/blender/blenkernel/BKE_packedFile.h index 0532047466e..fe444c03879 100644 --- a/source/blender/blenkernel/BKE_packedFile.h +++ b/source/blender/blenkernel/BKE_packedFile.h @@ -50,7 +50,6 @@ void packAll(struct Main *bmain, struct ReportList *reports); /* unpack */ char *unpackFile(struct ReportList *reports, char *abs_name, char *local_name, struct PackedFile *pf, int how); int unpackVFont(struct ReportList *reports, struct VFont *vfont, int how); -// AUD_XXX int unpackSample(struct ReportList *reports, struct bSample *sample, int how); int unpackSound(struct ReportList *reports, struct bSound *sound, int how); int unpackImage(struct ReportList *reports, struct Image *ima, int how); void unpackAll(struct Main *bmain, struct ReportList *reports, int how); diff --git a/source/blender/blenkernel/BKE_sequence.h b/source/blender/blenkernel/BKE_sequence.h index 280bf29b435..3a390bb07a0 100644 --- a/source/blender/blenkernel/BKE_sequence.h +++ b/source/blender/blenkernel/BKE_sequence.h @@ -183,5 +183,4 @@ int seq_test_overlap(struct ListBase * seqbasep, struct Sequence *test); int shuffle_seq(struct ListBase * seqbasep, struct Sequence *test); void free_imbuf_seq(struct ListBase * seqbasep, int check_mem_usage); -// AUD_XXX void seq_update_sound(struct Sequence *seq); diff --git a/source/blender/blenkernel/BKE_sound.h b/source/blender/blenkernel/BKE_sound.h index 974c7620deb..ef66b29f112 100644 --- a/source/blender/blenkernel/BKE_sound.h +++ b/source/blender/blenkernel/BKE_sound.h @@ -33,26 +33,10 @@ struct PackedFile; struct bSound; -// AUD_XXX struct bSample; struct bContext; struct ListBase; struct Main; -/* bad bad global... */ -// AUD_XXX -/*extern struct ListBase *samples; - -void sound_free_all_samples(void);*/ - -/* void *sound_get_listener(void); implemented in src!also declared there now */ - -// AUD_XXX -/*void sound_set_packedfile(struct bSample* sample, struct PackedFile* pf); -struct PackedFile* sound_find_packedfile(struct bSound* sound); -void sound_free_sample(struct bSample* sample); -void sound_free_sound(struct bSound* sound);*/ - -// AUD_XXX void sound_init(); void sound_reinit(struct bContext *C); @@ -61,7 +45,7 @@ void sound_exit(); struct bSound* sound_new_file(struct Main *main, char* filename); -// AUD_XXX unused currently +// XXX unused currently #if 0 struct bSound* sound_new_buffer(struct bContext *C, struct bSound *source); diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index 9df8c166304..af3913791c4 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -176,8 +176,6 @@ void pushpop_test() void free_blender(void) { /* samples are in a global list..., also sets G.main->sound->sample NULL */ -// AUD_XXX sound_free_all_samples(); - free_main(G.main); G.main= NULL; @@ -330,9 +328,6 @@ static void setup_app_data(bContext *C, BlendFileData *bfd, char *filename) MEM_freeN(bfd->user); } - /* samples is a global list... */ -// AUD_XXX sound_free_all_samples(); - /* case G_FILE_NO_UI or no screens in file */ if(mode) { /* leave entire context further unaltered? */ diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index da20d0d598a..67f79d026d7 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -567,7 +567,6 @@ void free_libblock(ListBase *lb, void *idv) //XXX free_script((Script *)id); break; case ID_SO: -// AUD_XXX sound_free_sound((bSound *)id); sound_free((bSound*)id); break; case ID_GR: diff --git a/source/blender/blenkernel/intern/packedFile.c b/source/blender/blenkernel/intern/packedFile.c index d27bfa4d87e..6aa94029c9f 100644 --- a/source/blender/blenkernel/intern/packedFile.c +++ b/source/blender/blenkernel/intern/packedFile.c @@ -123,7 +123,6 @@ int countPackedFiles(Main *bmain) { Image *ima; VFont *vf; -// AUD_XXX bSample *sample; bSound *sound; int count = 0; @@ -136,14 +135,9 @@ int countPackedFiles(Main *bmain) if(vf->packedfile) count++; -// AUD_XXX for(sound=bmain->sound.first; sound; sound=sound->id.next) if(sound->packedfile) count++; -/* if(samples) - for(sample=samples->first; sample; sample=sample->id.next) - if(sample->packedfile) - count++;*/ return count; } @@ -213,7 +207,6 @@ void packAll(Main *bmain, ReportList *reports) { Image *ima; VFont *vf; -// AUD_XXX bSample *sample; bSound *sound; for(ima=bmain->image.first; ima; ima=ima->id.next) @@ -224,14 +217,9 @@ void packAll(Main *bmain, ReportList *reports) if(vf->packedfile == NULL) vf->packedfile = newPackedFile(reports, vf->name); -// AUD_XXX for(sound=bmain->sound.first; sound; sound=sound->id.next) if(sound->packedfile == NULL) sound->packedfile = newPackedFile(reports, sound->name); -/* if(samples) - for(sample=samples->first; sample; sample=sample->id.next) - if(sample->packedfile == NULL) - sound_set_packedfile(sample, newPackedFile(reports, sample->name));*/ } @@ -466,36 +454,6 @@ int unpackVFont(ReportList *reports, VFont *vfont, int how) return (ret_value); } -/*int unpackSample(ReportList *reports, bSample *sample, int how) -{ - char localname[FILE_MAXDIR + FILE_MAX], fi[FILE_MAX]; - char *newname; - int ret_value = RET_ERROR; - PackedFile *pf; - - if (sample != NULL) { - strcpy(localname, sample->name); - BLI_splitdirstring(localname, fi); - sprintf(localname, "//samples/%s", fi); - - newname = unpackFile(reports, sample->name, localname, sample->packedfile, how); - if (newname != NULL) { - strcpy(sample->name, newname); - MEM_freeN(newname); - - pf = sample->packedfile; - // because samples and sounds can point to the - // same packedfile we have to check them all -// AUD_XXX sound_set_packedfile(sample, NULL); - freePackedFile(pf); - - ret_value = RET_OK; - } - } - - return(ret_value); -}*/ - int unpackSound(ReportList *reports, bSound *sound, int how) { char localname[FILE_MAXDIR + FILE_MAX], fi[FILE_MAX]; @@ -512,13 +470,9 @@ int unpackSound(ReportList *reports, bSound *sound, int how) strcpy(sound->name, newname); MEM_freeN(newname); - // because samples and sounds can point to the - // same packedfile we have to check them all -// AUD_XXX sound_set_packedfile(sample, NULL); freePackedFile(sound->packedfile); sound->packedfile = 0; -// AUD_XXX sound_load(sound); ret_value = RET_OK; @@ -557,7 +511,6 @@ void unpackAll(Main *bmain, ReportList *reports, int how) { Image *ima; VFont *vf; -// AUD_XXX bSample *sample; bSound *sound; for(ima=bmain->image.first; ima; ima=ima->id.next) @@ -571,11 +524,5 @@ void unpackAll(Main *bmain, ReportList *reports, int how) for(sound=bmain->sound.first; sound; sound=sound->id.next) if(sound->packedfile) unpackSound(reports, sound, how); - -// AUD_XXX -/* if(samples) - for(sample=samples->first; sample; sample=sample->id.next) - if(sample->packedfile) - unpackSample(reports, sample, how);*/ } diff --git a/source/blender/blenkernel/intern/sequence.c b/source/blender/blenkernel/intern/sequence.c index 59b7e528d91..8f3071617a9 100644 --- a/source/blender/blenkernel/intern/sequence.c +++ b/source/blender/blenkernel/intern/sequence.c @@ -52,7 +52,6 @@ #include "BLI_threads.h" #include <pthread.h> -// AUD_XXX #include "BKE_context.h" #include "BKE_sound.h" #include "AUD_C-API.h" @@ -183,7 +182,6 @@ void seq_free_strip(Strip *strip) MEM_freeN(strip); } -// AUD_XXX void seq_free_sequence(Scene *scene, Sequence *seq) { Editing *ed = scene->ed; @@ -191,8 +189,7 @@ void seq_free_sequence(Scene *scene, Sequence *seq) if(seq->strip) seq_free_strip(seq->strip); if(seq->anim) IMB_free_anim(seq->anim); - //XXX if(seq->hdaudio) sound_close_hdaudio(seq->hdaudio); - // AUD_XXX + if(seq->sound_handle) sound_delete_handle(scene, seq->sound_handle); @@ -457,7 +454,6 @@ void calc_sequence_disp(Sequence *seq) seq->handsize= (float)((seq->enddisp-seq->startdisp)/25); } - // AUD_XXX seq_update_sound(seq); } @@ -573,28 +569,6 @@ void reload_sequence_new_file(Scene *scene, Sequence * seq) seq->len = 0; } seq->strip->len = seq->len; -// AUD_XXX -#if 0 - } else if (seq->type == SEQ_HD_SOUND) { -// XXX if(seq->hdaudio) sound_close_hdaudio(seq->hdaudio); -// seq->hdaudio = sound_open_hdaudio(str); - -// AUD_XXX -/* if (!seq->hdaudio) { - return; - }*/ - -// XXX seq->len = sound_hdaudio_get_duration(seq->hdaudio, FPS) - seq->anim_startofs - seq->anim_endofs; -// AUD_XXX - if(seq->sound && seq->sound->snd_sound) - seq->len = AUD_getInfo(seq->sound->snd_sound).length * FPS - seq->anim_startofs - seq->anim_endofs; - - if (seq->len < 0) { - seq->len = 0; - } - seq->strip->len = seq->len; -#endif -// AUD_XXX } else if (seq->type == SEQ_SOUND) { seq->len = AUD_getInfo(seq->sound->snd_sound).length * FPS; seq->len -= seq->anim_startofs; @@ -715,9 +689,7 @@ char *give_seqname_by_type(int type) case SEQ_IMAGE: return "Image"; case SEQ_SCENE: return "Scene"; case SEQ_MOVIE: return "Movie"; - case SEQ_SOUND: return "Audio"; -// AUD_XXX case SEQ_RAM_SOUND: return "Audio (RAM)"; -// AUD_XXX case SEQ_HD_SOUND: return "Audio (HD)"; + case SEQ_SOUND: return "Audio"; case SEQ_CROSS: return "Cross"; case SEQ_GAMCROSS: return "Gamma Cross"; case SEQ_ADD: return "Add"; @@ -1096,8 +1068,6 @@ static int video_seq_is_rendered(Sequence * seq) { return (seq && !(seq->flag & SEQ_MUTE) -// AUD_XXX && seq->type != SEQ_RAM_SOUND -// AUD_XXX && seq->type != SEQ_HD_SOUND); && seq->type != SEQ_SOUND); } @@ -3333,7 +3303,6 @@ void seq_tx_handle_xlimits(Sequence *seq, int leftflag, int rightflag) } /* sounds cannot be extended past their endpoints */ -// AUD_XXX if (seq->type == SEQ_RAM_SOUND || seq->type == SEQ_HD_SOUND) { if (seq->type == SEQ_SOUND) { seq->startstill= 0; seq->endstill= 0; @@ -3432,7 +3401,6 @@ int shuffle_seq(ListBase * seqbasep, Sequence *test) } } -// AUD_XXX void seq_update_sound(struct Sequence *seq) { if(seq->type == SEQ_SOUND) diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 68edb3b3ab4..c3981180c0f 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -17,7 +17,6 @@ #include "DNA_screen_types.h" #include "DNA_userdef_types.h" -// AUD_XXX #include "AUD_C-API.h" #include "BKE_utildefines.h" @@ -32,129 +31,6 @@ #include <config.h> #endif -// AUD_XXX ListBase _samples = {0,0}, *samples = &_samples; - -/*void sound_free_sound(bSound *sound) -{*/ - /* when sounds have been loaded, but not played, the packedfile was not copied - to sample block and not freed otherwise */ -// AUD_XXX -/* if(sound->sample==NULL) { - if (sound->newpackedfile) { - freePackedFile(sound->newpackedfile); - sound->newpackedfile = NULL; - } - } - if (sound->stream) free(sound->stream); -}*/ - -// AUD_XXX -/* -void sound_free_sample(bSample *sample) -{ - if (sample) { - if (sample->data != &sample->fakedata[0] && sample->data != NULL) { - MEM_freeN(sample->data); - sample->data = &sample->fakedata[0]; - } - - if (sample->packedfile) { - freePackedFile(sample->packedfile); //FIXME: crashes sometimes - sample->packedfile = NULL; - } - - if (sample->alindex != SAMPLE_INVALID) { -// AUD_free_sample(sample->snd_sample); - sample->alindex = SAMPLE_INVALID; - } - - sample->type = SAMPLE_INVALID; - } -}*/ - -/* this is called after file reading or undos */ -// AUD_XXX -/* -void sound_free_all_samples(void) -{ -// AUD_XXX bSample *sample; - bSound *sound; -*/ - /* ensure no sample pointers exist, and check packedfile */ -// AUD_XXX -/* for(sound= G.main->sound.first; sound; sound= sound->id.next) { - if(sound->sample && sound->sample->packedfile==sound->newpackedfile) - sound->newpackedfile= NULL; - sound->sample= NULL; - }*/ - - /* now free samples */ -// AUD_XXX -/* for(sample= samples->first; sample; sample= sample->id.next) - sound_free_sample(sample); - BLI_freelistN(samples);*/ - -// AUD_XXX } - -// AUD_XXX -/* -void sound_set_packedfile(bSample *sample, PackedFile *pf) -{ - bSound *sound; - - if (sample) { - sample->packedfile = pf; - sound = G.main->sound.first; - while (sound) { - if (sound->sample == sample) { - sound->newpackedfile = pf; - if (pf == NULL) { - strcpy(sound->name, sample->name); - } - } - sound = sound->id.next; - } - } -} - -PackedFile* sound_find_packedfile(bSound *sound) -{ - bSound *search; - PackedFile *pf = NULL; - char soundname[FILE_MAXDIR + FILE_MAXFILE], searchname[FILE_MAXDIR + FILE_MAXFILE]; - - // convert sound->name to abolute filename - strcpy(soundname, sound->name); - BLI_convertstringcode(soundname, G.sce); - - search = G.main->sound.first; - while (search) { - if (search->sample && search->sample->packedfile) { - strcpy(searchname, search->sample->name); - BLI_convertstringcode(searchname, G.sce); - - if (BLI_streq(searchname, soundname)) { - pf = search->sample->packedfile; - break; - } - } - - if (search->newpackedfile) { - strcpy(searchname, search->name); - BLI_convertstringcode(searchname, G.sce); - if (BLI_streq(searchname, soundname)) { - pf = search->newpackedfile; - break; - } - } - search = search->id.next; - } - - return (pf); -}*/ - -// AUD_XXX - void sound_init() { AUD_Specs specs; @@ -228,7 +104,7 @@ struct bSound* sound_new_file(struct Main *main, char* filename) return sound; } -// AUD_XXX unused currently +// XXX unused currently #if 0 struct bSound* sound_new_buffer(struct bContext *C, struct bSound *source) { @@ -490,7 +366,7 @@ void sound_update_playing(struct bContext *C) { int position = AUD_getPosition(handle->handle); if(fabs(position - (cfra - handle->startframe) / fps) > SOUND_PLAYBACK_LAMBDA) -// if(fabs(position * fps - cfra + handle->startframe) > 5.0f) +// AUD_XXX if(fabs(position * fps - cfra + handle->startframe) > 5.0f) { action = 2; } diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index 380a5c978f9..e7164dc4794 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -65,7 +65,6 @@ #include "DNA_scene_types.h" -// AUD_XXX #include "AUD_C-API.h" #include "BKE_sound.h" #include "BKE_main.h" @@ -101,7 +100,6 @@ static int audio_input_frame_size = 0; static uint8_t* audio_output_buffer = 0; static int audio_outbuf_size = 0; -// AUD_XXX static AUD_Device* audio_mixdown_device = 0; #define FFMPEG_AUTOSPLIT_SIZE 2000000000 @@ -135,11 +133,6 @@ static int write_audio_frame(void) c = get_codec_from_stream(audio_stream); - //XXX audiostream_fill(audio_input_buffer, - // audio_input_frame_size - // * sizeof(short) * c->channels); - - // AUD_XXX if(audio_mixdown_device) AUD_readDevice(audio_mixdown_device, audio_input_buffer, audio_input_frame_size); @@ -845,7 +838,6 @@ void start_ffmpeg(struct Scene *scene, RenderData *rd, int rectx, int recty) start_ffmpeg_impl(rd, rectx, recty); - // AUD_XXX if(ffmpeg_multiplex_audio && audio_stream) { AVCodecContext* c = get_codec_from_stream(audio_stream); @@ -908,7 +900,6 @@ void end_ffmpeg(void) write_audio_frames(); } - // AUD_XXX if(audio_mixdown_device) { AUD_closeReadDevice(audio_mixdown_device); diff --git a/source/blender/blenlib/intern/bpath.c b/source/blender/blenlib/intern/bpath.c index 3ee9fadb2e7..6c89afe7173 100644 --- a/source/blender/blenlib/intern/bpath.c +++ b/source/blender/blenlib/intern/bpath.c @@ -51,7 +51,6 @@ /* for sequence */ //XXX #include "BSE_sequence.h" //XXX define below from BSE_sequence.h - otherwise potentially odd behaviour -// AUD_XXX #define SEQ_HAS_PATH(seq) (seq->type==SEQ_MOVIE || seq->type==SEQ_HD_SOUND || seq->type==SEQ_RAM_SOUND || seq->type==SEQ_IMAGE) #define SEQ_HAS_PATH(seq) (seq->type==SEQ_MOVIE || seq->type==SEQ_IMAGE) /* path/file handeling stuff */ diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 14f7a665bc3..d8ac61dd146 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -149,7 +149,6 @@ #include "BKE_utildefines.h" // SWITCH_INT DATA ENDB DNA1 O_BINARY GLOB USER TEST REND #include "BKE_idprop.h" -// AUD_XXX #include "BKE_sound.h" //XXX #include "BIF_butspace.h" // badlevel, for do_versions, patching event codes @@ -4044,7 +4043,6 @@ static void lib_link_scene(FileData *fd, Main *main) SEQ_BEGIN(sce->ed, seq) { if(seq->ipo) seq->ipo= newlibadr_us(fd, sce->id.lib, seq->ipo); if(seq->scene) seq->scene= newlibadr(fd, sce->id.lib, seq->scene); - // AUD_XXX if(seq->sound) { if(seq->type == SEQ_HD_SOUND) seq->type = SEQ_SOUND; @@ -4056,7 +4054,6 @@ static void lib_link_scene(FileData *fd, Main *main) } } seq->anim= 0; -// AUD_XXX seq->hdaudio = 0; } SEQ_END @@ -4100,7 +4097,7 @@ static void direct_link_scene(FileData *fd, Scene *sce) sce->theDag = NULL; sce->dagisvalid = 0; sce->obedit= NULL; - // AUD_XXX + memset(&sce->sound_handles, 0, sizeof(sce->sound_handles)); /* set users to one by default, not in lib-link, this will increase it for compo nodes */ @@ -5041,7 +5038,6 @@ static void lib_link_sound(FileData *fd, Main *main) sound->ipo= newlibadr_us(fd, sound->id.lib, sound->ipo); // XXX depreceated - old animation system sound->stream = 0; - // AUD_XXX sound_load(sound); } sound= sound->id.next; @@ -9189,7 +9185,6 @@ static void do_versions(FileData *fd, Library *lib, Main *main) PTCacheID *pid; ListBase pidlist; -// AUD_XXX bSound *sound; Sequence *seq; bActuator *act; diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 177499e1a2f..5e2ef5a534b 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -2137,53 +2137,23 @@ static void write_texts(WriteData *wd, ListBase *idbase) static void write_sounds(WriteData *wd, ListBase *idbase) { bSound *sound; -// AUD_XXX bSample *sample; PackedFile * pf; // set all samples to unsaved status -// AUD_XXX -/* sample = samples->first; // samples is a global defined in sound.c - while (sample) { - sample->flags |= SAMPLE_NEEDS_SAVE; - sample = sample->id.next; - }*/ - sound= idbase->first; while(sound) { if(sound->id.us>0 || wd->current) { - // do we need to save the packedfile as well ? -// AUD_XXX - /*sample = sound->sample; - if (sample) { - if (sample->flags & SAMPLE_NEEDS_SAVE) { - sound->newpackedfile = sample->packedfile; - sample->flags &= ~SAMPLE_NEEDS_SAVE; - } else { - sound->newpackedfile = NULL; - } - }*/ - /* write LibData */ writestruct(wd, ID_SO, "bSound", 1, sound); if (sound->id.properties) IDP_WriteProperty(sound->id.properties, wd); -// AUD_XXX if (sound->packedfile) { pf = sound->packedfile; writestruct(wd, DATA, "PackedFile", 1, pf); writedata(wd, DATA, pf->size, pf->data); } -/* if (sound->newpackedfile) { - pf = sound->newpackedfile; - writestruct(wd, DATA, "PackedFile", 1, pf); - writedata(wd, DATA, pf->size, pf->data); - } - - if (sample) { - sound->newpackedfile = sample->packedfile; - }*/ } sound= sound->id.next; } diff --git a/source/blender/editors/animation/anim_ops.c b/source/blender/editors/animation/anim_ops.c index 3bfe21ae818..ffa44e60d00 100644 --- a/source/blender/editors/animation/anim_ops.c +++ b/source/blender/editors/animation/anim_ops.c @@ -56,7 +56,6 @@ #include "ED_markers.h" #include "ED_screen.h" -// AUD_XXX #include "BKE_sound.h" /* ********************** frame change operator ***************************/ @@ -94,7 +93,6 @@ static void change_frame_apply(bContext *C, wmOperator *op) if (cfra < MINAFRAME) cfra= MINAFRAME; CFRA= cfra; - // AUD_XXX sound_scrub(C); WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene); diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 3b482ec3512..d68f5f5d7dc 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -56,7 +56,6 @@ #include "BKE_report.h" #include "BKE_screen.h" #include "BKE_utildefines.h" -// AUD_XXX #include "BKE_sound.h" #include "WM_api.h" @@ -2280,7 +2279,6 @@ static int screen_animation_step(bContext *C, wmOperator *op, wmEvent *event) /* since we follow drawflags, we can't send notifier but tag regions ourselves */ ED_update_for_newframe(C, 1); - // AUD_XXX sound_update_playing(C); for(sa= screen->areabase.first; sa; sa= sa->next) { @@ -2327,7 +2325,6 @@ static int screen_animation_play(bContext *C, wmOperator *op, wmEvent *event) if(screen->animtimer) { ED_screen_animation_timer(C, 0, 0); - // AUD_XXX sound_stop_all(C); } else { diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c index e84faa99a09..51cc8507ff8 100644 --- a/source/blender/editors/space_outliner/outliner.c +++ b/source/blender/editors/space_outliner/outliner.c @@ -4178,14 +4178,12 @@ static void tselem_draw_icon(float x, float y, TreeStoreElem *tselem, TreeElemen case TSE_POSEGRP_BASE: UI_icon_draw(x, y, ICON_VERTEXSEL); break; case TSE_SEQUENCE: -// AUD_XXX if((te->idcode==SEQ_MOVIE) || (te->idcode==SEQ_MOVIE_AND_HD_SOUND)) if(te->idcode==SEQ_MOVIE) UI_icon_draw(x, y, ICON_SEQUENCE); else if(te->idcode==SEQ_META) UI_icon_draw(x, y, ICON_DOT); else if(te->idcode==SEQ_SCENE) UI_icon_draw(x, y, ICON_SCENE); -// else if((te->idcode==SEQ_RAM_SOUND) || (te->idcode==SEQ_HD_SOUND)) else if(te->idcode==SEQ_SOUND) UI_icon_draw(x, y, ICON_SOUND); else if(te->idcode==SEQ_IMAGE) diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c index 7a50a0d019f..c527b418a31 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.c +++ b/source/blender/editors/space_sequencer/sequencer_add.c @@ -89,7 +89,6 @@ #include "UI_resources.h" #include "UI_view2d.h" -// AUD_XXX #include "BKE_sound.h" #include "AUD_C-API.h" diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index 347bd0a6d5d..3d0d908d3f6 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -173,8 +173,6 @@ static void get_seq_color3ubv(Scene *curscene, Sequence *seq, char *col) case SEQ_PLUGIN: UI_GetThemeColor3ubv(TH_SEQ_PLUGIN, col); break; -// AUD_XXX case SEQ_HD_SOUND: -// AUD_XXX case SEQ_RAM_SOUND: case SEQ_SOUND: UI_GetThemeColor3ubv(TH_SEQ_AUDIO, col); blendcol[0] = blendcol[1] = blendcol[2] = 128; @@ -547,18 +545,9 @@ static void draw_seq_text(View2D *v2d, Sequence *seq, float x1, float x2, float else sprintf(str, "%d | %s", seq->len, give_seqname(seq)); } -// AUD_XXX else if (seq->type == SEQ_SOUND) { sprintf(str, "%d | %s", seq->len, seq->sound->name); } -#if 0 - else if (seq->type == SEQ_RAM_SOUND) { - sprintf(str, "%d | %s", seq->len, seq->strip->stripdata->name); - } - else if (seq->type == SEQ_HD_SOUND) { - sprintf(str, "%d | %s", seq->len, seq->strip->stripdata->name); - } -#endif else if (seq->type == SEQ_MOVIE) { sprintf(str, "%d | %s%s", seq->len, seq->strip->dir, seq->strip->stripdata->name); } @@ -671,8 +660,8 @@ static void draw_seq_strip(Scene *scene, ARegion *ar, SpaceSeq *sseq, Sequence * draw_shadedstrip(seq, background_col, x1, y1, x2, y2); /* draw additional info and controls */ -// AUD_XXX -/* if (seq->type == SEQ_RAM_SOUND) +// XXX +/* if (seq->type == SEQ_SOUND) drawseqwave(scene, v2d, seq, x1, y1, x2, y2, ar->winx);*/ if (!is_single_image) diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index da6507188e8..1555784f470 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -65,7 +65,6 @@ #include "BKE_scene.h" #include "BKE_utildefines.h" #include "BKE_report.h" -// AUD_XXX #include "BKE_sound.h" #include "WM_api.h" @@ -168,7 +167,6 @@ Sequence *get_foreground_frame_seq(Scene *scene, int frame) if(seq->flag & SEQ_MUTE || seq->startdisp > frame || seq->enddisp <= frame) continue; /* only use elements you can see - not */ -// AUD_XXX if (ELEM6(seq->type, SEQ_IMAGE, SEQ_META, SEQ_SCENE, SEQ_MOVIE, SEQ_MOVIE_AND_HD_SOUND, SEQ_COLOR)) { if (ELEM5(seq->type, SEQ_IMAGE, SEQ_META, SEQ_SCENE, SEQ_MOVIE, SEQ_COLOR)) { if (seq->machine > best_machine) { best_seq = seq; @@ -725,7 +723,6 @@ int seq_effect_find_selected(Scene *scene, Sequence *activeseq, int type, Sequen for(seq=ed->seqbasep->first; seq; seq=seq->next) { if(seq->flag & SELECT) { -// AUD_XXX if (seq->type == SEQ_RAM_SOUND || seq->type == SEQ_HD_SOUND) { if (seq->type == SEQ_SOUND) { *error_str= "Can't apply effects to audio sequence strips"; return 0; @@ -860,7 +857,6 @@ static void recurs_del_seq_flag(Scene *scene, ListBase *lb, short flag, short de while(seq) { seqn= seq->next; if((seq->flag & flag) || deleteall) { -// AUD_XXX if(seq->type==SEQ_RAM_SOUND && seq->sound) if(seq->type==SEQ_SOUND && seq->sound) seq->sound->id.us--; @@ -940,19 +936,13 @@ static Sequence *dupli_seq(struct Scene *scene, Sequence *seq) seqn->strip->stripdata = MEM_dupallocN(seq->strip->stripdata); seqn->anim= 0; -// AUD_XXX } else if(seq->type == SEQ_RAM_SOUND) { } else if(seq->type == SEQ_SOUND) { - // AUD_XXX seqn->strip->stripdata = MEM_dupallocN(seq->strip->stripdata); if(seq->sound_handle) seqn->sound_handle = sound_new_handle(scene, seqn->sound, seq->sound_handle->startframe, seq->sound_handle->endframe, seq->sound_handle->frameskip); seqn->sound->id.us++; -/* AUD_XXX } else if(seq->type == SEQ_HD_SOUND) { - seqn->strip->stripdata = - MEM_dupallocN(seq->strip->stripdata); - seqn->hdaudio = 0;*/ } else if(seq->type == SEQ_IMAGE) { seqn->strip->stripdata = MEM_dupallocN(seq->strip->stripdata); @@ -1502,14 +1492,12 @@ static int sequencer_mute_exec(bContext *C, wmOperator *op) if(selected){ /* mute unselected */ if (seq->flag & SELECT) { seq->flag |= SEQ_MUTE; - // AUD_XXX seq_update_sound(seq); } } else { if ((seq->flag & SELECT)==0) { seq->flag |= SEQ_MUTE; - // AUD_XXX seq_update_sound(seq); } } @@ -1557,14 +1545,12 @@ static int sequencer_unmute_exec(bContext *C, wmOperator *op) if(selected){ /* unmute unselected */ if (seq->flag & SELECT) { seq->flag &= ~SEQ_MUTE; - // AUD_XXX seq_update_sound(seq); } } else { if ((seq->flag & SELECT)==0) { seq->flag &= ~SEQ_MUTE; - // AUD_XXX seq_update_sound(seq); } } @@ -2147,7 +2133,6 @@ static int sequencer_meta_make_exec(bContext *C, wmOperator *op) while(seq) { if(seq->flag & SELECT) { tot++; -// AUD_XXX if (seq->type == SEQ_RAM_SOUND) { if (seq->type == SEQ_SOUND) { BKE_report(op->reports, RPT_ERROR, "Can't make Meta Strip from audio"); return OPERATOR_CANCELLED;; diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c index d3d8dbab09d..dda5837e5f5 100644 --- a/source/blender/editors/space_sequencer/sequencer_select.c +++ b/source/blender/editors/space_sequencer/sequencer_select.c @@ -153,7 +153,6 @@ void select_single_seq(Scene *scene, Sequence *seq, int deselect_all) /* BRING B if(seq->strip) strncpy(ed->act_imagedir, seq->strip->dir, FILE_MAXDIR-1); } -// AUD_XXX else if((seq->type==SEQ_HD_SOUND) || (seq->type==SEQ_RAM_SOUND)) { else if(seq->type==SEQ_SOUND) { if(seq->strip) strncpy(ed->act_sounddir, seq->strip->dir, FILE_MAXDIR-1); @@ -337,7 +336,6 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, wmEvent *event) strncpy(ed->act_imagedir, seq->strip->dir, FILE_MAXDIR-1); } } else -// AUD_XXX if (seq->type == SEQ_HD_SOUND || seq->type == SEQ_RAM_SOUND) { if (seq->type == SEQ_SOUND) { if(seq->strip) { strncpy(ed->act_sounddir, seq->strip->dir, FILE_MAXDIR-1); diff --git a/source/blender/makesdna/DNA_actuator_types.h b/source/blender/makesdna/DNA_actuator_types.h index ad03d12987a..bbfd9cadf67 100644 --- a/source/blender/makesdna/DNA_actuator_types.h +++ b/source/blender/makesdna/DNA_actuator_types.h @@ -37,7 +37,7 @@ struct Scene; struct Group; struct Text; -// AUD_XXX for Sound3D +// for Sound3D #include "DNA_sound_types.h" /* ****************** ACTUATORS ********************* */ diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index bc06e0cd6f9..36cd0c6ffdf 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -662,7 +662,6 @@ typedef struct Scene { ListBase markers; ListBase transform_spaces; - // AUD_XXX NEW ListBase sound_handles; /* none of the dependancy graph vars is mean to be saved */ diff --git a/source/blender/makesdna/DNA_sequence_types.h b/source/blender/makesdna/DNA_sequence_types.h index 22cfae48132..6d455d20f59 100644 --- a/source/blender/makesdna/DNA_sequence_types.h +++ b/source/blender/makesdna/DNA_sequence_types.h @@ -160,7 +160,6 @@ typedef struct Sequence { ListBase seqbase; /* list of strips for metastrips */ struct bSound *sound; /* the linked "bSound" object */ -// AUD_XXX struct hdaudio *hdaudio; /* external hdaudio object */ struct SoundHandle *sound_handle; float level, pan; /* level in dB (0=full), pan -1..1 */ int scenenr; /* for scene selection */ @@ -282,7 +281,6 @@ typedef struct SpeedControlVars { #define SEQ_MOVIE 3 #define SEQ_RAM_SOUND 4 #define SEQ_HD_SOUND 5 -// AUD_XXX #define SEQ_MOVIE_AND_HD_SOUND 6 /* helper for add_sequence */ #define SEQ_SOUND 4 #define SEQ_EFFECT 8 diff --git a/source/blender/makesdna/DNA_sound_types.h b/source/blender/makesdna/DNA_sound_types.h index c0da5a8049f..841aae099cc 100644 --- a/source/blender/makesdna/DNA_sound_types.h +++ b/source/blender/makesdna/DNA_sound_types.h @@ -64,7 +64,7 @@ typedef struct bSample { short us; } bSample; -// AUD_XXX runtime only - no saving +// runtime only - no saving typedef struct SoundHandle { struct SoundHandle *next, *prev; struct bSound *source; @@ -79,7 +79,6 @@ typedef struct SoundHandle { float pad; } SoundHandle; -// AUD_XXX typedef struct Sound3D { float min_gain; diff --git a/source/blender/makesrna/intern/rna_sequence.c b/source/blender/makesrna/intern/rna_sequence.c index a884e10b6c4..fec91c64e4d 100644 --- a/source/blender/makesrna/intern/rna_sequence.c +++ b/source/blender/makesrna/intern/rna_sequence.c @@ -192,10 +192,7 @@ static StructRNA* rna_Sequence_refine(struct PointerRNA *ptr) case SEQ_SCENE: return &RNA_SceneSequence; case SEQ_MOVIE: -// AUD_XXX case SEQ_MOVIE_AND_HD_SOUND: return &RNA_MovieSequence; -// AUD_XXX case SEQ_RAM_SOUND: -// AUD_XXX case SEQ_HD_SOUND: case SEQ_SOUND: return &RNA_SoundSequence; case SEQ_CROSS: @@ -363,10 +360,7 @@ static void rna_def_sequence(BlenderRNA *brna) {SEQ_META, "META", 0, "Meta", ""}, {SEQ_SCENE, "SCENE", 0, "Scene", ""}, {SEQ_MOVIE, "MOVIE", 0, "Movie", ""}, -// AUD_XXX {SEQ_RAM_SOUND, "RAM_SOUND", 0, "Ram Sound", ""}, -// AUD_XXX {SEQ_HD_SOUND, "HD_SOUND", 0, "HD Sound", ""}, {SEQ_SOUND, "_SOUND", 0, "Sound", ""}, -// AUD_XXX {SEQ_MOVIE_AND_HD_SOUND, "MOVIE_AND_HD_SOUND", 0, "Movie and HD Sound", ""}, {SEQ_EFFECT, "REPLACE", 0, "Replace", ""}, {SEQ_CROSS, "CROSS", 0, "Cross", ""}, {SEQ_ADD, "ADD", 0, "Add", ""}, @@ -618,24 +612,6 @@ static void rna_def_filter_video(StructRNA *srna) RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); } -// AUD_XXX -#if 0 -static void rna_def_filter_sound(StructRNA *srna) -{ - PropertyRNA *prop; - - prop= RNA_def_property(srna, "sound_gain", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "level"); - RNA_def_property_range(prop, -96.0f, 6.0f); - RNA_def_property_ui_text(prop, "Sound Gain", "Sound level in dB (0 = full volume)."); - - prop= RNA_def_property(srna, "sound_pan", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "pan"); - RNA_def_property_range(prop, -1.0f, 1.0f); - RNA_def_property_ui_text(prop, "Sound Pan", "Stereo sound balance."); -} -#endif - static void rna_def_proxy(StructRNA *srna) { PropertyRNA *prop; @@ -777,7 +753,6 @@ static void rna_def_sound(BlenderRNA *brna) RNA_def_property_string_sdna(prop, NULL, "strip->dir"); RNA_def_property_ui_text(prop, "Directory", ""); -// AUD_XXX rna_def_filter_sound(srna); rna_def_input(srna); } diff --git a/source/blender/makesrna/intern/rna_sound.c b/source/blender/makesrna/intern/rna_sound.c index e8e5189b7e7..9ca2a74bedd 100644 --- a/source/blender/makesrna/intern/rna_sound.c +++ b/source/blender/makesrna/intern/rna_sound.c @@ -149,74 +149,6 @@ static void rna_def_sound(BlenderRNA *brna) prop= RNA_def_property(srna, "packed_file", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "packedfile"); RNA_def_property_ui_text(prop, "Packed File", ""); - - /* game engine settings */ -// AUD_XXX DEPRECATED! -#if 0 - prop= RNA_def_property(srna, "volume", PROP_FLOAT, PROP_UNSIGNED); - RNA_def_property_float_sdna(prop, NULL, "volume"); - RNA_def_property_ui_range(prop, 0.0, 1.0, 10, 4); - RNA_def_property_ui_text(prop, "Volume", "Game engine only: volume for this sound."); - - prop= RNA_def_property(srna, "pitch", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "pitch"); - RNA_def_property_ui_range(prop, -12.0, 12.0, 10, 4); - RNA_def_property_ui_text(prop, "Pitch", "Game engine only: set the pitch of this sound."); - - prop= RNA_def_property(srna, "loop", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flags", SOUND_FLAGS_LOOP); - RNA_def_property_ui_text(prop, "Sound Loop", "Game engine only: toggle between looping on/off."); - - prop= RNA_def_property(srna, "ping_pong", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flags", SOUND_FLAGS_BIDIRECTIONAL_LOOP); - RNA_def_property_ui_text(prop, "Ping Pong", "Game engine only: Toggle between A->B and A->B->A looping."); - - prop= RNA_def_property(srna, "sound_3d", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flags", SOUND_FLAGS_3D); - RNA_def_property_ui_text(prop, "3D Sound", "Game engine only: turns 3D sound on."); - - prop= RNA_def_property(srna, "attenuation", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "attenuation"); - RNA_def_property_range(prop, 0.0, 5.0); - RNA_def_property_ui_text(prop, "Attenuation", "Game engine only: sets the surround scaling factor for 3D sound."); - - /* gain */ - prop= RNA_def_property(srna, "min_gain", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "min_gain"); - RNA_def_property_range(prop, 0.0, 1.0); - RNA_def_property_ui_text(prop, "Min Gain", "Minimal gain which is always guaranteed for this sound."); - - prop= RNA_def_property(srna, "max_gain", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "max_gain"); - RNA_def_property_range(prop, 0.0, 1.0); - RNA_def_property_ui_text(prop, "Max Gain", "Maximal gain which is always guaranteed for this sound."); - - prop= RNA_def_property(srna, "reference_distance", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "distance"); - RNA_def_property_ui_text(prop, "Reference Distance", "Reference distance at which the listener will experience gain."); - RNA_def_property_ui_range(prop, 0.0, 1000.0, 10, 4); /* NOT used anywhere */ - - /* unused - prop= RNA_def_property(srna, "panning", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "panning"); - RNA_def_property_ui_range(prop, -1.0, 1.0, 10, 4); - RNA_def_property_ui_text(prop, "Panning", "Pan the sound from left to right"); */ - - /* unused - prop= RNA_def_property(srna, "fixed_volume", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flags", SOUND_FLAGS_FIXED_VOLUME); - RNA_def_property_ui_text(prop, "Fixed Volume", "Constraint sound to fixed volume."); */ - - /* unused - prop= RNA_def_property(srna, "fixed_panning", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flags", SOUND_FLAGS_FIXED_PANNING); - RNA_def_property_ui_text(prop, "Fixed Panning", "Constraint sound to fixed panning."); */ - - /* unused - prop= RNA_def_property(srna, "priority", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flags", SOUND_FLAGS_PRIORITY); - RNA_def_property_ui_text(prop, "Priority", "Make sound higher priority."); */ -#endif } void RNA_def_sound(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 244a286779f..8dcca446507 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -37,7 +37,6 @@ #include "BKE_utildefines.h" -// AUD_XXX #include "BKE_sound.h" #ifdef RNA_RUNTIME @@ -119,7 +118,6 @@ static PointerRNA rna_UserDef_system_get(PointerRNA *ptr) return rna_pointer_inherit_refine(ptr, &RNA_UserPreferencesSystem, ptr->data); } -// AUD_XXX static void rna_UserDef_audio_update(bContext *C, PointerRNA *ptr) { sound_reinit(C); diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c index 151b85bad9e..5b3cb9271f3 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.c +++ b/source/blender/windowmanager/intern/wm_init_exit.c @@ -90,7 +90,6 @@ #include "GPU_extensions.h" #include "GPU_draw.h" -// AUD_XXX #include "BKE_sound.h" /* XXX */ @@ -157,7 +156,6 @@ void WM_init(bContext *C) read_Blog(); BLI_strncpy(G.lib, G.sce, FILE_MAX); - // AUD_XXX - should be also on file load?! sound_init(); } @@ -188,7 +186,6 @@ void WM_exit(bContext *C) { wmWindow *win; - // AUD_XXX sound_exit(); /* first wrap up running stuff, we assume only the active WM is running */ diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp index d3b9b4bfbc3..bbef6027f09 100644 --- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp +++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp @@ -188,20 +188,6 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, int alw NG_LoopBackNetworkDeviceInterface(); // -// AUD_XXX -#if 0 - SYS_SystemHandle hSystem = SYS_GetSystem(); - bool noaudio = SYS_GetCommandLineInt(hSystem,"noaudio",0); - - if (noaudio)/*(noaudio) intrr: disable game engine audio (openal) */ - SND_DeviceManager::SetDeviceType(snd_e_dummydevice); - - // get an audiodevice - SND_DeviceManager::Subscribe(); - SND_IAudioDevice* audiodevice = SND_DeviceManager::Instance(); - audiodevice->UseCD(); -#endif - // create a ketsji/blendersystem (only needed for timing and stuff) KX_BlenderSystem* kxsystem = new KX_BlenderSystem(); @@ -216,8 +202,6 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, int alw ketsjiengine->SetRenderTools(rendertools); ketsjiengine->SetRasterizer(rasterizer); ketsjiengine->SetNetworkDevice(networkdevice); -// AUD_XXX -// ketsjiengine->SetAudioDevice(audiodevice); ketsjiengine->SetUseFixedTime(usefixed); ketsjiengine->SetTimingDisplay(frameRate, profile, properties); @@ -378,7 +362,6 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, int alw KX_Scene* startscene = new KX_Scene(keyboarddevice, mousedevice, networkdevice, -// AUD_XXX audiodevice, startscenename, blscene); @@ -523,8 +506,6 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, int alw canvas->SetMouseState(RAS_ICanvas::MOUSE_NORMAL); // clean up some stuff -// AUD_XXX audiodevice->StopCD(); - if (ketsjiengine) { delete ketsjiengine; @@ -641,14 +622,6 @@ extern "C" void StartKetsjiShellSimulation(struct wmWindow *win, NG_NetworkDeviceInterface* networkdevice = new NG_LoopBackNetworkDeviceInterface(); -// AUD_XXX -#if 0 - // get an audiodevice - SND_DeviceManager::Subscribe(); - SND_IAudioDevice* audiodevice = SND_DeviceManager::Instance(); - audiodevice->UseCD(); -#endif - // create a ketsji/blendersystem (only needed for timing and stuff) KX_BlenderSystem* kxsystem = new KX_BlenderSystem(); @@ -699,7 +672,6 @@ extern "C" void StartKetsjiShellSimulation(struct wmWindow *win, KX_Scene* startscene = new KX_Scene(keyboarddevice, mousedevice, networkdevice, -// AUD_XXX audiodevice, startscenename, blscene); @@ -763,7 +735,6 @@ extern "C" void StartKetsjiShellSimulation(struct wmWindow *win, canvas->SetMouseState(RAS_ICanvas::MOUSE_NORMAL); // clean up some stuff -// AUD_XXX audiodevice->StopCD(); if (ketsjiengine) { delete ketsjiengine; diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index f1e8d840ae8..db8c33cb9d5 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -101,10 +101,6 @@ #include "KX_KetsjiEngine.h" #include "KX_BlenderSceneConverter.h" -// AUD_XXX -//#include"SND_Scene.h" -//#include "SND_SoundListener.h" - /* This little block needed for linking to Blender... */ #ifdef WIN32 #include "BLI_winstuff.h" @@ -2619,23 +2615,6 @@ void BL_ConvertBlenderObjects(struct Main* maggie, sumolist->Release(); - // convert global sound stuff - - /* XXX, glob is the very very wrong place for this - * to be, re-enable once the listener has been moved into - * the scene. */ -// AUD_XXX -#if 0 - SND_Scene* soundscene = kxscene->GetSoundScene(); - SND_SoundListener* listener = soundscene->GetListener(); - if (listener && G.listener) - { - listener->SetDopplerFactor(G.listener->dopplerfactor); - listener->SetDopplerVelocity(G.listener->dopplervelocity); - listener->SetGain(G.listener->gain); - } -#endif - // convert world KX_WorldInfo* worldinfo = new BlenderWorldInfo(blenderscene->world); converter->RegisterWorldInfo(worldinfo); diff --git a/source/gameengine/Converter/KX_ConvertActuators.cpp b/source/gameengine/Converter/KX_ConvertActuators.cpp index 7ee02b8fa21..b9f67f7e2dc 100644 --- a/source/gameengine/Converter/KX_ConvertActuators.cpp +++ b/source/gameengine/Converter/KX_ConvertActuators.cpp @@ -38,8 +38,6 @@ #include "KX_BlenderSceneConverter.h" #include "KX_ConvertActuators.h" -// AUD_XXX -//#include "SND_Scene.h" #include "AUD_C-API.h" // Actuators //SCA logiclibrary native logicbricks @@ -349,8 +347,6 @@ void BL_ConvertActuators(char* maggiename, { bSoundActuator* soundact = (bSoundActuator*) bact->data; /* get type, and possibly a start and end frame */ - // AUD_XXX -// short startFrame = soundact->sta, stopFrame = soundact->end; KX_SoundActuator::KX_SOUNDACT_TYPE soundActuatorType = KX_SoundActuator::KX_SOUNDACT_NODEF; @@ -381,106 +377,6 @@ void BL_ConvertActuators(char* maggiename, if (soundActuatorType != KX_SoundActuator::KX_SOUNDACT_NODEF) { -// AUD_XXX -#if 0 - SND_Scene* soundscene = scene->GetSoundScene(); - STR_String samplename = ""; - bool sampleisloaded = false; - - if (soundact->sound) { - /* Need to convert the samplename into absolute path - * before checking if its loaded */ - char fullpath[FILE_MAX]; - - /* dont modify soundact->sound->name, only change a copy */ - BLI_strncpy(fullpath, soundact->sound->name, sizeof(fullpath)); - BLI_convertstringcode(fullpath, maggiename); - samplename = fullpath; - - /* let's see if the sample was already loaded */ - if (soundscene->IsSampleLoaded(samplename)) - { - sampleisloaded = true; - } - else { - /* if not, make it so */ - PackedFile* pf = soundact->sound->newpackedfile; - - /* but we need a packed file then */ - if (pf) - { - if (soundscene->LoadSample(samplename, pf->data, pf->size) > -1) - sampleisloaded = true; - } - /* or else load it from disk */ - else - { - if (soundscene->LoadSample(samplename, NULL, 0) > -1) { - sampleisloaded = true; - } - else { - std::cout << "WARNING: Sound actuator \"" << bact->name << - "\" from object \"" << blenderobject->id.name+2 << - "\" failed to load sample." << std::endl; - } - } - } - } else { - std::cout << "WARNING: Sound actuator \"" << bact->name << - "\" from object \"" << blenderobject->id.name+2 << - "\" has no sound datablock." << std::endl; - } - - /* Note, allowing actuators for sounds that are not there was added since 2.47 - * This is because python may expect the actuator and raise an exception if it dosnt find it - * better just to add a dummy sound actuator. */ - - SND_SoundObject* sndobj = NULL; - if (sampleisloaded) - { - /* setup the SND_SoundObject */ - sndobj = new SND_SoundObject(); - sndobj->SetSampleName(samplename.Ptr()); - sndobj->SetObjectName(bact->name); - if (soundact->sound) { - sndobj->SetRollOffFactor(soundact->sound->attenuation); - sndobj->SetGain(soundact->sound->volume); - sndobj->SetPitch(exp((soundact->sound->pitch / 12.0) * log(2.0))); - // sndobj->SetLoopStart(soundact->sound->loopstart); - // sndobj->SetLoopStart(soundact->sound->loopend); - if (soundact->sound->flags & SOUND_FLAGS_LOOP) - { - if (soundact->sound->flags & SOUND_FLAGS_BIDIRECTIONAL_LOOP) - sndobj->SetLoopMode(SND_LOOP_BIDIRECTIONAL); - else - sndobj->SetLoopMode(SND_LOOP_NORMAL); - } - else { - sndobj->SetLoopMode(SND_LOOP_OFF); - } - - if (soundact->sound->flags & SOUND_FLAGS_PRIORITY) - sndobj->SetHighPriority(true); - else - sndobj->SetHighPriority(false); - - if (soundact->sound->flags & SOUND_FLAGS_3D) - sndobj->Set3D(true); - else - sndobj->Set3D(false); - } - else { - /* dummy values for a NULL sound - * see editsound.c - defaults are unlikely to change soon */ - sndobj->SetRollOffFactor(1.0); - sndobj->SetGain(1.0); - sndobj->SetPitch(1.0); - sndobj->SetLoopMode(SND_LOOP_OFF); - sndobj->SetHighPriority(false); - sndobj->Set3D(false); - } - } -#else bSound* sound = soundact->sound; bool is3d = soundact->flag & ACT_SND_3D_SOUND ? true : false; AUD_Sound* snd_sound = NULL; @@ -502,7 +398,6 @@ void BL_ConvertActuators(char* maggiename, } else snd_sound = sound->cache ? sound->cache : sound->snd_sound; -#endif KX_SoundActuator* tmpsoundact = new KX_SoundActuator(gameobj, snd_sound, @@ -510,16 +405,10 @@ void BL_ConvertActuators(char* maggiename, exp((soundact->pitch / 12.0) * log(2.0)), is3d, settings, -// AUD_XXX sndobj, -// AUD_XXX scene->GetSoundScene(), // needed for replication! - soundActuatorType);//, -// AUD_XXX startFrame, -// AUD_XXX stopFrame); + soundActuatorType); tmpsoundact->SetName(bact->name); baseact = tmpsoundact; -// AUD_XXX if (sndobj) -// AUD_XXX soundscene->AddObject(sndobj); } break; } @@ -559,30 +448,6 @@ void BL_ConvertActuators(char* maggiename, /* This is an error!!! */ cdActuatorType = KX_CDActuator::KX_CDACT_NODEF; } - - if (cdActuatorType != KX_CDActuator::KX_CDACT_NODEF) - { -// AUD_XXX -#if 0 - SND_CDObject* pCD = SND_CDObject::Instance(); - - if (pCD) - { - pCD->SetGain(cdact->volume); - - KX_CDActuator* tmpcdact = - new KX_CDActuator(gameobj, - scene->GetSoundScene(), // needed for replication! - cdActuatorType, - cdact->track, - startFrame, - stopFrame); - - tmpcdact->SetName(bact->name); - baseact = tmpcdact; - } -#endif - } break; } case ACT_PROPERTY: diff --git a/source/gameengine/Ketsji/KX_CDActuator.cpp b/source/gameengine/Ketsji/KX_CDActuator.cpp index 0300fc1f9e1..0861a54d848 100644 --- a/source/gameengine/Ketsji/KX_CDActuator.cpp +++ b/source/gameengine/Ketsji/KX_CDActuator.cpp @@ -31,9 +31,7 @@ */ #include "KX_CDActuator.h" -// AUD_XXX #include "SND_CDObject.h" #include "KX_GameObject.h" -// AUD_XXX #include "SND_Scene.h" // needed for replication #include <iostream> #ifdef HAVE_CONFIG_H @@ -44,21 +42,18 @@ /* Native functions */ /* ------------------------------------------------------------------------- */ KX_CDActuator::KX_CDActuator(SCA_IObject* gameobject, -// AUD_XXX SND_Scene* soundscene, KX_CDACT_TYPE type, int track, short start, short end) : SCA_IActuator(gameobject) { -// AUD_XXX m_soundscene = soundscene; m_type = type; m_track = track; m_lastEvent = true; m_isplaying = false; m_startFrame = start; m_endFrame = end; -// AUD_XXX m_gain = SND_CDObject::Instance()->GetGain(); } @@ -89,56 +84,6 @@ bool KX_CDActuator::Update() { switch (m_type) { -// AUD_XXX -#if 0 - case KX_CDACT_PLAY_ALL: - { - SND_CDObject::Instance()->SetPlaymode(SND_CD_ALL); - SND_CDObject::Instance()->SetTrack(1); - SND_CDObject::Instance()->SetPlaystate(SND_MUST_PLAY); - //result = true; - break; - } - case KX_CDACT_PLAY_TRACK: - { - SND_CDObject::Instance()->SetPlaymode(SND_CD_TRACK); - SND_CDObject::Instance()->SetTrack(m_track); - SND_CDObject::Instance()->SetPlaystate(SND_MUST_PLAY); - //result = true; - break; - } - case KX_CDACT_LOOP_TRACK: - { - SND_CDObject::Instance()->SetPlaymode(SND_CD_ALL); - SND_CDObject::Instance()->SetTrack(m_track); - SND_CDObject::Instance()->SetPlaystate(SND_MUST_PLAY); - //result = true; - break; - } - case KX_CDACT_STOP: - { - SND_CDObject::Instance()->SetPlaystate(SND_MUST_STOP); - break; - } - case KX_CDACT_PAUSE: - { - SND_CDObject::Instance()->SetPlaystate(SND_MUST_PAUSE); - //result = true; - break; - } - case KX_CDACT_RESUME: - { - SND_CDObject::Instance()->SetPlaystate(SND_MUST_RESUME); - //result = true; - break; - } - case KX_CDACT_VOLUME: - { - SND_CDObject::Instance()->SetGain(m_gain); - //result = true; - break; - } -#endif default: // implement me !! break; @@ -199,7 +144,6 @@ PyMethodDef KX_CDActuator::Methods[] = { }; PyAttributeDef KX_CDActuator::Attributes[] = { -// AUD_XXX KX_PYATTRIBUTE_FLOAT_RW_CHECK("volume", 0.0, 1.0, KX_CDActuator, m_gain,pyattr_setGain), KX_PYATTRIBUTE_INT_RW("track", 1, 99, false, KX_CDActuator, m_track), { NULL } //Sentinel }; @@ -207,7 +151,6 @@ PyAttributeDef KX_CDActuator::Attributes[] = { int KX_CDActuator::pyattr_setGain(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef) { KX_CDActuator* act = static_cast<KX_CDActuator*>(self); -// AUD_XXX SND_CDObject::Instance()->SetGain(act->m_gain); return PY_SET_ATTR_SUCCESS; } @@ -215,7 +158,6 @@ KX_PYMETHODDEF_DOC_NOARGS(KX_CDActuator, startCD, "startCD()\n" "\tStarts the CD playing.\n") { -// AUD_XXX SND_CDObject::Instance()->SetPlaystate(SND_MUST_PLAY); Py_RETURN_NONE; } @@ -224,7 +166,6 @@ KX_PYMETHODDEF_DOC_NOARGS(KX_CDActuator, pauseCD, "pauseCD()\n" "\tPauses the CD playing.\n") { -// AUD_XXX SND_CDObject::Instance()->SetPlaystate(SND_MUST_PAUSE); Py_RETURN_NONE; } @@ -233,7 +174,6 @@ KX_PYMETHODDEF_DOC_NOARGS(KX_CDActuator, resumeCD, "resumeCD()\n" "\tResumes the CD playing.\n") { -// AUD_XXX SND_CDObject::Instance()->SetPlaystate(SND_MUST_RESUME); Py_RETURN_NONE; } @@ -242,7 +182,6 @@ KX_PYMETHODDEF_DOC_NOARGS(KX_CDActuator, stopCD, "stopCD()\n" "\tStops the CD playing.\n") { -// AUD_XXX SND_CDObject::Instance()->SetPlaystate(SND_MUST_STOP); Py_RETURN_NONE; } @@ -253,12 +192,6 @@ KX_PYMETHODDEF_DOC_O(KX_CDActuator, playTrack, { if (PyLong_Check(value)) { int track = PyLong_AsSsize_t(value); -// AUD_XXX -#if 0 - SND_CDObject::Instance()->SetPlaymode(SND_CD_TRACK); - SND_CDObject::Instance()->SetTrack(track); - SND_CDObject::Instance()->SetPlaystate(SND_MUST_PLAY); -#endif } Py_RETURN_NONE; } @@ -269,12 +202,6 @@ KX_PYMETHODDEF_DOC_NOARGS(KX_CDActuator, playAll, "playAll()\n" "\tPlays the CD from the beginning.\n") { -// AUD_XXX -#if 0 - SND_CDObject::Instance()->SetPlaymode(SND_CD_ALL); - SND_CDObject::Instance()->SetTrack(1); - SND_CDObject::Instance()->SetPlaystate(SND_MUST_PLAY); -#endif Py_RETURN_NONE; } @@ -286,8 +213,6 @@ PyObject* KX_CDActuator::PySetGain(PyObject* args) if (!PyArg_ParseTuple(args, "f:setGain", &gain)) return NULL; -// AUD_XXX SND_CDObject::Instance()->SetGain(gain); - Py_RETURN_NONE; } @@ -295,7 +220,7 @@ PyObject* KX_CDActuator::PySetGain(PyObject* args) PyObject* KX_CDActuator::PyGetGain(PyObject* args) { - float gain = 1.0;// AUD_XXXSND_CDObject::Instance()->GetGain(); + float gain = 1.0; ShowDeprecationWarning("getGain()", "the volume property"); PyObject* result = PyFloat_FromDouble(gain); diff --git a/source/gameengine/Ketsji/KX_CDActuator.h b/source/gameengine/Ketsji/KX_CDActuator.h index 0f168dcb525..bce29adb6e8 100644 --- a/source/gameengine/Ketsji/KX_CDActuator.h +++ b/source/gameengine/Ketsji/KX_CDActuator.h @@ -33,7 +33,6 @@ #define __KX_CDACTUATOR #include "SCA_IActuator.h" -// AUD_XXX #include "SND_CDObject.h" class KX_CDActuator : public SCA_IActuator { @@ -41,9 +40,7 @@ class KX_CDActuator : public SCA_IActuator bool m_lastEvent; bool m_isplaying; /* just some handles to the audio-data... */ -// AUD_XXX class SND_Scene* m_soundscene; int m_track; -// AUD_XXX float m_gain; short m_startFrame; short m_endFrame; @@ -64,7 +61,6 @@ public: KX_CDACT_TYPE m_type; KX_CDActuator(SCA_IObject* gameobject, -// AUD_XXX SND_Scene* soundscene, KX_CDACT_TYPE type, int track, short start, diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp index d3253b9eddd..132af7e6be8 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp @@ -61,10 +61,7 @@ #include "KX_PyConstraintBinding.h" #include "PHY_IPhysicsEnvironment.h" -// AUD_XXX #include "AUD_C-API.h" -//#include "SND_Scene.h" -//#include "SND_IAudioDevice.h" #include "NG_NetworkScene.h" #include "NG_NetworkDeviceInterface.h" @@ -115,7 +112,6 @@ KX_KetsjiEngine::KX_KetsjiEngine(KX_ISystem* system) m_rendertools(NULL), m_sceneconverter(NULL), m_networkdevice(NULL), -// AUD_XXX m_audiodevice(NULL), m_pythondictionary(NULL), m_keyboarddevice(NULL), m_mousedevice(NULL), @@ -213,17 +209,6 @@ void KX_KetsjiEngine::SetNetworkDevice(NG_NetworkDeviceInterface* networkdevice) } -// AUD_XXX -#if 0 -void KX_KetsjiEngine::SetAudioDevice(SND_IAudioDevice* audiodevice) -{ - MT_assert(audiodevice); - m_audiodevice = audiodevice; -} -#endif - - - void KX_KetsjiEngine::SetCanvas(RAS_ICanvas* canvas) { MT_assert(canvas); @@ -695,12 +680,6 @@ else if (m_networkdevice) m_networkdevice->NextFrame(); -// AUD_XXX -#if 0 - if (m_audiodevice) - m_audiodevice->NextFrame(); -#endif - // scene management ProcessScheduledScenes(); @@ -977,16 +956,6 @@ void KX_KetsjiEngine::DoSound(KX_Scene* scene) MT_Vector3 listenervelocity = cam->GetLinearVelocity(); MT_Matrix3x3 listenerorientation = cam->NodeGetWorldOrientation(); -// AUD_XXX -#if 0 - SND_Scene* soundscene = scene->GetSoundScene(); - soundscene->SetListenerTransform( - listenerposition, - listenervelocity, - listenerorientation); - - soundscene->Proceed(); -#else { AUD_3DData data; float f; @@ -1021,7 +990,6 @@ void KX_KetsjiEngine::DoSound(KX_Scene* scene) AUD_updateListener(&data); } -#endif } @@ -1640,7 +1608,6 @@ KX_Scene* KX_KetsjiEngine::CreateScene(const STR_String& scenename) KX_Scene* tmpscene = new KX_Scene(m_keyboarddevice, m_mousedevice, m_networkdevice, -// AUD_XXX m_audiodevice, scenename, scene); diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.h b/source/gameengine/Ketsji/KX_KetsjiEngine.h index 7e06166f57b..ab12adbd431 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.h +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.h @@ -70,7 +70,6 @@ private: class RAS_IRenderTools* m_rendertools; class KX_ISceneConverter* m_sceneconverter; class NG_NetworkDeviceInterface* m_networkdevice; -// AUD_XXX class SND_IAudioDevice* m_audiodevice; PyObject* m_pythondictionary; class SCA_IInputDevice* m_keyboarddevice; class SCA_IInputDevice* m_mousedevice; @@ -200,7 +199,6 @@ public: void SetKeyboardDevice(SCA_IInputDevice* keyboarddevice); void SetMouseDevice(SCA_IInputDevice* mousedevice); void SetNetworkDevice(NG_NetworkDeviceInterface* networkdevice); -// AUD_XXX void SetAudioDevice(SND_IAudioDevice* audiodevice); void SetCanvas(RAS_ICanvas* canvas); void SetRenderTools(RAS_IRenderTools* rendertools); void SetRasterizer(RAS_IRasterizer* rasterizer); diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 5d0f01d7bd0..13b992f2f3e 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -79,8 +79,6 @@ extern "C" { #include "ListValue.h" #include "InputParser.h" #include "KX_Scene.h" -// AUD_XXX -//#include "SND_DeviceManager.h" #include "NG_NetworkScene.h" //Needed for sendMessage() @@ -213,11 +211,12 @@ static bool usedsp = false; // this gets a pointer to an array filled with floats static PyObject* gPyGetSpectrum(PyObject*) { -// AUD_XXX SND_IAudioDevice* audiodevice = SND_DeviceManager::Instance(); +// SHOULD BE REMOVED +// XXX SND_IAudioDevice* audiodevice = SND_DeviceManager::Instance(); PyObject* resultlist = PyList_New(512); -// AUD_XXX +// XXX #if 0 if (audiodevice) { @@ -240,7 +239,7 @@ static PyObject* gPyGetSpectrum(PyObject*) { PyList_SET_ITEM(resultlist, index, PyFloat_FromDouble(0.0)); } -// AUD_XXX } +// XXX } return resultlist; } @@ -268,7 +267,7 @@ static PyObject* gPyStartDSP(PyObject*, PyObject* args) static PyObject* gPyStopDSP(PyObject*, PyObject* args) { -// AUD_XXX +// XXX SHOULD BE REMOVED #if 0 SND_IAudioDevice* audiodevice = SND_DeviceManager::Instance(); @@ -276,7 +275,6 @@ static PyObject* gPyStopDSP(PyObject*, PyObject* args) #endif PyErr_SetString(PyExc_RuntimeError, "no audio device available"); return NULL; -// AUD_XXX #if 0 } diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index fccaf4314f5..b6448666ec4 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -34,8 +34,6 @@ #include "KX_Scene.h" #include "MT_assert.h" -// AUD_XXX -//#include "SND_Scene.h" #include "KX_KetsjiEngine.h" #include "KX_BlenderMaterial.h" #include "RAS_IPolygonMaterial.h" @@ -136,7 +134,6 @@ extern bool gUseVisibilityTemp; KX_Scene::KX_Scene(class SCA_IInputDevice* keyboarddevice, class SCA_IInputDevice* mousedevice, class NG_NetworkDeviceInterface *ndi, -// AUD_XXX class SND_IAudioDevice* adi, const STR_String& sceneName, Scene *scene): PyObjectPlus(), @@ -145,7 +142,6 @@ KX_Scene::KX_Scene(class SCA_IInputDevice* keyboarddevice, m_sceneConverter(NULL), m_physicsEnvironment(0), m_sceneName(sceneName), -// AUD_XXX m_adi(adi), m_networkDeviceInterface(ndi), m_active_camera(NULL), m_ueberExecutionPriority(0), @@ -201,7 +197,6 @@ KX_Scene::KX_Scene(class SCA_IInputDevice* keyboarddevice, m_logicmgr->RegisterEventManager(joymgr); } -// AUD_XXX m_soundScene = new SND_Scene(adi); MT_assert (m_networkDeviceInterface != NULL); m_networkScene = new NG_NetworkScene(m_networkDeviceInterface); @@ -251,12 +246,6 @@ KX_Scene::~KX_Scene() if (m_physicsEnvironment) delete m_physicsEnvironment; -// AUD_XXX -#if 0 - if (m_soundScene) - delete m_soundScene; -#endif - if (m_networkScene) delete m_networkScene; @@ -368,14 +357,6 @@ class KX_WorldInfo* KX_Scene::GetWorldInfo() } -// AUD_XXX -#if 0 -SND_Scene* KX_Scene::GetSoundScene() -{ - return m_soundScene; -} -#endif - const STR_String& KX_Scene::GetName() { return m_sceneName; diff --git a/source/gameengine/Ketsji/KX_Scene.h b/source/gameengine/Ketsji/KX_Scene.h index c5aad07f5ca..fef6b92e829 100644 --- a/source/gameengine/Ketsji/KX_Scene.h +++ b/source/gameengine/Ketsji/KX_Scene.h @@ -63,9 +63,6 @@ class SCA_TimeEventManager; class SCA_MouseManager; class SCA_ISystem; class SCA_IInputDevice; -// AUD_XXX -//class SND_Scene; -//class SND_IAudioDevice; class NG_NetworkDeviceInterface; class NG_NetworkScene; class SG_IObject; @@ -161,13 +158,6 @@ protected: * @section Different scenes, linked to ketsji scene */ - - /** - * Sound scenes - */ -// AUD_XXX SND_Scene* m_soundScene; -// AUD_XXX SND_IAudioDevice* m_adi; - /** * Network scene. */ @@ -284,7 +274,6 @@ public: KX_Scene(class SCA_IInputDevice* keyboarddevice, class SCA_IInputDevice* mousedevice, class NG_NetworkDeviceInterface* ndi, -// AUD_XXX class SND_IAudioDevice* adi, const STR_String& scenename, struct Scene* scene); @@ -481,7 +470,6 @@ public: void CalculateVisibleMeshes(RAS_IRasterizer* rasty, KX_Camera *cam, int layer=0); void UpdateMeshTransformations(); KX_Camera* GetpCamera(); -// AUD_XXX SND_Scene* GetSoundScene(); NG_NetworkDeviceInterface* GetNetworkDeviceInterface(); NG_NetworkScene* GetNetworkScene(); diff --git a/source/gameengine/Ketsji/KX_SoundActuator.cpp b/source/gameengine/Ketsji/KX_SoundActuator.cpp index d9be066afdc..8ef035c0b53 100644 --- a/source/gameengine/Ketsji/KX_SoundActuator.cpp +++ b/source/gameengine/Ketsji/KX_SoundActuator.cpp @@ -42,9 +42,6 @@ #include <config.h> #endif -// AUD_XXX -#include "DNA_sound_types.h" - /* ------------------------------------------------------------------------- */ /* Native functions */ /* ------------------------------------------------------------------------- */ @@ -54,15 +51,9 @@ KX_SoundActuator::KX_SoundActuator(SCA_IObject* gameobj, float pitch, bool is3d, KX_3DSoundSettings settings, -// AUD_XXX SND_SoundObject* sndobj, -// AUD_XXX SND_Scene* sndscene, KX_SOUNDACT_TYPE type)//, -// AUD_XXX short start, -// AUD_XXX short end) : SCA_IActuator(gameobj) { -// AUD_XXX m_soundObject = sndobj; -// AUD_XXX m_soundScene = sndscene; m_sound = sound; m_volume = volume; m_pitch = pitch; @@ -70,29 +61,15 @@ KX_SoundActuator::KX_SoundActuator(SCA_IObject* gameobj, m_3d = settings; m_handle = NULL; m_type = type; -// AUD_XXX m_lastEvent = true; m_isplaying = false; -// AUD_XXX m_startFrame = start; -// AUD_XXX m_endFrame = end; -// AUD_XXX m_pino = false; - - } KX_SoundActuator::~KX_SoundActuator() { -// AUD_XXX if(m_handle) AUD_stop(m_handle); -#if 0 - if (m_soundObject) - { - m_soundScene->RemoveActiveObject(m_soundObject); - m_soundScene->DeleteObject(m_soundObject); - } -#endif } void KX_SoundActuator::play() @@ -160,16 +137,7 @@ CValue* KX_SoundActuator::GetReplica() void KX_SoundActuator::ProcessReplica() { SCA_IActuator::ProcessReplica(); -// AUD_XXX m_handle = 0; -#if 0 - if (m_soundObject) - { - SND_SoundObject* soundobj = new SND_SoundObject(*m_soundObject); - setSoundObject(soundobj); - m_soundScene->AddObject(soundobj); - } -#endif } bool KX_SoundActuator::Update(double curtime, bool frame) @@ -184,19 +152,11 @@ bool KX_SoundActuator::Update(double curtime, bool frame) RemoveAllEvents(); -// AUD_XXX if (!m_soundObject) if(!m_sound) return false; // actual audio device playing state - bool isplaying = /*AUD_XXX(m_soundObject->GetPlaystate() != SND_STOPPED && m_soundObject->GetPlaystate() != SND_INITIAL) ? true : false*/ AUD_getStatus(m_handle) == AUD_STATUS_PLAYING; - - /* AUD_XXX - if (m_pino) - { - bNegativeEvent = true; - m_pino = false; - }*/ + bool isplaying = AUD_getStatus(m_handle) == AUD_STATUS_PLAYING; if (bNegativeEvent) { @@ -209,20 +169,16 @@ bool KX_SoundActuator::Update(double curtime, bool frame) case KX_SOUNDACT_LOOPSTOP: case KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP: { -// AUD_XXX m_soundScene->RemoveActiveObject(m_soundObject); AUD_stop(m_handle); break; } case KX_SOUNDACT_PLAYEND: { -// AUD_XXX m_soundObject->SetPlaystate(SND_MUST_STOP_WHEN_FINISHED); break; } case KX_SOUNDACT_LOOPEND: case KX_SOUNDACT_LOOPBIDIRECTIONAL: { -// AUD_XXX m_soundObject->SetLoopMode(SND_LOOP_OFF); -// AUD_XXX m_soundObject->SetPlaystate(SND_MUST_STOP_WHEN_FINISHED); AUD_stopLoop(m_handle); break; } @@ -249,16 +205,10 @@ bool KX_SoundActuator::Update(double curtime, bool frame) play(); } // verify that the sound is still playing - isplaying = /*AUD_XXX(m_soundObject->GetPlaystate() != SND_STOPPED && m_soundObject->GetPlaystate() != SND_INITIAL) ? true :*/ AUD_getStatus(m_handle) == AUD_STATUS_PLAYING ? true : false; + isplaying = AUD_getStatus(m_handle) == AUD_STATUS_PLAYING ? true : false; if (isplaying) { -// AUD_XXX -#if 0 - m_soundObject->SetPosition(((KX_GameObject*)this->GetParent())->NodeGetWorldPosition()); - m_soundObject->SetVelocity(((KX_GameObject*)this->GetParent())->GetLinearVelocity()); - m_soundObject->SetOrientation(((KX_GameObject*)this->GetParent())->NodeGetWorldOrientation()); -#else if(m_is3d) { AUD_3DData data; @@ -289,7 +239,6 @@ bool KX_SoundActuator::Update(double curtime, bool frame) AUD_update3DSource(m_handle, &data); } -#endif result = true; } else @@ -297,24 +246,10 @@ bool KX_SoundActuator::Update(double curtime, bool frame) m_isplaying = false; result = false; } - /* - if (result && (m_soundObject->IsLifeSpanOver(curtime)) && ((m_type == KX_SOUNDACT_PLAYEND) || (m_type == KX_SOUNDACT_PLAYSTOP))) - { - m_pino = true; - } - */ return result; } -// AUD_XXX -#if 0 -void KX_SoundActuator::setSoundObject(class SND_SoundObject* soundobject) -{ - m_soundObject = soundobject; -} -#endif - /* ------------------------------------------------------------------------- */ @@ -354,19 +289,12 @@ PyTypeObject KX_SoundActuator::Type = { PyMethodDef KX_SoundActuator::Methods[] = { // Deprecated -----> -// AUD_XXX {"setFilename", (PyCFunction) KX_SoundActuator::sPySetFilename, METH_VARARGS,NULL}, -// AUD_XXX {"getFilename", (PyCFunction) KX_SoundActuator::sPyGetFilename, METH_NOARGS,NULL}, {"setGain",(PyCFunction) KX_SoundActuator::sPySetGain,METH_VARARGS,NULL}, {"getGain",(PyCFunction) KX_SoundActuator::sPyGetGain,METH_NOARGS,NULL}, {"setPitch",(PyCFunction) KX_SoundActuator::sPySetPitch,METH_VARARGS,NULL}, {"getPitch",(PyCFunction) KX_SoundActuator::sPyGetPitch,METH_NOARGS,NULL}, {"setRollOffFactor",(PyCFunction) KX_SoundActuator::sPySetRollOffFactor,METH_VARARGS,NULL}, {"getRollOffFactor",(PyCFunction) KX_SoundActuator::sPyGetRollOffFactor,METH_NOARGS,NULL}, -// AUD_XXX {"setLooping",(PyCFunction) KX_SoundActuator::sPySetLooping,METH_VARARGS,NULL}, -// AUD_XXX {"getLooping",(PyCFunction) KX_SoundActuator::sPyGetLooping,METH_NOARGS,NULL}, -// AUD_XXX {"setPosition",(PyCFunction) KX_SoundActuator::sPySetPosition,METH_VARARGS,NULL}, -// AUD_XXX {"setVelocity",(PyCFunction) KX_SoundActuator::sPySetVelocity,METH_VARARGS,NULL}, -// AUD_XXX {"setOrientation",(PyCFunction) KX_SoundActuator::sPySetOrientation,METH_VARARGS,NULL}, {"setType",(PyCFunction) KX_SoundActuator::sPySetType,METH_VARARGS,NULL}, {"getType",(PyCFunction) KX_SoundActuator::sPyGetType,METH_NOARGS,NULL}, // <----- @@ -378,14 +306,9 @@ PyMethodDef KX_SoundActuator::Methods[] = { }; PyAttributeDef KX_SoundActuator::Attributes[] = { -// AUD_XXX KX_PYATTRIBUTE_RW_FUNCTION("fileName", KX_SoundActuator, pyattr_get_filename, pyattr_set_filename), KX_PYATTRIBUTE_RW_FUNCTION("volume", KX_SoundActuator, pyattr_get_gain, pyattr_set_gain), KX_PYATTRIBUTE_RW_FUNCTION("pitch", KX_SoundActuator, pyattr_get_pitch, pyattr_set_pitch), KX_PYATTRIBUTE_RW_FUNCTION("rollOffFactor", KX_SoundActuator, pyattr_get_rollOffFactor, pyattr_set_rollOffFactor), -// AUD_XXX KX_PYATTRIBUTE_RW_FUNCTION("looping", KX_SoundActuator, pyattr_get_looping, pyattr_set_looping), -// AUD_XXX KX_PYATTRIBUTE_RW_FUNCTION("position", KX_SoundActuator, pyattr_get_position, pyattr_set_position), -// AUD_XXX KX_PYATTRIBUTE_RW_FUNCTION("velocity", KX_SoundActuator, pyattr_get_velocity, pyattr_set_velocity), -// AUD_XXX KX_PYATTRIBUTE_RW_FUNCTION("orientation", KX_SoundActuator, pyattr_get_orientation, pyattr_set_orientation), KX_PYATTRIBUTE_ENUM_RW("mode",KX_SoundActuator::KX_SOUNDACT_NODEF+1,KX_SoundActuator::KX_SOUNDACT_MAX-1,false,KX_SoundActuator,m_type), { NULL } //Sentinel }; @@ -395,11 +318,6 @@ KX_PYMETHODDEF_DOC_NOARGS(KX_SoundActuator, startSound, "startSound()\n" "\tStarts the sound.\n") { -// AUD_XXX if (m_soundObject) - // This has no effect if the actuator is not active. - // To start the sound you must activate the actuator. - // This function is to restart the sound. -// AUD_XXX m_soundObject->StartSound(); switch(AUD_getStatus(m_handle)) { case AUD_STATUS_PLAYING: @@ -417,9 +335,6 @@ KX_PYMETHODDEF_DOC_NOARGS(KX_SoundActuator, pauseSound, "pauseSound()\n" "\tPauses the sound.\n") { -// AUD_XXX if (m_soundObject) - // unfortunately, openal does not implement pause correctly, it is equivalent to a stop -// AUD_XXX m_soundObject->PauseSound(); AUD_pause(m_handle); Py_RETURN_NONE; } @@ -428,38 +343,15 @@ KX_PYMETHODDEF_DOC_NOARGS(KX_SoundActuator, stopSound, "stopSound()\n" "\tStops the sound.\n") { -// AUD_XXX if (m_soundObject) -// AUD_XXX m_soundObject->StopSound(); AUD_stop(m_handle); Py_RETURN_NONE; } /* Atribute setting and getting -------------------------------------------- */ -// AUD_XXX -#if 0 -PyObject* KX_SoundActuator::pyattr_get_filename(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef) -{ - KX_SoundActuator * actuator = static_cast<KX_SoundActuator *> (self); -// AUD_XXX if (!actuator->m_soundObject) -// AUD_XXX { - return PyUnicode_FromString(""); - } - STR_String objectname = actuator->m_soundObject->GetObjectName(); - char* name = objectname.Ptr(); - - if (!name) { - PyErr_SetString(PyExc_RuntimeError, "value = actuator.fileName: KX_SoundActuator, unable to get sound fileName"); - return NULL; - } else - return PyUnicode_FromString(name); -} -#endif - PyObject* KX_SoundActuator::pyattr_get_gain(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef) { KX_SoundActuator * actuator = static_cast<KX_SoundActuator *> (self); -// AUD_XXX float gain = (actuator->m_soundObject) ? actuator->m_soundObject->GetGain() : 1.0f; float gain = actuator->m_volume; PyObject* result = PyFloat_FromDouble(gain); @@ -470,7 +362,6 @@ PyObject* KX_SoundActuator::pyattr_get_gain(void *self, const struct KX_PYATTRIB PyObject* KX_SoundActuator::pyattr_get_pitch(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef) { KX_SoundActuator * actuator = static_cast<KX_SoundActuator *> (self); -// AUD_XXX float pitch = (actuator->m_soundObject) ? actuator->m_soundObject->GetPitch() : 1.0; float pitch = actuator->m_pitch; PyObject* result = PyFloat_FromDouble(pitch); @@ -481,84 +372,12 @@ PyObject* KX_SoundActuator::pyattr_get_pitch(void *self, const struct KX_PYATTRI PyObject* KX_SoundActuator::pyattr_get_rollOffFactor(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef) { KX_SoundActuator * actuator = static_cast<KX_SoundActuator *> (self); -// AUD_XXX float rollofffactor = (actuator->m_soundObject) ? actuator->m_soundObject->GetRollOffFactor() : 1.0; float rollofffactor = actuator->m_3d.rolloff_factor; PyObject* result = PyFloat_FromDouble(rollofffactor); return result; } -// AUD_XXX -#if 0 -PyObject* KX_SoundActuator::pyattr_get_looping(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef) -{ - KX_SoundActuator * actuator = static_cast<KX_SoundActuator *> (self); -// AUD_XXX int looping = (actuator->m_soundObject) ? actuator->m_soundObject->GetLoopMode() : (int)SND_LOOP_OFF; - int looping = (int)SND_LOOP_OFF; - PyObject* result = PyLong_FromSsize_t(looping); - - return result; -} - -PyObject* KX_SoundActuator::pyattr_get_position(void * self, const struct KX_PYATTRIBUTE_DEF *attrdef) -{ - KX_SoundActuator * actuator = static_cast<KX_SoundActuator *> (self); - MT_Vector3 pos(0.0, 0.0, 0.0); - -// AUD_XXX if (actuator->m_soundObject) -// AUD_XXX pos = actuator->m_soundObject->GetPosition(); - - pos = ((KX_GameObject*)actuator->GetParent())->NodeGetWorldPosition(); - - PyObject * result = PyObjectFrom(pos); - return result; -} - -PyObject* KX_SoundActuator::pyattr_get_velocity(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef) -{ - KX_SoundActuator * actuator = static_cast<KX_SoundActuator *> (self); - MT_Vector3 vel; - -// AUD_XXX if (actuator->m_soundObject) -// AUD_XXX vel = actuator->m_soundObject->GetVelocity(); - - vel = ((KX_GameObject*)actuator->GetParent())->GetLinearVelocity(); - - PyObject * result = PyObjectFrom(vel); - return result; -} - -PyObject* KX_SoundActuator::pyattr_get_orientation(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef) -{ - KX_SoundActuator * actuator = static_cast<KX_SoundActuator *> (self); - MT_Matrix3x3 ori; - -// AUD_XXX if (actuator->m_soundObject) -// AUD_XXX ori = actuator->m_soundObject->GetOrientation(); - - ori = ((KX_GameObject*)actuator->GetParent())->NodeGetWorldOrientation(); - - PyObject * result = PyObjectFrom(ori); - return result; -} - -int KX_SoundActuator::pyattr_set_filename(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) -{ - char *soundName = NULL; - KX_SoundActuator * actuator = static_cast<KX_SoundActuator*> (self); - // void *soundPointer = NULL; /*unused*/ - - if (!PyArg_Parse(value, "s", &soundName)) - return PY_SET_ATTR_FAIL; - -// AUD_XXX if (actuator->m_soundObject) { -// AUD_XXX actuator->m_soundObject->SetObjectName(soundName); -// AUD_XXX } - - return PY_SET_ATTR_SUCCESS; -} -#endif - int KX_SoundActuator::pyattr_set_gain(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { float gain = 1.0; @@ -566,9 +385,6 @@ int KX_SoundActuator::pyattr_set_gain(void *self, const struct KX_PYATTRIBUTE_DE if (!PyArg_Parse(value, "f", &gain)) return PY_SET_ATTR_FAIL; -// AUD_XXX if (actuator->m_soundObject) -// AUD_XXX actuator->m_soundObject->SetGain(gain); - actuator->m_volume = gain; if(actuator->m_handle) AUD_setSoundVolume(actuator->m_handle, gain); @@ -583,9 +399,6 @@ int KX_SoundActuator::pyattr_set_pitch(void *self, const struct KX_PYATTRIBUTE_D if (!PyArg_Parse(value, "f", &pitch)) return PY_SET_ATTR_FAIL; -// AUD_XXX if (actuator->m_soundObject) -// AUD_XXX actuator->m_soundObject->SetPitch(pitch); - actuator->m_pitch = pitch; if(actuator->m_handle) AUD_setSoundPitch(actuator->m_handle, pitch); @@ -600,9 +413,6 @@ int KX_SoundActuator::pyattr_set_rollOffFactor(void *self, const struct KX_PYATT if (!PyArg_Parse(value, "f", &rollofffactor)) return PY_SET_ATTR_FAIL; -// AUD_XXX if (actuator->m_soundObject) -// AUD_XXX actuator->m_soundObject->SetRollOffFactor(rollofffactor); - actuator->m_3d.rolloff_factor = rollofffactor; if(actuator->m_handle) AUD_set3DSourceSetting(actuator->m_handle, AUD_3DSS_ROLLOFF_FACTOR, rollofffactor); @@ -610,102 +420,6 @@ int KX_SoundActuator::pyattr_set_rollOffFactor(void *self, const struct KX_PYATT return PY_SET_ATTR_SUCCESS; } -// AUD_XXX -#if 0 -int KX_SoundActuator::pyattr_set_looping(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) -{ - KX_SoundActuator * actuator = static_cast<KX_SoundActuator *> (self); - int looping = 1; - if (!PyArg_Parse(value, "i", &looping)) - return PY_SET_ATTR_FAIL; - -// AUD_XXX if (actuator->m_soundObject) -// AUD_XXX actuator->m_soundObject->SetLoopMode(looping); - - return PY_SET_ATTR_SUCCESS; -} - -int KX_SoundActuator::pyattr_set_position(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) -{ - float pos[3]; - - KX_SoundActuator * actuator = static_cast<KX_SoundActuator *> (self); - - if (!PyArg_ParseTuple(value, "fff", &pos[0], &pos[1], &pos[2])) - return PY_SET_ATTR_FAIL; - -// AUD_XXX if (actuator->m_soundObject) -// AUD_XXX actuator->m_soundObject->SetPosition(MT_Vector3(pos)); - - return PY_SET_ATTR_SUCCESS; -} - -int KX_SoundActuator::pyattr_set_velocity(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) -{ - float vel[3]; - KX_SoundActuator * actuator = static_cast<KX_SoundActuator *> (self); - - - if (!PyArg_ParseTuple(value, "fff", &vel[0], &vel[1], &vel[2])) - return PY_SET_ATTR_FAIL; - -// AUD_XXX if (actuator->m_soundObject) -// AUD_XXX actuator->m_soundObject->SetVelocity(MT_Vector3(vel)); - - return PY_SET_ATTR_SUCCESS; - -} - -int KX_SoundActuator::pyattr_set_orientation(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) -{ - - MT_Matrix3x3 rot; - KX_SoundActuator * actuator = static_cast<KX_SoundActuator *> (self); - - /* if value is not a sequence PyOrientationTo makes an error */ - if (!PyOrientationTo(value, rot, "actuator.orientation = value: KX_SoundActuator")) - return PY_SET_ATTR_FAIL; - - /* Since not having m_soundObject didn't do anything in the old version, - * it probably should be kept that way */ -// AUD_XXX if (!actuator->m_soundObject) - return PY_SET_ATTR_SUCCESS; - -// AUD_XXX actuator->m_soundObject->SetOrientation(rot); -// AUD_XXX return PY_SET_ATTR_SUCCESS; -} - -// Deprecated -----> -PyObject* KX_SoundActuator::PySetFilename(PyObject* args) -{ - char *soundName = NULL; - ShowDeprecationWarning("setFilename()", "the fileName property"); - // void *soundPointer = NULL; /*unused*/ - - if (!PyArg_ParseTuple(args, "s", &soundName)) - return NULL; - - Py_RETURN_NONE; -} - -PyObject* KX_SoundActuator::PyGetFilename() -{ - ShowDeprecationWarning("getFilename()", "the fileName property"); -// AUD_XXX if (!m_soundObject) -// AUD_XXX { - return PyUnicode_FromString(""); - } - STR_String objectname = m_soundObject->GetObjectName(); - char* name = objectname.Ptr(); - - if (!name) { - PyErr_SetString(PyExc_RuntimeError, "Unable to get sound fileName"); - return NULL; - } else - return PyUnicode_FromString(name); -} -#endif - PyObject* KX_SoundActuator::PySetGain(PyObject* args) { ShowDeprecationWarning("setGain()", "the volume property"); @@ -713,9 +427,6 @@ PyObject* KX_SoundActuator::PySetGain(PyObject* args) if (!PyArg_ParseTuple(args, "f:setGain", &gain)) return NULL; -// AUD_XXX if (m_soundObject) -// AUD_XXX m_soundObject->SetGain(gain); - m_volume = gain; if(m_handle) AUD_setSoundVolume(m_handle, gain); @@ -728,7 +439,6 @@ PyObject* KX_SoundActuator::PySetGain(PyObject* args) PyObject* KX_SoundActuator::PyGetGain() { ShowDeprecationWarning("getGain()", "the volume property"); -// AUD_XXX float gain = AUD_XXX(m_soundObject) ? m_soundObject->GetGain() : 1.0f; float gain = m_volume; PyObject* result = PyFloat_FromDouble(gain); @@ -744,9 +454,6 @@ PyObject* KX_SoundActuator::PySetPitch(PyObject* args) if (!PyArg_ParseTuple(args, "f:setPitch", &pitch)) return NULL; -// AUD_XXX if (m_soundObject) -// AUD_XXX m_soundObject->SetPitch(pitch); - m_pitch = pitch; if(m_handle) AUD_setSoundPitch(m_handle, pitch); @@ -759,7 +466,6 @@ PyObject* KX_SoundActuator::PySetPitch(PyObject* args) PyObject* KX_SoundActuator::PyGetPitch() { ShowDeprecationWarning("getPitch()", "the pitch property"); -// AUD_XXX float pitch = AUD_XXX(m_soundObject) ? m_soundObject->GetPitch() : 1.0; float pitch = m_pitch; PyObject* result = PyFloat_FromDouble(pitch); @@ -775,9 +481,6 @@ PyObject* KX_SoundActuator::PySetRollOffFactor(PyObject* args) if (!PyArg_ParseTuple(args, "f:setRollOffFactor", &rollofffactor)) return NULL; -// AUD_XXX if (m_soundObject) -// AUD_XXX m_soundObject->SetRollOffFactor(rollofffactor); - m_3d.rolloff_factor = rollofffactor; if(m_handle) AUD_set3DSourceSetting(m_handle, AUD_3DSS_ROLLOFF_FACTOR, rollofffactor); @@ -790,7 +493,6 @@ PyObject* KX_SoundActuator::PySetRollOffFactor(PyObject* args) PyObject* KX_SoundActuator::PyGetRollOffFactor() { ShowDeprecationWarning("getRollOffFactor()", "the rollOffFactor property"); -// AUD_XXX float rollofffactor = AUD_XXX(m_soundObject) ? m_soundObject->GetRollOffFactor() : 1.0; float rollofffactor = m_3d.rolloff_factor; PyObject* result = PyFloat_FromDouble(rollofffactor); @@ -799,94 +501,6 @@ PyObject* KX_SoundActuator::PyGetRollOffFactor() -// AUD_XXX -#if 0 -PyObject* KX_SoundActuator::PySetLooping(PyObject* args) -{ - ShowDeprecationWarning("setLooping()", "the looping property"); - bool looping = 1; - if (!PyArg_ParseTuple(args, "i:setLooping", &looping)) - return NULL; - -// AUD_XXX if (m_soundObject) -// AUD_XXX m_soundObject->SetLoopMode(looping); - - Py_RETURN_NONE; -} - - - -PyObject* KX_SoundActuator::PyGetLooping() -{ - ShowDeprecationWarning("getLooping()", "the looping property"); - int looping = /*AUD_XXX(m_soundObject) ? m_soundObject->GetLoopMode() :*/ (int)SND_LOOP_OFF; - PyObject* result = PyLong_FromSsize_t(looping); - - return result; -} - - -PyObject* KX_SoundActuator::PySetPosition(PyObject* args) -{ - MT_Point3 pos; - ShowDeprecationWarning("setPosition()", "the position property"); - pos[0] = 0.0; - pos[1] = 0.0; - pos[2] = 0.0; - - if (!PyArg_ParseTuple(args, "fff:setPosition", &pos[0], &pos[1], &pos[2])) - return NULL; - -// AUD_XXX if (m_soundObject) -// AUD_XXX m_soundObject->SetPosition(pos); - - Py_RETURN_NONE; -} - - -PyObject* KX_SoundActuator::PySetVelocity(PyObject* args) -{ - MT_Vector3 vel; - ShowDeprecationWarning("setVelocity()", "the velocity property"); - vel[0] = 0.0; - vel[1] = 0.0; - vel[2] = 0.0; - - if (!PyArg_ParseTuple(args, "fff:setVelocity", &vel[0], &vel[1], &vel[2])) - return NULL; - -// AUD_XXX if (m_soundObject) -// AUD_XXX m_soundObject->SetVelocity(vel); - - Py_RETURN_NONE; -} - - - -PyObject* KX_SoundActuator::PySetOrientation(PyObject* args) -{ - MT_Matrix3x3 ori; - ShowDeprecationWarning("setOrientation()", "the orientation property"); - ori[0][0] = 1.0; - ori[0][1] = 0.0; - ori[0][2] = 0.0; - ori[1][0] = 0.0; - ori[1][1] = 1.0; - ori[1][2] = 0.0; - ori[2][0] = 0.0; - ori[2][1] = 0.0; - ori[2][2] = 1.0; - - if (!PyArg_ParseTuple(args, "fffffffff:setOrientation", &ori[0][0], &ori[0][1], &ori[0][2], &ori[1][0], &ori[1][1], &ori[1][2], &ori[2][0], &ori[2][1], &ori[2][2])) - return NULL; - -// AUD_XXX if (m_soundObject) -// AUD_XXX m_soundObject->SetOrientation(ori); - - Py_RETURN_NONE; -} -#endif - PyObject* KX_SoundActuator::PySetType(PyObject* args) { int typeArg; diff --git a/source/gameengine/Ketsji/KX_SoundActuator.h b/source/gameengine/Ketsji/KX_SoundActuator.h index 61d0b4b06c5..ddf8330072e 100644 --- a/source/gameengine/Ketsji/KX_SoundActuator.h +++ b/source/gameengine/Ketsji/KX_SoundActuator.h @@ -34,7 +34,6 @@ #include "SCA_IActuator.h" -// AUD_XXX #include "AUD_C-API.h" #include "BKE_sound.h" @@ -92,15 +91,10 @@ public: float pitch, bool is3d, KX_3DSoundSettings settings, -// AUD_XXX class SND_SoundObject* sndobj, -// AUD_XXX class SND_Scene* sndscene, - KX_SOUNDACT_TYPE type);//, -// AUD_XXX short start, -// AUD_XXX short end); + KX_SOUNDACT_TYPE type); ~KX_SoundActuator(); -// AUD_XXX void setSoundObject(class SND_SoundObject* soundobject); virtual bool Update(double curtime, bool frame); CValue* GetReplica(); @@ -114,40 +108,23 @@ public: KX_PYMETHOD_DOC_NOARGS(KX_SoundActuator, pauseSound); KX_PYMETHOD_DOC_NOARGS(KX_SoundActuator, stopSound); -// AUD_XXX static int pyattr_set_filename(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); static int pyattr_set_gain(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); static int pyattr_set_pitch(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); static int pyattr_set_rollOffFactor(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); -// AUD_XXX static int pyattr_set_looping(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); -// AUD_XXX static int pyattr_set_position(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); -// AUD_XXX static int pyattr_set_velocity(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); -// AUD_XXX static int pyattr_set_orientation(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); static int pyattr_set_type(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); -// AUD_XXX static PyObject* pyattr_get_filename(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_gain(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_pitch(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); -// AUD_XXX static PyObject* pyattr_get_looping(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_rollOffFactor(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); -// AUD_XXX static PyObject* pyattr_get_position(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); -// AUD_XXX static PyObject* pyattr_get_velocity(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); -// AUD_XXX static PyObject* pyattr_get_orientation(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_type(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); // Deprecated -----> -// AUD_XXX KX_PYMETHOD_VARARGS(KX_SoundActuator,SetFilename); -// AUD_XXX KX_PYMETHOD_NOARGS(KX_SoundActuator,GetFilename); KX_PYMETHOD_VARARGS(KX_SoundActuator,SetGain); KX_PYMETHOD_NOARGS(KX_SoundActuator,GetGain); KX_PYMETHOD_VARARGS(KX_SoundActuator,SetPitch); KX_PYMETHOD_NOARGS(KX_SoundActuator,GetPitch); KX_PYMETHOD_VARARGS(KX_SoundActuator,SetRollOffFactor); KX_PYMETHOD_NOARGS(KX_SoundActuator,GetRollOffFactor); -// AUD_XXX KX_PYMETHOD_VARARGS(KX_SoundActuator,SetLooping); -// AUD_XXX KX_PYMETHOD_NOARGS(KX_SoundActuator,GetLooping); -// AUD_XXX KX_PYMETHOD_VARARGS(KX_SoundActuator,SetPosition); -// AUD_XXX KX_PYMETHOD_VARARGS(KX_SoundActuator,SetVelocity); -// AUD_XXX KX_PYMETHOD_VARARGS(KX_SoundActuator,SetOrientation); KX_PYMETHOD_VARARGS(KX_SoundActuator,SetType); KX_PYMETHOD_NOARGS(KX_SoundActuator,GetType); // <----- |