Blender  V3.3
Macros | Functions | Variables
blenkernel/intern/sound.c File Reference
#include <stdlib.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_iterator.h"
#include "BLI_math.h"
#include "BLI_threads.h"
#include "BLT_translation.h"
#include "DNA_anim_types.h"
#include "DNA_object_types.h"
#include "DNA_packedFile_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_sequence_types.h"
#include "DNA_sound_types.h"
#include "DNA_speaker_types.h"
#include "DNA_windowmanager_types.h"
#include "BKE_bpath.h"
#include "BKE_global.h"
#include "BKE_idtype.h"
#include "BKE_lib_id.h"
#include "BKE_main.h"
#include "BKE_packedFile.h"
#include "BKE_scene.h"
#include "BKE_sound.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_query.h"
#include "BLO_read_write.h"
#include "SEQ_sequencer.h"
#include "SEQ_sound.h"
#include "SEQ_time.h"
#include "BLI_utildefines.h"

Go to the source code of this file.

Macros

#define DNA_DEPRECATED_ALLOW
 

Functions

static void sound_free_audio (bSound *sound)
 
static void sound_copy_data (Main *UNUSED(bmain), ID *id_dst, const ID *id_src, const int UNUSED(flag))
 
static void sound_free_data (ID *id)
 
static void sound_foreach_cache (ID *id, IDTypeForeachCacheFunctionCallback function_callback, void *user_data)
 
static void sound_foreach_path (ID *id, BPathForeachPathData *bpath_data)
 
static void sound_blend_write (BlendWriter *writer, ID *id, const void *id_address)
 
static void sound_blend_read_data (BlendDataReader *reader, ID *id)
 
static void sound_blend_read_lib (BlendLibReader *reader, ID *id)
 
static void sound_blend_read_expand (BlendExpander *expander, ID *id)
 
BLI_INLINE void sound_verify_evaluated_id (const ID *id)
 
bSoundBKE_sound_new_file (Main *bmain, const char *filepath)
 
bSoundBKE_sound_new_file_exists_ex (Main *bmain, const char *filepath, bool *r_exists)
 
bSoundBKE_sound_new_file_exists (Main *bmain, const char *filepath)
 
void BKE_sound_force_device (const char *UNUSED(device))
 
void BKE_sound_init_once (void)
 
void BKE_sound_init (Main *UNUSED(bmain))
 
void BKE_sound_exit (void)
 
void BKE_sound_exit_once (void)
 
void BKE_sound_cache (bSound *UNUSED(sound))
 
void BKE_sound_delete_cache (bSound *UNUSED(sound))
 
void BKE_sound_load (Main *UNUSED(bmain), bSound *UNUSED(sound))
 
void BKE_sound_create_scene (Scene *UNUSED(scene))
 
void BKE_sound_destroy_scene (Scene *UNUSED(scene))
 
void BKE_sound_lock (void)
 
void BKE_sound_unlock (void)
 
void BKE_sound_reset_scene_specs (Scene *UNUSED(scene))
 
void BKE_sound_mute_scene (Scene *UNUSED(scene), int UNUSED(muted))
 
voidBKE_sound_scene_add_scene_sound (Scene *UNUSED(scene), Sequence *UNUSED(sequence), int UNUSED(startframe), int UNUSED(endframe), int UNUSED(frameskip))
 
voidBKE_sound_scene_add_scene_sound_defaults (Scene *UNUSED(scene), Sequence *UNUSED(sequence))
 
voidBKE_sound_add_scene_sound (Scene *UNUSED(scene), Sequence *UNUSED(sequence), int UNUSED(startframe), int UNUSED(endframe), int UNUSED(frameskip))
 
voidBKE_sound_add_scene_sound_defaults (Scene *UNUSED(scene), Sequence *UNUSED(sequence))
 
void BKE_sound_remove_scene_sound (Scene *UNUSED(scene), void *UNUSED(handle))
 
void BKE_sound_mute_scene_sound (void *UNUSED(handle), char UNUSED(mute))
 
void BKE_sound_move_scene_sound (const Scene *UNUSED(scene), void *UNUSED(handle), int UNUSED(startframe), int UNUSED(endframe), int UNUSED(frameskip), double UNUSED(audio_offset))
 
void BKE_sound_move_scene_sound_defaults (Scene *UNUSED(scene), Sequence *UNUSED(sequence))
 
void BKE_sound_play_scene (Scene *UNUSED(scene))
 
void BKE_sound_stop_scene (Scene *UNUSED(scene))
 
void BKE_sound_seek_scene (Main *UNUSED(bmain), Scene *UNUSED(scene))
 
