samp_nav_exp.c
上传用户:super_houu
上传日期:2008-09-21
资源大小:4099k
文件大小:5k
- /*
- file: samp_nav_api.c
- decription: implements SAMP nav APIs for use by UI task.
- */
- #include "config.h"
- #ifdef TEST_HARNASS // for test only.
- #include "IncludeSysDefs.h"
- #include "playcoresampsamp_gen.h"
- #include "playcoresampsamp_nav.h"
- #include "playcoresampschedulersamp_api.h"
- SAMP(ErrCode) SAMP_EXP(NAV_AreaSwitch)(SAMP(SACD_Area) Area)
- {
- SAMP(ErrCode) err;
- SAMP_API_PARAM[0] = (UINT32)Area ;
- SAMP_APICallRequest (NAV_AREASWITCH, &err);
- return err;
- }
- SAMP(ErrCode) SAMP_EXP(NAV_PlayAtTimecode)(SAMP(SACD_TimeCode) Timecode)
- {
- SAMP(ErrCode) err;
- SAMP_API_PARAM[0] = (UINT32)Timecode.min ;
- SAMP_API_PARAM[1] = (UINT32)Timecode.sec ;
- SAMP_API_PARAM[2] = (UINT32)Timecode.fr ;
- SAMP_APICallRequest (NAV_PLAYATTIMECODE, &err);
- return err;
- }
- SAMP(ErrCode) SAMP_EXP(NAV_PlayTrack)(SAMP(UInt16) track, SAMP(UInt16) index)
- {
- SAMP(ErrCode) err;
- SAMP_API_PARAM[0] = (UINT32)track ;
- SAMP_API_PARAM[1] = (UINT32)index ;
- SAMP_APICallRequest (NAV_PLAYTRACK, &err);
- return err;
- }
- SAMP(ErrCode) SAMP_EXP(NAV_Stop)(void)
- {
- SAMP(ErrCode) err;
- SAMP_APICallRequest (NAV_STOP, &err);
- return err;
- }
- SAMP(ErrCode) SAMP_EXP(NAV_Pause)(void)
- {
- SAMP(ErrCode) err;
- SAMP_APICallRequest (NAV_PAUSE, &err);
- return err;
- }
- SAMP(ErrCode) SAMP_EXP(NAV_ResumePlay)(void)
- {
- SAMP(ErrCode) err;
- SAMP_APICallRequest (NAV_RESUMEPLAY, &err);
- return err;
- }
- SAMP(ErrCode) SAMP_EXP(NAV_NextTrack)(void)
- {
- SAMP(ErrCode) err;
- SAMP_APICallRequest (NAV_NEXTTRACK, &err) ;
- return err;
- }
- SAMP(ErrCode) SAMP_EXP(NAV_PreviousTrack)(void)
- {
- SAMP(ErrCode) err;
- SAMP_APICallRequest (NAV_PREVIOUSTRACK, &err);
- return err;
- }
- SAMP(ErrCode) SAMP_EXP(NAV_ForwardScan)(SAMP(UInt8) Speed)
- {
- SAMP(ErrCode) err;
- SAMP_API_PARAM[0] = (UINT32)Speed ;
- SAMP_APICallRequest (NAV_FORWORDSCAN, &err) ;
- return err;
- }
- SAMP(ErrCode) SAMP_EXP(NAV_BackwardScan)(SAMP(UInt8) Speed)
- {
- SAMP(ErrCode) err;
- SAMP_API_PARAM[0] = (UINT32)Speed ;
- SAMP_APICallRequest (NAV_BACKWORDSCAN, &err) ;
- return err;
- }
- SAMP(ErrCode) SAMP_EXP(NAV_Repeat)(SAMP(NAV_RepeatModeDef) RepeatMode)
- {
- SAMP(ErrCode) err;
- SAMP_API_PARAM[0] = (UINT32)RepeatMode ;
- SAMP_APICallRequest (NAV_REPEAT, &err);
- return err;
- }
- SAMP(ErrCode) SAMP_EXP(NAV_RepeatAB)(SAMP(NAV_RepeatABModeDef) RepeatABMode)
- {
- SAMP(ErrCode) err;
- SAMP_API_PARAM[0] = (UINT32)RepeatABMode ;
- SAMP_APICallRequest (NAV_REPEATAB, &err) ;
- return err;
- }
- SAMP(ErrCode) SAMP_EXP(NAV_Shuffle)(SAMP(Bool) ShuffleMode)
- {
- SAMP(ErrCode) err;
- SAMP_API_PARAM[0] = (UINT32)ShuffleMode ;
- SAMP_APICallRequest (NAV_SHUFFLE, &err) ;
- return err;
- }
- SAMP(ErrCode) SAMP_EXP(NAV_IntroScan)(SAMP(Bool) IntroScanMode, SAMP(UInt8) Duration)
- {
- SAMP(ErrCode) err;
- SAMP_API_PARAM[0] = (UINT32)IntroScanMode ;
- SAMP_API_PARAM[1] = (UINT32)Duration ;
- SAMP_APICallRequest (NAV_INTROSCAN, &err) ;
- return err;
- }
- SAMP(ErrCode) SAMP_EXP(NAV_SetPlaySequence)(SAMP(NAV_PlaySequenceDef) PlaySequence)
- {
- SAMP(ErrCode) err;
- SAMP_API_PARAM[0] = (UINT32)PlaySequence ;
- SAMP_APICallRequest (NAV_SETPLAYSEQUENCE, &err) ;
- return err;
- }
- SAMP(ErrCode) SAMP_EXP(NAV_SetProgramList)(SAMP(NAV_ProgramListDef) *ProgramList)
- {
- SAMP(ErrCode) err;
- SAMP_API_PARAM[0] = (UINT32)ProgramList ;
- SAMP_APICallRequest (NAV_PLAYSEQUENCEDEF, &err) ;
- return err;
- }
- SAMP(ErrCode) SAMP_EXP(NAV_Subscribe)(SAMP(NAV_CallbackDef) Callback, SAMP(BitSet32) Events)
- {
- SAMP(ErrCode) err;
- SAMP_API_PARAM[0] = (UINT32)Callback ;
- SAMP_API_PARAM[1] = (UINT32)Events ;
- SAMP_APICallRequest (NAV_SUBSCRIBE, &err) ;
- return err;
- }
- SAMP(ErrCode) SAMP_EXP(NAV_Subscribe_1394)(SAMP(NAV_CallbackDef) Callback, SAMP(BitSet32) Events)
- {
- SAMP(ErrCode) err;
- SAMP_API_PARAM[0] = (UINT32)Callback ;
- SAMP_API_PARAM[1] = (UINT32)Events ;
- SAMP_APICallRequest (NAV_SUBSCRIBE_1394, &err) ;
- return err;
- }
- SAMP(ErrCode) SAMP_EXP(NAV_GetState)(SAMP(NAV_StateDef) *PState)
- {
- SAMP(ErrCode) err;
- SAMP_API_PARAM[0] = (UINT32)PState ;
- SAMP_APICallRequest (NAV_GETSTATE, &err) ;
- return err;
- }
- SAMP(ErrCode) SAMP_EXP(NAV_GetPlayList)(SAMP(NAV_ProgramListDef) *ProgramList)
- {
- SAMP(ErrCode) err;
- SAMP_API_PARAM[0] = (UINT32)ProgramList ;
- SAMP_APICallRequest (NAV_GETPLAYLIST, &err) ;
- return err;
- }
- #endif