Blender V4.3
sound.cc File Reference
#include <cstdlib>
#include <cstring>
#include <optional>
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_iterator.h"
#include "BLI_math_rotation.h"
#include "BLI_threads.h"
#include "BLT_translation.hh"
#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.hh"
#include "BKE_global.hh"
#include "BKE_idtype.hh"
#include "BKE_lib_id.hh"
#include "BKE_lib_query.hh"
#include "BKE_main.hh"
#include "BKE_packedFile.hh"
#include "BKE_sound.h"
#include "DEG_depsgraph.hh"
#include "DEG_depsgraph_query.hh"
#include "BLO_read_write.hh"
#include "SEQ_sound.hh"
#include "SEQ_time.hh"
#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 *, std::optional< Library * >, ID *id_dst, const ID *id_src, const int)
 
static void sound_free_data (ID *id)
 
static void sound_foreach_id (ID *id, LibraryForeachIDData *data)
 
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)
 
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_update_sequence_handle (void *handle, void *sound_handle)
 
void BKE_sound_force_device (const char *)
 
void BKE_sound_init_once ()
 
void BKE_sound_init (Main *)
 
void BKE_sound_exit ()
 
void BKE_sound_exit_once ()
 
void BKE_sound_cache (bSound *)
 
void BKE_sound_delete_cache (bSound *)
 
void BKE_sound_load (Main *, bSound *)
 
void BKE_sound_create_scene (Scene *)
 
void BKE_sound_destroy_scene (Scene *)
 
void BKE_sound_lock ()
 
void BKE_sound_unlock ()
 
void BKE_sound_reset_scene_specs (Scene *)
 
void BKE_sound_mute_scene (Scene *, int)
 
void * BKE_sound_scene_add_scene_sound (Scene *, Sequence *, int, int, int)
 
void * BKE_sound_scene_add_scene_sound_defaults (Scene *, Sequence *)
 
void * BKE_sound_add_scene_sound (Scene *, Sequence *, int, int, int)
 
void * BKE_sound_add_scene_sound_defaults (Scene *, Sequence *)
 
void BKE_sound_remove_scene_sound (Scene *, void *)
 
void BKE_sound_mute_scene_sound (void *, bool)
 
void BKE_sound_move_scene_sound (const Scene *, void *, int, int, int, double)
 
void BKE_sound_move_scene_sound_defaults (Scene *, Sequence *)
 
void BKE_sound_play_scene (Scene *)
 
void BKE_sound_stop_scene (Scene *)
 
void BKE_sound_seek_scene (Main *, Scene *)
 
double BKE_sound_sync_scene (Scene *)
 
int BKE_sound_scene_playing (Scene *)
 
void BKE_sound_read_waveform (Main *bmain, bSound *sound, bool *stop)
 
void BKE_sound_init_main (Main *)
 
void BKE_sound_update_sequencer (Main *, bSound *)
 
void BKE_sound_update_scene (Depsgraph *, Scene *)
 
void BKE_sound_update_scene_sound (void *, bSound *)
 
void BKE_sound_update_scene_listener (Scene *)
 
void BKE_sound_update_fps (Main *, Scene *)
 
void BKE_sound_set_scene_sound_volume_at_frame (void *, int, float, char)
 
void BKE_sound_set_scene_sound_pan_at_frame (void *, int, float, char)
 
void BKE_sound_set_scene_volume (Scene *, float)
 
void BKE_sound_set_scene_sound_pitch_at_frame (void *, int, float, char)
 
void BKE_sound_set_scene_sound_pitch_constant_range (void *, int, int, float)
 
float BKE_sound_get_length (Main *, bSound *)
 
char ** BKE_sound_get_device_names ()
 
void BKE_sound_free_waveform (bSound *)
 
bool BKE_sound_info_get (Main *, bSound *, SoundInfo *)
 
bool BKE_sound_stream_info_get (Main *, const char *, int, SoundStreamInfo *)
 
void BKE_sound_reset_scene_runtime (Scene *scene)
 