double BKE_sound_sync_scene (Scene *UNUSED(scene))
 
int BKE_sound_scene_playing (Scene *UNUSED(scene))
 
void BKE_sound_read_waveform (Main *bmain, bSound *sound, short *stop)
 
void BKE_sound_init_main (Main *UNUSED(bmain))
 
void BKE_sound_set_cfra (int UNUSED(cfra))
 
void BKE_sound_update_sequencer (Main *UNUSED(main), bSound *UNUSED(sound))
 
void BKE_sound_update_scene (Depsgraph *UNUSED(depsgraph), Scene *UNUSED(scene))
 
void BKE_sound_update_scene_sound (void *UNUSED(handle), bSound *UNUSED(sound))
 
void BKE_sound_update_scene_listener (Scene *UNUSED(scene))
 
void BKE_sound_update_fps (Main *UNUSED(bmain), Scene *UNUSED(scene))
 
void BKE_sound_set_scene_sound_volume (void *UNUSED(handle), float UNUSED(volume), char UNUSED(animated))
 
void BKE_sound_set_scene_sound_pan (void *UNUSED(handle), float UNUSED(pan), char UNUSED(animated))
 
void BKE_sound_set_scene_volume (Scene *UNUSED(scene), float UNUSED(volume))
 
void BKE_sound_set_scene_sound_pitch (void *UNUSED(handle), float UNUSED(pitch), char UNUSED(animated))
 
float BKE_sound_get_length (struct Main *UNUSED(bmain), bSound *UNUSED(sound))
 
char ** BKE_sound_get_device_names (void)
 
void BKE_sound_free_waveform (bSound *UNUSED(sound))
 
bool BKE_sound_info_get (struct Main *UNUSED(main), struct bSound *UNUSED(sound), SoundInfo *UNUSED(sound_info))
 
bool BKE_sound_stream_info_get (struct Main *UNUSED(main), const char *UNUSED(filepath), int UNUSED(stream), SoundStreamInfo *UNUSED(sound_info))
 
void BKE_sound_reset_scene_runtime (Scene *scene)
 
void BKE_sound_ensure_scene (struct Scene *scene)
 
void BKE_sound_reset_runtime (bSound *sound)
 
void BKE_sound_ensure_loaded (Main *bmain, bSound *sound)
 
void BKE_sound_jack_sync_callback_set (SoundJackSyncCallback callback)
 
void BKE_sound_jack_scene_update (Scene *scene, int mode, double time)
 
void BKE_sound_evaluate (Depsgraph *depsgraph, Main *bmain, bSound *sound)
 

Variables

IDTypeInfo IDType_ID_SO
 

Macro Definition Documentation

◆ DNA_DEPRECATED_ALLOW

#define DNA_DEPRECATED_ALLOW

Definition at line 21 of file blenkernel/intern/sound.c.

Function Documentation

◆ BKE_sound_add_scene_sound()

void* BKE_sound_add_scene_sound ( Scene UNUSEDscene,
Sequence UNUSEDsequence,
int   UNUSEDstartframe,
int   UNUSEDendframe,
int   UNUSEDframeskip 
)

Definition at line 1334 of file blenkernel/intern/sound.c.

References NULL.

◆ BKE_sound_add_scene_sound_defaults()

void* BKE_sound_add_scene_sound_defaults ( Scene UNUSEDscene,
Sequence UNUSEDsequence 
)

Definition at line 1342 of file blenkernel/intern/sound.c.

References NULL.

◆ BKE_sound_cache()

void BKE_sound_cache ( bSound UNUSEDsound)

Definition at line 1295 of file blenkernel/intern/sound.c.

◆ BKE_sound_create_scene()

void BKE_sound_create_scene ( Scene UNUSEDscene)

Definition at line 1304 of file blenkernel/intern/sound.c.

Referenced by BKE_sound_ensure_scene().

◆ BKE_sound_delete_cache()

void BKE_sound_delete_cache ( bSound UNUSEDsound)

Definition at line 1298 of file blenkernel/intern/sound.c.

◆ BKE_sound_destroy_scene()

void BKE_sound_destroy_scene ( Scene UNUSEDscene)

Definition at line 1307 of file blenkernel/intern/sound.c.

◆ BKE_sound_ensure_loaded()

void BKE_sound_ensure_loaded ( Main bmain,
bSound sound 
)

Definition at line 1477 of file blenkernel/intern/sound.c.

References BKE_sound_load(), bSound::cache, and NULL.

Referenced by BKE_sound_evaluate().

◆ BKE_sound_ensure_scene()

