#ifndef AEEMEDIAFORMATSMAPI_H
#define AEEMEDIAFORMATSMAPI_H

/*============================================================================
FILE: AEEMediaFormatsMapi.h

SERVICES:  BREW MultiMedia Services for YAMAHA MA5/MA-7 device

DESCRIPTION:
   This file defines MA-5/MA-7 specific parameters and functions.

PUBLIC CLASSES:  Not applicable

INITIALIZATION AND SEQUENCING REQUIREMENTS:  Not Applicable

        Copyright © 1999-2005 QUALCOMM Incorporated.
               All Rights Reserved.
            QUALCOMM Proprietary/GTDR
============================================================================*/

/*===============================================================================
    INCLUDES AND VARIABLE DEFINITIONS
===============================================================================*/
/*-------------------------------------------------------------------
            Defines
-------------------------------------------------------------------*/

/*-------------------------------------------------------------------
      Include Files
-------------------------------------------------------------------*/

#include "AEEMedia.h"

#ifndef MT_AUDIO_SAF
#define MT_AUDIO_SAF       "audio/saf"
#endif
#define MT_AUDIO_HVS       "audio/hvs"
#define MT_AUDIO_STM       "audio/stm"
#define MT_AUDIO_M3F       "audio/m3f"
#define MT_AUDIO_MQF       "audio/mqf"

#define MT_VIDEO_MMF       "video/mmf"
#define MT_VIDEO_M3F       "video/m3f"
#define MT_VIDEO_MQF       "video/mqf"

/* in 3.1.2, following are defined in standard AEECLSIDs.h */
#ifndef AEECLSID_MEDIAHVS
#define AEECLSID_MEDIAHVS           (AEECLSID_MULTIMEDIA + 15)
#endif

/* Define interface pointers */
typedef struct _IMediaMapiMel       IMediaMapiMel;
typedef struct _IMediaMapiPhr       IMediaMapiPhr;
typedef struct _IMediaMapiHvs       IMediaMapiHvs;

/*===========================================================================

   IMediaMapiMel Interface

===========================================================================*/

QINTERFACE(IMediaMapiMel)
{
   INHERIT_IMedia(IMedia);
};

QINTERFACE(IMediaMapiPhr)
{
   INHERIT_IMedia(IMedia);
};

QINTERFACE(IMediaMapiHvs)
{
   INHERIT_IMedia(IMedia);
};

/*===========================================================================

                      MA5/MA7 specific Parms

===========================================================================*/

#define MM_PARM_DISPLAY_MODE        (MM_PARM_USER_BASE+2)  /* Set/Get. p1 = 0 or 1. if 0, OEM layer draws the frame automatically. */

#define MM_PARM_LAYOUTSIZE          (MM_PARM_USER_BASE+3)  /* Get only, p1 = pointer to MAPI_MELODY_RECTSIZE */
#define MM_PARM_CONTENTSDATA        (MM_PARM_USER_BASE+5)  /* Get only, p1 = pointer to MAPI_CONTENTSINFO, 
                                                              p2 = pointer to int32. which contains sizeof(*p1) */
#define MM_PARM_SFX_PARAMS          (MM_PARM_USER_BASE+12) /* Set/Get. p1 = pointer to MAPI_SFX_CONTROL. */
#define MM_PARM_DRY_SEND            (MM_PARM_USER_BASE+13) /* Set/Get. p1 = pointer to int32. 0 to 127, the volume of DRY SEND. */
#define MM_PARM_REVERB_SEND         (MM_PARM_USER_BASE+14) /* Set/Get. p1 = pointer to int32. 0 to 127, the volume of REVERB SEND. */
#define MM_PARM_CHORUS_SEND         (MM_PARM_USER_BASE+15) /* Set/Get. p1 = pointer to int32. 0 to 127, the volume of CHORUS SEND. */
#define MM_PARM_CHVOLUME            (MM_PARM_USER_BASE+16) /* Set/Get. p1 = pointer to MAPI_RELVOL */
#define MM_PARM_LOCAL_VOLUME        (MM_PARM_USER_BASE+17) /* Set/Get. p1 = pointer to int32. 0 to 127, the volume of Local. */

/*===========================================================================

                      MA7 specific status

===========================================================================*/

#define MM_STATUS_3DMOVEDONE        (MM_STATUS_USER_BASE + 1) /* The 3D moving with duration reaches the specified position. */

/*===========================================================================

                    Media Control Parms (for 3D), TBD

===========================================================================*/

