Vitor Sessak a écrit :
>
> Changing a little bit the subject, I suggest that after you take into
> account all the feedback you had, you send a new patchset, this time
> containing just the headers for the BSS (and _only_ the BSS, without a
> single code line or define that belongs to the player!), so we can
> give a second round of reviewing.
So here is it, I merged them all into one to avoid flooding the ML.
They're getting small enough now, to merge them all into one, I think!
--
Best regards,
:-) Basty/CDGS (-:
diff --git a/libavsequencer/instr.h b/libavsequencer/instr.h
index 9811cfd..bf10925 100755
--- a/libavsequencer/instr.h
+++ b/libavsequencer/instr.h
@@ -210,10 +210,17 @@ typedef struct AVSequencerInstrument {
* name, artist and comment. */
AVMetadata *metadata;
- /** Array of pointers containing every sample used by this
- instrument. */
+ /** Array (of size samples) of pointers containing every sample
+ used by this instrument. */
AVSequencerSample **sample_list;
+ /** Number of samples associated with this instrument
+ (a maximum number of 255 attached samples is allowed).
+ The default is one attached sample. */
+ uint8_t samples;
+#define AVSEQ_INSTRUMENT_SAMPLES 1
+#define AVSEQ_INSTRUMENT_SAMPLES_MAX 255
+
/** Pointer to envelope data interpreted as volume control
or NULL if volume envelope control is not used. */
AVSequencerEnvelope *volume_env;
@@ -259,13 +266,6 @@ typedef struct AVSequencerInstrument {
the octave/instrument-pair to an associated sample. */
AVSequencerKeyboard *keyboard_defs;
- /** Number of samples associated with this instrument
- (a maximum number of 255 attached samples is allowed).
- The default is one attached sample. */
- uint8_t samples;
-#define AVSEQ_INSTRUMENT_SAMPLES 1
-#define AVSEQ_INSTRUMENT_SAMPLES_MAX 255
-
/** Global volume scaling instrument samples. */
uint8_t global_volume;
diff --git a/libavsequencer/module.h b/libavsequencer/module.h
index 1b3323c..825603e 100755
--- a/libavsequencer/module.h
+++ b/libavsequencer/module.h
@@ -42,46 +42,49 @@ typedef struct AVSequencerModule {
/** AVSequencerPlayerChannel pointer to virtual channel data. */
AVSequencerPlayerChannel *channel_data;
- /** Array of pointers containing every sub-song for this
- module. */
- AVSequencerSong **song_list;
-
- /** Array of pointers containing every instrument for this
- module. */
- AVSequencerInstrument **instrument_list;
-
- /** Array of pointers containing every evelope for this
- module. */
- AVSequencerEnvelope **envelope_list;
-
- /** Array of pointers containing every keyboard definitionb list
+ /** Array (of size songs) of pointers containing every sub-song
for this module. */
- AVSequencerKeyboard **keyboard_list;
-
- /** Array of pointers containing every arpeggio envelope
- definition list for this module. */
- AVSequencerArpeggio **arpeggio_list;
-
- /** Duration of the module, in AV_TIME_BASE fractional
- seconds. This is the total sum of all sub-song durations
- this module contains. */
- uint64_t duration;
+ AVSequencerSong **song_list;
/** Number of sub-songs attached to this module. */
uint16_t songs;
+ /** Array (of size instruments) of pointers containing every
+ instrument for this module. */
+ AVSequencerInstrument **instrument_list;
+
/** Number of instruments attached to this module. */
uint16_t instruments;
+ /** Array (of size envelopes) of pointers containing every
+ evelope for this module. */
+ AVSequencerEnvelope **envelope_list;
+
/** Number of envelopes attached to this module. */
uint16_t envelopes;
+ /** Array (of size keyboards) of pointers containing every
+ keyboard definitionb list for this module. */
+ AVSequencerKeyboard **keyboard_list;
+
/** Number of keyboard definitions attached to this module. */
uint16_t keyboards;
+ /** Array (of size arpeggios) of pointers containing every
+ arpeggio envelope definition list for this module. */
+ AVSequencerArpeggio **arpeggio_list;
+
/** Number of arpeggio definitions attached to this module. */
uint16_t arpeggios;
+ /** Forced duration of the module, in AV_TIME_BASE fractional
+ seconds. This is the total sum of all sub-song durations
+ this module contains or zero if the duration is unknown and
+ also cannot be automatically determined. The composer then can
+ set manually a duration after which the player can skip over to
+ the next module if it is playing back in once mode. */
+ uint64_t forced_duration;
+
/** Maximum number of virtual channels, including NNA (New Note
Action) background channels to be allocated and processed by
the mixing engine (defaults to 64). */
diff --git a/libavsequencer/order.h b/libavsequencer/order.h
index 853984d..091fe7d 100644
--- a/libavsequencer/order.h
+++ b/libavsequencer/order.h
@@ -33,8 +33,8 @@
* version bump.
*/
typedef struct AVSequencerOrderList {
- /** Array of pointers containing all order list data used by this
- channel. */
+ /** Array (of size orders) of pointers containing all order list
+ data used by this channel. */
AVSequencerOrderData **order_data;
/** Number of order list data used for this channel. */
@@ -78,14 +78,6 @@ typedef struct AVSequencerOrderList {
uint8_t channel_sub_panning;
#define AVSEQ_ORDER_LIST_SUB_PANNING 0
- /** Compatibility flags for playback. There are rare cases
- where order handling can not be mapped into internal
- playback engine and have to be handled specially. For
- each order list which needs this, this will define new
- flags which tag the player to handle it to that special
- way. */
- uint8_t compat_flags;
-
/** Order list playback flags. Some sequencers feature
surround panning or allow initial muting. which has to
be taken care specially in the internal playback engine.
@@ -156,7 +148,9 @@ typedef struct AVSequencerOrderData {
mapped to this if this is non-zero. */
int16_t instr_transpose;
- /** Tempo change or zero to skip tempo change. */
+ /** Tempo change or zero to skip tempo change. A tempo value of
+ zero would be zero, since that would mean literally execute
+ unlimited rows and tracks in just one tick. */
uint16_t tempo;
/** Played nesting level (GoSub command maximum nesting depth). */
@@ -164,7 +158,9 @@ typedef struct AVSequencerOrderData {
/** Track volume (this overrides settings in AVSequencerTrack).
To enable this, the flag AVSEQ_ORDER_DATA_FLAG_SET_VOLUME
- must be set in flags. */
+ must be set in flags. This allows have a basic default track
+ volume by still allowing to override the track volume in case
+ the track is used multiple times, e.g. for creating echoes. */
uint8_t volume;
/** Track sub-volume. This is basically track volume
diff --git a/libavsequencer/player.h b/libavsequencer/player.h
index c24e9db..3aec459 100644
--- a/libavsequencer/player.h
+++ b/libavsequencer/player.h
@@ -1370,18 +1370,18 @@ typedef struct AVSequencerPlayerHostChannel {
no previous envelope. */
AVSequencerEnvelope *prev_auto_pan_env;
- /** Array of pointers containing attached waveforms used by this
- host channel. */
+ /** Array (of size waveforms) of pointers containing attached
+ waveforms used by this host channel. */
AVSequencerSynthWave **waveform_list;
+ /** Number of attached waveforms used by this host channel. */
+ uint16_t waveforms;
+
/** Pointer to player synth sound definition for the
current host channel for obtaining the synth
sound code. */
AVSequencerSynth *synth;
- /** Number of attached waveforms used by this host channel. */
- uint16_t waveforms;
-
/** Current entry position (line number) of volume [0], panning
[1], slide [2] and special [3] handling code or 0 if the
current sample does not use synth sound. */
@@ -1681,10 +1681,13 @@ typedef struct AVSequencerPlayerChannel {
octave * 12 + current note where C-0 equals to one. */
uint8_t sample_note;
- /** Array of pointers containing attached waveforms used by this
- virtual channel. */
+ /** Array (of size waveforms) of pointers containing attached
+ waveforms used by this virtual channel. */
AVSequencerSynthWave **waveform_list;
+ /** Number of attached waveforms used by this virtual channel. */
+ uint16_t waveforms;
+
/** Pointer to sequencer sample synth sound currently being played
by this virtual channel for obtaining the synth sound code. */
AVSequencerSynth *synth;
@@ -1709,9 +1712,6 @@ typedef struct AVSequencerPlayerChannel {
sound currently being played by this virtual channel. */
AVSequencerPlayerSynthWave *arpeggio_waveform;
- /** Number of attached waveforms used by this virtual channel. */
- uint16_t waveforms;
-
/** Current entry position (line number) of volume [0], panning
[1], slide [2] and special [3] handling code or 0 if the
current sample does not use synth sound. */
diff --git a/libavsequencer/song.h b/libavsequencer/song.h
index 9ddb346..5c8e8e6 100755
--- a/libavsequencer/song.h
+++ b/libavsequencer/song.h
@@ -49,23 +49,26 @@ typedef struct AVSequencerSong {
/** AVSequencerOrderList pointer to list of order data. */
AVSequencerOrderList *order_list;
- /** Array of pointers containing all tracks for this sub-song. */
+ /** Array (of size tracks) of pointers containing all tracks for
+ this sub-song. */
AVSequencerTrack **track_list;
+ /** Number of tracks attached to this sub-song. */
+ uint16_t tracks;
+
/** Duration of this sub-song, in AV_TIME_BASE fractional
seconds. */
uint64_t duration;
- /** Number of tracks attached to this sub-song. */
- uint16_t tracks;
-
/** Stack size, i.e. maximum recursion depth of GoSub command which
defaults to 4. */
uint16_t gosub_stack_size;
#define AVSEQ_SONG_GOSUB_STACK 4
/** Stack size, i.e. maximum recursion depth of the pattern loop
- command, which defaults to 1 to imitate most trackers. */
+ command, which defaults to 1 to imitate most trackers (most
+ trackers do not even support any other value than one, i.e.
+ the pattern loop command is not nestable). */
uint16_t loop_stack_size;
#define AVSEQ_SONG_PATTERN_LOOP_STACK 1
@@ -100,7 +103,9 @@ typedef struct AVSequencerSong {
#define AVSEQ_SONG_CHANNELS_MAX 256
/** Initial number of frames per row, i.e. sequencer tempo
- (defaults to 6 as in most tracker formats). */
+ (defaults to 6 as in most tracker formats), a value of
+ zero is pointless, since that would mean to play unlimited
+ rows and tracks in just one tick. */
uint16_t frames;
#define AVSEQ_SONG_FRAMES 6
@@ -128,12 +133,17 @@ typedef struct AVSequencerSong {
#define AVSEQ_SONG_BPM_SPEED 125
/** Minimum and lower limit of number of frames per row
- (defaults to 1). */
+ (defaults to 1), a value of zero is pointless, since
+ that would mean to play unlimited rows and tracks in
+ just one tick. */
uint16_t frames_min;
#define AVSEQ_SONG_FRAMES_MIN 1
/** Maximum and upper limit of number of frames per row
- (defaults to 255). */
+ (defaults to 255) since a larger value would not make
+ sense (see track effects, they all set 8-bit values only),
+ if we would allow a higher speed here, we could never
+ change the speed values which are larger than 255. */
uint16_t frames_max;
#define AVSEQ_SONG_FRAMES_MAX 255
@@ -143,7 +153,10 @@ typedef struct AVSequencerSong {
#define AVSEQ_SONG_SPD_MIN 1
/** Maximum and upper limit of MED style SPD timing values
- (defaults to 255). */
+ (defaults to 255) since a larger value would not make
+ sense (see track effects, they all set 8-bit values only),
+ if we would allow a higher speed here, we could never
+ change the speed values which are larger than 255. */
uint16_t spd_max;
#define AVSEQ_SONG_SPD_MAX 255
@@ -153,7 +166,10 @@ typedef struct AVSequencerSong {
#define AVSEQ_SONG_BPM_TEMPO_MIN 1
/** Maximum and upper limit of rows per beat timing values
- (defaults to 255). */
+ (defaults to 255) since a larger value would not make
+ sense (see track effects, they all set 8-bit values only),
+ if we would allow a higher speed here, we could never
+ change the speed values which are larger than 255. */
uint16_t bpm_tempo_max;
#define AVSEQ_SONG_BPM_TEMPO_MAX 255
@@ -163,7 +179,10 @@ typedef struct AVSequencerSong {
#define AVSEQ_SONG_BPM_SPEED_MIN 1
/** Maximum and upper limit of beats per minute timing values
- (defaults to 255). */
+ (defaults to 255) since a larger value would not make
+ sense (see track effects, they all set 8-bit values only),
+ if we would allow a higher speed here, we could never
+ change the speed values which are larger than 255. */
uint16_t bpm_speed_max;
#define AVSEQ_SONG_BPM_SPEED_MAX 255
diff --git a/libavsequencer/synth.h b/libavsequencer/synth.h
index 95d4699..8f8feaf 100755
--- a/libavsequencer/synth.h
+++ b/libavsequencer/synth.h
@@ -1221,26 +1221,26 @@ typedef struct AVSequencerSynth {
* artist and comment. */
AVMetadata *metadata;
- /** Array of pointers containing attached waveform used by this
- synth sound. */
+ /** Array (of size waveforms) of pointers containing attached
+ waveform used by this synth sound. */
AVSequencerSynthWave **waveform_list;
- /** Array of pointers containing named symbols used by this
- synth sound code. */
- AVSequencerSynthSymbolTable **symbol_list;
-
- /** AVSequencerSynthCode pointer to synth sound code structure. */
- AVSequencerSynthCode *code;
-
/** Number of waveforms. Can be 0 if this is a hybrid, the normal
sample data is used in that case. Default is one waveform. */
uint16_t waveforms;
#define AVSEQ_SYNTH_WAVEFORMS 1
#define AVSEQ_SYNTH_WAVEFORMS_MAX 65535
+ /** Array (of size symbols) of pointers containing named symbols
+ used by this synth sound code. */
+ AVSequencerSynthSymbolTable **symbol_list;
+
/** Number of named symbols used by this synth sound code. */
uint16_t symbols;
+ /** AVSequencerSynthCode pointer to synth sound code structure. */
+ AVSequencerSynthCode *code;
+
/** Number of instructions (lines) in the synth sound execution
code (defaults to one line). */
uint16_t size;
diff --git a/libavsequencer/track.h b/libavsequencer/track.h
index c1370ed..33095d9 100755
--- a/libavsequencer/track.h
+++ b/libavsequencer/track.h
@@ -34,12 +34,18 @@
* version bump.
*/
typedef struct AVSequencerTrackData {
- /** Array of pointers containing all effects used by this
- track. */
+ /** Array (of size effects) of pointers containing all effects
+ used by this track. */
AVSequencerTrack **effects_data;
- /** Which octave the note is played upon, if note is a
- positive value (defaults to 4). */
+ /** Number of effects used by this track. */
+ uint16_t effects;
+
+ /** Which octave the note is played upon, if note is a positive
+ value (defaults to 4). Allowed values are in the [0:9] range,
+ since the keyboard definition table has 120 entries (10 octave
+ range * 12 notes per octave), also expect trouble with most
+ trackers if values outside this range are used. */
uint8_t octave;
#define AVSEQ_TRACK_DATA_OCTAVE 4
#define AVSEQ_TRACK_DATA_OCTAVE_MIN 0
@@ -113,9 +119,6 @@ typedef struct AVSequencerTrackData {
uint16_t instrument;
/** C-4 = default tone */
#define AVSEQ_TRACK_DATA_TONE ((FF_AVSEQ_TRACK_DATA_OCTAVE << 8) | FF_AVSEQ_TRACK_DATA_NOTE)
-
- /** Number of effects used by this track. */
- uint16_t effects;
} AVSequencerTrackData;
/**
@@ -242,39 +245,8 @@ typedef struct AVSequencerTrack {
* version bump.
*/
typedef struct AVSequencerTrackEffect {
- /** Unused and reserved for future expansions, leave 0 for now. */
- uint8_t reserved;
-
/** Effect command byte. */
uint8_t command;
- /** Command types. */
-
- /** Note effects (00-1F). */
-#define AVSEQ_TRACK_EFFECT_NOTE_MIN 0x00
-#define AVSEQ_TRACK_EFFECT_NOTE_MAX 0x1F
-
- /** Volume control related effects (20-2F). */
-#define AVSEQ_TRACK_EFFECT_VOLUME_MIN 0x20
-#define AVSEQ_TRACK_EFFECT_VOLUME_MAX 0x2F
-
- /** Panning control related effects (30-3F). */
-#define AVSEQ_TRACK_EFFECT_PANNING_MIN 0x30
-#define AVSEQ_TRACK_EFFECT_PANNING_MAX 0x3F
-
- /** Track and channel control related effects (40-4F). */
-#define AVSEQ_TRACK_EFFECT_TRACK_MIN 0x40
-#define AVSEQ_TRACK_EFFECT_TRACK_MAX 0x4F
-
- /** Instrument, sample and synth control related effects (50-5F). */
-#define AVSEQ_TRACK_EFFECT_INSTRUMENT_MIN 0x50
-#define AVSEQ_TRACK_EFFECT_INSTRUMENT_MAX 0x5F
-
- /** Global control related effects (60-7E). */
-#define AVSEQ_TRACK_EFFECT_GLOBAL_MIN 0x60
-#define AVSEQ_TRACK_EFFECT_GLOBAL_MAX 0x7E
-
- /** User customized effect for trigger in demos, etc. */
-#define AVSEQ_TRACK_EFFECT_USER 0x7F
/** Note effect commands.
0x00 - Arpeggio:
@@ -592,7 +564,8 @@ typedef struct AVSequencerTrackEffect {
Both xx and yy are unsigned values. */
#define AVSEQ_TRACK_EFFECT_CMD_STOP_FX 0x1D
- /** Volume effect commands. */
+ /* Volume effect commands. */
+
/** 0x20 - Set volume:
Data word consists of two 8-bit pairs named xx and yy
where xx is the volume level (ranging either from
@@ -756,7 +729,8 @@ typedef struct AVSequencerTrackEffect {
means that the tremolo envelope values will be inverted. */
#define AVSEQ_TRACK_EFFECT_CMD_T_TREMO_ONCE 0x2F
- /** Panning effect commands. */
+ /* Panning effect commands. */
+
/** 0x30 - Set panning position:
Data word consists of two 8-bit pairs named xx and yy where
xx is the panning position ranging from 0x00 (full stereo left
@@ -929,7 +903,8 @@ typedef struct AVSequencerTrackEffect {
#define AVSEQ_TRACK_EFFECT_CMD_TPANOLO_ONCE 0x3F
#define AVSEQ_TRACK_EFFECT_CMD_TPANBRELO_ONCE AVSEQ_TRACK_EFFECT_CMD_TPANOLO_ONCE
- /** Track effect commands. */
+ /* Track effect commands. */
+
/** 0x40 - Set channel tempo:
Data word consists of a 16-bit unsigned value which
represents the number of ticks per row to change to
@@ -1059,7 +1034,8 @@ typedef struct AVSequencerTrackEffect {
/** Set global panning sub-slide to yy. */
#define AVSEQ_TRACK_EFFECT_CMD_SET_SUBSLIDE_GLOBAL_PANNING 0x20
- /** Instrument, sample and synth effect commands. */
+ /* Instrument, sample and synth effect commands. */
+
/** 0x50 - Sample offset high word:
Data word consists of a 16-bit unsigned value which
is the high word (upper 16 bits) of the target
@@ -1390,7 +1366,8 @@ typedef struct AVSequencerTrackEffect {
indicates a simple inversion of playback direction, */
#define AVSEQ_TRACK_EFFECT_CMD_SET_LOOP 0x5C
- /** Global effect commands. */
+ /* Global effect commands. */
+
/** 0x60 - Set speed:
Data word consists of one upper 4-bit nibble named x and of a
12-bit value named yyy. All values are considered unsigned and
@@ -1770,6 +1747,9 @@ typedef struct AVSequencerTrackEffect {
#define AVSEQ_TRACK_EFFECT_CMD_G_PANNOLO_O 0x78
#define AVSEQ_TRACK_EFFECT_CMD_G_PANBRELLO_O AVSEQ_TRACK_EFFECT_CMD_G_PANNOLO_O
+ /** User customized effect for trigger in demos, etc. */
+#define AVSEQ_TRACK_EFFECT_CMD_USER 0x7F
+
/** Effect command data word. */
uint16_t data;
} AVSequencerTrackEffect;
_______________________________________________
FFmpeg-soc mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-soc