void BKE_sound_ensure_scene ( struct Scene scene)

◆ BKE_sound_evaluate()

void BKE_sound_evaluate ( Depsgraph depsgraph,
Main bmain,
bSound sound 
)

◆ BKE_sound_exit()

void BKE_sound_exit ( void  )

Definition at line 1289 of file blenkernel/intern/sound.c.

Referenced by WM_exit_ex().

◆ BKE_sound_exit_once()

void BKE_sound_exit_once ( void  )

Definition at line 1292 of file blenkernel/intern/sound.c.

◆ BKE_sound_force_device()

void BKE_sound_force_device ( const char *  UNUSEDdevice)

Definition at line 1280 of file blenkernel/intern/sound.c.

◆ BKE_sound_free_waveform()

void BKE_sound_free_waveform ( bSound UNUSEDsound)

Definition at line 1434 of file blenkernel/intern/sound.c.

Referenced by sound_free_data().

◆ BKE_sound_get_device_names()

char** BKE_sound_get_device_names ( void  )

Definition at line 1428 of file blenkernel/intern/sound.c.

References names, and NULL.

◆ BKE_sound_get_length()

float BKE_sound_get_length ( struct Main UNUSEDbmain,
bSound UNUSEDsound 
)

Definition at line 1424 of file blenkernel/intern/sound.c.

◆ BKE_sound_info_get()

bool BKE_sound_info_get ( struct Main UNUSEDmain,
struct bSound UNUSEDsound,
SoundInfo UNUSEDsound_info 
)

Definition at line 1438 of file blenkernel/intern/sound.c.

Referenced by BKE_sound_new_file().

◆ BKE_sound_init()

void BKE_sound_init ( Main UNUSEDbmain)

Definition at line 1286 of file blenkernel/intern/sound.c.

◆ BKE_sound_init_main()

void BKE_sound_init_main ( Main UNUSEDbmain)

Definition at line 1387 of file blenkernel/intern/sound.c.

◆ BKE_sound_init_once()

void BKE_sound_init_once ( void  )

Definition at line 1283 of file blenkernel/intern/sound.c.

Referenced by main().

◆ BKE_sound_jack_scene_update()

void BKE_sound_jack_scene_update ( Scene scene,
int  mode,
double  time 
)

◆ BKE_sound_jack_sync_callback_set()

void BKE_sound_jack_sync_callback_set ( SoundJackSyncCallback  callback)

Definition at line 1485 of file blenkernel/intern/sound.c.

References callback, sound_jack_sync_callback(), and UNUSED_VARS.

Referenced by WM_init().

◆ BKE_sound_load()

void BKE_sound_load ( Main UNUSEDbmain,
bSound UNUSEDsound 
)

Definition at line 1301 of file blenkernel/intern/sound.c.

Referenced by BKE_sound_ensure_loaded(), and BKE_sound_evaluate().

◆ BKE_sound_lock()

void BKE_sound_lock ( void  )

◆ BKE_sound_move_scene_sound()

void BKE_sound_move_scene_sound ( const Scene UNUSEDscene,
void UNUSEDhandle,
int   UNUSEDstartframe,
int   UNUSEDendframe,
int   UNUSEDframeskip,
double   UNUSEDaudio_offset 
)

Definition at line 1352 of file blenkernel/intern/sound.c.

◆ BKE_sound_move_scene_sound_defaults()

void BKE_sound_move_scene_sound_defaults ( Scene UNUSEDscene,
Sequence UNUSEDsequence 
)

Definition at line 1360 of file blenkernel/intern/sound.c.

◆ BKE_sound_mute_scene()

void BKE_sound_mute_scene ( Scene UNUSEDscene,
int   UNUSEDmuted 
)

Definition at line 1319 of file blenkernel/intern/sound.c.

◆ BKE_sound_mute_scene_sound()

void BKE_sound_mute_scene_sound ( void UNUSEDhandle,
char   UNUSEDmute 
)

Definition at line 1349 of file blenkernel/intern/sound.c.

◆ BKE_sound_new_file()

bSound* BKE_sound_new_file ( Main bmain,
const char *  filepath 
)

◆ BKE_sound_new_file_exists()

bSound* BKE_sound_new_file_exists ( Main bmain,
const char *  filepath 
)

Definition at line 312 of file blenkernel/intern/sound.c.

References BKE_sound_new_file_exists_ex(), and NULL.

◆ BKE_sound_new_file_exists_ex()

bSound* BKE_sound_new_file_exists_ex ( Main bmain,
const char *  filepath,
bool r_exists 
)

◆ BKE_sound_play_scene()

