diff options
author | Wouter van Heyst <larstiq-bforge@larstiq.dyndns.org> | 2003-07-14 00:16:56 +0400 |
---|---|---|
committer | Wouter van Heyst <larstiq-bforge@larstiq.dyndns.org> | 2003-07-14 00:16:56 +0400 |
commit | 4f273867403672b3970ff8879afe8459827f172a (patch) | |
tree | 75476eed3e2e70481dcc38a2f10c51805b8ab305 /source/blender/makesdna | |
parent | 9cb79c6534ae4a1c51571d59fe93d41706cd2dc3 (diff) |
Commit message and the brunt of the code courtesy of intrr, apologies for the
size of this;
Finally, the Sequencer audio support and global audio/animation sync stuff!
(See http://intrr.org/blender/audiosequencer.html)
Stuff that has been done:
./source/blender/blenloader/intern/writefile.c
./source/blender/blenloader/intern/readfile.c
Added code to make it handle sounds used by audio strips, and to convert
Scene data from older (<2.28) versions to init Scene global audio settings
(Scene->audio) to defaults.
./source/blender/include/BSE_seqaudio.h
./source/blender/src/seqaudio.c
The main audio routines that start/stop/scrub the audio stream at
a certain frame position, provide the frame reference for the current
stream position, mix the audio, convert the audio, mixdown the audio
into a file.
./source/blender/makesdna/DNA_sound_types.h
Introduced new variables in the bSound struct to accomodate the sample
data after converted to the scene's global mixing format (stream, streamlen).
Also added a new flag SOUND_FLAGS_SEQUENCE that gets set if the Sound
belongs to a sequence strip.
./source/blender/makesdna/DNA_scene_types.h
Added AudioData struct, which holds scene-global audio settings.
./source/blender/makesdna/DNA_sequence_types.h
Added support for audio strips. Some variables to hold Panning/Attenuation
information, position information, reference to the sample, and some flags.
./source/blender/makesdna/DNA_userdef_types.h
./source/blender/src/usiblender.c
Added a "Mixing buffer size" userpref. Made the versions stuff initialize
it to a default for versions <2.28.
./source/blender/makesdna/DNA_space_types.h
./source/blender/src/filesel.c
Added a Cyan dot to .WAV files. Any other suggestions on a better color? :)
./source/blender/src/editsound.c
Changes (fixes) to the WAV file loader, re-enabled some gameengine code that
is needed for dealing with bSounds and bSamples.
./source/blender/src/editipo.c
./source/blender/src/drawseq.c
./source/blender/src/editnla.c
./source/blender/src/space.c
./source/blender/src/drawview.c
./source/blender/src/renderwin.c
./source/blender/src/headerbuttons.c
- Created two different wrappers for update_for_newframe(), one which scrubs
the audio, one which doesn't.
- Replaced some of the occurences of update_for_newframe() with
update_for_newframe_muted(), which doesn't scrub the audio.
- In drawview.c: Changed the synchronization scheme to get the current audio
position from the audio engine, and use that as a reference for setting
CFRA. Implements a/v sync and framedrop.
- In editipo.c: Changed handling of Fac IPOs to be usable for audio strips as
volume envelopes.
- In space.c: Added the mixing buffer size Userpref, enabled audio scrubbing
(update_for_newframe()) for moving the sequence editor framebar.
./source/blender/src/editseq.c
Added support for audio strips and a default directory for WAV files which
gets saved from the last Shift-A operation.
./source/blender/src/buttons.c
Added Scene-global audio sequencer settings in Sound buttons.
./source/blender/src/sequence.c
Various stuff that deals with handling audio strips differently than
usual strips.
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r-- | source/blender/makesdna/DNA_scene_types.h | 12 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_sequence_types.h | 12 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_sound_types.h | 9 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_space_types.h | 1 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_userdef_types.h | 1 |
5 files changed, 30 insertions, 5 deletions
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index c15b34def92..7ce8447da6a 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -92,6 +92,12 @@ typedef struct QuicktimeCodecData { char qtcodecname[128]; } QuicktimeCodecData; +typedef struct AudioData { + int mixrate; + float main; /* Main mix in dB */ + short flag; + short pad[3]; +} AudioData; typedef struct RenderData { struct AviCodecData *avicodecdata; @@ -243,6 +249,7 @@ typedef struct Scene { /* migrate or replace? depends on some internal things... */ /* no, is on the right place (ton) */ struct RenderData r; + struct AudioData audio; ScriptLink scriptlink; } Scene; @@ -354,6 +361,11 @@ typedef struct Scene { #define F_SET 2 #define F_DUPLI 3 +/* audio->flag */ +#define AUDIO_MUTE 1 +#define AUDIO_SYNC 2 +#define AUDIO_SCRUB 4 + #ifdef __cplusplus } #endif diff --git a/source/blender/makesdna/DNA_sequence_types.h b/source/blender/makesdna/DNA_sequence_types.h index f3827f5e0b2..efc145da8f6 100644 --- a/source/blender/makesdna/DNA_sequence_types.h +++ b/source/blender/makesdna/DNA_sequence_types.h @@ -36,6 +36,9 @@ #include "DNA_listBase.h" +/* needed for sound support */ +#include "DNA_sound_types.h" + struct Ipo; struct Scene; @@ -111,9 +114,12 @@ typedef struct Sequence { /* meta */ ListBase seqbase; + struct bSound *sound; /* the linked "bSound" object */ + float level, pan; /* level in dB (0=full), pan -1..1 */ + int curpos; /* last sample position in audio_fill() */ + int pad; + } Sequence; - - # # typedef struct MetaStack { @@ -137,12 +143,14 @@ typedef struct Editing { #define SEQ_RIGHTSEL 4 #define SEQ_OVERLAP 8 #define SEQ_FILTERY 16 +#define SEQ_MUTE 32 /* seq->type WATCH IT: BIT 3!!! */ #define SEQ_IMAGE 0 #define SEQ_META 1 #define SEQ_SCENE 2 #define SEQ_MOVIE 3 +#define SEQ_SOUND 4 #define SEQ_EFFECT 8 #define SEQ_CROSS 8 diff --git a/source/blender/makesdna/DNA_sound_types.h b/source/blender/makesdna/DNA_sound_types.h index 41429a0217e..8f91cb81e47 100644 --- a/source/blender/makesdna/DNA_sound_types.h +++ b/source/blender/makesdna/DNA_sound_types.h @@ -73,6 +73,7 @@ typedef struct bSound { ID id; char name[160]; struct bSample *sample; + void *stream; struct PackedFile *packedfile; struct PackedFile *newpackedfile; void *snd_sound; @@ -101,12 +102,12 @@ typedef struct bSound { */ float distance; int flags; + int streamlen; // unsigned int loopstart; // unsigned int loopend; char channels; char highprio; - char pad[6]; - + char pad[10]; } bSound; typedef struct bSoundListener { @@ -169,7 +170,8 @@ enum SOUND_FLAGS_BITS { SOUND_FLAGS_FIXED_PANNING_BIT, SOUND_FLAGS_3D_BIT, SOUND_FLAGS_BIDIRECTIONAL_LOOP_BIT, - SOUND_FLAGS_PRIORITY_BIT + SOUND_FLAGS_PRIORITY_BIT, + SOUND_FLAGS_SEQUENCE_BIT }; #define SOUND_FLAGS_LOOP (1 << SOUND_FLAGS_LOOP_BIT) @@ -178,6 +180,7 @@ enum SOUND_FLAGS_BITS { #define SOUND_FLAGS_3D (1 << SOUND_FLAGS_3D_BIT) #define SOUND_FLAGS_BIDIRECTIONAL_LOOP (1 << SOUND_FLAGS_BIDIRECTIONAL_LOOP_BIT) #define SOUND_FLAGS_PRIORITY (1 << SOUND_FLAGS_PRIORITY_BIT) +#define SOUND_FLAGS_SEQUENCE (1 << SOUND_FLAGS_SEQUENCE_BIT) enum SAMPLE_FLAGS_BITS { SAMPLE_NEEDS_SAVE_BIT = 0 diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 59fa9e07604..a3b2e857417 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -396,6 +396,7 @@ typedef struct SpaceImaSel { #define MOVIEFILE 32 #define PYSCRIPTFILE 64 #define FTFONTFILE 128 +#define SOUNDFILE 256 #define SCROLLH 16 /* height scrollbar */ #define SCROLLB 16 /* width scrollbar */ diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 2d2ba593513..5a329749708 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -53,6 +53,7 @@ typedef struct UserDef { int userpref; short console_buffer; //console vars here for tuhopuu compat, --phase short console_out; + int mixbufsize; int fontsize; short encoding; short transopts; |