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:
authorPeter Schlaile <peter@schlaile.de>2007-04-04 10:27:36 +0400
committerPeter Schlaile <peter@schlaile.de>2007-04-04 10:27:36 +0400
commit7f526483fbeaafa1e3792022aa818538604d317a (patch)
tree9dcab37c0fb8cca1abd19594f3b63418ab9b2a57 /source/blender/src/editseq.c
parentd0bd8de9726644264aa4fb28b190a428f8bcabf9 (diff)
== Sequencer ==
Added patch #5231 Insert multiple movies / audio tracks in video sequence editor by Diego Borghetti. Opening several movie / audio (HD) tracks in the file selector results in adding them in a row to the timeline.
Diffstat (limited to 'source/blender/src/editseq.c')
-rw-r--r--source/blender/src/editseq.c95
1 files changed, 87 insertions, 8 deletions
diff --git a/source/blender/src/editseq.c b/source/blender/src/editseq.c
index 9ed75e5b12f..1677fe49c59 100644
--- a/source/blender/src/editseq.c
+++ b/source/blender/src/editseq.c
@@ -588,7 +588,9 @@ static Sequence *sfile_to_sequence(SpaceFile *sfile, int cfra, int machine, int
return seq;
}
-static void sfile_to_mv_sequence(SpaceFile *sfile, int cfra, int machine)
+
+static int sfile_to_mv_sequence_load(SpaceFile *sfile, int cfra,
+ int machine, int index )
{
Sequence *seq;
struct anim *anim;
@@ -601,14 +603,17 @@ static void sfile_to_mv_sequence(SpaceFile *sfile, int cfra, int machine)
totframe= 0;
strncpy(str, sfile->dir, FILE_MAXDIR-1);
- strncat(str, sfile->file, FILE_MAXDIR-1);
+ if(index<0)
+ strncat(str, sfile->file, FILE_MAXDIR-1);
+ else
+ strncat(str, sfile->filelist[index].relname, FILE_MAXDIR-1);
/* is it a movie? */
anim = openanim(str, IB_rect);
if(anim==0) {
error("The selected file is not a movie or "
"FFMPEG-support not compiled in!");
- return;
+ return(cfra);
}
totframe= IMB_anim_get_duration(anim);
@@ -638,7 +643,10 @@ static void sfile_to_mv_sequence(SpaceFile *sfile, int cfra, int machine)
strip->stripdata= se= MEM_callocN(totframe*sizeof(StripElem), "stripelem");
/* name movie in first strip */
- strncpy(se->name, sfile->file, FILE_MAXFILE-1);
+ if(index<0)
+ strncpy(se->name, sfile->file, FILE_MAXFILE-1);
+ else
+ strncpy(se->name, sfile->filelist[index].relname, FILE_MAXFILE-1);
for(a=1; a<=totframe; a++, se++) {
se->ok= 1;
@@ -647,6 +655,38 @@ static void sfile_to_mv_sequence(SpaceFile *sfile, int cfra, int machine)
/* last active name */
strncpy(last_imagename, seq->strip->dir, FILE_MAXDIR-1);
+ return(cfra+totframe);
+}
+
+static void sfile_to_mv_sequence(SpaceFile *sfile, int cfra, int machine)
+{
+ int a, totsel;
+
+ totsel= 0;
+ for(a= 0; a<sfile->totfile; a++) {
+ if(sfile->filelist[a].flags & ACTIVE) {
+ if ((sfile->filelist[a].type & S_IFDIR)==0) {
+ totsel++;
+ }
+ }
+ }
+
+ if((totsel==0) && (sfile->file[0])) {
+ cfra= sfile_to_mv_sequence_load(sfile, cfra, machine, -1);
+ return;
+ }
+
+ if(totsel==0) return;
+
+ /* ok. check all the select file, and load it. */
+ for(a= 0; a<sfile->totfile; a++) {
+ if(sfile->filelist[a].flags & ACTIVE) {
+ if ((sfile->filelist[a].type & S_IFDIR)==0) {
+ /* load and update current frame. */
+ cfra= sfile_to_mv_sequence_load(sfile, cfra, machine, a);
+ }
+ }
+ }
}
static Sequence *sfile_to_ramsnd_sequence(SpaceFile *sfile,
@@ -719,7 +759,8 @@ static Sequence *sfile_to_ramsnd_sequence(SpaceFile *sfile,
return seq;
}
-static void sfile_to_hdsnd_sequence(SpaceFile *sfile, int cfra, int machine)
+static int sfile_to_hdsnd_sequence_load(SpaceFile *sfile, int cfra,
+ int machine, int index)
{
Sequence *seq;
struct hdaudio *hdaudio;
@@ -732,14 +773,17 @@ static void sfile_to_hdsnd_sequence(SpaceFile *sfile, int cfra, int machine)
totframe= 0;
strncpy(str, sfile->dir, FILE_MAXDIR-1);
- strncat(str, sfile->file, FILE_MAXDIR-1);
+ if(index<0)
+ strncat(str, sfile->file, FILE_MAXDIR-1);
+ else
+ strncat(str, sfile->filelist[index].relname, FILE_MAXDIR-1);
/* is it a sound file? */
hdaudio = sound_open_hdaudio(str);
if(hdaudio==0) {
error("The selected file is not a sound file or "
"FFMPEG-support not compiled in!");
- return;
+ return(cfra);
}
totframe= sound_hdaudio_get_duration(hdaudio, G.scene->r.frs_sec);
@@ -768,7 +812,10 @@ static void sfile_to_hdsnd_sequence(SpaceFile *sfile, int cfra, int machine)
strip->stripdata= se= MEM_callocN(totframe*sizeof(StripElem), "stripelem");
/* name movie in first strip */
- strncpy(se->name, sfile->file, FILE_MAXFILE-1);
+ if(index<0)
+ strncpy(se->name, sfile->file, FILE_MAXFILE-1);
+ else
+ strncpy(se->name, sfile->filelist[index].relname, FILE_MAXFILE-1);
for(a=1; a<=totframe; a++, se++) {
se->ok= 2;
@@ -778,6 +825,38 @@ static void sfile_to_hdsnd_sequence(SpaceFile *sfile, int cfra, int machine)
/* last active name */
strncpy(last_sounddir, seq->strip->dir, FILE_MAXDIR-1);
+ return(cfra+totframe);
+}
+
+static void sfile_to_hdsnd_sequence(SpaceFile *sfile, int cfra, int machine)
+{
+ int totsel, a;
+
+ totsel= 0;
+ for(a= 0; a<sfile->totfile; a++) {
+ if(sfile->filelist[a].flags & ACTIVE) {
+ if((sfile->filelist[a].type & S_IFDIR)==0) {
+ totsel++;
+ }
+ }
+ }
+
+ if((totsel==0) && (sfile->file[0])) {
+ cfra= sfile_to_hdsnd_sequence_load(sfile, cfra, machine, -1);
+ return;
+ }
+
+ if(totsel==0) return;
+
+ /* ok, check all the select file, and load it. */
+ for(a= 0; a<sfile->totfile; a++) {
+ if(sfile->filelist[a].flags & ACTIVE) {
+ if((sfile->filelist[a].type & S_IFDIR)==0) {
+ /* load and update current frame. */
+ cfra= sfile_to_hdsnd_sequence_load(sfile, cfra, machine, a);
+ }
+ }
+ }
}