First try in sound UI for the sequencer.
authorJoerg Mueller <nexyon@gmail.com>
Fri, 28 Aug 2009 12:27:29 +0000 (12:27 +0000)
committerJoerg Mueller <nexyon@gmail.com>
Fri, 28 Aug 2009 12:27:29 +0000 (12:27 +0000)
release/ui/space_sequencer.py
source/blender/editors/include/ED_sound.h [new file with mode: 0644]
source/blender/editors/sound/sound_intern.h
source/blender/editors/sound/sound_ops.c
source/blender/editors/space_api/spacetypes.c
source/blender/editors/space_image/image_ops.c

index 1498c37d7610f260be28a40e9a459b8ded21aa13..6b86ea5dabebf8143ed1aa4266e6b11b3a7cc542 100644 (file)
@@ -455,6 +455,29 @@ class SEQUENCER_PT_input(SequencerButtonsPanel):
                col.itemR(strip, "animation_start_offset", text="Start")
                col.itemR(strip, "animation_end_offset", text="End")
 
+class SEQUENCER_PT_sound(SequencerButtonsPanel):
+       __label__ = "Sound"
+       
+       def poll(self, context):
+               if context.space_data.display_mode != 'SEQUENCER':
+                       return False
+               
+               strip = act_strip(context)
+               if not strip:
+                       return False
+               
+               return strip.type in ('SOUND')
+       
+       def draw(self, context):
+               layout = self.layout
+               
+               strip = act_strip(context)
+               
+               layout.template_ID(strip, "sound", new="sound.open")
+               
+               layout.itemR(strip.sound, "filename")
+               layout.itemR(strip.sound, "caching")
+
 class SEQUENCER_PT_filter(SequencerButtonsPanel):
        __label__ = "Filter"
        
@@ -558,6 +581,7 @@ bpy.types.register(SEQUENCER_MT_strip)
 bpy.types.register(SEQUENCER_PT_edit) # sequencer panels
 bpy.types.register(SEQUENCER_PT_effect)
 bpy.types.register(SEQUENCER_PT_input)
+bpy.types.register(SEQUENCER_PT_sound)
 bpy.types.register(SEQUENCER_PT_filter)
 bpy.types.register(SEQUENCER_PT_proxy)
 
diff --git a/source/blender/editors/include/ED_sound.h b/source/blender/editors/include/ED_sound.h
new file mode 100644 (file)
index 0000000..584370b
--- /dev/null
@@ -0,0 +1,35 @@
+/**
+ * $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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ * 
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifndef ED_SOUND_H
+#define ED_SOUND_H
+
+void ED_operatortypes_sound(void);
+
+#endif /* ED_SOUND_H */
+
index b0d6abb3f00dc43860835554427a299fab345f6b..eb793a0b661b854e0a28dc95024bd0d73ccd2f69 100644 (file)
@@ -33,7 +33,5 @@ struct wmOperatorType;
 
 void SOUND_OT_open(wmOperatorType *ot);
 
-void sound_operatortype_init(void);
-
 #endif /* ED_SOUND_INTERN_H */
 
index 59bb9c5319c9d1fbc46849f7ba267f21360d394f..a23a28423efc0fff8c02c287a10fa709bb75969e 100644 (file)
@@ -38,6 +38,8 @@
 #include "BKE_report.h"
 #include "BKE_sound.h"
 
+#include "ED_sound.h"
+
 #include "RNA_access.h"
 #include "RNA_define.h"
 
@@ -84,7 +86,7 @@ static int open_invoke(bContext *C, wmOperator *op, wmEvent *event)
 void SOUND_OT_open(wmOperatorType *ot)
 {
        /* identifiers */
-       ot->name= "Open";
+       ot->name= "Open Sound";
        ot->idname= "SOUND_OT_open";
        ot->description= "Load a sound file into blender";
 
@@ -101,7 +103,7 @@ void SOUND_OT_open(wmOperatorType *ot)
 
 /* ******************************************************* */
 
-void sound_operatortype_init(void)
+void ED_operatortypes_sound(void)
 {
        WM_operatortype_append(SOUND_OT_open);
 }
index 61b6fe391aeb4b96d972e0651a32091df2955a9f..0d702144959c059ca212086402fecdb447095711 100644 (file)
@@ -51,6 +51,7 @@
 #include "ED_screen.h"
 #include "ED_sculpt.h"
 #include "ED_space_api.h"
+#include "ED_sound.h"
 #include "ED_uvedit.h"
 #include "ED_mball.h"
 
@@ -99,6 +100,7 @@ void ED_spacetypes_init(void)
        ED_operatortypes_metaball();
        ED_operatortypes_boids();
        ED_operatortypes_gpencil();
+       ED_operatortypes_sound();
        
        ui_view2d_operatortypes();
        
index d9f02a35142f37dd298505beb63abfdf879bc59f..7a39cd587eb761d80d3347b94f8d108b6c0362e8 100644 (file)
@@ -650,7 +650,7 @@ static int open_invoke(bContext *C, wmOperator *op, wmEvent *event)
 void IMAGE_OT_open(wmOperatorType *ot)
 {
        /* identifiers */
-       ot->name= "Open";
+       ot->name= "Open Image";
        ot->idname= "IMAGE_OT_open";
        
        /* api callbacks */