samp_sdi_exp.c
上传用户:super_houu
上传日期:2008-09-21
资源大小:4099k
文件大小:6k
- /*
- file: samp_sdi_exp.c
- decription: implements SAMP sdi APIs for use by UI task.
- */
- #include "config.h"
- #if D_SUPPORT_SACD // ZKR GLSACD
- #if 1 // UI need these functions. ///////////////////////////////////////////////////////////////////////////////////
- #include "IncludeSysDefs.h"
- #include "playcoresampsamp_gen.h"
- #include "playcoresampsamp_sdi.h"
- #include "playcoresampschedulersamp_api.h"
- #define SAMP_EXP(name) SAMP_EXP_##name
- SAMP(ErrCode) SAMP_EXP(SDI_SetAvailableCharSets)( SAMP(UInt8) nrOfCharSets, SAMP(UInt8) *pCharSetList )
- {
- SAMP(ErrCode) err;
- SAMP_API_PARAM[0] = (UINT32)nrOfCharSets ;
- SAMP_API_PARAM[1] = (UINT32)pCharSetList ;
- SAMP_APICallRequest (SDI_SETAVAILABLECHARSETS, &err);
- return err;
- }
- SAMP(ErrCode) SAMP_EXP(SDI_SetLanguagePreference)( SAMP(UInt8) nrOfLanguages, SAMP(SDI_LanguageCodeDef) *pLanguageCodes )
- {
- SAMP(ErrCode) err;
- SAMP_API_PARAM[0] = (UINT32)nrOfLanguages ;
- SAMP_API_PARAM[1] = (UINT32)pLanguageCodes ;
- SAMP_APICallRequest (SDI_SETLANGPREF, &err);
- return err;
- }
- SAMP(ErrCode) SAMP_EXP(SDI_GetAlbumInfo)( SAMP(SDI_Album_Info) *pAlbumInfo )
- {
- SAMP(ErrCode) err;
- SAMP_API_PARAM[0] = (UINT32)pAlbumInfo ;
- SAMP_APICallRequest (SDI_GETALBUMINFO, &err);
- return err;
- }
- SAMP(ErrCode) SAMP_EXP(SDI_GetAlbumText)( SAMP(SDI_AlbumTextField) field, SAMP(SDI_TextChannelType) type, SAMP(UInt32) bufferSize, void *pAlbumText, SAMP(UInt8) *pCharSet, SAMP(SDI_LanguageCodeDef) *pLanguage )
- {
- SAMP(ErrCode) err;
- SAMP_API_PARAM[0] = (UINT32)field ;
- SAMP_API_PARAM[1] = (UINT32)type ;
- SAMP_API_PARAM[2] = (UINT32)bufferSize ;
- SAMP_API_PARAM[3] = (UINT32)pAlbumText ;
- SAMP_API_PARAM[4] = (UINT32)pCharSet ;
- SAMP_API_PARAM[5] = (UINT32)pLanguage ;
- SAMP_APICallRequest (SDI_GETALBUMTEXT, &err);
- return err;
- }
- SAMP(ErrCode) SAMP_EXP(SDI_GetDiscInfo)( SAMP(SDI_Disc_Info) *pDiscInfo )
- {
- SAMP(ErrCode) err;
- SAMP_API_PARAM[0] = (UINT32)pDiscInfo ;
- SAMP_APICallRequest (SDI_GETDISCINFO, &err);
- return err;
- }
- SAMP(ErrCode) SAMP_EXP(SDI_GetDiscText)( SAMP(SDI_DiscTextField) field, SAMP(SDI_TextChannelType) type, SAMP(UInt32) bufferSize, void *pDiscText, SAMP(UInt8) *pCharSet, SAMP(SDI_LanguageCodeDef) *pLanguage )
- {
- SAMP(ErrCode) err;
- SAMP_API_PARAM[0] = (UINT32)field ;
- SAMP_API_PARAM[1] = (UINT32)type ;
- SAMP_API_PARAM[2] = (UINT32)bufferSize ;
- SAMP_API_PARAM[3] = (UINT32)pDiscText ;
- SAMP_API_PARAM[4] = (UINT32)pCharSet ;
- SAMP_API_PARAM[5] = (UINT32)pLanguage ;
- SAMP_APICallRequest (SDI_GETDISCTEXT, &err);
- return err;
- }
- SAMP(ErrCode) SAMP_EXP(SDI_GetAreaText)( SAMP(SACD_Area) area, SAMP(SDI_AreaTextField) field, SAMP(SDI_TextChannelType) type, SAMP(UInt32) bufferSize, void *pAreaText, SAMP(UInt8) *pCharSet, SAMP(SDI_LanguageCodeDef) *pLanguage )
- {
- SAMP(ErrCode) err;
- SAMP_API_PARAM[0] = (UINT32)area ;
- SAMP_API_PARAM[1] = (UINT32)field ;
- SAMP_API_PARAM[2] = (UINT32)type ;
- SAMP_API_PARAM[3] = (UINT32)bufferSize ;
- SAMP_API_PARAM[4] = (UINT32)pAreaText ;
- SAMP_API_PARAM[5] = (UINT32)pCharSet ;
- SAMP_API_PARAM[6] = (UINT32)pLanguage ;
- SAMP_APICallRequest (SDI_GETAREATEXT, &err);
- return err;
- }
- SAMP(ErrCode) SAMP_EXP(SDI_GetTrackInfo)( SAMP(SACD_Area) area, SAMP(UInt8) trackNr, SAMP(SDI_Track_Info) *pTrackInfo )
- {
- SAMP(ErrCode) err;
- SAMP_API_PARAM[0] = (UINT32)area ;
- SAMP_API_PARAM[1] = (UINT32)trackNr ;
- SAMP_API_PARAM[2] = (UINT32)pTrackInfo ;
- SAMP_APICallRequest (SDI_GETTRACKINFO, &err);
- return err;
- }
- SAMP(ErrCode) SAMP_EXP(SDI_GetTrackText)( SAMP(SACD_Area) area, SAMP(UInt8) trackNr, SAMP(SDI_TrackTextField) field, SAMP(SDI_TextChannelType) type, SAMP(UInt32) bufferSize, void *pTrackText, SAMP(UInt8) *pCharSet, SAMP(SDI_LanguageCodeDef) *pLanguage )
- {
- SAMP(ErrCode) err;
- SAMP_API_PARAM[0] = (UINT32)area ;
- SAMP_API_PARAM[1] = (UINT32)trackNr ;
- SAMP_API_PARAM[2] = (UINT32)field ;
- SAMP_API_PARAM[3] = (UINT32)type ;
- SAMP_API_PARAM[4] = (UINT32)bufferSize ;
- SAMP_API_PARAM[5] = (UINT32)pTrackText ;
- SAMP_API_PARAM[6] = (UINT32)pCharSet ;
- SAMP_API_PARAM[7] = (UINT32)pLanguage ;
- SAMP_APICallRequest (SDI_GETTRACKTEXT, &err);
- return err;
- }
- SAMP(ErrCode) SAMP_EXP(SDI_GetNumberOfIndices)( SAMP(SACD_Area) area, SAMP(UInt8) track, SAMP(UInt8) *pNrOfIndices )
- {
- SAMP(ErrCode) err;
- SAMP_API_PARAM[0] = (UINT32)area ;
- SAMP_API_PARAM[1] = (UINT32)track ;
- SAMP_API_PARAM[2] = (UINT32)pNrOfIndices ;
- SAMP_APICallRequest (SDI_GETNUMOFINDEX, &err);
- return err;
- }
- SAMP(ErrCode) SAMP_EXP(SDI_GetDTCP_Info)(SAMP(UInt32) offset, SAMP(UInt32) size, void *pBuffer)
- {
- SAMP(ErrCode) err;
- SAMP_API_PARAM[0] = (UINT32)offset ;
- SAMP_API_PARAM[1] = (UINT32)size ;
- SAMP_API_PARAM[2] = (UINT32)pBuffer ;
- SAMP_APICallRequest (SDI_GETDTCPINFO, &err);
- return err;
- }
- SAMP(ErrCode) SAMP_EXP(SDI_GetSpecVersion)( SAMP(SDI_Spec_Version) *pSpecVersion )
- {
- SAMP(ErrCode) err;
- SAMP_API_PARAM[0] = (UINT32)pSpecVersion ;
- SAMP_APICallRequest (SDI_GETSPECVERSION, &err);
- return err;
- }
- SAMP(ErrCode) SAMP_EXP(SDI_GetAreaData)(SAMP(SACD_Area) area, SAMP(SDI_Area_Data) *pAreaData )
- {
- SAMP(ErrCode) err;
- SAMP_API_PARAM[0] = (UINT32)area ;
- SAMP_API_PARAM[1] = (UINT32)pAreaData ;
- SAMP_APICallRequest (SDI_GETAREADATA, &err);
- return err;
- }
- #endif//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- #endif // D_SUPPORT_SACD