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