Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoerg Mueller <nexyon@gmail.com>2009-08-10 01:16:39 +0400
committerJoerg Mueller <nexyon@gmail.com>2009-08-10 01:16:39 +0400
commit6c5c58e05799f2b593cd81fcff57e6ef72ad57fb (patch)
tree8add929ef94d03fc69aecce6ef2baf283505782f /source/blender/makesrna
parentc1ca2ab5dceb8d5355215a3c7a80b171f394e487 (diff)
2.5: Sound branch merge!
See mailing list for additional information.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/intern/rna_sequence.c24
-rw-r--r--source/blender/makesrna/intern/rna_sound.c65
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c72
3 files changed, 74 insertions, 87 deletions
diff --git a/source/blender/makesrna/intern/rna_sequence.c b/source/blender/makesrna/intern/rna_sequence.c
index 8ca023dc57c..fec91c64e4d 100644
--- a/source/blender/makesrna/intern/rna_sequence.c
+++ b/source/blender/makesrna/intern/rna_sequence.c
@@ -192,10 +192,8 @@ static StructRNA* rna_Sequence_refine(struct PointerRNA *ptr)
case SEQ_SCENE:
return &RNA_SceneSequence;
case SEQ_MOVIE:
- case SEQ_MOVIE_AND_HD_SOUND:
return &RNA_MovieSequence;
- case SEQ_RAM_SOUND:
- case SEQ_HD_SOUND:
+ case SEQ_SOUND:
return &RNA_SoundSequence;
case SEQ_CROSS:
case SEQ_ADD:
@@ -362,9 +360,7 @@ static void rna_def_sequence(BlenderRNA *brna)
{SEQ_META, "META", 0, "Meta", ""},
{SEQ_SCENE, "SCENE", 0, "Scene", ""},
{SEQ_MOVIE, "MOVIE", 0, "Movie", ""},
- {SEQ_RAM_SOUND, "RAM_SOUND", 0, "Ram Sound", ""},
- {SEQ_HD_SOUND, "HD_SOUND", 0, "HD Sound", ""},
- {SEQ_MOVIE_AND_HD_SOUND, "MOVIE_AND_HD_SOUND", 0, "Movie and HD Sound", ""},
+ {SEQ_SOUND, "_SOUND", 0, "Sound", ""},
{SEQ_EFFECT, "REPLACE", 0, "Replace", ""},
{SEQ_CROSS, "CROSS", 0, "Cross", ""},
{SEQ_ADD, "ADD", 0, "Add", ""},
@@ -616,21 +612,6 @@ static void rna_def_filter_video(StructRNA *srna)
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
}
-static void rna_def_filter_sound(StructRNA *srna)
-{
- PropertyRNA *prop;
-
- prop= RNA_def_property(srna, "sound_gain", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "level");
- RNA_def_property_range(prop, -96.0f, 6.0f);
- RNA_def_property_ui_text(prop, "Sound Gain", "Sound level in dB (0 = full volume).");
-
- prop= RNA_def_property(srna, "sound_pan", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "pan");
- RNA_def_property_range(prop, -1.0f, 1.0f);
- RNA_def_property_ui_text(prop, "Sound Pan", "Stereo sound balance.");
-}
-
static void rna_def_proxy(StructRNA *srna)
{
PropertyRNA *prop;
@@ -772,7 +753,6 @@ static void rna_def_sound(BlenderRNA *brna)
RNA_def_property_string_sdna(prop, NULL, "strip->dir");
RNA_def_property_ui_text(prop, "Directory", "");
- rna_def_filter_sound(srna);
rna_def_input(srna);
}
diff --git a/source/blender/makesrna/intern/rna_sound.c b/source/blender/makesrna/intern/rna_sound.c
index 363a5595b43..9ca2a74bedd 100644
--- a/source/blender/makesrna/intern/rna_sound.c
+++ b/source/blender/makesrna/intern/rna_sound.c
@@ -149,71 +149,6 @@ static void rna_def_sound(BlenderRNA *brna)
prop= RNA_def_property(srna, "packed_file", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "packedfile");
RNA_def_property_ui_text(prop, "Packed File", "");
-
- /* game engine settings */
- prop= RNA_def_property(srna, "volume", PROP_FLOAT, PROP_UNSIGNED);
- RNA_def_property_float_sdna(prop, NULL, "volume");
- RNA_def_property_ui_range(prop, 0.0, 1.0, 10, 4);
- RNA_def_property_ui_text(prop, "Volume", "Game engine only: volume for this sound.");
-
- prop= RNA_def_property(srna, "pitch", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "pitch");
- RNA_def_property_ui_range(prop, -12.0, 12.0, 10, 4);
- RNA_def_property_ui_text(prop, "Pitch", "Game engine only: set the pitch of this sound.");
-
- prop= RNA_def_property(srna, "loop", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flags", SOUND_FLAGS_LOOP);
- RNA_def_property_ui_text(prop, "Sound Loop", "Game engine only: toggle between looping on/off.");
-
- prop= RNA_def_property(srna, "ping_pong", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flags", SOUND_FLAGS_BIDIRECTIONAL_LOOP);
- RNA_def_property_ui_text(prop, "Ping Pong", "Game engine only: Toggle between A->B and A->B->A looping.");
-
- prop= RNA_def_property(srna, "sound_3d", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flags", SOUND_FLAGS_3D);
- RNA_def_property_ui_text(prop, "3D Sound", "Game engine only: turns 3D sound on.");
-
- prop= RNA_def_property(srna, "attenuation", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "attenuation");
- RNA_def_property_range(prop, 0.0, 5.0);
- RNA_def_property_ui_text(prop, "Attenuation", "Game engine only: sets the surround scaling factor for 3D sound.");
-
- /* gain */
- prop= RNA_def_property(srna, "min_gain", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "min_gain");
- RNA_def_property_range(prop, 0.0, 1.0);
- RNA_def_property_ui_text(prop, "Min Gain", "Minimal gain which is always guaranteed for this sound.");
-
- prop= RNA_def_property(srna, "max_gain", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "max_gain");
- RNA_def_property_range(prop, 0.0, 1.0);
- RNA_def_property_ui_text(prop, "Max Gain", "Maximal gain which is always guaranteed for this sound.");
-
- prop= RNA_def_property(srna, "reference_distance", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "distance");
- RNA_def_property_ui_text(prop, "Reference Distance", "Reference distance at which the listener will experience gain.");
- RNA_def_property_ui_range(prop, 0.0, 1000.0, 10, 4); /* NOT used anywhere */
-
- /* unused
- prop= RNA_def_property(srna, "panning", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "panning");
- RNA_def_property_ui_range(prop, -1.0, 1.0, 10, 4);
- RNA_def_property_ui_text(prop, "Panning", "Pan the sound from left to right"); */
-
- /* unused
- prop= RNA_def_property(srna, "fixed_volume", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flags", SOUND_FLAGS_FIXED_VOLUME);
- RNA_def_property_ui_text(prop, "Fixed Volume", "Constraint sound to fixed volume."); */
-
- /* unused
- prop= RNA_def_property(srna, "fixed_panning", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flags", SOUND_FLAGS_FIXED_PANNING);
- RNA_def_property_ui_text(prop, "Fixed Panning", "Constraint sound to fixed panning."); */
-
- /* unused
- prop= RNA_def_property(srna, "priority", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flags", SOUND_FLAGS_PRIORITY);
- RNA_def_property_ui_text(prop, "Priority", "Make sound higher priority."); */
}
void RNA_def_sound(BlenderRNA *brna)
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index f1fd11a0094..8dcca446507 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -37,6 +37,8 @@
#include "BKE_utildefines.h"
+#include "BKE_sound.h"
+
#ifdef RNA_RUNTIME
static void rna_userdef_lmb_select_set(struct PointerRNA *ptr,int value)
@@ -116,6 +118,11 @@ static PointerRNA rna_UserDef_system_get(PointerRNA *ptr)
return rna_pointer_inherit_refine(ptr, &RNA_UserPreferencesSystem, ptr->data);
}
+static void rna_UserDef_audio_update(bContext *C, PointerRNA *ptr)
+{
+ sound_reinit(C);
+}
+
#else
static void rna_def_userdef_theme_ui_font_style(BlenderRNA *brna)
@@ -1977,6 +1984,46 @@ static void rna_def_userdef_system(BlenderRNA *brna)
{512, "AUDIO_SAMPLES_512", 0, "512", "Set audio mixing buffer size to 512 samples"},
{1024, "AUDIO_SAMPLES_1024", 0, "1024", "Set audio mixing buffer size to 1024 samples"},
{2048, "AUDIO_SAMPLES_2048", 0, "2048", "Set audio mixing buffer size to 2048 samples"},
+ {4096, "AUDIO_SAMPLES_4096", 0, "4096", "Set audio mixing buffer size to 4096 samples"},
+ {8192, "AUDIO_SAMPLES_8192", 0, "8192", "Set audio mixing buffer size to 8192 samples"},
+ {16384, "AUDIO_SAMPLES_16384", 0, "16384", "Set audio mixing buffer size to 16384 samples"},
+ {32768, "AUDIO_SAMPLES_32768", 0, "32768", "Set audio mixing buffer size to 32768 samples"},
+ {0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem audio_device_items[] = {
+ {0, "AUDIO_DEVICE_NULL", 0, "No Audio", "Null device - there will be no audio output."},
+ {1, "AUDIO_DEVICE_SDL", 0, "SDL", "SDL device - simple direct media layer, recommended for sequencer usage."},
+ {2, "AUDIO_DEVICE_OPENAL", 0, "OpenAL", "OpenAL device - supports 3D audio, recommended for game engine usage."},
+ {0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem audio_rate_items[] = {
+// {8000, "AUDIO_RATE_8000", 0, "8 kHz", "Set audio sampling rate to 8000 samples per second."},
+// {11025, "AUDIO_RATE_11025", 0, "11.025 kHz", "Set audio sampling rate to 11025 samples per second."},
+// {16000, "AUDIO_RATE_16000", 0, "16 kHz", "Set audio sampling rate to 16000 samples per second."},
+// {22050, "AUDIO_RATE_22050", 0, "22.05 kHz", "Set audio sampling rate to 22050 samples per second."},
+// {32000, "AUDIO_RATE_32000", 0, "32 kHz", "Set audio sampling rate to 32000 samples per second."},
+ {44100, "AUDIO_RATE_44100", 0, "44.1 kHz", "Set audio sampling rate to 44100 samples per second."},
+ {48000, "AUDIO_RATE_48000", 0, "48 kHz", "Set audio sampling rate to 48000 samples per second."},
+// {88200, "AUDIO_RATE_88200", 0, "88.2 kHz", "Set audio sampling rate to 88200 samples per second."},
+ {96000, "AUDIO_RATE_96000", 0, "96 kHz", "Set audio sampling rate to 96000 samples per second."},
+ {192000, "AUDIO_RATE_192000", 0, "192 kHz", "Set audio sampling rate to 192000 samples per second."},
+ {0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem audio_format_items[] = {
+ {0x01, "AUDIO_FORMAT_U8", 0, "8-bit Unsigned", "Set audio sample format to 8 bit unsigned integer."},
+ {0x12, "AUDIO_FORMAT_S16", 0, "16-bit Signed", "Set audio sample format to 16 bit signed integer."},
+ {0x13, "AUDIO_FORMAT_S24", 0, "24-bit Signed", "Set audio sample format to 24 bit signed integer."},
+ {0x14, "AUDIO_FORMAT_S32", 0, "32-bit Signed", "Set audio sample format to 32 bit signed integer."},
+ {0x24, "AUDIO_FORMAT_FLOAT", 0, "32-bit Float", "Set audio sample format to 32 bit float."},
+ {0x28, "AUDIO_FORMAT_DOUBLE", 0, "64-bit Float", "Set audio sample format to 64 bit float."},
+ {0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem audio_channel_items[] = {
+ {1, "AUDIO_CHANNELS_MONO", 0, "Mono", "Set audio channels to mono."},
+ {2, "AUDIO_CHANNELS_STEREO", 0, "Stereo", "Set audio channels to stereo."},
+ {4, "AUDIO_CHANNELS_SURROUND4", 0, "4 Channels", "Set audio channels to 4 channels."},
+ {6, "AUDIO_CHANNELS_SURROUND51", 0, "5.1 Surround", "Set audio channels to 5.1 surround sound."},
+ {8, "AUDIO_CHANNELS_SURROUND71", 0, "7.1 Surround", "Set audio channels to 7.1 surround sound."},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem draw_method_items[] = {
@@ -2078,6 +2125,31 @@ static void rna_def_userdef_system(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "mixbufsize");
RNA_def_property_enum_items(prop, audio_mixing_samples_items);
RNA_def_property_ui_text(prop, "Audio Mixing Buffer", "Sets the number of samples used by the audio mixing buffer.");
+ RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
+
+ prop= RNA_def_property(srna, "audio_device", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "audiodevice");
+ RNA_def_property_enum_items(prop, audio_device_items);
+ RNA_def_property_ui_text(prop, "Audio Device", "Sets the audio output device.");
+ RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
+
+ prop= RNA_def_property(srna, "audio_sample_rate", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "audiorate");
+ RNA_def_property_enum_items(prop, audio_rate_items);
+ RNA_def_property_ui_text(prop, "Audio Sample Rate", "Sets the audio sample rate.");
+ RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
+
+ prop= RNA_def_property(srna, "audio_sample_format", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "audioformat");
+ RNA_def_property_enum_items(prop, audio_format_items);
+ RNA_def_property_ui_text(prop, "Audio Sample Format", "Sets the audio sample format.");
+ RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
+
+ prop= RNA_def_property(srna, "audio_channels", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "audiochannels");
+ RNA_def_property_enum_items(prop, audio_channel_items);
+ RNA_def_property_ui_text(prop, "Audio Channels", "Sets the audio channel count.");
+ RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
#if 0
prop= RNA_def_property(srna, "verse_master", PROP_STRING, PROP_NONE);