37 #include "RNA_prototypes.h"
48 # include <AUD_Special.h>
167 ot->
name =
"Open Sound Mono";
278 ot->
name =
"Update Animation";
280 ot->
idname =
"SOUND_OT_update_animation_flags";
316 ot->
name =
"Update Animation Cache";
318 ot->
idname =
"SOUND_OT_bake_animation";
331 #ifdef WITH_AUDASPACE
339 int bitrate, accuracy;
340 AUD_DeviceSpecs specs;
341 AUD_Container container;
344 char error_message[1024] = {
'\0'};
362 const int start_frame = scene_eval->
r.
sfra;
363 const int end_frame = scene_eval->
r.
efra;
367 start_frame * specs.rate / fps,
368 (end_frame - start_frame + 1) * specs.rate / fps,
378 sizeof(error_message));
382 start_frame * specs.rate / fps,
383 (end_frame - start_frame + 1) * specs.rate / fps,
393 sizeof(error_message));
409 #ifdef WITH_AUDASPACE
412 {AUD_CONTAINER_AC3,
"AC3", 0,
"ac3",
"Dolby Digital ATRAC 3"},
414 {AUD_CONTAINER_FLAC,
"FLAC", 0,
"flac",
"Free Lossless Audio Codec"},
416 {AUD_CONTAINER_MATROSKA,
"MATROSKA", 0,
"mkv",
"Matroska"},
417 {AUD_CONTAINER_MP2,
"MP2", 0,
"mp2",
"MPEG-1 Audio Layer II"},
418 {AUD_CONTAINER_MP3,
"MP3", 0,
"mp3",
"MPEG-2 Audio Layer III"},
420 {AUD_CONTAINER_OGG,
"OGG", 0,
"ogg",
"Xiph.Org Ogg Container"},
421 {AUD_CONTAINER_WAV,
"WAV", 0,
"wav",
"Waveform Audio File Format"},
425 static const char *snd_ext_sound[] = {
440 const char *extension =
NULL;
444 if (item->
value == container) {
445 const char **ext = snd_ext_sound;
446 while (*ext !=
NULL) {
496 #ifdef WITH_AUDASPACE
503 return !(
STR_ELEM(prop_id,
"filepath",
"directory",
"filename"));
509 {AUD_FORMAT_U8,
"U8", 0,
"U8",
"8-bit unsigned"},
510 {AUD_FORMAT_S16,
"S16", 0,
"S16",
"16-bit signed"},
512 {AUD_FORMAT_S24,
"S24", 0,
"S24",
"24-bit signed"},
514 {AUD_FORMAT_S32,
"S32", 0,
"S32",
"32-bit signed"},
515 {AUD_FORMAT_FLOAT32,
"F32", 0,
"F32",
"32-bit floating-point"},
516 {AUD_FORMAT_FLOAT64,
"F64", 0,
"F64",
"64-bit floating-point"},
521 {AUD_FORMAT_S16,
"S16", 0,
"S16",
"16-bit signed"},
522 {AUD_FORMAT_S32,
"S32", 0,
"S32",
"32-bit signed"},
528 {AUD_FORMAT_S16,
"S16", 0,
"S16",
"16-bit signed"},
529 {AUD_FORMAT_S24,
"S24", 0,
"S24",
"24-bit signed"},
535 {AUD_CODEC_AAC,
"AAC", 0,
"AAC",
"Advanced Audio Coding"},
536 {AUD_CODEC_AC3,
"AC3", 0,
"AC3",
"Dolby Digital ATRAC 3"},
537 {AUD_CODEC_FLAC,
"FLAC", 0,
"FLAC",
"Free Lossless Audio Codec"},
538 {AUD_CODEC_MP2,
"MP2", 0,
"MP2",
"MPEG-1 Audio Layer II"},
539 {AUD_CODEC_MP3,
"MP3", 0,
"MP3",
"MPEG-2 Audio Layer III"},
540 {AUD_CODEC_PCM,
"PCM", 0,
"PCM",
"Pulse Code Modulation (RAW)"},
541 {AUD_CODEC_VORBIS,
"VORBIS", 0,
"Vorbis",
"Xiph.Org Vorbis Codec"},
546 {AUD_CODEC_FLAC,
"FLAC", 0,
"FLAC",
"Free Lossless Audio Codec"},
547 {AUD_CODEC_VORBIS,
"VORBIS", 0,
"Vorbis",
"Xiph.Org Vorbis Codec"},
573 case AUD_CONTAINER_AC3:
578 case AUD_CONTAINER_FLAC:
589 case AUD_CONTAINER_MATROSKA:
616 case AUD_CODEC_VORBIS:
624 case AUD_CONTAINER_MP2:
629 case AUD_CONTAINER_MP3:
635 case AUD_CONTAINER_OGG:
640 case AUD_CONTAINER_WAV:
661 #ifdef WITH_AUDASPACE
663 {AUD_FORMAT_U8,
"U8", 0,
"U8",
"8-bit unsigned"},
664 {AUD_FORMAT_S16,
"S16", 0,
"S16",
"16-bit signed"},
665 {AUD_FORMAT_S24,
"S24", 0,
"S24",
"24-bit signed"},
666 {AUD_FORMAT_S32,
"S32", 0,
"S32",
"32-bit signed"},
667 {AUD_FORMAT_FLOAT32,
"F32", 0,
"F32",
"32-bit floating-point"},
668 {AUD_FORMAT_FLOAT64,
"F64", 0,
"F64",
"64-bit floating-point"},
674 {AUD_CODEC_AAC,
"AAC", 0,
"AAC",
"Advanced Audio Coding"},
675 {AUD_CODEC_AC3,
"AC3", 0,
"AC3",
"Dolby Digital ATRAC 3"},
677 {AUD_CODEC_FLAC,
"FLAC", 0,
"FLAC",
"Free Lossless Audio Codec"},
679 {AUD_CODEC_MP2,
"MP2", 0,
"MP2",
"MPEG-1 Audio Layer II"},
680 {AUD_CODEC_MP3,
"MP3", 0,
"MP3",
"MPEG-2 Audio Layer III"},
682 {AUD_CODEC_PCM,
"PCM", 0,
"PCM",
"Pulse Code Modulation (RAW)"},
683 {AUD_CODEC_VORBIS,
"VORBIS", 0,
"Vorbis",
"Xiph.Org Vorbis Codec"},
698 #ifdef WITH_AUDASPACE
699 ot->
check = sound_mixdown_check;
700 ot->
ui = sound_mixdown_draw;
713 #ifdef WITH_AUDASPACE
721 "Sample accuracy, important for animation data (the lower the value, the more accurate)",
725 ot->
srna,
"container", container_items, AUD_CONTAINER_FLAC,
"Container",
"File format");
727 RNA_def_enum(
ot->
srna,
"format", format_items, AUD_FORMAT_S16,
"Format",
"Sample format");
728 RNA_def_int(
ot->
srna,
"bitrate", 192, 32, 512,
"Bitrate",
"Bitrate in kbit/s", 32, 512);
733 "Each channel will be rendered into a mono file");
779 ot->
description =
"Pack the sound into the current blend file";
812 "AutoPack is enabled, so image will be packed again on file save");
842 "AutoPack is enabled, so image will be packed again on file save");
854 ot->
name =
"Unpack Sound";
855 ot->
description =
"Unpack the sound to the samples filename";
struct Scene * CTX_data_scene(const bContext *C)
struct wmWindowManager * CTX_wm_manager(const bContext *C)
struct Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
struct Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
struct Main * CTX_data_main(const bContext *C)
struct FCurve * id_data_find_fcurve(ID *id, void *data, struct StructRNA *type, const char *prop_name, int index, bool *r_driven)
void BKE_main_id_tag_idcode(struct Main *mainvar, short type, int tag, bool value)
void id_us_min(struct ID *id)
const char * BKE_main_blendfile_path(const struct Main *bmain) ATTR_NONNULL()
struct PackedFile * BKE_packedfile_new(struct ReportList *reports, const char *filepath, const char *basepath)
int BKE_packedfile_unpack_sound(struct Main *bmain, struct ReportList *reports, struct bSound *sound, enum ePF_FileStatus how)
void BKE_report(ReportList *reports, eReportType type, const char *message)
void BKE_scene_graph_update_for_newframe(struct Depsgraph *depsgraph)
struct bSound * BKE_sound_new_file(struct Main *main, const char *filepath)
void BKE_sound_reset_scene_specs(struct Scene *scene)
void * BLI_findstring(const struct ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
bool BLI_path_extension_check_array(const char *str, const char **ext_array) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT
bool BLI_path_extension_ensure(char *path, size_t maxlen, const char *ext) ATTR_NONNULL()
bool BLI_path_extension_replace(char *path, size_t maxlen, const char *ext) ATTR_NONNULL()
bool BLI_path_abs(char *path, const char *basepath) ATTR_NONNULL()
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
typedef double(DMatrix)[4][4]
struct Depsgraph Depsgraph
void DEG_id_tag_update_ex(struct Main *bmain, struct ID *id, int flag)
void DEG_id_tag_update(struct ID *id, int flag)
void DEG_relations_tag_update(struct Main *bmain)
struct Scene * DEG_get_evaluated_scene(const struct Depsgraph *graph)
@ ID_RECALC_SEQUENCER_STRIPS
#define ID_BLEND_PATH(_bmain, _id)
#define AUDIO_VOLUME_ANIMATED
@ SEQ_AUDIO_PITCH_ANIMATED
@ SEQ_AUDIO_VOLUME_ANIMATED
void unpack_menu(struct bContext *C, const char *opname, const char *id_name, const char *abs_name, const char *folder, struct PackedFile *pf)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble GLdouble r _GL_VOID_RET _GL_VOID GLfloat GLfloat r _GL_VOID_RET _GL_VOID GLint GLint r _GL_VOID_RET _GL_VOID GLshort GLshort r _GL_VOID_RET _GL_VOID GLdouble GLdouble r
Read Guarded memory(de)allocation.
void uiLayoutSetPropSep(uiLayout *layout, bool is_sep)
@ UI_BUT_LABEL_ALIGN_NONE
void UI_context_active_but_prop_get_templateID(struct bContext *C, struct PointerRNA *r_ptr, struct PropertyRNA **r_prop)
void uiLayoutSetPropDecorate(uiLayout *layout, bool is_sep)
eAutoPropButsReturn uiDefAutoButsRNA(uiLayout *layout, struct PointerRNA *ptr, bool(*check_prop)(struct PointerRNA *ptr, struct PropertyRNA *prop, void *user_data), void *user_data, struct PropertyRNA *prop_activate_init, eButLabelAlign label_align, bool compact)
const Depsgraph * depsgraph
SyclQueue void void size_t num_bytes void
void SEQ_for_each_callback(ListBase *seqbase, SeqForEachFunc callback, void *user_data)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void split(const std::string &s, const char delim, std::vector< std::string > &tokens)
void RNA_pointer_create(ID *id, StructRNA *type, void *data, PointerRNA *r_ptr)
void RNA_id_pointer_create(ID *id, PointerRNA *r_ptr)
const char * RNA_property_identifier(const PropertyRNA *prop)
void RNA_property_pointer_set(PointerRNA *ptr, PropertyRNA *prop, PointerRNA ptr_value, ReportList *reports)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
void RNA_property_update(bContext *C, PointerRNA *ptr, PropertyRNA *prop)
void RNA_string_get(PointerRNA *ptr, const char *name, char *value)
int RNA_int_get(PointerRNA *ptr, const char *name)
void RNA_property_string_get(PointerRNA *ptr, PropertyRNA *prop, char *value)
bool RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
void RNA_enum_set(PointerRNA *ptr, const char *name, int value)
int RNA_enum_get(PointerRNA *ptr, const char *name)
void RNA_property_string_set(PointerRNA *ptr, PropertyRNA *prop, const char *value)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, int default_value, int hardmin, int hardmax, const char *ui_name, const char *ui_description, int softmin, int softmax)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
const EnumPropertyItem rna_enum_unpack_method_items[]
static void SOUND_OT_pack(wmOperatorType *ot)
static int sound_open_exec(bContext *UNUSED(C), wmOperator *op)
static void SOUND_OT_open(wmOperatorType *ot)
static void SOUND_OT_open_mono(wmOperatorType *ot)
static bool sound_update_animation_flags_fn(Sequence *seq, void *user_data)
static int sound_pack_exec(bContext *C, wmOperator *op)
static int sound_open_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static bool sound_poll(bContext *C)
static void SOUND_OT_update_animation_flags(wmOperatorType *ot)
static void sound_open_cancel(bContext *UNUSED(C), wmOperator *op)
static int sound_mixdown_exec(bContext *C, wmOperator *op)
void ED_operatortypes_sound(void)
static void SOUND_OT_bake_animation(wmOperatorType *ot)
static void sound_update_animation_flags(Scene *scene)
static void SOUND_OT_mixdown(wmOperatorType *ot)
static void SOUND_OT_unpack(wmOperatorType *ot)
static int sound_update_animation_flags_exec(bContext *C, wmOperator *UNUSED(op))
static int sound_unpack_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
static int sound_bake_animation_exec(bContext *C, wmOperator *UNUSED(op))
static int sound_unpack_exec(bContext *C, wmOperator *op)
static void sound_open_init(bContext *C, wmOperator *op)
static int sound_mixdown_invoke(bContext *C, wmOperator *op, const wmEvent *event)
struct PropertyRNA * prop
struct FFMpegCodecData ffcodecdata
struct PackedFile * packedfile
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
void(* cancel)(struct bContext *, struct wmOperator *)
void(* ui)(struct bContext *, struct wmOperator *)
bool(* check)(struct bContext *, struct wmOperator *)
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
struct wmOperatorType * type
void WM_operator_properties_filesel(wmOperatorType *ot, const int filter, const short type, const eFileSel_Action action, const eFileSel_Flag flag, const short display, const short sort)
void WM_operatortype_append(void(*opfunc)(wmOperatorType *))
int WM_operator_filesel(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))