void BKE_sound_ensure_scene (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 23 of file blenkernel/intern/sound.cc.

Function Documentation

◆ BKE_sound_add_scene_sound()

void * BKE_sound_add_scene_sound ( Scene * scene,
Sequence * sequence,
int startframe,
int endframe,
int frameskip )

Definition at line 1365 of file blenkernel/intern/sound.cc.

◆ BKE_sound_add_scene_sound_defaults()

void * BKE_sound_add_scene_sound_defaults ( Scene * scene,
Sequence * sequence )

Definition at line 1373 of file blenkernel/intern/sound.cc.

Referenced by seq_update_mix_sounds(), and sequencer_swap_data_exec().

◆ BKE_sound_cache()

void BKE_sound_cache ( bSound * sound)

Definition at line 1344 of file blenkernel/intern/sound.cc.

◆ BKE_sound_create_scene()

void BKE_sound_create_scene ( Scene * scene)

Definition at line 1347 of file blenkernel/intern/sound.cc.

Referenced by BKE_sound_ensure_scene().

◆ BKE_sound_delete_cache()

void BKE_sound_delete_cache ( bSound * sound)

Definition at line 1345 of file blenkernel/intern/sound.cc.

◆ BKE_sound_destroy_scene()

void BKE_sound_destroy_scene ( Scene * scene)

Definition at line 1348 of file blenkernel/intern/sound.cc.

Referenced by BKE_scene_duplicate(), and scene_free_data().

◆ BKE_sound_ensure_loaded()

void BKE_sound_ensure_loaded ( Main * bmain,
bSound * sound )

Definition at line 1486 of file blenkernel/intern/sound.cc.

References BKE_sound_load(), and bSound::cache.

Referenced by BKE_sound_evaluate().

◆ BKE_sound_ensure_scene()

void BKE_sound_ensure_scene ( 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 1342 of file blenkernel/intern/sound.cc.

Referenced by WM_exit_ex().

◆ BKE_sound_exit_once()

void BKE_sound_exit_once ( void )

Definition at line 1343 of file blenkernel/intern/sound.cc.

◆ BKE_sound_force_device()

void BKE_sound_force_device ( const char * device)

◆ BKE_sound_free_waveform()

void BKE_sound_free_waveform ( bSound * sound)

Definition at line 1447 of file blenkernel/intern/sound.cc.

Referenced by sound_free_data().

◆ BKE_sound_get_device_names()

char ** BKE_sound_get_device_names ( void )

Definition at line 1441 of file blenkernel/intern/sound.cc.

◆ BKE_sound_get_length()

float BKE_sound_get_length ( Main * bmain,
bSound * sound )

Definition at line 1437 of file blenkernel/intern/sound.cc.

Referenced by SEQ_add_reload_new_file().

◆ BKE_sound_info_get()

bool BKE_sound_info_get ( Main * main,
bSound * sound,
SoundInfo * sound_info )

Definition at line 1449 of file blenkernel/intern/sound.cc.

Referenced by BKE_nla_add_soundstrip(), and BKE_sound_new_file().

◆ BKE_sound_init()

void BKE_sound_init ( Main * bmain)

Definition at line 1341 of file blenkernel/intern/sound.cc.

Referenced by wm_init_userdef().

◆ BKE_sound_init_main()

void BKE_sound_init_main ( Main * bmain)

Definition at line 1406 of file blenkernel/intern/sound.cc.

Referenced by CTX_data_main_set().

◆ BKE_sound_init_once()

void BKE_sound_init_once ( void )

Definition at line 1340 of file blenkernel/intern/sound.cc.

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 1494 of file blenkernel/intern/sound.cc.

References callback, sound_jack_sync_callback(), and UNUSED_VARS.

Referenced by WM_init().

◆ BKE_sound_load()

void BKE_sound_load ( Main * bmain,
bSound * sound )

◆ BKE_sound_lock()

void BKE_sound_lock ( void )

◆ BKE_sound_move_scene_sound()

void BKE_sound_move_scene_sound ( const Scene * ,
void * ,
int ,
int ,
int ,
double  )

Definition at line 1379 of file blenkernel/intern/sound.cc.

◆ BKE_sound_move_scene_sound_defaults()

void BKE_sound_move_scene_sound_defaults ( Scene * scene,
Sequence * sequence )

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

Referenced by SEQ_sound_update_bounds().

◆ BKE_sound_mute_scene()

void BKE_sound_mute_scene ( Scene * scene,
int muted )

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

Referenced by BKE_scene_update_sound().

◆ BKE_sound_mute_scene_sound()

void BKE_sound_mute_scene_sound ( void * handle,
bool mute )

Definition at line 1378 of file blenkernel/intern/sound.cc.

Referenced by seq_update_muting_recursive().

◆ BKE_sound_new_file()

◆ 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.cc.

References BKE_sound_new_file_exists_ex().

◆ 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 * scene)

◆ BKE_sound_read_waveform()

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

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

References UNUSED_VARS.

Referenced by execute_read_sound_waveform_task().

◆ BKE_sound_remove_scene_sound()

void BKE_sound_remove_scene_sound ( Scene * scene,
void * handle )

◆ BKE_sound_reset_runtime()

void BKE_sound_reset_runtime ( bSound * sound)

Definition at line 1480 of file blenkernel/intern/sound.cc.

References bSound::cache, 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 * scene)

Definition at line 1351 of file blenkernel/intern/sound.cc.

Referenced by RE_RenderAnim(), and sound_mixdown_exec().

◆ BKE_sound_scene_add_scene_sound()

void * BKE_sound_scene_add_scene_sound ( Scene * scene,
Sequence * sequence,
int startframe,
int endframe,
int frameskip )

Definition at line 1353 of file blenkernel/intern/sound.cc.

◆ BKE_sound_scene_add_scene_sound_defaults()

void * BKE_sound_scene_add_scene_sound_defaults ( Scene * scene,
Sequence * sequence )

Definition at line 1361 of file blenkernel/intern/sound.cc.