#define MM_PARM_EFFECT_MODE                 (MM_PARM_USER_BASE+24)
#define MM_PARM_3D_RESET                    (MM_PARM_USER_BASE+25)
#define MM_PARM_3D_DURATION                 (MM_PARM_USER_BASE+26)  /* same as SetPanRate, to be merged */
#define MM_PARM_3D_POSITION                 (MM_PARM_USER_BASE+27)
#define MM_PARM_3D_POSITION_RELATIVE        (MM_PARM_USER_BASE+28)
#define MM_PARM_3D_POSITION_POLARRELATIVE   (MM_PARM_USER_BASE+29)
#define MM_PARM_3D_VELOCITY                 (MM_PARM_USER_BASE+30)
#define MM_PARM_3D_ORIENTATION              (MM_PARM_USER_BASE+31)
#define MM_PARM_3D_CONEANGLES               (MM_PARM_USER_BASE+32)
#define MM_PARM_3D_CONEOUTER_LEVEL          (MM_PARM_USER_BASE+33)
#define MM_PARM_3D_MIN_DISTANCE             (MM_PARM_USER_BASE+34)
#define MM_PARM_3D_MAX_DISTANCE             (MM_PARM_USER_BASE+35)
#define MM_PARM_3D_ROLLOFF_FACTOR           (MM_PARM_USER_BASE+36)
#define MM_PARM_3D_USER_POSITION            (MM_PARM_USER_BASE+37)
#define MM_PARM_3D_USER_VELOCITY            (MM_PARM_USER_BASE+38)
#define MM_PARM_3D_USER_ORIENTATION_FRONT   (MM_PARM_USER_BASE+39)
#define MM_PARM_3D_USER_ORIENTATION_UP      (MM_PARM_USER_BASE+40)
#define MM_PARM_3D_REVERB_PROPERTIES        (MM_PARM_USER_BASE+41)
#define MM_PARM_3D_ENABLE_3D                (MM_PARM_USER_BASE+42)
#define MM_PARM_3D_IS_ENABLED_3D            (MM_PARM_USER_BASE+43)
#define MM_PARM_3D_PARAMS                   (MM_PARM_USER_BASE+44)
#define MM_PARM_3D_COMMIT                   (MM_PARM_USER_BASE+45)

/*===========================================================================

                      Definition for IMUSIC Interface

===========================================================================*/

/* contents information */
typedef struct
{
	unsigned short code;
	unsigned char tag[2];
	unsigned char * buf;
	unsigned long size;
} MAPI_CONTENTSINFO;

/* layout(screen) size (for SMAF graphics contents) */
typedef struct 
{
	short    xw;
	short    yw;
} MAPI_MELODY_RECTSIZE;

/* clip */
typedef struct 
{
	short clpx; 
	short clpy; 
	short clpxw; 
	short clpyw; 
	short posx;
	short posy;
} MAPI_MELODY_CLIP;

/* channel volume */
typedef struct
{
	unsigned char bCh;
	unsigned char bVol;
} MAPI_RELVOL;

/* SFX control */
typedef struct
{
	unsigned long dCmd;
	unsigned long dUpdate;
	unsigned char* pbParam;
} MAPI_SFX_CONTROL;

/* 3D command */
/* 3D vector */
typedef struct 
{
	signed long sdX;
	signed long sdY;
	signed long sdZ;
} MAPI_P3DAVECTOR;

/* 3D Polar */
typedef struct
{
	signed long sdAzimuth;
	signed long sdElevation;
	signed long sdDistance;
} MAPI_P3DAPOLAR;

/* cone angle */
typedef struct 
{
	unsigned long dInnerAngle;
	unsigned long dOuterAngle;
} MAPI_P3DACONEANGLE;

/* distance decay */
typedef struct 
{
	unsigned long dRollOff;
	unsigned long dMuteAfterMax;
} MAPI_P3DAROLLOFF;
	
/* reverb */
typedef struct 
{
	unsigned long dUpdateFlags;
	unsigned long dDirectGain;
	signed long sdDirectHfLevel;
	unsigned long dRoomGain;
	signed long sdRoomHfLevel;
} MAPI_P3DASOURCEREVERBPARAMS;

/* 3D parameter */
typedef struct 
{
	unsigned long dUpdateFlags;
	unsigned long dPositionMode;
	MAPI_P3DAVECTOR sPosition; 
	unsigned long dMovementTime;
	MAPI_P3DAVECTOR sVelocity; 
	MAPI_P3DAVECTOR sOrientation; 
	unsigned long dConeInnerAngle;
	unsigned long dConeOuterAngle;
	signed long sdConeOuterLevel;
	unsigned long dMaxDistance;
	unsigned long dMinDistance;
	MAPI_P3DAROLLOFF sRollOff;
	unsigned long dFlags;
	MAPI_P3DAVECTOR sUserPosition; 
	MAPI_P3DAVECTOR sUserOrientationFront; 
	MAPI_P3DAVECTOR sUserOrientationUp; 
	MAPI_P3DASOURCEREVERBPARAMS sReverb;
} MAPI_P3DASOUNDSOURCEPARAMS;

