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>2011-08-01 15:44:20 +0400
committerJoerg Mueller <nexyon@gmail.com>2011-08-01 15:44:20 +0400
commit3e85ec432ef050563d75488eca3049b77497153d (patch)
tree147c765f8b099b0d525c5e55ccc6a70995632509 /source/blender/makesrna
parentf3c867c3dbde6919653e7cc712099e48b7508715 (diff)
3D Audio GSoC:
Adds new speaker object type. Notes: * Needs some nice icons * Quickily review by Joshua Leung (5 mins) * Properties UI updated (with help of Thomans Dinges) * Speakers have their own theme color * No real audio functionality yet. * Minor bug regarding lamps/lattices fixed in interface_templates.c I personality tested: * Creation, Deletion, Duplication * Saving, Loading * Library linking (incl. make local) * Tracking * Dope Sheet, Outliner * Animation * Drawing (incl. Theme)
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/RNA_access.h1
-rw-r--r--source/blender/makesrna/intern/CMakeLists.txt1
-rw-r--r--source/blender/makesrna/intern/makesrna.c1
-rw-r--r--source/blender/makesrna/intern/rna_ID.c3
-rw-r--r--source/blender/makesrna/intern/rna_action.c6
-rw-r--r--source/blender/makesrna/intern/rna_internal.h2
-rw-r--r--source/blender/makesrna/intern/rna_main.c7
-rw-r--r--source/blender/makesrna/intern/rna_main_api.c52
-rw-r--r--source/blender/makesrna/intern/rna_object.c2
-rw-r--r--source/blender/makesrna/intern/rna_speaker.c172
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c5
11 files changed, 252 insertions, 0 deletions
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h
index f5d73bddc3b..2add02a7f4e 100644
--- a/source/blender/makesrna/RNA_access.h
+++ b/source/blender/makesrna/RNA_access.h
@@ -463,6 +463,7 @@ extern StructRNA RNA_SpaceTimeline;
extern StructRNA RNA_SpaceUVEditor;
extern StructRNA RNA_SpaceUserPreferences;
extern StructRNA RNA_SpaceView3D;
+extern StructRNA RNA_Speaker;
extern StructRNA RNA_SpeedControlSequence;
extern StructRNA RNA_Spline;
extern StructRNA RNA_SplineIKConstraint;
diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt
index cb593e7deab..7d7c5532fb5 100644
--- a/source/blender/makesrna/intern/CMakeLists.txt
+++ b/source/blender/makesrna/intern/CMakeLists.txt
@@ -78,6 +78,7 @@ set(DEFSRC
rna_smoke.c
rna_sound.c
rna_space.c
+ rna_speaker.c
rna_test.c
rna_text.c
rna_texture.c
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c
index 7da538e171b..feb926fd28e 100644
--- a/source/blender/makesrna/intern/makesrna.c
+++ b/source/blender/makesrna/intern/makesrna.c
@@ -2461,6 +2461,7 @@ static RNAProcessItem PROCESS_ITEMS[]= {
{"rna_sequencer.c", "rna_sequencer_api.c", RNA_def_sequencer},
{"rna_smoke.c", NULL, RNA_def_smoke},
{"rna_space.c", NULL, RNA_def_space},
+ {"rna_speaker.c", NULL, RNA_def_speaker},
{"rna_test.c", NULL, RNA_def_test},
{"rna_text.c", NULL, RNA_def_text},
{"rna_timeline.c", NULL, RNA_def_timeline_marker},
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c
index 3ce84e3a19f..48b5592dbfc 100644
--- a/source/blender/makesrna/intern/rna_ID.c
+++ b/source/blender/makesrna/intern/rna_ID.c
@@ -66,6 +66,7 @@ EnumPropertyItem id_type_items[] = {
{ID_PA, "PARTICLE", ICON_PARTICLE_DATA, "Particle", ""},
{ID_SCE, "SCENE", ICON_SCENE_DATA, "Scene", ""},
{ID_SCR, "SCREEN", ICON_SPLITSCREEN, "Screen", ""},
+ {ID_SPK, "SPEAKER", ICON_SPEAKER, "Speaker", ""},
{ID_SO, "SOUND", ICON_PLAY_AUDIO, "Sound", ""},
{ID_TXT, "TEXT", ICON_TEXT, "Text", ""},
{ID_TE, "TEXTURE", ICON_TEXTURE_DATA, "Texture", ""},
@@ -136,6 +137,7 @@ short RNA_type_to_ID_code(StructRNA *type)
if(RNA_struct_is_a(type, &RNA_ParticleSettings)) return ID_PA;
if(RNA_struct_is_a(type, &RNA_Scene)) return ID_SCE;
if(RNA_struct_is_a(type, &RNA_Screen)) return ID_SCR;
+ if(RNA_struct_is_a(type, &RNA_Speaker)) return ID_SPK;
if(RNA_struct_is_a(type, &RNA_Sound)) return ID_SO;
if(RNA_struct_is_a(type, &RNA_Text)) return ID_TXT;
if(RNA_struct_is_a(type, &RNA_Texture)) return ID_TE;
@@ -169,6 +171,7 @@ StructRNA *ID_code_to_RNA_type(short idcode)
case ID_PA: return &RNA_ParticleSettings;
case ID_SCE: return &RNA_Scene;
case ID_SCR: return &RNA_Screen;
+ case ID_SPK: return &RNA_Speaker;
case ID_SO: return &RNA_Sound;
case ID_TXT: return &RNA_Text;
case ID_TE: return &RNA_Texture;
diff --git a/source/blender/makesrna/intern/rna_action.c b/source/blender/makesrna/intern/rna_action.c
index 525868259a5..31a9d57bc93 100644
--- a/source/blender/makesrna/intern/rna_action.c
+++ b/source/blender/makesrna/intern/rna_action.c
@@ -416,6 +416,12 @@ static void rna_def_dopesheet(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Display Node", "Include visualization of Node related Animation data");
RNA_def_property_ui_icon(prop, ICON_NODETREE, 0);
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
+
+ prop= RNA_def_property(srna, "show_speakers", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOSPK);
+ RNA_def_property_ui_text(prop, "Display Speaker", "Include visualization of Speaker related Animation data");
+ RNA_def_property_ui_icon(prop, ICON_SPEAKER, 0);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
}
static void rna_def_action_group(BlenderRNA *brna)
diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h
index 9175806e2bb..f0028fb331c 100644
--- a/source/blender/makesrna/intern/rna_internal.h
+++ b/source/blender/makesrna/intern/rna_internal.h
@@ -168,6 +168,7 @@ void RNA_def_sensor(struct BlenderRNA *brna);
void RNA_def_sequencer(struct BlenderRNA *brna);
void RNA_def_smoke(struct BlenderRNA *brna);
void RNA_def_space(struct BlenderRNA *brna);
+void RNA_def_speaker(struct BlenderRNA *brna);
void RNA_def_test(struct BlenderRNA *brna);
void RNA_def_text(struct BlenderRNA *brna);
void RNA_def_texture(struct BlenderRNA *brna);
@@ -279,6 +280,7 @@ void RNA_def_main_brushes(BlenderRNA *brna, PropertyRNA *cprop);
void RNA_def_main_worlds(BlenderRNA *brna, PropertyRNA *cprop);
void RNA_def_main_groups(BlenderRNA *brna, PropertyRNA *cprop);
void RNA_def_main_texts(BlenderRNA *brna, PropertyRNA *cprop);
+void RNA_def_main_speakers(BlenderRNA *brna, PropertyRNA *cprop);
void RNA_def_main_sounds(BlenderRNA *brna, PropertyRNA *cprop);
void RNA_def_main_armatures(BlenderRNA *brna, PropertyRNA *cprop);
void RNA_def_main_actions(BlenderRNA *brna, PropertyRNA *cprop);
diff --git a/source/blender/makesrna/intern/rna_main.c b/source/blender/makesrna/intern/rna_main.c
index bb13a3b1bf1..021aa9660ed 100644
--- a/source/blender/makesrna/intern/rna_main.c
+++ b/source/blender/makesrna/intern/rna_main.c
@@ -187,6 +187,12 @@ static void rna_Main_text_begin(CollectionPropertyIterator *iter, PointerRNA *pt
rna_iterator_listbase_begin(iter, &bmain->text, NULL);
}
+static void rna_Main_speaker_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ Main *bmain= (Main*)ptr->data;
+ rna_iterator_listbase_begin(iter, &bmain->speaker, NULL);
+}
+
static void rna_Main_sound_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
Main *bmain= (Main*)ptr->data;
@@ -297,6 +303,7 @@ void RNA_def_main(BlenderRNA *brna)
{"shape_keys", "Key", "rna_Main_key_begin", "Shape Keys", "Shape Key datablocks.", NULL},
{"scripts", "ID", "rna_Main_script_begin", "Scripts", "Script datablocks (DEPRECATED).", NULL},
{"texts", "Text", "rna_Main_text_begin", "Texts", "Text datablocks.", RNA_def_main_texts},
+ {"speakers", "Speaker", "rna_Main_speaker_begin", "Speakers", "Speaker datablocks.", RNA_def_main_speakers},
{"sounds", "Sound", "rna_Main_sound_begin", "Sounds", "Sound datablocks.", RNA_def_main_sounds},
{"armatures", "Armature", "rna_Main_armature_begin", "Armatures", "Armature datablocks.", RNA_def_main_armatures},
{"actions", "Action", "rna_Main_action_begin", "Actions", "Action datablocks.", RNA_def_main_actions},
diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c
index 8ac620c2fcf..7b951294aee 100644
--- a/source/blender/makesrna/intern/rna_main_api.c
+++ b/source/blender/makesrna/intern/rna_main_api.c
@@ -71,6 +71,7 @@
#include "DNA_material_types.h"
#include "DNA_mesh_types.h"
#include "DNA_object_types.h"
+#include "DNA_speaker_types.h"
#include "DNA_text_types.h"
#include "DNA_texture_types.h"
#include "DNA_group_types.h"
@@ -147,6 +148,9 @@ Object *rna_Main_objects_new(Main *UNUSED(bmain), ReportList *reports, const cha
case ID_LA:
type= OB_LAMP;
break;
+ case ID_SPK:
+ type= OB_SPEAKER;
+ break;
case ID_CA:
type= OB_CAMERA;
break;
@@ -406,6 +410,22 @@ void rna_Main_groups_remove(Main *bmain, Group *group)
/* XXX python now has invalid pointer? */
}
+Speaker *rna_Main_speakers_new(Main *UNUSED(bmain), const char *name)
+{
+ Speaker *speaker= add_speaker(name);
+ id_us_min(&speaker->id);
+ return speaker;
+}
+void rna_Main_speakers_remove(Main *bmain, ReportList *reports, Speaker *speaker)
+{
+ if(ID_REAL_USERS(speaker) <= 0)
+ free_libblock(&bmain->speaker, speaker);
+ else
+ BKE_reportf(reports, RPT_ERROR, "Speaker \"%s\" must have zero users to be removed, found %d.", speaker->id.name+2, ID_REAL_USERS(speaker));
+
+ /* XXX python now has invalid pointer? */
+}
+
Text *rna_Main_texts_new(Main *UNUSED(bmain), const char *name)
{
return add_empty_text(name);
@@ -502,6 +522,7 @@ void rna_Main_groups_tag(Main *bmain, int value) { tag_main_lb(&bmain->group, va
void rna_Main_shape_keys_tag(Main *bmain, int value) { tag_main_lb(&bmain->key, value); }
void rna_Main_scripts_tag(Main *bmain, int value) { tag_main_lb(&bmain->script, value); }
void rna_Main_texts_tag(Main *bmain, int value) { tag_main_lb(&bmain->text, value); }
+void rna_Main_speakers_tag(Main *bmain, int value) { tag_main_lb(&bmain->speaker, value); }
void rna_Main_sounds_tag(Main *bmain, int value) { tag_main_lb(&bmain->sound, value); }
void rna_Main_armatures_tag(Main *bmain, int value) { tag_main_lb(&bmain->armature, value); }
void rna_Main_actions_tag(Main *bmain, int value) { tag_main_lb(&bmain->action, value); }
@@ -1076,6 +1097,37 @@ void RNA_def_main_groups(BlenderRNA *brna, PropertyRNA *cprop)
parm= RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
}
+
+void RNA_def_main_speakers(BlenderRNA *brna, PropertyRNA *cprop)
+{
+ StructRNA *srna;
+ FunctionRNA *func;
+ PropertyRNA *parm;
+
+ RNA_def_property_srna(cprop, "BlendDataSpeakers");
+ srna= RNA_def_struct(brna, "BlendDataSpeakers", NULL);
+ RNA_def_struct_sdna(srna, "Main");
+ RNA_def_struct_ui_text(srna, "Main Speakers", "Collection of speakers");
+
+ func= RNA_def_function(srna, "new", "rna_Main_speakers_new");
+ RNA_def_function_ui_description(func, "Add a new speaker to the main database");
+ parm= RNA_def_string(func, "name", "Speaker", 0, "", "New name for the datablock.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ /* return type */
+ parm= RNA_def_pointer(func, "speaker", "Speaker", "", "New speaker datablock.");
+ RNA_def_function_return(func, parm);
+
+ func= RNA_def_function(srna, "remove", "rna_Main_speakers_remove");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ RNA_def_function_ui_description(func, "Remove a speaker from the current blendfile.");
+ parm= RNA_def_pointer(func, "speaker", "Speaker", "", "Speaker to remove.");
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
+
+ func= RNA_def_function(srna, "tag", "rna_Main_speakers_tag");
+ parm= RNA_def_boolean(func, "value", 0, "Value", "");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+}
+
void RNA_def_main_texts(BlenderRNA *brna, PropertyRNA *cprop)
{
StructRNA *srna;
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index 76bbfcbed41..3371f194e6e 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -115,6 +115,7 @@ EnumPropertyItem object_type_items[] = {
{0, "", 0, NULL, NULL},
{OB_CAMERA, "CAMERA", 0, "Camera", ""},
{OB_LAMP, "LAMP", 0, "Lamp", ""},
+ {OB_SPEAKER, "SPEAKER", 0, "Speaker", ""},
{0, NULL, 0, NULL, NULL}};
EnumPropertyItem object_type_curve_items[] = {
@@ -365,6 +366,7 @@ static StructRNA *rna_Object_data_typef(PointerRNA *ptr)
case OB_CAMERA: return &RNA_Camera;
case OB_LATTICE: return &RNA_Lattice;
case OB_ARMATURE: return &RNA_Armature;
+ case OB_SPEAKER: return &RNA_Speaker;
default: return &RNA_ID;
}
}
diff --git a/source/blender/makesrna/intern/rna_speaker.c b/source/blender/makesrna/intern/rna_speaker.c
new file mode 100644
index 00000000000..60208de5aa5
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_speaker.c
@@ -0,0 +1,172 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * 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
+ * of the License, or (at your option) any later version.
+ *
+ * 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,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor(s): Jörg Müller.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file blender/makesrna/intern/rna_speaker.c
+ * \ingroup RNA
+ */
+
+
+#include <stdlib.h>
+
+#include "RNA_define.h"
+#include "RNA_enum_types.h"
+
+#include "rna_internal.h"
+
+#include "DNA_speaker_types.h"
+#include "DNA_sound_types.h"
+
+#ifdef RNA_RUNTIME
+
+#include "MEM_guardedalloc.h"
+
+#include "BKE_depsgraph.h"
+#include "BKE_main.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+
+#else
+
+static void rna_def_speaker(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "Speaker", "ID");
+ RNA_def_struct_ui_text(srna, "Speaker", "Speaker datablock for 3D audio speaker objects");
+ RNA_def_struct_ui_icon(srna, ICON_SPEAKER);
+
+ prop= RNA_def_property(srna, "muted", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", SPK_MUTED);
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+ RNA_def_property_ui_text(prop, "Mute", "Mutes the speaker.");
+ // RNA_def_property_update(prop, 0, "rna_Speaker_update");
+
+ /* This shouldn't be changed actually, hiding it!
+ prop= RNA_def_property(srna, "relative", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", SPK_RELATIVE);
+ RNA_def_property_ui_text(prop, "Relative", "Whether the source is relative to the camera or not.");
+ // RNA_def_property_update(prop, 0, "rna_Speaker_update");*/
+
+ prop= RNA_def_property(srna, "sound", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "sound");
+ RNA_def_property_struct_type(prop, "Sound");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+ RNA_def_property_ui_text(prop, "Sound", "Sound datablock used by this speaker.");
+ // RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_sound_set", NULL);
+ // RNA_def_property_update(prop, 0, "rna_Speaker_update");
+
+ prop= RNA_def_property(srna, "volume_max", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "volume_max");
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Maximum Volume", "Maximum volume, no matter how near the object is.");
+ // RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_volume_max_set", NULL);
+ // RNA_def_property_update(prop, 0, "rna_Speaker_update");
+
+ prop= RNA_def_property(srna, "volume_min", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "volume_min");
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Minimum Volume", "Minimum volume, no matter how far away the object is.");
+ // RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_volume_min_set", NULL);
+ // RNA_def_property_update(prop, 0, "rna_Speaker_update");
+
+ prop= RNA_def_property(srna, "distance_max", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "distance_max");
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+ RNA_def_property_range(prop, 0.0f, FLT_MAX);
+ RNA_def_property_ui_text(prop, "Maximum Distance", "Maximum distance for volume calculation, no matter how far away the object is.");
+ // RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_distance_max_set", NULL);
+ // RNA_def_property_update(prop, 0, "rna_Speaker_update");
+
+ prop= RNA_def_property(srna, "distance_reference", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "distance_reference");
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+ RNA_def_property_range(prop, 0.0f, FLT_MAX);
+ RNA_def_property_ui_text(prop, "Reference Distance", "Reference distance at which volume is 100 %.");
+ // RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_distance_reference_set", NULL);
+ // RNA_def_property_update(prop, 0, "rna_Speaker_update");
+
+ prop= RNA_def_property(srna, "attenuation", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "attenuation");
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+ RNA_def_property_range(prop, 0.0f, FLT_MAX);
+ RNA_def_property_ui_text(prop, "Attenuation", "How strong the distance affects volume, depending on distance model.");
+ // RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_attenuation_set", NULL);
+ // RNA_def_property_update(prop, 0, "rna_Speaker_update");
+
+ prop= RNA_def_property(srna, "cone_angle_outer", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "cone_angle_outer");
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+ RNA_def_property_range(prop, 0.0f, 360.0f);
+ RNA_def_property_ui_text(prop, "Outer Cone Angle", "Outer angle of the cone in degrees, outside this cone the volume is the outer cone volume, between inner and outer cone the volume is interpolated.");
+ // RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_cone_angle_outer_set", NULL);
+ // RNA_def_property_update(prop, 0, "rna_Speaker_update");
+
+ prop= RNA_def_property(srna, "cone_angle_inner", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "cone_angle_inner");
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+ RNA_def_property_range(prop, 0.0f, 360.0f);
+ RNA_def_property_ui_text(prop, "Inner Cone Angle", "Inner angle of the cone in degrees, inside the cone the volume is 100 %.");
+ // RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_cone_angle_inner_set", NULL);
+ // RNA_def_property_update(prop, 0, "rna_Speaker_update");
+
+ prop= RNA_def_property(srna, "cone_volume_outer", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "cone_volume_outer");
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Outer Cone Volume", "Volume outside the outer cone.");
+ // RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_cone_volume_outer_set", NULL);
+ // RNA_def_property_update(prop, 0, "rna_Speaker_update");
+
+ prop= RNA_def_property(srna, "volume", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "volume");
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Volume", "How loud the sound is.");
+ // RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_volume_set", NULL);
+ // RNA_def_property_update(prop, 0, "rna_Speaker_update");
+
+ prop= RNA_def_property(srna, "pitch", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "pitch");
+ RNA_def_property_range(prop, 0.1f, 10.0f);
+ RNA_def_property_ui_text(prop, "Pitch", "Playback pitch of the sound.");
+ // RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_pitch_set", NULL);
+ // RNA_def_property_update(prop, 0, "rna_Speaker_update");
+
+ /* common */
+ rna_def_animdata_common(srna);
+}
+
+
+void RNA_def_speaker(BlenderRNA *brna)
+{
+ rna_def_speaker(brna);
+}
+
+#endif
+
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 4a4b712ca40..36a6762074c 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -919,6 +919,11 @@ static void rna_def_userdef_theme_space_view3d(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Lamp", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
+ prop= RNA_def_property(srna, "speaker", PROP_FLOAT, PROP_COLOR_GAMMA);
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Speaker", "");
+ RNA_def_property_update(prop, 0, "rna_userdef_update");
+
prop= RNA_def_property(srna, "object_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "select");
RNA_def_property_array(prop, 3);