void BKE_sound_play_scene ( Scene UNUSEDscene)

Definition at line 1363 of file blenkernel/intern/sound.c.

Referenced by BKE_sound_jack_scene_update().

◆ BKE_sound_read_waveform()

void BKE_sound_read_waveform ( Main bmain,
bSound sound,
short *  stop 
)

Definition at line 1380 of file blenkernel/intern/sound.c.

References UNUSED_VARS.

Referenced by preview_startjob().

◆ BKE_sound_remove_scene_sound()

void BKE_sound_remove_scene_sound ( Scene UNUSEDscene,
void UNUSEDhandle 
)

Definition at line 1346 of file blenkernel/intern/sound.c.

◆ BKE_sound_reset_runtime()

void BKE_sound_reset_runtime ( bSound sound)

Definition at line 1471 of file blenkernel/intern/sound.c.

References bSound::cache, NULL, and bSound::playback_handle.

Referenced by BKE_sound_new_file(), and sound_copy_data().

◆ BKE_sound_reset_scene_runtime()

void BKE_sound_reset_scene_runtime ( Scene scene)

◆ BKE_sound_reset_scene_specs()

void BKE_sound_reset_scene_specs ( Scene UNUSEDscene)

Definition at line 1316 of file blenkernel/intern/sound.c.

◆ BKE_sound_scene_add_scene_sound()

void* BKE_sound_scene_add_scene_sound ( Scene UNUSEDscene,
Sequence UNUSEDsequence,
int   UNUSEDstartframe,
int   UNUSEDendframe,
int   UNUSEDframeskip 
)

Definition at line 1322 of file blenkernel/intern/sound.c.

References NULL.

◆ BKE_sound_scene_add_scene_sound_defaults()

void* BKE_sound_scene_add_scene_sound_defaults ( Scene UNUSEDscene,
Sequence UNUSEDsequence 
)

Definition at line 1330 of file blenkernel/intern/sound.c.

References NULL.

◆ BKE_sound_scene_playing()

int BKE_sound_scene_playing ( Scene UNUSEDscene)

Definition at line 1376 of file blenkernel/intern/sound.c.

◆ BKE_sound_seek_scene()

void BKE_sound_seek_scene ( Main UNUSEDbmain,
Scene UNUSEDscene 
)

Definition at line 1369 of file blenkernel/intern/sound.c.

◆ BKE_sound_set_cfra()

void BKE_sound_set_cfra ( int   UNUSEDcfra)

Definition at line 1390 of file blenkernel/intern/sound.c.

◆ BKE_sound_set_scene_sound_pan()

void BKE_sound_set_scene_sound_pan ( void UNUSEDhandle,
float   UNUSEDpan,
char   UNUSEDanimated 
)

Definition at line 1413 of file blenkernel/intern/sound.c.

◆ BKE_sound_set_scene_sound_pitch()

void BKE_sound_set_scene_sound_pitch ( void UNUSEDhandle,
float   UNUSEDpitch,
char   UNUSEDanimated 
)

Definition at line 1419 of file blenkernel/intern/sound.c.

◆ BKE_sound_set_scene_sound_volume()

void BKE_sound_set_scene_sound_volume ( void UNUSEDhandle,
float   UNUSEDvolume,
char   UNUSEDanimated 
)

Definition at line 1408 of file blenkernel/intern/sound.c.

◆ BKE_sound_set_scene_volume()

void BKE_sound_set_scene_volume ( Scene UNUSEDscene,
float   UNUSEDvolume 
)

Definition at line 1416 of file blenkernel/intern/sound.c.

◆ BKE_sound_stop_scene()

void BKE_sound_stop_scene ( Scene UNUSEDscene)

Definition at line 1366 of file blenkernel/intern/sound.c.

Referenced by BKE_sound_jack_scene_update().

◆ BKE_sound_stream_info_get()

bool BKE_sound_stream_info_get ( struct Main UNUSEDmain,
const char *  UNUSEDfilepath,
int   UNUSEDstream,
SoundStreamInfo UNUSEDsound_info 
)

Definition at line 1445 of file blenkernel/intern/sound.c.

◆ BKE_sound_sync_scene()

double BKE_sound_sync_scene ( Scene UNUSEDscene)

Definition at line 1372 of file blenkernel/intern/sound.c.

References NAN_FLT.

◆ BKE_sound_unlock()

void BKE_sound_unlock ( void  )

◆ BKE_sound_update_fps()

void BKE_sound_update_fps ( Main UNUSEDbmain,
Scene UNUSEDscene 
)

Definition at line 1405 of file blenkernel/intern/sound.c.

