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
|
|
|
*/
|
2012-02-17 18:59:41 +00:00
|
|
|
#ifndef __BKE_SOUND_H__
|
|
|
|
|
#define __BKE_SOUND_H__
|
2002-10-12 11:37:38 +00:00
|
|
|
|
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
|
|
|
|
|
|
2015-06-16 10:03:35 +02:00
|
|
|
#ifdef WITH_SYSTEM_AUDASPACE
|
|
|
|
|
# include AUD_DEVICE_H
|
2014-03-04 13:44:15 +01:00
|
|
|
#endif
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
struct bSound;
|
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
|
|
|
|
2012-05-10 15:22:29 +00:00
|
|
|
typedef struct SoundWaveform {
|
2011-08-09 14:10:32 +00:00
|
|
|
int length;
|
|
|
|
|
float *data;
|
|
|
|
|
} SoundWaveform;
|
|
|
|
|
|
2015-03-26 11:35:41 +01:00
|
|
|
void BKE_sound_init_once(void);
|
|
|
|
|
void BKE_sound_exit_once(void);
|
2010-04-24 16:35:16 +00:00
|
|
|
|
2015-07-29 10:43:32 +10:00
|
|
|
void *BKE_sound_get_device(void);
|
2014-11-13 00:33:28 +13:00
|
|
|
|
2015-03-26 11:35:41 +01:00
|
|
|
void BKE_sound_init(struct Main *main);
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2015-03-26 11:35:41 +01:00
|
|
|
void BKE_sound_init_main(struct Main *bmain);
|
2011-08-09 08:38:14 +00:00
|
|
|
|
2015-03-26 11:35:41 +01:00
|
|
|
void BKE_sound_exit(void);
|
2006-11-25 13:07:28 +00:00
|
|
|
|
2015-07-24 15:44:17 +02:00
|
|
|
void BKE_sound_force_device(const char *device);
|
2009-12-07 20:39:57 +00:00
|
|
|
|
2015-03-26 11:35:41 +01:00
|
|
|
struct bSound *BKE_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
|
2015-03-26 11:39:08 +01:00
|
|
|
struct bSound *BKE_sound_new_buffer(struct Main *bmain, struct bSound *source);
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2015-03-26 11:39:08 +01:00
|
|
|
struct bSound *BKE_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
|
|
|
|
2015-03-26 11:35:41 +01:00
|
|
|
void BKE_sound_delete(struct Main *bmain, struct bSound *sound);
|
2009-08-09 21:16:39 +00:00
|
|
|
|
2015-03-26 11:35:41 +01:00
|
|
|
void BKE_sound_cache(struct bSound *sound);
|
2009-08-09 21:16:39 +00:00
|
|
|
|
2015-03-26 11:35:41 +01:00
|
|
|
void BKE_sound_delete_cache(struct bSound *sound);
|
2009-08-26 18:20:17 +00:00
|
|
|
|
2015-03-26 11:35:41 +01:00
|
|
|
void BKE_sound_load(struct Main *main, struct bSound *sound);
|
2009-08-09 21:16:39 +00:00
|
|
|
|
2012-05-10 15:22:29 +00:00
|
|
|
void BKE_sound_free(struct bSound *sound);
|
2009-08-09 21:16:39 +00:00
|
|
|
|
2015-06-16 10:03:35 +02:00
|
|
|
#if defined(__AUD_C_API_H__) || defined(WITH_SYSTEM_AUDASPACE)
|
2015-03-26 11:39:08 +01:00
|
|
|
AUD_Device *BKE_sound_mixdown(struct Scene *scene, AUD_DeviceSpecs specs, int start, float volume);
|
2010-02-07 23:41:17 +00:00
|
|
|
#endif
|
2009-08-09 21:16:39 +00:00
|
|
|
|
2015-03-26 11:35:41 +01:00
|
|
|
void BKE_sound_create_scene(struct Scene *scene);
|
2009-08-09 21:16:39 +00:00
|
|
|
|
2015-03-26 11:35:41 +01:00
|
|
|
void BKE_sound_destroy_scene(struct Scene *scene);
|
2009-08-09 21:16:39 +00:00
|
|
|
|
2015-03-26 11:35:41 +01:00
|
|
|
void BKE_sound_mute_scene(struct Scene *scene, int muted);
|
2011-04-10 22:40:37 +00:00
|
|
|
|
2015-03-26 11:35:41 +01:00
|
|
|
void BKE_sound_update_fps(struct Scene *scene);
|
2011-07-26 13:56:31 +00:00
|
|
|
|
2015-03-26 11:35:41 +01:00
|
|
|
void BKE_sound_update_scene_listener(struct Scene *scene);
|
2011-08-03 09:25:40 +00:00
|
|
|
|
2015-03-26 11:35:41 +01:00
|
|
|
void *BKE_sound_scene_add_scene_sound(struct Scene *scene, struct Sequence *sequence, int startframe, int endframe, int frameskip);
|
|
|
|
|
void *BKE_sound_scene_add_scene_sound_defaults(struct Scene *scene, struct Sequence *sequence);
|
2010-03-20 11:15:16 +00:00
|
|
|
|
2015-03-26 11:35:41 +01:00
|
|
|
void *BKE_sound_add_scene_sound(struct Scene *scene, struct Sequence *sequence, int startframe, int endframe, int frameskip);
|
|
|
|
|
void *BKE_sound_add_scene_sound_defaults(struct Scene *scene, struct Sequence *sequence);
|
2009-08-09 21:16:39 +00:00
|
|
|
|
2015-03-26 11:35:41 +01:00
|
|
|
void BKE_sound_remove_scene_sound(struct Scene *scene, void *handle);
|
2009-08-09 21:16:39 +00:00
|
|
|
|
2015-03-26 11:35:41 +01:00
|
|
|
void BKE_sound_mute_scene_sound(void *handle, char mute);
|
2010-02-07 23:41:17 +00:00
|
|
|
|
2015-03-26 11:35:41 +01:00
|
|
|
void BKE_sound_move_scene_sound(struct Scene *scene, void *handle, int startframe, int endframe, int frameskip);
|
|
|
|
|
void BKE_sound_move_scene_sound_defaults(struct Scene *scene, struct Sequence *sequence);
|
2010-02-07 23:41:17 +00:00
|
|
|
|
2015-03-26 11:35:41 +01:00
|
|
|
void BKE_sound_update_scene_sound(void *handle, struct bSound *sound);
|
2011-07-26 13:56:31 +00:00
|
|
|
|
2015-03-26 11:35:41 +01:00
|
|
|
void BKE_sound_set_cfra(int cfra);
|
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
|
|
|
|
2015-03-26 11:35:41 +01:00
|
|
|
void BKE_sound_set_scene_volume(struct Scene *scene, float volume);
|
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
|
|
|
|
2015-03-26 11:35:41 +01:00
|
|
|
void BKE_sound_set_scene_sound_volume(void *handle, float volume, char animated);
|
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
|
|
|
|
2015-03-26 11:35:41 +01:00
|
|
|
void BKE_sound_set_scene_sound_pitch(void *handle, float pitch, char animated);
|
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
|
|
|
|
2015-03-26 11:35:41 +01:00
|
|
|
void BKE_sound_set_scene_sound_pan(void *handle, float pan, char animated);
|
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
|
|
|
|
2015-03-26 11:35:41 +01:00
|
|
|
void BKE_sound_update_sequencer(struct Main *main, struct bSound *sound);
|
2011-07-26 13:56:31 +00:00
|
|
|
|
2015-03-26 11:35:41 +01:00
|
|
|
void BKE_sound_play_scene(struct Scene *scene);
|
2010-02-07 23:41:17 +00:00
|
|
|
|
2015-03-26 11:35:41 +01:00
|
|
|
void BKE_sound_stop_scene(struct Scene *scene);
|
2010-02-07 23:41:17 +00:00
|
|
|
|
2015-03-26 11:35:41 +01:00
|
|
|
void BKE_sound_seek_scene(struct Main *bmain, struct Scene *scene);
|
2009-08-09 21:16:39 +00:00
|
|
|
|
2015-03-26 11:35:41 +01:00
|
|
|
float BKE_sound_sync_scene(struct Scene *scene);
|
2010-02-19 12:20:29 +00:00
|
|
|
|
2015-03-26 11:35:41 +01:00
|
|
|
int BKE_sound_scene_playing(struct Scene *scene);
|
2010-02-21 18:01:41 +00:00
|
|
|
|
2015-03-26 11:35:41 +01:00
|
|
|
void BKE_sound_free_waveform(struct bSound *sound);
|
2011-08-09 14:10:32 +00:00
|
|
|
|
2015-03-26 11:35:41 +01:00
|
|
|
void BKE_sound_read_waveform(struct bSound *sound, short *stop);
|
2009-08-09 21:16:39 +00:00
|
|
|
|
2015-03-26 11:35:41 +01:00
|
|
|
void BKE_sound_update_scene(struct Main *bmain, struct Scene *scene);
|
2011-08-09 08:38:14 +00:00
|
|
|
|
2015-03-26 11:35:41 +01:00
|
|
|
void *BKE_sound_get_factory(void *sound);
|
2012-05-10 15:10:51 +00:00
|
|
|
|
2015-03-26 11:35:41 +01:00
|
|
|
float BKE_sound_get_length(struct bSound *sound);
|
2011-06-05 22:06:29 +00:00
|
|
|
|
2015-07-29 10:43:32 +10:00
|
|
|
char **BKE_sound_get_device_names(void);
|
2015-07-24 15:44:17 +02:00
|
|
|
|
2015-03-26 11:35:41 +01:00
|
|
|
bool BKE_sound_is_jack_supported(void);
|
2013-03-27 07:19:54 +00:00
|
|
|
|
2014-04-15 10:59:42 +02:00
|
|
|
#endif /* __BKE_SOUND_H__ */
|