[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18476] branches/blender2.5/blender/source /blender/editors/space_sequencer: 2.5
Ton Roosendaal
ton at blender.org
Tue Jan 13 12:41:52 CET 2009
Revision: 18476
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18476
Author: ton
Date: 2009-01-13 12:41:52 +0100 (Tue, 13 Jan 2009)
Log Message:
-----------
2.5
Renamed sequencer file to conform editor specs.
Couldn't yesterday, svn refused for some reason :)
Added Paths:
-----------
branches/blender2.5/blender/source/blender/editors/space_sequencer/sequencer_edit.c
Removed Paths:
-------------
branches/blender2.5/blender/source/blender/editors/space_sequencer/editseq.c
Deleted: branches/blender2.5/blender/source/blender/editors/space_sequencer/editseq.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_sequencer/editseq.c 2009-01-13 09:48:25 UTC (rev 18475)
+++ branches/blender2.5/blender/source/blender/editors/space_sequencer/editseq.c 2009-01-13 11:41:52 UTC (rev 18476)
@@ -1,3985 +0,0 @@
-/**
- * $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) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * Contributor(s): Blender Foundation, 2003-2009
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-#ifndef WIN32
-#include <unistd.h>
-#else
-#include <io.h>
-#endif
-#include <sys/types.h>
-
-#include "MEM_guardedalloc.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-#include "BLI_storage_types.h"
-
-#include "IMB_imbuf_types.h"
-#include "IMB_imbuf.h"
-
-#include "DNA_ipo_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_sequence_types.h"
-#include "DNA_view2d_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_sound_types.h"
-
-#include "BKE_context.h"
-#include "BKE_global.h"
-#include "BKE_image.h"
-#include "BKE_library.h"
-#include "BKE_main.h"
-#include "BKE_plugin_types.h"
-#include "BKE_sequence.h"
-#include "BKE_scene.h"
-#include "BKE_utildefines.h"
-
-#include "BIF_gl.h"
-#include "BIF_glutil.h"
-
-#include "WM_types.h"
-
-#include "ED_anim_api.h"
-#include "ED_space_api.h"
-#include "ED_types.h"
-
-#include "UI_interface.h"
-#include "UI_resources.h"
-#include "UI_view2d.h"
-
-/* own include */
-#include "sequencer_intern.h"
-
-/* XXX */
-static Sequence *_last_seq=0;
-static int _last_seq_init=0;
-/* XXX */
-static void BIF_undo_push() {}
-static void error() {}
-static void waitcursor() {}
-static void activate_fileselect() {}
-static void std_rmouse_transform() {}
-static int get_mbut() {return 0;}
-static int pupmenu() {return 0;}
-static int pupmenu_col() {return 0;}
-static int okee() {return 0;}
-static void *find_nearest_marker() {return NULL;}
-static void deselect_markers() {}
-static void transform_markers() {}
-static void transform_seq_nomarker() {}
-#define SCE_MARKERS 0
-/* XXX */
-
-
-#ifdef WIN32
-char last_imagename[FILE_MAXDIR+FILE_MAXFILE]= "c:\\";
-#else
-char last_imagename[FILE_MAXDIR+FILE_MAXFILE]= "/";
-#endif
-
-char last_sounddir[FILE_MAXDIR+FILE_MAXFILE]= "";
-
-#define SEQ_DESEL ~(SELECT+SEQ_LEFTSEL+SEQ_RIGHTSEL)
-
-typedef struct TransSeq {
- int start, machine;
- int startstill, endstill;
- int startdisp, enddisp;
- int startofs, endofs;
- int final_left, final_right;
- int len;
-} TransSeq;
-
-Sequence *get_last_seq(Scene *scene)
-{
- if(!_last_seq_init) {
- Editing *ed;
- Sequence *seq;
- Sequence *l_sel = NULL;
- Sequence *l_act = NULL;
-
- ed= scene->ed;
- if(!ed) return NULL;
-
- for(seq= ed->seqbasep->first; seq; seq=seq->next) {
- if(seq->flag & SEQ_ACTIVE)
- l_act = seq;
- if(seq->flag & SELECT)
- l_sel = seq;
- }
-
- if (l_act) {
- _last_seq = l_act;
- } else {
- _last_seq = l_sel;
- }
-
- if (_last_seq) {
- _last_seq->flag |= SEQ_ACTIVE;
- }
-
- _last_seq_init = 1;
- }
-
- return _last_seq;
-}
-
-void set_last_seq(Sequence *seq)
-{
- if (_last_seq_init && _last_seq) {
- _last_seq->flag &= ~SEQ_ACTIVE;
- }
-
- _last_seq = seq;
- _last_seq_init = 1;
-
- if (_last_seq) {
- _last_seq->flag |= SEQ_ACTIVE;
- }
-}
-
-void clear_last_seq()
-{
- if (_last_seq_init && _last_seq) {
- _last_seq->flag &= ~SEQ_ACTIVE;
- }
- _last_seq = NULL;
- _last_seq_init = 0;
-}
-
-Sequence *get_forground_frame_seq(Scene *scene, int frame)
-{
- Editing *ed;
- Sequence *seq, *best_seq=NULL;
- int best_machine = -1;
- ed= scene->ed;
- if(!ed) return NULL;
-
- for (seq=ed->seqbasep->first; seq; seq= seq->next) {
- if(seq->startdisp > frame || seq->enddisp <= frame)
- continue;
- /* only use elements you can see - not */
- if (ELEM6(seq->type, SEQ_IMAGE, SEQ_META, SEQ_SCENE, SEQ_MOVIE, SEQ_MOVIE_AND_HD_SOUND, SEQ_COLOR)) {
- if (seq->machine > best_machine) {
- best_seq = seq;
- best_machine = seq->machine;
- }
- }
- }
- return best_seq;
-}
-
-/* seq funcs's for transforming internally
- notice the difference between start/end and left/right.
-
- left and right are the bounds at which the sequence is rendered,
-start and end are from the start and fixed length of the sequence.
-*/
-int seq_tx_get_start(Sequence *seq) {
- return seq->start;
-}
-int seq_tx_get_end(Sequence *seq)
-{
- return seq->start+seq->len;
-}
-
-int seq_tx_get_final_left(Sequence *seq, int metaclip)
-{
- if (metaclip && seq->tmp) {
- /* return the range clipped by the parents range */
- return MAX2( seq_tx_get_final_left(seq, 0), seq_tx_get_final_left((Sequence *)seq->tmp, 1) );
- } else {
- return (seq->start - seq->startstill) + seq->startofs;
- }
-
-}
-int seq_tx_get_final_right(Sequence *seq, int metaclip)
-{
- if (metaclip && seq->tmp) {
- /* return the range clipped by the parents range */
- return MIN2( seq_tx_get_final_right(seq, 0), seq_tx_get_final_right((Sequence *)seq->tmp, 1) );
- } else {
- return ((seq->start+seq->len) + seq->endstill) - seq->endofs;
- }
-}
-
-void seq_tx_set_final_left(Sequence *seq, int val)
-{
- if (val < (seq)->start) {
- seq->startstill = abs(val - (seq)->start);
- (seq)->startofs = 0;
- } else {
- seq->startofs = abs(val - (seq)->start);
- seq->startstill = 0;
- }
-}
-
-void seq_tx_set_final_right(Sequence *seq, int val)
-{
- if (val > (seq)->start + (seq)->len) {
- seq->endstill = abs(val - (seq->start + (seq)->len));
- (seq)->endofs = 0;
- } else {
- seq->endofs = abs(val - ((seq)->start + (seq)->len));
- seq->endstill = 0;
- }
-}
-
-/* check if one side can be transformed */
-int seq_tx_check_left(Sequence *seq)
-{
- if (seq->flag & SELECT) {
- if (seq->flag & SEQ_LEFTSEL)
- return 1;
- else if (seq->flag & SEQ_RIGHTSEL)
- return 0;
-
- return 1; /* selected and neither left or right handles are, so let us move both */
- }
- return 0;
-}
-
-int seq_tx_check_right(Sequence *seq)
-{
- if (seq->flag & SELECT) {
- if (seq->flag & SEQ_RIGHTSEL)
- return 1;
- else if (seq->flag & SEQ_LEFTSEL)
- return 0;
-
- return 1; /* selected and neither left or right handles are, so let us move both */
- }
- return 0;
-}
-
-/* used so we can do a quick check for single image seq
- since they work a bit differently to normal image seq's (during transform) */
-int check_single_seq(Sequence *seq)
-{
- if ( seq->len==1 && (seq->type == SEQ_IMAGE || seq->type == SEQ_COLOR))
- return 1;
- else
- return 0;
-}
-
-static void fix_single_image_seq(Sequence *seq)
-{
- int left, start, offset;
- if (!check_single_seq(seq))
- return;
-
- /* make sure the image is always at the start since there is only one,
- adjusting its start should be ok */
- left = seq_tx_get_final_left(seq, 0);
- start = seq->start;
- if (start != left) {
- offset = left - start;
- seq_tx_set_final_left( seq, seq_tx_get_final_left(seq, 0) - offset );
- seq_tx_set_final_right( seq, seq_tx_get_final_right(seq, 0) - offset );
- seq->start += offset;
- }
-}
-
-int test_overlap_seq(Scene *scene, Sequence *test)
-{
- Sequence *seq;
- Editing *ed;
-
- ed= scene->ed;
- if(ed==NULL) return 0;
-
- seq= ed->seqbasep->first;
- while(seq) {
- if(seq!=test) {
- if(test->machine==seq->machine) {
- if(test->depth==seq->depth) {
- if( (test->enddisp <= seq->startdisp) || (test->startdisp >= seq->enddisp) );
- else return 1;
- }
- }
- }
- seq= seq->next;
- }
- return 0;
-}
-
-void shuffle_seq(Scene *scene, Sequence *test)
-{
- Editing *ed;
- Sequence *seq;
- int a, start;
-
- ed= scene->ed;
- if(ed==NULL) return;
-
- /* is there more than 1 select: only shuffle y */
- a=0;
- seq= ed->seqbasep->first;
- while(seq) {
- if(seq->flag & SELECT) a++;
- seq= seq->next;
- }
-
- if(a<2 && test->type==SEQ_IMAGE) {
- start= test->start;
-
- for(a= 1; a<50; a++) {
- test->start= start+a;
- calc_sequence(test);
- if( test_overlap_seq(scene, test)==0) return;
- test->start= start-a;
- calc_sequence(test);
- if( test_overlap_seq(scene, test)==0) return;
- }
- test->start= start;
- }
-
- test->machine++;
- calc_sequence(test);
- while( test_overlap_seq(scene, test) ) {
- if(test->machine >= MAXSEQ) {
- error("There is no more space to add a sequence strip");
-
- BLI_remlink(ed->seqbasep, test);
- seq_free_sequence(test);
- return;
- }
- test->machine++;
- calc_sequence(test);
- }
-}
-
-static void change_plugin_seq(Scene *scene, char *str) /* called from fileselect */
-{
- struct SeqEffectHandle sh;
- Sequence *last_seq= get_last_seq(scene);
-
- if(last_seq && last_seq->type != SEQ_PLUGIN) return;
-
- sh = get_sequence_effect(last_seq);
- sh.free(last_seq);
- sh.init_plugin(last_seq, str);
-
- last_seq->machine = MAX3(last_seq->seq1->machine,
- last_seq->seq2->machine,
- last_seq->seq3->machine);
-
- if( test_overlap_seq(scene, last_seq) ) shuffle_seq(scene, last_seq);
-
- BIF_undo_push("Load/Change Plugin, Sequencer");
-}
-
-
-void boundbox_seq(Scene *scene, rctf *rect)
-{
- Sequence *seq;
- Editing *ed;
- float min[2], max[2];
-
- ed= scene->ed;
- if(ed==NULL) return;
-
- min[0]= 0.0;
- max[0]= EFRA+1;
- min[1]= 0.0;
- max[1]= 8.0;
-
- seq= ed->seqbasep->first;
- while(seq) {
-
- if( min[0] > seq->startdisp-1) min[0]= seq->startdisp-1;
- if( max[0] < seq->enddisp+1) max[0]= seq->enddisp+1;
- if( max[1] < seq->machine+2.0) max[1]= seq->machine+2.0;
-
- seq= seq->next;
- }
-
- rect->xmin= min[0];
- rect->xmax= max[0];
- rect->ymin= min[1];
- rect->ymax= max[1];
-
-}
-
-int sequence_is_free_transformable(Sequence * seq)
-{
- return seq->type < SEQ_EFFECT
- || (get_sequence_effect_num_inputs(seq->type) == 0);
-}
-
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list