◆ BKE_sound_update_scene()

void BKE_sound_update_scene ( Depsgraph UNUSEDdepsgraph,
Scene UNUSEDscene 
)

Definition at line 1396 of file blenkernel/intern/sound.c.

◆ BKE_sound_update_scene_listener()

void BKE_sound_update_scene_listener ( Scene UNUSEDscene)

Definition at line 1402 of file blenkernel/intern/sound.c.

◆ BKE_sound_update_scene_sound()

void BKE_sound_update_scene_sound ( void UNUSEDhandle,
bSound UNUSEDsound 
)

Definition at line 1399 of file blenkernel/intern/sound.c.

◆ BKE_sound_update_sequencer()

void BKE_sound_update_sequencer ( Main UNUSEDmain,
bSound UNUSEDsound 
)

Definition at line 1393 of file blenkernel/intern/sound.c.

◆ sound_blend_read_data()

static void sound_blend_read_data ( BlendDataReader reader,
ID id 
)
static

◆ sound_blend_read_expand()

static void sound_blend_read_expand ( BlendExpander expander,
ID id 
)
static

Definition at line 189 of file blenkernel/intern/sound.c.

References BLO_expand, and bSound::ipo.

◆ sound_blend_read_lib()

static void sound_blend_read_lib ( BlendLibReader reader,
ID id 
)
static

Definition at line 182 of file blenkernel/intern/sound.c.

References BLO_read_id_address, bSound::id, bSound::ipo, and ID::lib.

◆ sound_blend_write()

static void sound_blend_write ( BlendWriter writer,
ID id,
const void id_address 
)
static

◆ sound_copy_data()

static void sound_copy_data ( Main UNUSEDbmain,
ID id_dst,
const ID id_src,
const int   UNUSEDflag 
)
static

◆ sound_foreach_cache()

static void sound_foreach_cache ( ID id,
IDTypeForeachCacheFunctionCallback  function_callback,
void user_data 
)
static

◆ sound_foreach_path()

static void sound_foreach_path ( ID id,
BPathForeachPathData bpath_data 
)
static

◆ sound_free_audio()

static void sound_free_audio ( bSound sound)
static

◆ sound_free_data()

static void sound_free_data ( ID id)
static

◆ sound_verify_evaluated_id()

BLI_INLINE void sound_verify_evaluated_id ( const ID id)

Variable Documentation

◆ IDType_ID_SO

IDTypeInfo IDType_ID_SO
Initial value:
= {
.id_code = ID_SO,
.id_filter = FILTER_ID_SO,
.main_listbase_index = INDEX_ID_SO,
.struct_size = sizeof(bSound),
.name = "Sound",
.name_plural = "sounds",
.translation_context = BLT_I18NCONTEXT_ID_SOUND,
.asset_type_info = NULL,
.copy_data = sound_copy_data,
.free_data = sound_free_data,
.make_local = NULL,
.foreach_id = NULL,
.foreach_cache = sound_foreach_cache,
.foreach_path = sound_foreach_path,
.owner_get = NULL,
.blend_write = sound_blend_write,
.blend_read_data = sound_blend_read_data,
.blend_read_lib = sound_blend_read_lib,
.blend_read_expand = sound_blend_read_expand,
.blend_read_undo_preserve = NULL,
.lib_override_apply_post = NULL,
}
@ IDTYPE_FLAGS_APPEND_IS_REUSABLE
Definition: BKE_idtype.h:39
@ IDTYPE_FLAGS_NO_ANIMDATA
Definition: BKE_idtype.h:41
#define BLT_I18NCONTEXT_ID_SOUND
#define FILTER_ID_SO
Definition: DNA_ID.h:921
@ INDEX_ID_SO
Definition: DNA_ID.h:1002
@ ID_SO
Definition: DNA_ID_enums.h:64
struct bSound bSound
static void init_data(ModifierData *md)
static void sound_copy_data(Main *UNUSED(bmain), ID *id_dst, const ID *id_src, const int UNUSED(flag))
static void sound_free_data(ID *id)
static void sound_blend_read_lib(BlendLibReader *reader, ID *id)
static void sound_blend_read_data(BlendDataReader *reader, ID *id)
static void sound_blend_write(BlendWriter *writer, ID *id, const void *id_address)
static void sound_foreach_path(ID *id, BPathForeachPathData *bpath_data)
static void sound_foreach_cache(ID *id, IDTypeForeachCacheFunctionCallback function_callback, void *user_data)
static void sound_blend_read_expand(BlendExpander *expander, ID *id)

Definition at line 195 of file blenkernel/intern/sound.c.