PrevNextUpHome SophiaFramework UNIVERSE 5.3
SFBSoundPlayer
Wrapper Class for the ISoundPlayer interface.
#include <SFBSoundPlayer.h.hpp>
class SFBSoundPlayer : public SFBBase;
SFMTYPEDEFWRAPPER(SFBSoundPlayer)

Inheritance diagram

 Inheritance diagram of SFBSoundPlayerClass

Version

BREW 2.0 BREW 2.1 BREW 3.1 BREW 4.0
O O O O

Reference

BREW API ISoundPlayer

Member

Public Functions
Void FastForward( UInt32 time )
Issue a command to fast-forward the current MIDI/MP3 playback.
SFCError GetInfo( AEESoundPlayerInfo* info )
Get either the current audio source of SFBSoundPlayer or the state of SFBSoundPlayer. The status of the function is returned immediately.
Void GetTotalTime( Void )
Issue a command to request the calculation of the total playback time of the specified MP3/MIDI input source.
Void GetVolume( Void )
Get the volume for the current playback device and method.
static
SFBSoundPlayerSmp
NewInstance( SFCErrorPtr exception = null )
Create a new SFBSoundPlayer instance.
static
SFBSoundPlayerSmp
NewInstance( AEECLSID id , SFCErrorPtr exception = null )
Create a new SFBSoundPlayer instance.
Void Pause( Void )
Issue a command to pause the current MIDI/MP3 playback.
Void Play( Void )
This function issues a command to play a MIDI/MP3/QCP audio from the input source specified in the call to SFBSoundPlayer::Set().
Void RegisterNotify( PFNSOUNDPLAYERSTATUS notify , VoidPtr data = null )
Register the status event callback function.
SFCError ResetInfo( Void )
Reset the audio source of ISoundPlayer. The status of the function is returned immediately.
Void Resume( Void )
Issue a command to resume the current MIDI/MP3 playback.
Void Rewind( UInt32 time )
Issue a command to rewind the current MIDI/MP3 playback.
Void Set( AEESoundPlayerInput input , VoidPtr data )
Free the memory associated with previous input data buffer, if any, and sets the current input data buffer as the source of the MIDI/MP3/QCP audio.
Void Set( AEESoundPlayerInput input , SFXBufferPtr data )
Free the memory associated with previous input data buffer, if any, and sets the current input data buffer as the source of the MIDI/MP3/QCP audio.
SFCError SetInfo( AEESoundPlayerInfo* info )
Set or reset the audio source of ISoundPlayer. The status of the function is returned immediately.
Void SetSoundDevice( AEESoundDevice device , AEESoundMuteCtl ear , AEESoundMuteCtl mic )
Connect the device to a specific audio device.
Void SetStream( SFBAStreamSmpConstRef s )
Allow an SFBAStream Interface to be associated with an SFBSoundPlayer instance to allow audio source data to be streamed from SFBAStream (like file or socket).
SFCError SetStream( SFXStorageConstRef storage )
Allow an SFBAStream Interface to be associated with an SFBSoundPlayer instance to allow audio source data to be streamed from SFBAStream (like file or socket).
Void SetTempo( UInt32 factor )
Issue a command to modify the playback tempo of the current MIDI playback as a percentage of the normal playback tempo.
Void SetTune( UInt08 step )
Issue a command to modify the tune (pitch level) of the current MIDI playback in half-step increments.
Void SetVolume( UInt16 volume )
Set the volume for the current playback device.
Void Stop( Void )
Issue a command to stop the current MIDI/MP3/QCP playback.
Void UnregisterNotify( Void )
Unregister the status event callback function.
Protected Functions
static
SFBBaseSmp
FactoryByCreate( AEECLSID id , SFCErrorPtr exception = null ) (inherits from SFBBase)
Create the instance for the specified ClassID's interface.
static
SFBBaseSmp
FactoryByQuery( SFBQuerySmpConstRef query , AEECLSID id , SFCErrorPtr exception = null ) (inherits from SFBBase)
Create the instance for the specified ClassID's interface using the SFBQuery instance.

