PrevNextUpHome SophiaFramework UNIVERSE 5.3
SFBMedia
Wrapper Class for the IMedia interface.
#include <SFBMedia.h.hpp>
class SFBMedia : public SFBQuery;
SFMTYPEDEFWRAPPER(SFBMedia)

Inheritance diagram

 Inheritance diagram of SFBMediaClass

Version

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

Reference

BREW API IMedia

Member

Public Functions
SFCError EnableChannelShare( Bool enable )
Enable/Disable exclusive playback of the media.
SFCError EnableFrameCallback( Bool enable )
Enable/Disable frame playback of the media.
SFCError FastForward( SInt32 time )
Fast forward lTimeMS milliseconds from the current position. The media is left in the current state.
SFCError GetClassID( AEECLSID* clsid )
Retrieve the class ID of SFBMedia Interface object.
AEECLSID GetClassID( Void )
Retrieve the class ID of SFBMedia Interface object.
SFCError GetDecryptCaps( UInt32Ptr caps , UInt32ConstHandle formats )
Retrieves the decryption capabilities, including the decryption formats, supported for the media.
SFCError GetFrame( SFBBitmapSmpPtr frame )
Retrieves the current frame as SFBBitmap pointer.
SFCError GetMediaData( AEEMediaData* data )
Get the media data.
SFCError GetMediaParm( SInt32 id , SInt32Ptr param1 , SInt32Ptr param2 )
Get the parameters.
SFCError GetRect( SFXRectanglePtr imgRect , SFXRectanglePtr textRect )
Retrieve the destination image rectangle and text rectangle.
SInt32 GetState( BoolPtr stateChanging )
Return the current state of SFBMedia Interface and also indicates if the SFBMedia Interface object is currently in state transition.
SFCError GetTotalTime( Void )
Return the total playback time of the SFBMedia Interface object.
SFCError GetVolume( UInt16Ptr volume )
Retrieve the volume of the current playback / recording.
UInt16 GetVolume( Void )
Retrieve the volume of the current playback / recording.
SFCError IsChannelShare( BoolPtr enable )
Retrieves the current channel share setting.
SFCError IsFrameCallback( BoolPtr enable )
Retrieves the current frame callback enable/disable setting.
static
SFBMediaSmp
NewInstance( SFCErrorPtr exception = null )
Create a new SFBMedia instance.
static
SFBMediaSmp
NewInstance( AEECLSID id , SFCErrorPtr exception = null )
Create a new SFBMedia instance.
SFCError Pause( Void )
Pause the media.
SFCError Play( Void )
Start the playback of a media.
SFCError Record( Void )
Start the recording of a media.
SFCError RegisterNotify( PFNMEDIANOTIFY notify , VoidPtr data = null )
Register a callback notification function.
SFCError Resume( Void )
Resume the media from the current position.
SFCError Rewind( SInt32 time )
Rewind the specified time from the current position. The media is left in the current state.
SFCError Seek( AEEMediaSeek seek , SInt32 time )
Seek the media position. The media is left in the current state.
SFCError SeekFrame( AEEMediaSeek seek , SInt32 frames )
Seek the media pos based on the seek reference and number of frames. Typically, this API is used for video formats to seek based on frames. The media is left in the current state.
SFCError SetAudioDevice( AEESoundDevice device )
Set the audio output device.
SFCError SetAudioPath( SInt32 path , UInt32 pause )
Set the audio path for playback/recording.
SFCError SetDecryptInfo( AEEMediaDecryptInfo* info )
Set required decryption info necessary to decrypt the media content.
SFCError SetMediaData( AEEMediaData* data )
Set the media data and puts the media in Ready state.
SFCError SetMediaDataEx( AEEMediaDataEx* mediaContent , SInt32 count )
Set a list of media data and puts the media in Ready state.
SFCError SetMediaParm( SInt32 id , SInt32 param1 , SInt32 param2 )
Set specified the media parameters.
SFCError SetMuteCtl( Bool mute )
Mute / Unmute the current audio path.
SFCError SetPan( UInt16 pan )
Set the pan factor of the current playback.
SFCError SetRect( SFXRectanglePtr imgRect , SFXRectanglePtr textRect )
Set the destination image rectangle and text rectangle.
SFCError SetTickTime( UInt32 tick )
Set periodicity of MM_TICK_UPDATE event sent to the application during playback/recording.
SFCError SetVolume( UInt16 volume )
Set the volume of the current playback / recording.
SFCError Stop( Void )
Stop the playback/recording of media.
SFCError QueryInterface( AEECLSID clsid , VoidHandle handle ) (inherits from SFBQuery)
Ask an object for another API contract from the object in question.
SFCError QueryInterface( AEECLSID clsid , SFBBaseSmpPtr handle ) (inherits from SFBQuery)
Ask an object for another API contract from the object in question.
SFBBaseSmp QueryInterface( AEECLSID clsid ) (inherits from SFBQuery)
Ask an object for another API contract from the object in question.
Void Self( AEECLSID clsidReq , SFBQuerySmpPtr clone , AEECLSID clsidImp ) (inherits from SFBQuery)
Helper macro for those implementing an object with a single interface.
SFBQuerySmp Self( AEECLSID clsidReq , AEECLSID clsidImp ) (inherits from SFBQuery)
Helper macro for those implementing an object with a single interface.
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.

