2011-02-18 13:05:18 +00:00
|
|
|
/*
|
2008-01-07 19:13:47 +00:00
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
2002-10-12 11:37:38 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
2008-01-07 19:13:47 +00:00
|
|
|
* of the License, or (at your option) any later version.
|
2002-10-12 11:37:38 +00:00
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2002-10-12 11:37:38 +00:00
|
|
|
*
|
|
|
|
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* The Original Code is: all of this file.
|
|
|
|
*
|
|
|
|
* Contributor(s): none yet.
|
|
|
|
*
|
2008-01-07 19:13:47 +00:00
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
2002-10-12 11:37:38 +00:00
|
|
|
*/
|
|
|
|
#ifndef BKE_SOUND_H
|
|
|
|
#define BKE_SOUND_H
|
|
|
|
|
2011-02-18 13:05:18 +00:00
|
|
|
/** \file BKE_sound.h
|
|
|
|
* \ingroup bke
|
|
|
|
* \since March 2001
|
|
|
|
* \author nzc
|
|
|
|
*/
|
|
|
|
|
2011-08-09 14:10:32 +00:00
|
|
|
#define SOUND_WAVE_SAMPLES_PER_SECOND 250
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
struct PackedFile;
|
|
|
|
struct bSound;
|
|
|
|
struct ListBase;
|
2009-08-09 21:16:39 +00:00
|
|
|
struct Main;
|
2010-02-07 23:41:17 +00:00
|
|
|
struct Sequence;
|
2009-08-09 21:16:39 +00:00
|
|
|
|
2011-08-09 14:10:32 +00:00
|
|
|
typedef struct SoundWaveform
|
|
|
|
{
|
|
|
|
int length;
|
|
|
|
float *data;
|
|
|
|
} SoundWaveform;
|
|
|
|
|
2010-12-03 12:30:59 +00:00
|
|
|
void sound_init_once(void);
|
2010-04-24 16:35:16 +00:00
|
|
|
|
2010-10-16 14:49:56 +00:00
|
|
|
void sound_init(struct Main *main);
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2011-08-09 08:38:14 +00:00
|
|
|
void sound_init_main(struct Main *bmain);
|
|
|
|
|
2010-12-03 12:30:59 +00:00
|
|
|
void sound_exit(void);
|
2006-11-25 13:07:28 +00:00
|
|
|
|
2010-01-30 21:04:51 +00:00
|
|
|
void sound_force_device(int device);
|
2011-02-19 12:05:20 +00:00
|
|
|
int sound_define_from_str(const char *str);
|
2009-12-07 20:39:57 +00:00
|
|
|
|
2010-11-19 02:14:18 +00:00
|
|
|
struct bSound* sound_new_file(struct Main *main, const char *filename);
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2009-08-09 21:16:39 +00:00
|
|
|
// XXX unused currently
|
|
|
|
#if 0
|
2011-09-05 19:34:27 +00:00
|
|
|
struct bSound* sound_new_buffer(struct Main *bmain, struct bSound *source);
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2011-09-05 19:34:27 +00:00
|
|
|
struct bSound* sound_new_limiter(struct Main *bmain, struct bSound *source, float start, float end);
|
2002-10-12 11:37:38 +00:00
|
|
|
#endif
|
2002-10-30 02:07:20 +00:00
|
|
|
|
2011-09-05 19:34:27 +00:00
|
|
|
void sound_delete(struct Main *bmain, struct bSound* sound);
|
2009-08-09 21:16:39 +00:00
|
|
|
|
2011-08-07 11:54:58 +00:00
|
|
|
void sound_cache(struct bSound* sound);
|
2009-08-09 21:16:39 +00:00
|
|
|
|
2011-08-07 11:54:58 +00:00
|
|
|
void sound_cache_notifying(struct Main* main, struct bSound* sound);
|
2011-07-26 13:56:31 +00:00
|
|
|
|
2009-08-26 18:20:17 +00:00
|
|
|
void sound_delete_cache(struct bSound* sound);
|
|
|
|
|
2010-10-17 09:01:37 +00:00
|
|
|
void sound_load(struct Main *main, struct bSound* sound);
|
2009-08-09 21:16:39 +00:00
|
|
|
|
|
|
|
void sound_free(struct bSound* sound);
|
|
|
|
|
2010-02-07 23:41:17 +00:00
|
|
|
#ifdef AUD_CAPI
|
|
|
|
AUD_Device* sound_mixdown(struct Scene *scene, AUD_DeviceSpecs specs, int start, float volume);
|
|
|
|
#endif
|
2009-08-09 21:16:39 +00:00
|
|
|
|
2010-02-07 23:41:17 +00:00
|
|
|
void sound_create_scene(struct Scene *scene);
|
2009-08-09 21:16:39 +00:00
|
|
|
|
2010-02-07 23:41:17 +00:00
|
|
|
void sound_destroy_scene(struct Scene *scene);
|
2009-08-09 21:16:39 +00:00
|
|
|
|
2011-04-10 22:40:37 +00:00
|
|
|
void sound_mute_scene(struct Scene *scene, int muted);
|
|
|
|
|
2011-07-26 13:56:31 +00:00
|
|
|
void sound_update_fps(struct Scene *scene);
|
|
|
|
|
2011-08-03 09:25:40 +00:00
|
|
|
void sound_update_scene_listener(struct Scene *scene);
|
|
|
|
|
2010-03-20 11:15:16 +00:00
|
|
|
void* sound_scene_add_scene_sound(struct Scene *scene, struct Sequence* sequence, int startframe, int endframe, int frameskip);
|
2012-01-05 10:34:50 +00:00
|
|
|
void* sound_scene_add_scene_sound_defaults(struct Scene *scene, struct Sequence* sequence);
|
2010-03-20 11:15:16 +00:00
|
|
|
|
2010-02-07 23:41:17 +00:00
|
|
|
void* sound_add_scene_sound(struct Scene *scene, struct Sequence* sequence, int startframe, int endframe, int frameskip);
|
2012-01-05 10:34:50 +00:00
|
|
|
void* sound_add_scene_sound_defaults(struct Scene *scene, struct Sequence* sequence);
|
2009-08-09 21:16:39 +00:00
|
|
|
|
2010-02-07 23:41:17 +00:00
|
|
|
void sound_remove_scene_sound(struct Scene *scene, void* handle);
|
2009-08-09 21:16:39 +00:00
|
|
|
|
2011-08-07 11:54:58 +00:00
|
|
|
void sound_mute_scene_sound(void* handle, char mute);
|
2010-02-07 23:41:17 +00:00
|
|
|
|
|
|
|
void sound_move_scene_sound(struct Scene *scene, void* handle, int startframe, int endframe, int frameskip);
|
2012-01-05 10:34:50 +00:00
|
|
|
void sound_move_scene_sound_defaults(struct Scene *scene, struct Sequence *sequence);
|
2010-02-07 23:41:17 +00:00
|
|
|
|
2011-07-26 13:56:31 +00:00
|
|
|
void sound_update_scene_sound(void* handle, struct bSound* sound);
|
|
|
|
|
3D Audio GSoC:
Implemented basic audio animation.
* AnimatableProperty: Propper cache writing and spline interpolation for reading (the solution for stair steps in audio animation)
* Animatable properties so far are: volume, pitch, panning
* Users note: Changing the pitch of a sound results in wrong seeking, due to the resulting playback length difference.
* Users note: Panning only works for mono sources, values are in the range [-2..2], this basically controls the angle of the sound, 0 is front, -1 left, 1 right and 2 and -2 are back. Typical stereo panning only supports [-1..1].
* Disabled animation of audio related ffmpeg output parameters.
* Scene Audio Panel: 3D Listener settings also for Renderer, new Volume property (animatable!), Update/Bake buttons for animation problems, moved sampling rate and channel count here
2011-07-28 13:58:59 +00:00
|
|
|
void sound_set_cfra(int cfra);
|
|
|
|
|
|
|
|
void sound_set_scene_volume(struct Scene *scene, float volume);
|
|
|
|
|
|
|
|
void sound_set_scene_sound_volume(void* handle, float volume, char animated);
|
|
|
|
|
|
|
|
void sound_set_scene_sound_pitch(void* handle, float pitch, char animated);
|
|
|
|
|
|
|
|
void sound_set_scene_sound_pan(void* handle, float pan, char animated);
|
|
|
|
|
2011-07-26 13:56:31 +00:00
|
|
|
void sound_update_sequencer(struct Main* main, struct bSound* sound);
|
|
|
|
|
2010-02-07 23:41:17 +00:00
|
|
|
void sound_play_scene(struct Scene *scene);
|
|
|
|
|
|
|
|
void sound_stop_scene(struct Scene *scene);
|
|
|
|
|
2011-09-05 19:34:27 +00:00
|
|
|
void sound_seek_scene(struct Main *bmain, struct Scene *scene);
|
2009-08-09 21:16:39 +00:00
|
|
|
|
2010-02-19 12:20:29 +00:00
|
|
|
float sound_sync_scene(struct Scene *scene);
|
|
|
|
|
2010-02-21 18:01:41 +00:00
|
|
|
int sound_scene_playing(struct Scene *scene);
|
|
|
|
|
2011-08-09 14:10:32 +00:00
|
|
|
void sound_free_waveform(struct bSound* sound);
|
|
|
|
|
|
|
|
void sound_read_waveform(struct bSound* sound);
|
2009-08-09 21:16:39 +00:00
|
|
|
|
2011-08-28 14:21:44 +00:00
|
|
|
void sound_update_scene(struct Scene* scene);
|
2011-08-09 08:38:14 +00:00
|
|
|
|
2011-06-05 22:06:29 +00:00
|
|
|
void* sound_get_factory(void* sound);
|
|
|
|
|
2009-08-09 21:16:39 +00:00
|
|
|
#endif
|