Public Member Functions

SoundObj Class Reference

Search for all occurrences

Detailed Description

See also:
Class ReferenceTarget, Class Animatable.

Description:
This is the base class for the creation of sound plug-ins. The 3ds Max user may choose a sound plug-in using the File / Preferences... Animation Tab / Sound Plug-In option.

There is always one sound object in the scene. A sound object's primary purpose is to provide a sound track for the scene. The sound object also serves as a clock that controls timing when an animation is played. This ensure the animation is synched to the sound object. This class has methods to start and stop the sound playing, play a specified range of the sound, and toggle the sound on and off.

A sound plug-in can participate in Track View by implementing the methods of Animatable such as PaintTrack(). See the Advanced Topics section Track View for details.

Sound Object plug-ins use a Super Class ID of SOUNDOBJ_CLASS_ID.

#include <soundobj.h>

Inheritance diagram for SoundObj:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual SClass_ID  SuperClassID ()
  Retrieves a constant representing the type of the plugin.
virtual BOOL  Play (TimeValue tStart, TimeValue t0, TimeValue t1, TimeValue frameStep)=0
virtual void  Scrub (TimeValue t0, TimeValue t1)=0
virtual TimeValue  Stop ()=0
virtual TimeValue  GetTime ()=0
virtual BOOL  Playing ()=0
virtual void  SaveSound (PAVIFILE pfile, TimeValue t0, TimeValue t1)=0
virtual void  SetMute (BOOL mute)=0
virtual BOOL  IsMute ()=0

Member Function Documentation

virtual SClass_ID SuperClassID ( ) [inline, virtual]

Retrieves a constant representing the type of the plugin.

Returns:
A super class id that uniquely identifies the type (category) of the plugin. Note that several plugin classes can be of the same type, thus return the same super class id. Plugins are uniquely identified by their class ids. List of Super Class IDs.
See also:
SClass_ID

Reimplemented from ReferenceTarget.

{return SClass_ID(SOUNDOBJ_CLASS_ID);}      
virtual BOOL Play ( TimeValue  tStart,
TimeValue  t0,
TimeValue  t1,
TimeValue  frameStep 
) [pure virtual]
Remarks:
When the system calls this method the plug-in should loop the playing of sound from time t0 to t1 beginning at time tStart. It should continue to loop until Stop() is called.
Parameters:
TimeValue tStart

The time to start playing the sound.

TimeValue t0

The loop begin range.

TimeValue t1

The loop end range.

TimeValue frameStep

The frame increment.
Returns:
TRUE if the sound was played; FALSE otherwise.
virtual void Scrub ( TimeValue  t0,
TimeValue  t1 
) [pure virtual]
Remarks:
Implementation of this method is optional. The plug-in should play the amount of sound between time t0 and t1. The sound should only be played once.
Parameters:
TimeValue t0

The start time for playback.

TimeValue t1

The end time for playback.
virtual TimeValue Stop ( ) [pure virtual]
Remarks:
This stops the sound from playing.
Returns:
The time at which the sound was stopped.
virtual TimeValue GetTime ( ) [pure virtual]
Remarks:
This returns the current time as managed by the SoundObj.
Returns:
The current time.
virtual BOOL Playing ( ) [pure virtual]
Remarks:
Returns TRUE if the sound is playing; otherwise FALSE.
virtual void SaveSound ( PAVIFILE  pfile,
TimeValue  t0,
TimeValue  t1 
) [pure virtual]
Remarks:
This saves the sound between the specified times to the specified file.
Parameters:
PAVIFILE pfile

The file to save the sound track to.

TimeValue t0

The start of the time range to save.

TimeValue t1

The end of the time range to save.
virtual void SetMute ( BOOL  mute ) [pure virtual]
Remarks:
Sets the sound to mute or toggles it back on. This will be called if the Active checkbox is toggled for example.
Parameters:
BOOL mute

Specifies if the sound should be muted. TRUE indicates the sound should be muted; FALSE indicates the sound should be enabled.
virtual BOOL IsMute ( ) [pure virtual]
Remarks:
Returns TRUE if the sound is muted; otherwise FALSE.

SoundObj SoundObj SoundObj SoundObj SoundObj SoundObj SoundObj SoundObj SoundObj SoundObj
SoundObj SoundObj SoundObj SoundObj SoundObj SoundObj SoundObj SoundObj SoundObj SoundObj