SFBMedia::EnableChannelShare
Enable/Disable exclusive playback of the media.
[ public ]
SFCError EnableChannelShare(
    Bool enable   // true/false => Enable/Disable channel share 
);

Version

Supported in BREW 2.1 or later.

Reference

BREW API IMEDIA_EnableChannelShare


SFBMedia::EnableFrameCallback
Enable/Disable frame playback of the media.
[ public ]
SFCError EnableFrameCallback(
    Bool enable   // true/false => Enable/Disable frame callback 
);

バージョン

Supported in BREW 2.1 or later.

Reference

BREW API IMEDIA_EnableFrameCallback


SFBMedia::FastForward
Fast forward lTimeMS milliseconds from the current position. The media is left in the current state.
[ public ]
SFCError FastForward(
    SInt32 time   // time in milliseconds 
);

Reference

BREW API IMEDIA_FastForward | SFBMedia::Seek | SFBMedia::Rewind | SFBMedia::Play


SFBMedia::GetClassID
Retrieve the class ID of SFBMedia Interface object.
[ public ]
SFCError GetClassID(
    AEECLSID* clsid   // pointer to the space for retrieving ClassID
);
[ public ]
AEECLSID GetClassID(Void);

Reference

BREW API IMEDIA_GetClassID | SFBMedia::GetMediaParm