SFBSoundPlayer::FastForward
Issue a command to fast-forward the current MIDI/MP3 playback.
[ public ]
Void FastForward(
    UInt32 time   // this function issues a command to fast-forward the current MIDI/MP3 playback
);

Reference

BREW API ISOUNDPLAYER_FastForward


SFBSoundPlayer::GetInfo
Get either the current audio source of SFBSoundPlayer or the state of SFBSoundPlayer. The status of the function is returned immediately.
[ public ]
SFCError GetInfo(
    AEESoundPlayerInfo* info   // audio source of SFBSoundPlayer
);

Reference

BREW API ISOUNDPLAYER_GetInfo | AEESoundPlayerInfo | SFBSoundPlayer::SetInfo


SFBSoundPlayer::GetTotalTime
Issue a command to request the calculation of the total playback time of the specified MP3/MIDI input source.
[ public ]
Void GetTotalTime(Void);

Reference

BREW API ISOUNDPLAYER_GetTotalTime


SFBSoundPlayer::GetVolume
Get the volume for the current playback device and method.
[ public ]
Void GetVolume(Void);

Reference

BREW API ISOUNDPLAYER_GetVolume | AEESoundCmd | SFBSoundPlayer::SetVolume


SFBSoundPlayer::NewInstance
Create a new SFBSoundPlayer instance.
[ public, static ]
SFBSoundPlayerSmp NewInstance(
    SFCErrorPtr exception = null   // Error
);
[ public, static ]
SFBSoundPlayerSmp NewInstance(
    AEECLSID id                    // Class ID
    SFCErrorPtr exception = null   // Error
);

SFBSoundPlayer::Pause
Issue a command to pause the current MIDI/MP3 playback.
[ public ]
Void Pause(Void);

Reference

BREW API ISOUNDPLAYER_Pause


SFBSoundPlayer::Play
This function issues a command to play a MIDI/MP3/QCP audio from the input source specified in the call to SFBSoundPlayer::Set().
[ public ]
Void Play(Void);

Reference

BREW API ISOUNDPLAYER_Play | SFBSoundPlayer::Set


SFBSoundPlayer::RegisterNotify
Register the status event callback function.
[ public ]
Void RegisterNotify(
    PFNSOUNDPLAYERSTATUS notify   // pointer to the user callback (null to deregister)
    VoidPtr data = null           // user data for unique correlation/identification of the transaction.
                                  // this piece of information is not retrieved or processed by SFBSoundPlayer 
                                  // and can be null if no identifying data is required. 
                                  // this same data pointer is passed back to the client along with status callback to correlate the transactions
);

Reference

BREW API ISOUNDPLAYER_RegisterNotify | PFNSOUNDPLAYERSTATUS


SFBSoundPlayer::ResetInfo
Reset the audio source of ISoundPlayer. The status of the function is returned immediately.
[ public ]
SFCError ResetInfo(Void);

Description

Calling this function is as same as calling SFBSoundPlayer::SetInfo(null)

Reference

SFBSoundPlayer::SetInfo


SFBSoundPlayer::Resume
Issue a command to resume the current MIDI/MP3 playback.
[ public ]
Void Resume(Void);

Reference

BREW API ISOUNDPLAYER_Resume | SFBSoundPlayer::Pause


SFBSoundPlayer::Rewind
Issue a command to rewind the current MIDI/MP3 playback.
[ public ]
Void Rewind(
    UInt32 time   // amount of time, in milliseconds, to rewind the current playback
);

Reference

BREW API ISOUNDPLAYER_Rewind


SFBSoundPlayer::Set
Free the memory associated with previous input data buffer, if any, and sets the current input data buffer as the source of the MIDI/MP3/QCP audio.
[ public ]
Void Set(
    AEESoundPlayerInput input   // source type of Data
                                // the values below are supported:
                                // SDT_FILE   : The specified data is file name.
                                // SDT_BUFFER : The specified data is unprocessed buffer
    VoidPtr data                // pointer to the data of specified type
);
[ public ]
Void Set(
    AEESoundPlayerInput input   // source type of Data
                                // the values below are supported:
                                // SDT_FILE   : The specified data is file name.
                                // SDT_BUFFER : The specified data is unprocessed buffer
    SFXBufferPtr data           // pointer to the data of specified type,
                                // if null, return null as user data
);