Referenced by seq_dupli(), and seq_update_mix_sounds().

◆ BKE_sound_scene_playing()

int BKE_sound_scene_playing ( Scene * scene)

Definition at line 1395 of file blenkernel/intern/sound.cc.

Referenced by wm_event_do_handlers().

◆ BKE_sound_seek_scene()

void BKE_sound_seek_scene ( Main * bmain,
Scene * scene )

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

Referenced by BKE_scene_update_sound().

◆ BKE_sound_set_scene_sound_pan_at_frame()

void BKE_sound_set_scene_sound_pan_at_frame ( void * handle,
int frame,
float pan,
char animated )

Definition at line 1418 of file blenkernel/intern/sound.cc.

Referenced by seq_update_sound_properties().

◆ BKE_sound_set_scene_sound_pitch_at_frame()

void BKE_sound_set_scene_sound_pitch_at_frame ( void * handle,
int frame,
float pitch,
char animated )

Definition at line 1425 of file blenkernel/intern/sound.cc.

Referenced by SEQ_retiming_sound_animation_data_set().

◆ BKE_sound_set_scene_sound_pitch_constant_range()

void BKE_sound_set_scene_sound_pitch_constant_range ( void * handle,
int frame_start,
int frame_end,
float pitch )

Definition at line 1431 of file blenkernel/intern/sound.cc.

Referenced by SEQ_retiming_sound_animation_data_set().

◆ BKE_sound_set_scene_sound_volume_at_frame()

void BKE_sound_set_scene_sound_volume_at_frame ( void * handle,
int frame,
float volume,
char animated )

Definition at line 1412 of file blenkernel/intern/sound.cc.

Referenced by seq_update_sound_properties().

◆ BKE_sound_set_scene_volume()

void BKE_sound_set_scene_volume ( Scene * scene,
float volume )

◆ BKE_sound_stop_scene()

void BKE_sound_stop_scene ( Scene * scene)

◆ BKE_sound_stream_info_get()

bool BKE_sound_stream_info_get ( Main * main,
const char * filepath,
int stream,
SoundStreamInfo * sound_info )

Definition at line 1454 of file blenkernel/intern/sound.cc.

◆ BKE_sound_sync_scene()

double BKE_sound_sync_scene ( Scene * scene)

Definition at line 1391 of file blenkernel/intern/sound.cc.

References NAN_FLT.

Referenced by screen_animation_step_invoke(), and wm_event_do_handlers().

◆ BKE_sound_unlock()

void BKE_sound_unlock ( void )

◆ BKE_sound_update_fps()

void BKE_sound_update_fps ( Main * bmain,
Scene * scene )

Definition at line 1411 of file blenkernel/intern/sound.cc.

Referenced by BKE_scene_update_sound().

◆ BKE_sound_update_scene()

void BKE_sound_update_scene ( Depsgraph * depsgraph,
Scene * scene )

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

Referenced by BKE_scene_update_sound().

◆ BKE_sound_update_scene_listener()

void BKE_sound_update_scene_listener ( Scene * scene)

Definition at line 1410 of file blenkernel/intern/sound.cc.

Referenced by BKE_scene_update_sound().

◆ BKE_sound_update_scene_sound()

void BKE_sound_update_scene_sound ( void * handle,
bSound * sound )

◆ BKE_sound_update_sequence_handle()

void BKE_sound_update_sequence_handle ( void * handle,
void * sound_handle )

Definition at line 816 of file blenkernel/intern/sound.cc.

References UNUSED_VARS.

Referenced by seq_update_sound_modifiers().

◆ BKE_sound_update_sequencer()

void BKE_sound_update_sequencer ( Main * main,
bSound * sound )

Definition at line 1407 of file blenkernel/intern/sound.cc.

◆ sound_blend_read_data()

◆ sound_blend_write()

◆ sound_copy_data()

static void sound_copy_data ( Main * ,
std::optional< Library * > ,
ID * id_dst,
const ID * id_src,
const int  )
static

◆ sound_foreach_cache()

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

◆ sound_foreach_id()

◆ sound_foreach_path()

◆ 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:
= {
0,
sizeof(bSound),
"Sound",
N_("sounds"),
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
}
@ IDTYPE_FLAGS_APPEND_IS_REUSABLE
Definition BKE_idtype.hh:39
@ IDTYPE_FLAGS_NO_ANIMDATA
Definition BKE_idtype.hh:41
#define BLT_I18NCONTEXT_ID_SOUND
#define FILTER_ID_SO
Definition DNA_ID.h:1186
@ INDEX_ID_SO
Definition DNA_ID.h:1270
@ ID_SO
struct bSound bSound
static void sound_free_data(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_id(ID *id, LibraryForeachIDData *data)
static void sound_copy_data(Main *, std::optional< Library * >, ID *id_dst, const ID *id_src, const int)
static void sound_foreach_cache(ID *id, IDTypeForeachCacheFunctionCallback function_callback, void *user_data)
#define N_(msgid)

Definition at line 194 of file blenkernel/intern/sound.cc.