SFBMedia::GetDecryptCaps
Retrieves the decryption capabilities, including the decryption formats, supported for the media.
[ public ]
SFCError GetDecryptCaps(
    UInt32Ptr caps              // pointer to ORed MM_DECRYPT_CAPS_XXX (see comments)
    UInt32ConstHandle formats   // pointer to a zero-terminated array of decryption formats supported 
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If invalid argument: SFERR_INVALID_PARAM
  • Argument cannot be gotten: SFERR_INVALID_STATE
  • Decryption is not supported by this player: SFERR_UNSUPPORTED

Version

This function is available in BREW 3.1.

Reference

BREW API IMEDIA_GetDecryptCaps | SFBMedia::SetDecryptInfo


SFBMedia::GetFrame
Retrieves the current frame as SFBBitmap pointer.
[ public ]
SFCError GetFrame(
    SFBBitmapSmpPtr frame   // pointer to space for retrieving SFBBitmap object
);

Version

Supported in BREW 2.1 or later.

Reference

BREW API IMEDIA_EnableFrameCallback


SFBMedia::GetMediaData
Get the media data.
[ public ]
SFCError GetMediaData(
    AEEMediaData* data   // pointer to space for retrieving media data
);

Reference

BREW API IMEDIA_GetMediaData | AEEMediaData | SFBMedia::GetMediaParm | SFBMedia::GetMediaData | SFBMedia::SetMediaParm


SFBMedia::GetMediaParm
Get the parameters.
[ public ]
SFCError GetMediaParm(
    SInt32 id          // parameter ID
    SInt32Ptr param1   // pointer to space for retrieving the first parameter
    SInt32Ptr param2   // pointer to space for retrieving the second parameter
);

Reference

BREW API IMEDIA_GetMediaParm | SFBMedia::SetMediaParm | AEEMediaCmdNotify


SFBMedia::GetRect
Retrieve the destination image rectangle and text rectangle.
[ public ]
SFCError GetRect(
    SFXRectanglePtr imgRect    // image rectangle pointer 
    SFXRectanglePtr textRect   // text rectangle pointer 
);

Reference

BREW API IMEDIA_GetRect | SFBMedia::Play | SFBMedia::Record | SFBMedia::SetMediaParm | SFBMedia::GetMediaParm


SFBMedia::GetState
Return the current state of SFBMedia Interface and also indicates if the SFBMedia Interface object is currently in state transition.
[ public ]
SInt32 GetState(
    BoolPtr stateChanging   // true means SFBMedia Interface is currently busy with state transition
);

Reference

BREW API IMEDIA_GetState


SFBMedia::GetTotalTime
Return the total playback time of the SFBMedia Interface object.
[ public ]
SFCError GetTotalTime(Void);

Reference

BREW API IMEDIA_GetTotalTime | AEEMediaCmdNotify


SFBMedia::GetVolume
Retrieve the volume of the current playback / recording.
[ public ]
SFCError GetVolume(
    UInt16Ptr volume   // pointer to space for retrieving volume
);
[ public ]
UInt16 GetVolume(Void);

Reference

BREW API IMEDIA_GetVolume | SFBMedia::SetAudioPath | SFBMedia::SetMuteCtl | SFBMedia::SetVolume | SFBMedia::SetPan | SFBMedia::SetMediaParm | SFBMedia::GetMediaParm | SFBMedia::SetAudioDevice


SFBMedia::IsChannelShare
Retrieves the current channel share setting.
[ public ]
SFCError IsChannelShare(
    BoolPtr enable   // pointer to space for retrieving channel share setting
);

Version

Supported in BREW 2.1 or later.

Reference

BREW API IMEDIA_IsChannelShare


SFBMedia::IsFrameCallback
Retrieves the current frame callback enable/disable setting.
[ public ]
SFCError IsFrameCallback(
    BoolPtr enable   // pointer to space for retrieving frame callback setting
);

Version

Supported in BREW 2.1 or later.

Reference

BREW API IMEDIA_IsFrameCallback


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

SFBMedia::Pause
Pause the media.
[ public ]
SFCError Pause(Void);

Reference

BREW API IMEDIA_Pause | SFBMedia::Play | SFBMedia::Resume | SFBMedia::Record | AEEMediaCmdNotify


SFBMedia::Play
Start the playback of a media.
[ public ]
SFCError Play(Void);

Reference

BREW API IMEDIA_Play | SFBMedia::FastForward | SFBMedia::Pause | SFBMedia::Record | SFBMedia::Resume | SFBMedia::Rewind | SFBMedia::Seek | SFBMedia::Stop | AEEMediaCmdNotify


SFBMedia::Record
Start the recording of a media.
[ public ]
SFCError Record(Void);

Reference

BREW API IMEDIA_Record | SFBMedia::FastForward | SFBMedia::Pause | SFBMedia::Play | SFBMedia::Resume | SFBMedia::Rewind | SFBMedia::Seek | SFBMedia::Stop | AEEMediaCmdNotify | AEEMediaData


SFBMedia::RegisterNotify
Register a callback notification function.
[ public ]
SFCError RegisterNotify(
    PFNMEDIANOTIFY notify   // callback function
    VoidPtr data = null     // user data
);

Reference

BREW API IMEDIA_RegisterNotify | PFNMEDIANOTIFY


SFBMedia::Resume
Resume the media from the current position.
[ public ]
SFCError Resume(Void);

Reference

BREW API IMEDIA_Resume | SFBMedia::Play | SFBMedia::Pause | SFBMedia::Record | AEEMediaCmdNotify


SFBMedia::Rewind
Rewind the specified time from the current position. The media is left in the current state.
[ public ]
SFCError Rewind(
    SInt32 time   // time in milliseconds 
);

Example

When LEFT key is pressed, rewind sound for 10 seconds.

// announce as class member argument.
SFBMediaSmp         _media;
AEEMediaData        _mdata;
----------------------------------------------------------------------

// announce local parameter in function.
SFBShellSmp     shell    = SFBShell::GetInstance();
const char*     filename = "test.qcp";

// get SFBMediaQCP interface, set media data.
_media = SFBMediaQCP::NewInstance();

if (_media != null) {
    // set media data inAEEMediaData structure.
    _mdata.clsData  = MMD_FILE_NAME;
    _mdata.pData    = STRDUP(filename);
    _mdata.dwSize   = 0;

    // set media data.
    _media->SetMediaData(&_mdata);

    // set audio device.
    _media->SetAudioDevice(AEE_SOUND_DEVICE_CURRENT);

    // play sound.
    _media->Play();
}

----------------------------------------------------------------------
// if LEFT key is pressed,
// rewind sound for 10 seconds.
if (key == AVK_LEFT) {
    if (_media != null) {
        // rewind (10 seconds)
        _media->Rewind(10000);
    }
}

Reference

BREW API IMEDIA_Resume | SFBMedia::FastForward | SFBMedia::Seek | SFBMedia::Play | AEEMediaCmdNotify


SFBMedia::Seek
Seek the media position. The media is left in the current state.
[ public ]
SFCError Seek(
    AEEMediaSeek seek   // seek reference 
    SInt32 time         // time in milliseconds 
);

Reference

BREW API IMEDIA_Seek | AEEMediaSeek | SFBMedia::FastForward | SFBMedia::Rewind | SFBMedia::Play


SFBMedia::SeekFrame
Seek the media pos based on the seek reference and number of frames. Typically, this API is used for video formats to seek based on frames. The media is left in the current state.
[ public ]
SFCError SeekFrame(
    AEEMediaSeek seek   // seek reference
    SInt32 frames       // number of frames
);

Version

Supported in BREW 2.1 or later.

Reference

BREW API IMEDIA_SeekFrame


SFBMedia::SetAudioDevice
Set the audio output device.
[ public ]
SFCError SetAudioDevice(
    AEESoundDevice device   // target audio device 
);

Reference

BREW API IMEDIA_SetAudioDevice | AEESoundDevice | SFBMedia::SetAudioPath | SFBMedia::SetMuteCtl | SFBMedia::SetVolume | SFBMedia::GetVolume | SFBMedia::SetPan | SFBMedia::SetMediaParm | SFBMedia::GetMediaParm


SFBMedia::SetAudioPath
Set the audio path for playback/recording.
[ public ]
SFCError SetAudioPath(
    SInt32 path    // audio path 
    UInt32 pause   // pause, in milliseconds, between rings
);

Reference

BREW API IMEDIA_SetAudioPath | SFBMedia::SetMuteCtl | SFBMedia::SetVolume | SFBMedia::GetVolume | SFBMedia::SetPan | SFBMedia::SetMediaParm | SFBMedia::GetMediaParm | SFBMedia::SetAudioDevice


SFBMedia::SetDecryptInfo
Set required decryption info necessary to decrypt the media content.
[ public ]
SFCError SetDecryptInfo(
    AEEMediaDecryptInfo* info   // decrypt information
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If invalid argument: SFERR_INVALID_PARAM
  • Argument has not been set yet: SFERR_INVALID_STATE
  • The decrypt information is not supported by this class: SFERR_UNSUPPORTED
  • The decrypt information is not supported by media player: SFERR_INVALID_FORMAT

Version

This function is available in BREW 3.1.

Reference

BREW API IMEDIA_GetDecryptCaps | SFBMedia::GetDecryptCaps


SFBMedia::SetMediaData
Set the media data and puts the media in Ready state.
[ public ]
SFCError SetMediaData(
    AEEMediaData* data   // media data 
);

Reference

BREW API IMEDIA_SetMediaData | SFBMedia::GetMediaData | SFBMedia::GetMediaParm | SFBMedia::SetMediaParm


SFBMedia::SetMediaDataEx
Set a list of media data and puts the media in Ready state.
[ public ]
SFCError SetMediaDataEx(
    AEEMediaDataEx* mediaContent   // list of media content
    SInt32 count                   // number of the elements in mediaContent
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If invalid argument: SFERR_INVALID_PARAM
  • Argument has not been set yet: SFERR_INVALID_STATE
  • Arguent is not supported by this class: SFERR_UNSUPPORTED
  • A value has been returned in registered callback function : MM_PENDING

Version

This function is available in BREW 3.1.

Reference

BREW API IMEDIA_SetMediaDataEx | SFBMedia::GetMediaData | SFBMedia::GetMediaParm | SFBMedia::SetMediaParm


SFBMedia::SetMediaParm
Set specified the media parameters.
[ public ]
SFCError SetMediaParm(
    SInt32 id       // parameter ID
    SInt32 param1   // the first parameter
    SInt32 param2   // the second parameter
);

Reference

BREW API IMEDIA_SetMediaParm | AEEMediaData | SFBMedia::GetMediaParm


SFBMedia::SetMuteCtl
Mute / Unmute the current audio path.
[ public ]
SFCError SetMuteCtl(
    Bool mute   // true means mute Otherwise do not mute
);

Reference

BREW API IMEDIA_SetMuteCtl | SFBMedia::SetAudioPath | SFBMedia::SetVolume | SFBMedia::GetVolume | SFBMedia::SetPan | SFBMedia::SetMediaParm | SFBMedia::GetMediaParm | SFBMedia::SetAudioDevice


SFBMedia::SetPan
Set the pan factor of the current playback.
[ public ]
SFCError SetPan(
    UInt16 pan   // pan factor(balance)
);

Reference

BREW API IMEDIA_SetPan | SFBMedia::SetAudioPath | SFBMedia::SetMuteCtl | SFBMedia::SetVolume | SFBMedia::GetVolume | SFBMedia::SetMediaParm | SFBMedia::GetMediaParm | SFBMedia::SetAudioDevice


SFBMedia::SetRect
Set the destination image rectangle and text rectangle.
[ public ]
SFCError SetRect(
    SFXRectanglePtr imgRect    // image rectangle pointer
    SFXRectanglePtr textRect   // text rectangle pointer
);

Reference

BREW API IMEDIA_SetRect | AEERect | SFBMedia::Play | SFBMedia::Record | SFBMedia::SetMediaParm | SFBMedia::GetMediaParm


SFBMedia::SetTickTime
Set periodicity of MM_TICK_UPDATE event sent to the application during playback/recording.
[ public ]
SFCError SetTickTime(
    UInt32 tick   // tick period in milliseconds
);

Reference

BREW API IMEDIA_SetTickTime | SFBMedia::Play | SFBMedia::Record | SFBMedia::SetMediaParm | SFBMedia::GetMediaParm


SFBMedia::SetVolume
Set the volume of the current playback / recording.
[ public ]
SFCError SetVolume(
    UInt16 volume   // volume
);

Reference

BREW API IMEDIA_SetVolume | SFBMedia::SetAudioDevice | SFBMedia::SetAudioPath | SFBMedia::SetMuteCtl | SFBMedia::GetVolume | SFBMedia::SetPan | SFBMedia::SetMediaParm | SFBMedia::GetMediaParm


SFBMedia::Stop
Stop the playback/recording of media.
[ public ]
SFCError Stop(Void);

Reference

BREW API IMEDIA_Stop | SFBMedia::Play | SFBMedia::Record