Bugfix #21032: sound strips could not be drag-n-dropped from filebrowser to sequencer
authorJoshua Leung <aligorith@gmail.com>
Tue, 9 Feb 2010 09:31:45 +0000 (09:31 +0000)
committerJoshua Leung <aligorith@gmail.com>
Tue, 9 Feb 2010 09:31:45 +0000 (09:31 +0000)
source/blender/editors/space_sequencer/space_sequencer.c

index 9949227234078307dd5f666ee3af97d291bcd21d..cb811d98fc91fc17f8a02c324e10c247738a53a7 100644 (file)
@@ -320,6 +320,14 @@ static int movie_drop_poll(bContext *C, wmDrag *drag, wmEvent *event)
        return 0;
 }
 
+static int sound_drop_poll(bContext *C, wmDrag *drag, wmEvent *event)
+{
+       if(drag->type==WM_DRAG_PATH)
+               if(ELEM(drag->icon, ICON_FILE_SOUND, ICON_FILE_BLANK))  /* rule might not work? */
+                       return 1;
+       return 0;
+}
+
 static void sequencer_drop_copy(wmDrag *drag, wmDropBox *drop)
 {
        /* copy drag path to properties */
@@ -333,6 +341,7 @@ static void sequencer_dropboxes(void)
        
        WM_dropbox_add(lb, "SEQUENCER_OT_image_strip_add", image_drop_poll, sequencer_drop_copy);
        WM_dropbox_add(lb, "SEQUENCER_OT_movie_strip_add", movie_drop_poll, sequencer_drop_copy);
+       WM_dropbox_add(lb, "SEQUENCER_OT_sound_strip_add", sound_drop_poll, sequencer_drop_copy);
 }
 
 /* ************* end drop *********** */