Another error in last bigger commit.
[blender.git] / source / blender / blenkernel / intern / sound.c
1 /** \file blender/blenkernel/intern/sound.c
2  *  \ingroup bke
3  */
4 /**
5  * sound.c (mar-2001 nzc)
6  *
7  * $Id$
8  */
9
10 #include <string.h>
11 #include <stdlib.h>
12
13 #include "MEM_guardedalloc.h"
14
15 #include "BLI_blenlib.h"
16 #include "BLI_math.h"
17
18 #include "DNA_anim_types.h"
19 #include "DNA_object_types.h"
20 #include "DNA_scene_types.h"
21 #include "DNA_sequence_types.h"
22 #include "DNA_packedFile_types.h"
23 #include "DNA_screen_types.h"
24 #include "DNA_sound_types.h"
25 #include "DNA_speaker_types.h"
26
27 #ifdef WITH_AUDASPACE
28 #  include "AUD_C-API.h"
29 #endif
30
31 #include "BKE_utildefines.h"
32 #include "BKE_global.h"
33 #include "BKE_main.h"
34 #include "BKE_sound.h"
35 #include "BKE_context.h"
36 #include "BKE_library.h"
37 #include "BKE_packedFile.h"
38 #include "BKE_animsys.h"
39 #include "BKE_sequencer.h"
40
41 // evil global ;-)
42 static int sound_cfra;
43
44 struct bSound* sound_new_file(struct Main *bmain, const char *filename)
45 {
46         bSound* sound = NULL;
47
48         char str[FILE_MAX];
49         char *path;
50
51         int len;
52
53         strcpy(str, filename);
54
55         path = /*bmain ? bmain->name :*/ G.main->name;
56
57         BLI_path_abs(str, path);
58
59         len = strlen(filename);
60         while(len > 0 && filename[len-1] != '/' && filename[len-1] != '\\')
61                 len--;
62
63         sound = alloc_libblock(&bmain->sound, ID_SO, filename+len);
64         BLI_strncpy(sound->name, filename, FILE_MAX);
65 // XXX unused currently sound->type = SOUND_TYPE_FILE;
66
67         sound_load(bmain, sound);
68
69         if(!sound->playback_handle)
70         {
71                 free_libblock(&bmain->sound, sound);
72                 sound = NULL;
73         }
74
75         return sound;
76 }
77
78 void sound_free(struct bSound* sound)
79 {
80         if (sound->packedfile)
81         {
82                 freePackedFile(sound->packedfile);
83                 sound->packedfile = NULL;
84         }
85
86 #ifdef WITH_AUDASPACE
87         if(sound->handle)
88         {
89                 AUD_unload(sound->handle);
90                 sound->handle = NULL;
91                 sound->playback_handle = NULL;
92         }
93
94         if(sound->cache)
95         {
96                 AUD_unload(sound->cache);
97                 sound->cache = NULL;
98         }
99
100         sound_free_waveform(sound);
101 #endif // WITH_AUDASPACE
102 }
103
104 #ifdef WITH_AUDASPACE
105
106 static int force_device = -1;
107
108 #ifdef WITH_JACK
109 static void sound_sync_callback(void* data, int mode, float time)
110 {
111         struct Main* bmain = (struct Main*)data;
112         struct Scene* scene;
113
114         scene = bmain->scene.first;
115         while(scene)
116         {
117                 if(scene->audio.flag & AUDIO_SYNC)
118                 {
119                         if(mode)
120                                 sound_play_scene(scene);
121                         else
122                                 sound_stop_scene(scene);
123                         if(scene->sound_scene_handle)
124                                 AUD_seek(scene->sound_scene_handle, time);
125                 }
126                 scene = scene->id.next;
127         }
128 }
129 #endif
130
131 int sound_define_from_str(const char *str)
132 {
133         if (BLI_strcaseeq(str, "NULL"))
134                 return AUD_NULL_DEVICE;
135         if (BLI_strcaseeq(str, "SDL"))
136                 return AUD_SDL_DEVICE;
137         if (BLI_strcaseeq(str, "OPENAL"))
138                 return AUD_OPENAL_DEVICE;
139         if (BLI_strcaseeq(str, "JACK"))
140                 return AUD_JACK_DEVICE;
141
142         return -1;
143 }
144
145 void sound_force_device(int device)
146 {
147         force_device = device;
148 }
149
150 void sound_init_once(void)
151 {
152         AUD_initOnce();
153 }
154
155 void sound_init(struct Main *bmain)
156 {
157         AUD_DeviceSpecs specs;
158         int device, buffersize;
159
160         device = U.audiodevice;
161         buffersize = U.mixbufsize;
162         specs.channels = U.audiochannels;
163         specs.format = U.audioformat;
164         specs.rate = U.audiorate;
165
166         if(force_device >= 0)
167                 device = force_device;
168
169         if(buffersize < 128)
170                 buffersize = AUD_DEFAULT_BUFFER_SIZE;
171
172         if(specs.rate < AUD_RATE_8000)
173                 specs.rate = AUD_RATE_44100;
174
175         if(specs.format <= AUD_FORMAT_INVALID)
176                 specs.format = AUD_FORMAT_S16;
177
178         if(specs.channels <= AUD_CHANNELS_INVALID)
179                 specs.channels = AUD_CHANNELS_STEREO;
180
181         if(!AUD_init(device, specs, buffersize))
182                 AUD_init(AUD_NULL_DEVICE, specs, buffersize);
183
184         sound_init_main(bmain);
185 }
186
187 void sound_init_main(struct Main *bmain)
188 {
189 #ifdef WITH_JACK
190         AUD_setSyncCallback(sound_sync_callback, bmain);
191 #else
192         (void)bmain; /* unused */
193 #endif
194 }
195
196 void sound_exit(void)
197 {
198         AUD_exit();
199 }
200
201 // XXX unused currently
202 #if 0
203 struct bSound* sound_new_buffer(struct bContext *C, struct bSound *source)
204 {
205         bSound* sound = NULL;
206
207         char name[25];
208         strcpy(name, "buf_");
209         strcpy(name + 4, source->id.name);
210
211         sound = alloc_libblock(&CTX_data_main(C)->sound, ID_SO, name);
212
213         sound->child_sound = source;
214         sound->type = SOUND_TYPE_BUFFER;
215
216         sound_load(CTX_data_main(C), sound);
217
218         if(!sound->playback_handle)
219         {
220                 free_libblock(&CTX_data_main(C)->sound, sound);
221                 sound = NULL;
222         }
223
224         return sound;
225 }
226
227 struct bSound* sound_new_limiter(struct bContext *C, struct bSound *source, float start, float end)
228 {
229         bSound* sound = NULL;
230
231         char name[25];
232         strcpy(name, "lim_");
233         strcpy(name + 4, source->id.name);
234
235         sound = alloc_libblock(&CTX_data_main(C)->sound, ID_SO, name);
236
237         sound->child_sound = source;
238         sound->start = start;
239         sound->end = end;
240         sound->type = SOUND_TYPE_LIMITER;
241
242         sound_load(CTX_data_main(C), sound);
243
244         if(!sound->playback_handle)
245         {
246                 free_libblock(&CTX_data_main(C)->sound, sound);
247                 sound = NULL;
248         }
249
250         return sound;
251 }
252 #endif
253
254 void sound_delete(struct bContext *C, struct bSound* sound)
255 {
256         if(sound)
257         {
258                 sound_free(sound);
259
260                 free_libblock(&CTX_data_main(C)->sound, sound);
261         }
262 }
263
264 void sound_cache(struct bSound* sound)
265 {
266         sound->flags |= SOUND_FLAGS_CACHING;
267         if(sound->cache)
268                 AUD_unload(sound->cache);
269
270         sound->cache = AUD_bufferSound(sound->handle);
271         sound->playback_handle = sound->cache;
272 }
273
274 void sound_cache_notifying(struct Main* main, struct bSound* sound)
275 {
276         sound_cache(sound);
277         sound_update_sequencer(main, sound);
278 }
279
280 void sound_delete_cache(struct bSound* sound)
281 {
282         sound->flags &= ~SOUND_FLAGS_CACHING;
283         if(sound->cache)
284         {
285                 AUD_unload(sound->cache);
286                 sound->cache = NULL;
287                 sound->playback_handle = sound->handle;
288         }
289 }
290
291 void sound_load(struct Main *bmain, struct bSound* sound)
292 {
293         if(sound)
294         {
295                 if(sound->cache)
296                 {
297                         AUD_unload(sound->cache);
298                         sound->cache = NULL;
299                 }
300
301                 if(sound->handle)
302                 {
303                         AUD_unload(sound->handle);
304                         sound->handle = NULL;
305                         sound->playback_handle = NULL;
306                 }
307
308 // XXX unused currently
309 #if 0
310                 switch(sound->type)
311                 {
312                 case SOUND_TYPE_FILE:
313 #endif
314                 {
315                         char fullpath[FILE_MAX];
316                         char *path;
317
318                         /* load sound */
319                         PackedFile* pf = sound->packedfile;
320
321                         /* dont modify soundact->sound->name, only change a copy */
322                         BLI_strncpy(fullpath, sound->name, sizeof(fullpath));
323
324                         if(sound->id.lib)
325                                 path = sound->id.lib->filepath;
326                         else
327                                 path = bmain->name;
328
329                         BLI_path_abs(fullpath, path);
330
331                         /* but we need a packed file then */
332                         if (pf)
333                                 sound->handle = AUD_loadBuffer((unsigned char*) pf->data, pf->size);
334                         /* or else load it from disk */
335                         else
336                                 sound->handle = AUD_load(fullpath);
337                 }
338 // XXX unused currently
339 #if 0
340                         break;
341                 }
342                 case SOUND_TYPE_BUFFER:
343                         if(sound->child_sound && sound->child_sound->handle)
344                                 sound->handle = AUD_bufferSound(sound->child_sound->handle);
345                         break;
346                 case SOUND_TYPE_LIMITER:
347                         if(sound->child_sound && sound->child_sound->handle)
348                                 sound->handle = AUD_limitSound(sound->child_sound, sound->start, sound->end);
349                         break;
350                 }
351 #endif
352                 if(sound->flags & SOUND_FLAGS_CACHING)
353                 {
354                         sound->cache = AUD_bufferSound(sound->handle);
355                 }
356
357                 if(sound->cache)
358                         sound->playback_handle = sound->cache;
359                 else
360                         sound->playback_handle = sound->handle;
361
362                 sound_update_sequencer(bmain, sound);
363         }
364 }
365
366 AUD_Device* sound_mixdown(struct Scene *scene, AUD_DeviceSpecs specs, int start, float volume)
367 {
368         AUD_Device* mixdown = AUD_openReadDevice(specs);
369
370         AUD_setDeviceVolume(mixdown, volume);
371
372         AUD_setSequencerSpecs(scene->sound_scene, specs.specs);
373         AUD_freeHandle(AUD_playDevice(mixdown, scene->sound_scene, start / FPS));
374
375         return mixdown;
376 }
377
378 void sound_create_scene(struct Scene *scene)
379 {
380         scene->sound_scene = AUD_createSequencer(FPS, scene->audio.flag & AUDIO_MUTE);
381         AUD_updateSequencerData(scene->sound_scene, scene->audio.speed_of_sound,
382                                                         scene->audio.doppler_factor, scene->audio.distance_model);
383         scene->sound_scene_handle = NULL;
384         scene->sound_scrub_handle = NULL;
385         scene->speaker_handles = NULL;
386 }
387
388 void sound_destroy_scene(struct Scene *scene)
389 {
390         if(scene->sound_scene_handle)
391                 AUD_stop(scene->sound_scene_handle);
392         if(scene->sound_scrub_handle)
393                 AUD_stop(scene->sound_scrub_handle);
394         if(scene->sound_scene)
395                 AUD_destroySequencer(scene->sound_scene);
396         if(scene->speaker_handles)
397                 AUD_destroySet(scene->speaker_handles);
398 }
399
400 void sound_mute_scene(struct Scene *scene, int muted)
401 {
402         if(scene->sound_scene)
403                 AUD_setSequencerMuted(scene->sound_scene, muted);
404 }
405
406 void sound_update_fps(struct Scene *scene)
407 {
408         if(scene->sound_scene)
409                 AUD_setSequencerFPS(scene->sound_scene, FPS);
410 }
411
412 void sound_update_scene_listener(struct Scene *scene)
413 {
414         AUD_updateSequencerData(scene->sound_scene, scene->audio.speed_of_sound,
415                                                         scene->audio.doppler_factor, scene->audio.distance_model);
416 }
417
418 void* sound_scene_add_scene_sound(struct Scene *scene, struct Sequence* sequence, int startframe, int endframe, int frameskip)
419 {
420         if(scene != sequence->scene)
421                 return AUD_addSequence(scene->sound_scene, sequence->scene->sound_scene, startframe / FPS, endframe / FPS, frameskip / FPS);
422         return NULL;
423 }
424
425 void* sound_add_scene_sound(struct Scene *scene, struct Sequence* sequence, int startframe, int endframe, int frameskip)
426 {
427         void* handle = AUD_addSequence(scene->sound_scene, sequence->sound->playback_handle, startframe / FPS, endframe / FPS, frameskip / FPS);
428         AUD_muteSequence(handle, (sequence->flag & SEQ_MUTE) != 0);
429         AUD_setSequenceAnimData(handle, AUD_AP_VOLUME, CFRA, &sequence->volume, 0);
430         AUD_setSequenceAnimData(handle, AUD_AP_PITCH, CFRA, &sequence->pitch, 0);
431         AUD_setSequenceAnimData(handle, AUD_AP_PANNING, CFRA, &sequence->pan, 0);
432         return handle;
433 }
434
435 void sound_remove_scene_sound(struct Scene *scene, void* handle)
436 {
437         AUD_removeSequence(scene->sound_scene, handle);
438 }
439
440 void sound_mute_scene_sound(void* handle, char mute)
441 {
442         AUD_muteSequence(handle, mute);
443 }
444
445 void sound_move_scene_sound(struct Scene *scene, void* handle, int startframe, int endframe, int frameskip)
446 {
447         AUD_moveSequence(handle, startframe / FPS, endframe / FPS, frameskip / FPS);
448 }
449
450 void sound_update_scene_sound(void* handle, struct bSound* sound)
451 {
452         AUD_updateSequenceSound(handle, sound->playback_handle);
453 }
454
455 void sound_set_cfra(int cfra)
456 {
457         sound_cfra = cfra;
458 }
459
460 void sound_set_scene_volume(struct Scene *scene, float volume)
461 {
462         AUD_setSequencerAnimData(scene->sound_scene, AUD_AP_VOLUME, CFRA, &volume, (scene->audio.flag & AUDIO_VOLUME_ANIMATED) != 0);
463 }
464
465 void sound_set_scene_sound_volume(void* handle, float volume, char animated)
466 {
467         AUD_setSequenceAnimData(handle, AUD_AP_VOLUME, sound_cfra, &volume, animated);
468 }
469
470 void sound_set_scene_sound_pitch(void* handle, float pitch, char animated)
471 {
472         AUD_setSequenceAnimData(handle, AUD_AP_PITCH, sound_cfra, &pitch, animated);
473 }
474
475 void sound_set_scene_sound_pan(void* handle, float pan, char animated)
476 {
477         AUD_setSequenceAnimData(handle, AUD_AP_PANNING, sound_cfra, &pan, animated);
478 }
479
480 void sound_update_sequencer(struct Main* main, struct bSound* sound)
481 {
482         struct Scene* scene;
483
484         for(scene = main->scene.first; scene; scene = scene->id.next)
485                 seq_update_sound(scene, sound);
486 }
487
488 static void sound_start_play_scene(struct Scene *scene)
489 {
490         if(scene->sound_scene_handle)
491                 AUD_stop(scene->sound_scene_handle);
492
493         AUD_setSequencerDeviceSpecs(scene->sound_scene);
494
495         if((scene->sound_scene_handle = AUD_play(scene->sound_scene, 1)))
496                 AUD_setLoop(scene->sound_scene_handle, -1);
497 }
498
499 void sound_play_scene(struct Scene *scene)
500 {
501         AUD_Status status;
502         AUD_lock();
503
504         status = scene->sound_scene_handle ? AUD_getStatus(scene->sound_scene_handle) : AUD_STATUS_INVALID;
505
506         if(status == AUD_STATUS_INVALID)
507                 sound_start_play_scene(scene);
508
509         if(!scene->sound_scene_handle)
510         {
511                 AUD_unlock();
512                 return;
513         }
514
515         if(status != AUD_STATUS_PLAYING)
516         {
517                 AUD_seek(scene->sound_scene_handle, CFRA / FPS);
518                 AUD_resume(scene->sound_scene_handle);
519         }
520
521         if(scene->audio.flag & AUDIO_SYNC)
522                 AUD_startPlayback();
523
524         AUD_unlock();
525 }
526
527 void sound_stop_scene(struct Scene *scene)
528 {
529         if(scene->sound_scene_handle)
530         {
531                 AUD_pause(scene->sound_scene_handle);
532
533                 if(scene->audio.flag & AUDIO_SYNC)
534                         AUD_stopPlayback();
535         }
536 }
537
538 void sound_seek_scene(struct bContext *C)
539 {
540         struct Scene *scene = CTX_data_scene(C);
541         AUD_Status status;
542
543         AUD_lock();
544
545         status = scene->sound_scene_handle ? AUD_getStatus(scene->sound_scene_handle) : AUD_STATUS_INVALID;
546
547         if(status == AUD_STATUS_INVALID)
548         {
549                 sound_start_play_scene(scene);
550
551                 if(!scene->sound_scene_handle)
552                 {
553                         AUD_unlock();
554                         return;
555                 }
556
557                 AUD_pause(scene->sound_scene_handle);
558         }
559
560         if(scene->audio.flag & AUDIO_SCRUB && !CTX_wm_screen(C)->animtimer)
561         {
562                 if(scene->audio.flag & AUDIO_SYNC)
563                 {
564                         AUD_seek(scene->sound_scene_handle, CFRA / FPS);
565                         AUD_seekSequencer(scene->sound_scene_handle, CFRA / FPS);
566                 }
567                 else
568                         AUD_seek(scene->sound_scene_handle, CFRA / FPS);
569                 AUD_resume(scene->sound_scene_handle);
570                 if(scene->sound_scrub_handle && AUD_getStatus(scene->sound_scrub_handle) != AUD_STATUS_INVALID)
571                         AUD_seek(scene->sound_scrub_handle, 0);
572                 else
573                 {
574                         if(scene->sound_scrub_handle)
575                                 AUD_stop(scene->sound_scrub_handle);
576                         scene->sound_scrub_handle = AUD_pauseAfter(scene->sound_scene_handle, 1 / FPS);
577                 }
578         }
579         else
580         {
581                 if(scene->audio.flag & AUDIO_SYNC)
582                         AUD_seekSequencer(scene->sound_scene_handle, CFRA / FPS);
583                 else
584                 {
585                         if(status == AUD_STATUS_PLAYING)
586                                 AUD_seek(scene->sound_scene_handle, CFRA / FPS);
587                 }
588         }
589
590         AUD_unlock();
591 }
592
593 float sound_sync_scene(struct Scene *scene)
594 {
595         if(scene->sound_scene_handle)
596         {
597                 if(scene->audio.flag & AUDIO_SYNC)
598                         return AUD_getSequencerPosition(scene->sound_scene_handle);
599                 else
600                         return AUD_getPosition(scene->sound_scene_handle);
601         }
602         return 0.0f;
603 }
604
605 int sound_scene_playing(struct Scene *scene)
606 {
607         if(scene->audio.flag & AUDIO_SYNC)
608                 return AUD_doesPlayback();
609         else
610                 return -1;
611 }
612
613 void sound_free_waveform(struct bSound* sound)
614 {
615         if(sound->waveform)
616         {
617                 MEM_freeN(((SoundWaveform*)sound->waveform)->data);
618                 MEM_freeN(sound->waveform);
619         }
620
621         sound->waveform = NULL;
622 }
623
624 void sound_read_waveform(struct bSound* sound)
625 {
626         AUD_SoundInfo info;
627
628         info = AUD_getInfo(sound->playback_handle);
629
630         if(info.length > 0)
631         {
632                 SoundWaveform* waveform = MEM_mallocN(sizeof(SoundWaveform), "SoundWaveform");
633                 int length = info.length * SOUND_WAVE_SAMPLES_PER_SECOND;
634
635                 waveform->data = MEM_mallocN(length * sizeof(float) * 3, "SoundWaveform.samples");
636                 waveform->length = AUD_readSound(sound->playback_handle, waveform->data, length, SOUND_WAVE_SAMPLES_PER_SECOND);
637
638                 sound_free_waveform(sound);
639                 sound->waveform = waveform;
640         }
641 }
642
643 int sound_get_channels(struct bSound* sound)
644 {
645         AUD_SoundInfo info;
646
647         info = AUD_getInfo(sound->playback_handle);
648
649         return info.specs.channels;
650 }
651
652 void sound_update_scene(struct Main* bmain, struct Scene* scene)
653 {
654         Object* ob;
655         NlaTrack* track;
656         NlaStrip* strip;
657         Speaker* speaker;
658
659         void* new_set = AUD_createSet();
660         void* handle;
661         float quat[4];
662
663         for(ob = bmain->object.first; ob; ob = ob->id.next)
664         {
665                 if(ob->type == OB_SPEAKER)
666                 {
667                         if(ob->adt)
668                         {
669                                 for(track = ob->adt->nla_tracks.first; track; track = track->next)
670                                 {
671                                         for(strip = track->strips.first; strip; strip = strip->next)
672                                         {
673                                                 if(strip->type == NLASTRIP_TYPE_SOUND)
674                                                 {
675                                                         speaker = (Speaker*)ob->data;
676
677                                                         if(AUD_removeSet(scene->speaker_handles, strip->speaker_handle))
678                                                         {
679                                                                 AUD_moveSequence(strip->speaker_handle, strip->start / FPS, -1, 0);
680                                                         }
681                                                         else
682                                                         {
683                                                                 if(speaker && speaker->sound)
684                                                                 {
685                                                                         strip->speaker_handle = AUD_addSequence(scene->sound_scene, speaker->sound->playback_handle, strip->start / FPS, -1, 0);
686                                                                         AUD_setRelativeSequence(strip->speaker_handle, 0);
687                                                                 }
688                                                         }
689
690                                                         if(strip->speaker_handle)
691                                                         {
692                                                                 AUD_addSet(new_set, strip->speaker_handle);
693                                                                 AUD_updateSequenceData(strip->speaker_handle, speaker->volume_max,
694                                                                                                            speaker->volume_min, speaker->distance_max,
695                                                                                                            speaker->distance_reference, speaker->attenuation,
696                                                                                                            speaker->cone_angle_outer, speaker->cone_angle_inner,
697                                                                                                            speaker->cone_volume_outer);
698
699                                                                 mat4_to_quat(quat, ob->obmat);
700                                                                 AUD_setSequenceAnimData(strip->speaker_handle, AUD_AP_LOCATION, CFRA, ob->obmat[3], 1);
701                                                                 AUD_setSequenceAnimData(strip->speaker_handle, AUD_AP_ORIENTATION, CFRA, quat, 1);
702                                                                 AUD_setSequenceAnimData(strip->speaker_handle, AUD_AP_VOLUME, CFRA, &speaker->volume, 1);
703                                                                 AUD_setSequenceAnimData(strip->speaker_handle, AUD_AP_PITCH, CFRA, &speaker->pitch, 1);
704                                                                 AUD_updateSequenceSound(strip->speaker_handle, speaker->sound->playback_handle);
705                                                                 AUD_muteSequence(strip->speaker_handle, ((strip->flag & NLASTRIP_FLAG_MUTED) != 0) || ((speaker->flag & SPK_MUTED) != 0));
706                                                         }
707                                                 }
708                                         }
709                                 }
710                         }
711                 }
712         }
713
714         while((handle = AUD_getSet(scene->speaker_handles)))
715         {
716                 AUD_removeSequence(scene->sound_scene, handle);
717         }
718
719         if(scene->camera)
720         {
721                 mat4_to_quat(quat, scene->camera->obmat);
722                 AUD_setSequencerAnimData(scene->sound_scene, AUD_AP_LOCATION, CFRA, scene->camera->obmat[3], 1);
723                 AUD_setSequencerAnimData(scene->sound_scene, AUD_AP_ORIENTATION, CFRA, quat, 1);
724         }
725
726         AUD_destroySet(scene->speaker_handles);
727         scene->speaker_handles = new_set;
728 }
729
730 void* sound_get_factory(void* sound)
731 {
732         return ((struct bSound*) sound)->playback_handle;
733 }
734
735 #else // WITH_AUDASPACE
736
737 #include "BLI_utildefines.h"
738
739 int sound_define_from_str(const char *UNUSED(str)) { return -1;}
740 void sound_force_device(int UNUSED(device)) {}
741 void sound_init_once(void) {}
742 void sound_init(struct Main *UNUSED(bmain)) {}
743 void sound_exit(void) {}
744 void sound_cache(struct bSound* UNUSED(sound)) { }
745 void sound_delete_cache(struct bSound* UNUSED(sound)) {}
746 void sound_load(struct Main *UNUSED(bmain), struct bSound* UNUSED(sound)) {}
747 void sound_create_scene(struct Scene *UNUSED(scene)) {}
748 void sound_destroy_scene(struct Scene *UNUSED(scene)) {}
749 void sound_mute_scene(struct Scene *UNUSED(scene), int UNUSED(muted)) {}
750 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; }
751 void* sound_add_scene_sound(struct Scene *UNUSED(scene), struct Sequence* UNUSED(sequence), int UNUSED(startframe), int UNUSED(endframe), int UNUSED(frameskip)) { return NULL; }
752 void sound_remove_scene_sound(struct Scene *UNUSED(scene), void* UNUSED(handle)) {}
753 void sound_mute_scene_sound(void* UNUSED(handle), char UNUSED(mute)) {}
754 void sound_move_scene_sound(struct Scene *UNUSED(scene), void* UNUSED(handle), int UNUSED(startframe), int UNUSED(endframe), int UNUSED(frameskip)) {}
755 static void sound_start_play_scene(struct Scene *UNUSED(scene)) {}
756 void sound_play_scene(struct Scene *UNUSED(scene)) {}
757 void sound_stop_scene(struct Scene *UNUSED(scene)) {}
758 void sound_seek_scene(struct bContext *UNUSED(C)) {}
759 float sound_sync_scene(struct Scene *UNUSED(scene)) { return 0.0f; }
760 int sound_scene_playing(struct Scene *UNUSED(scene)) { return -1; }
761 int sound_read_sound_buffer(struct bSound* UNUSED(sound), float* UNUSED(buffer), int UNUSED(length), float UNUSED(start), float UNUSED(end)) { return 0; }
762 int sound_get_channels(struct bSound* UNUSED(sound)) { return 1; }
763
764 #endif // WITH_AUDASPACE