/* SFX */
/* command */
#define MAPI_SFX_REV_PRM    0x00
#define MAPI_SFX_CHO_PRM    0x01

/* effect type */
/* REVERB (SFX1) */
/* Reverb */
#define NO_EFFECT   0x0000
/* #define LR_HALL1    0x0100 */
/* #define LR_HALL2    0x0101 */
#define LR_ROOM1    0x0200
#define LR_ROOM2    0x0201
#define LR_ROOM3    0x0202
/* #define LR_STAGE1   0x0300 */
/* #define LR_STAGE2   0x0301 */
#define LR_PLATE    0x0400
#define LR_WT_ROOM  0x1000
#define LR_TUNNEL   0x1100
#define LR_BSMENT   0x1300

/* Echo */
#define LE_KARAOK1  0x1400
#define LE_KARAOK2  0x1401
#define LE_KARAOK3  0x1402

/* CHORUS (SFX2) */
/* Mod1 */
#define LV_CHORUS1  0x4100
#define LV_CHORUS2  0x4101
#define LV_CHORUS3  0x4102
#define LV_CHORUS4  0x4108
#define LV_CELEST1  0x4200
#define LV_CELEST2  0x4201
#define LV_CELEST3  0x4202
#define LV_CELEST4  0x4208
#define LV_FLANGE1  0x4300
#define LV_FLANGE2  0x4301
#define LV_FLANGE3  0x4308
#define LV_2BNDEQ   0x4D00
#define LV_STR3EQ   0x4C00

/* Mod2 */
#define LV_TREMOLO  0x4600
#define LV_RINGMOD  0x4608
#define LV_AUTOPAN  0x4700
#define LV_AMBIENCE 0x5800

/* Phaser */
#define LV_PHASER   0x4800

/* Distortion */
#define LV_DIST     0x4900
#define LV_OVR_DRV  0x4A00
#define LV_AMP_SIM  0x4B00
#define LV_3BND_EQ  0x4C01

/* Wah */
#define LV_AUTOWAH  0x4E00
#define LV_VC_CNCL  0x5500

/* Pitch Change */
#define LV_PITCH    0x5000
#define LV_ENSEMBLE 0x5700

/* Compressor + Expander */
#define LV_COMP     0x5301

/* update flags */
/* update flags for MAPI_P3DASOURCEREVERBPARAMS */
#define MAPI_FLAG_SRC_RVB_DIRECTGAIN		(0x00000001)
#define MAPI_FLAG_SRC_RVB_DIRECTHFLEVEL		(0x00000002)
#define MAPI_FLAG_SRC_RVB_ROOMGAIN			(0x00000004)
#define MAPI_FLAG_SRC_RVB_ROOMHFLEVEL		(0x00000008)
#define MAPI_FLAG_SRC_RVB_ALL				(0x0000000f)

/* update flags for MAPI_P3DASOUNDSOURCEPARAMS */
#define MAPI_FLAG_SRC_POSITIONMODE			(0x00000001)
#define MAPI_FLAG_SRC_POSITION				(0x00000002)
#define MAPI_FLAG_SRC_TIME					(0x00000004)
#define MAPI_FLAG_SRC_VELOCITY				(0x00000008)
#define MAPI_FLAG_SRC_ORIENTATION			(0x00000010)
#define MAPI_FLAG_SRC_CONEINNERANGLE		(0x00000020)
#define MAPI_FLAG_SRC_CONEOUTERANGLE		(0x00000040)
#define MAPI_FLAG_SRC_CONEOUTERLEVEL		(0x00000080)
#define MAPI_FLAG_SRC_MINDISTANCE			(0x00000100)
#define MAPI_FLAG_SRC_MAXDISTANCE			(0x00000200)
#define MAPI_FLAG_SRC_ROLLOFFFACTOR			(0x00000400)
#define MAPI_FLAG_SRC_FLAGS					(0x00000800)
#define MAPI_FLAG_SRC_USER_POSITION			(0x00001000)
/* #define MAPI_FLAG_SRC_USER_VELOCITY		(0x00002000) */
#define MAPI_FLAG_SRC_USER_ORIENTATIONFRONT	(0x00002000)
#define MAPI_FLAG_SRC_USER_ORIENTATIONUP	(0x00004000)
#define MAPI_FLAG_SRC_REVERBPROPERTIES		(0x00008000)
#define MAPI_FLAG_SRC_ALL					(0x0000FFFF)


#endif /* AEEMEDIAFORMATSMAPI_H */