Reference

BREW API ISOUNDPLAYER_Set | AEESoundPlayerInput


SFBSoundPlayer::SetInfo
Set or reset the audio source of ISoundPlayer. The status of the function is returned immediately.
[ public ]
SFCError SetInfo(
    AEESoundPlayerInfo* info   // audio source of SFBSoundPlayer
);

Reference

BREW API ISOUNDPLAYER_SetInfo | AEESoundPlayerInfo | SFBSoundPlayer::GetInfo


SFBSoundPlayer::SetSoundDevice
Connect the device to a specific audio device.
[ public ]
Void SetSoundDevice(
    AEESoundDevice device   // audio device to be connected
    AEESoundMuteCtl ear     // mute or unmute the ear piece
    AEESoundMuteCtl mic     // mute or unmute the microphone
);

Reference

BREW API ISOUNDPLAYER_SetSoundDevice | AEESoundMuteCtl | AEESoundDevice


SFBSoundPlayer::SetStream
Allow an SFBAStream Interface to be associated with an SFBSoundPlayer instance to allow audio source data to be streamed from SFBAStream (like file or socket).
[ public ]
Void SetStream(
    SFBAStreamSmpConstRef s   // SFBAStream class
                              // pointer to the instance of SFBFile interface or SFBSocket class
);
[ public ]
SFCError SetStream(
    SFXStorageConstRef storage   // storage class
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • Socket is closed: SFERR_INVALID_STATE
  • Argument is null: SFERR_INVALID_PARAM

Reference

BREW API ISOUNDPLAYER_SetStream | SFBAStream::Read | SFBAStream::Readable


SFBSoundPlayer::SetTempo
Issue a command to modify the playback tempo of the current MIDI playback as a percentage of the normal playback tempo.
[ public ]
Void SetTempo(
    UInt32 factor   // this parameter is used to modify the playback tempo as a percentage of the normal playback tempo.
                    // possibly, playback is not active or another command is active. 
                    // a dwTempoFactor of 50 means half of the normal playback tempo. 
                    // the maximum supported tempo factor is 500% or five times of the normal playback tempo. 
                    // the minimum tempo factor is 1% of the normal playback tempo. 
                    // the tempo factor is initially 100% when the SFBSoundPlayer::Play() function is called
);

Reference

BREW API ISOUNDPLAYER_SetTempo | SFBSoundPlayer::Play


SFBSoundPlayer::SetTune
Issue a command to modify the tune (pitch level) of the current MIDI playback in half-step increments.
[ public ]
Void SetTune(
    UInt08 step   // this parameter is used to modify the tune of the playback in half-step increments. 
		// 0 indicates normal playback. 
		// -1 indicates 1 half-step lower than the normal playback. 
		// +1 indicates 1 half-step higher than the normal playback.
		// -12 indicates 12 half-steps, or 1 octave lower than the normal playback. 
		// +12 indicates 12 half-steps, or 1 octave higher than the normal playback
);

Reference

BREW API ISOUNDPLAYER_SetTune | SFBSoundPlayer::Play


SFBSoundPlayer::SetVolume
Set the volume for the current playback device.
[ public ]
Void SetVolume(
    UInt16 volume   // new volume level for device/method
);

Reference

BREW API ISOUNDPLAYER_SetVolume | SFBSoundPlayer::GetVolume


SFBSoundPlayer::Stop
Issue a command to stop the current MIDI/MP3/QCP playback.
[ public ]
Void Stop(Void);

Reference

BREW API ISOUNDPLAYER_Stop


SFBSoundPlayer::UnregisterNotify
Unregister the status event callback function.
[ public ]
Void UnregisterNotify(Void);

Description

Calling this function is as same as calling SFBSoundPlayer::RegisterNotify( null , null )

Reference

SFBSoundPlayer::RegisterNotify