Class ANIMAudioCommand

java.lang.Object
org.monte.media.anim.ANIMAudioCommand

public class ANIMAudioCommand extends Object
An ANIMAudioCommand handles an audio command that is associated to a single ANIMFrame of a ANIMMovieTrack. An ANIMFrame may be associated to multiple ANIMAudioCommands.

This version of ANIMAudioCommand is designed to handle audio commands as specified by the ANIM+SLA Sound Control collection chunk (ILBM SCTL).

Here's the specification of the SCTL collection chunk:

 typedef UBYTE Command; // Choice of commands
 #define cmdPlaySound 1 // Start playing a sound
 #define cmdStopSound 2 // Stop the sound in a given channelMask
 #define cmdSetFreqvol 3 // Change frequency/volume for a channelMask

 typedef USHORT Flags; // Choice of flags
 #define flagNoInterrupt 1 // Play the sound, but only if
                           // the channelMask isn't in use

 typedef struct {
 Command  command;   // What to do, see above
 UBYTE    volume;    // Volume 0..64
 UWORD    sound,     // Sound number (one based)
          repeats,   // Number of times to play the sound
          channelMask,   // Channel(s) to use for playing (bit mask)
          frequency; // If non-zero, overrides the VHDR value
 Flags    flags;     // Flags, see above
 UBYTE    pad[4];       // For future use
 
Author:
Werner Randelshofer, Hausmatt 10, CH-6405 Goldau, Switzerland
  • Field Details

    • COMMAND_PLAY_SOUND

      public static final int COMMAND_PLAY_SOUND
      Start playing a sound.
      See Also:
    • COMMAND_STOP_SOUND

      public static final int COMMAND_STOP_SOUND
      Stop the sound in a given channelMask.
      See Also:
    • COMMAND_SET_FREQVOL

      public static final int COMMAND_SET_FREQVOL
      Change frequency/volume for a channelMask.
      See Also:
    • FLAG_NO_INTERRUPT

      public static final int FLAG_NO_INTERRUPT
      Play the sound, but only if the channelMask isn't in use.
      See Also:
  • Constructor Details

    • ANIMAudioCommand

      public ANIMAudioCommand(int command, int volume, int sound, int repeats, int channelMask, int frequency, int flags)
      Creates a new instance.
  • Method Details

    • getChannelMask

      public int getChannelMask()
    • getFrequency

      public int getFrequency()
    • getSound

      public int getSound()
    • getVolume

      public int getVolume()
    • getCommand

      public int getCommand()
    • getPan

      public float getPan()
    • prepare

      public void prepare(ANIMMovieResources track)
    • play

      public void play(ANIMMovieResources track)
    • stop

      public void stop(ANIMMovieResources track)
    • stop

      public void stop(ANIMMovieResources track, int channelMask)
      Stops playback of this audio command on the specified channels.
    • doCommand

      public void doCommand(ANIMMovieResources track, ANIMAudioCommand[] runningCommands)
    • dispose

      public void dispose()
    • getRepeats

      public int getRepeats()