📄 dvdcontrol.c
字号:
* @retval DVD_E_Ok Success. * @retval DVD_E_NotImplemented The function is not implemented. */DVDResult_t DVDGetDefaultAudioLanguage(DVDNav_t *nav, DVDLangID_t *const Language, DVDAudioLangExt_t *const AudioExtension){ return DVD_E_NotImplemented;}/** * Querry the currently selected angle. * @param nav Specifies the connection to the DVD navigator. * * @return If successful DVD_E_Ok is returned. Otherwise an error code * is returned. * * @retval DVD_E_Ok Success. * @retval DVD_E_FailedToSend Failed to send the request. */DVDResult_t DVDGetCurrentAngle(DVDNav_t *nav, int *const AnglesAvailable, DVDAngle_t *const CurrentAngle){ MsgEvent_t ev; int32_t serial; ev.type = MsgEventQDVDCtrl; DVD_SETSERIAL(nav, ev.dvdctrl.cmd); serial = ev.dvdctrl.cmd.any.serial; ev.dvdctrl.cmd.type = DVDCtrlGetCurrentAngle; if(MsgSendEvent(nav->msgq, nav->client, &ev, 0) == -1) { return DVD_E_FailedToSend; } while(1) { if(MsgNextEvent(nav->msgq, &ev) == -1) { return DVD_E_Unspecified; } if((ev.type == MsgEventQDVDCtrl) && (ev.dvdctrl.cmd.type == DVDCtrlRetVal) && (ev.dvdctrl.cmd.retval.serial == serial)) { return ev.dvdctrl.cmd.retval.val; } if((ev.type == MsgEventQDVDCtrl) && (ev.dvdctrl.cmd.type == DVDCtrlCurrentAngle)) { *AnglesAvailable = ev.dvdctrl.cmd.currentangle.anglesavailable; *CurrentAngle = ev.dvdctrl.cmd.currentangle.anglenr; return DVD_E_Ok; } }}/** * Query the current DVD volume information. * @param nav Specifies the connection to the DVD navigator. * @param VolumeInfo will get the Volume info of the DVD. * * @return If successful DVD_E_Ok is returned. Otherwise an error code * is returned. * * @retval DVD_E_Ok Success. * @retval DVD_E_FailedToSend Failed to send the request. */DVDResult_t DVDGetDVDVolumeInfo(DVDNav_t *nav, DVDVolumeInfo_t *const VolumeInfo){ MsgEvent_t ev; int32_t serial; ev.type = MsgEventQDVDCtrl; DVD_SETSERIAL(nav, ev.dvdctrl.cmd); serial = ev.dvdctrl.cmd.any.serial; ev.dvdctrl.cmd.type = DVDCtrlGetDVDVolumeInfo; if(MsgSendEvent(nav->msgq, nav->client, &ev, 0) == -1) { return DVD_E_FailedToSend; } while(1) { if(MsgNextEvent(nav->msgq, &ev) == -1) { return DVD_E_Unspecified; } if((ev.type == MsgEventQDVDCtrl) && (ev.dvdctrl.cmd.type == DVDCtrlRetVal) && (ev.dvdctrl.cmd.retval.serial == serial)) { return ev.dvdctrl.cmd.retval.val; } if((ev.type == MsgEventQDVDCtrl) && (ev.dvdctrl.cmd.type == DVDCtrlDVDVolumeInfo)) { *VolumeInfo = ev.dvdctrl.cmd.volumeinfo.volumeinfo; return DVD_E_Ok; } }}/** * Query the number of Titel tracks on the DVD. * @param nav Specifies the connection to the DVD navigator. * @param TitlesAvailable Will contain the number of Title tracks. * * @return If successful DVD_E_Ok is returned. Otherwise an error code * is returned. * * @retval DVD_E_Ok Success. * @retval DVD_E_FailedToSend Failed to send the request. */DVDResult_t DVDGetTitles(DVDNav_t *nav, int *const TitlesAvailable){ MsgEvent_t ev; int32_t serial; ev.type = MsgEventQDVDCtrl; DVD_SETSERIAL(nav, ev.dvdctrl.cmd); serial = ev.dvdctrl.cmd.any.serial; ev.dvdctrl.cmd.type = DVDCtrlGetTitles; if(MsgSendEvent(nav->msgq, nav->client, &ev, 0) == -1) { return DVD_E_FailedToSend; } while(1) { if(MsgNextEvent(nav->msgq, &ev) == -1) { return DVD_E_Unspecified; } if((ev.type == MsgEventQDVDCtrl) && (ev.dvdctrl.cmd.type == DVDCtrlRetVal) && (ev.dvdctrl.cmd.retval.serial == serial)) { return ev.dvdctrl.cmd.retval.val; } if((ev.type == MsgEventQDVDCtrl) && (ev.dvdctrl.cmd.type == DVDCtrlTitles)) { *TitlesAvailable = ev.dvdctrl.cmd.titles.titles; return DVD_E_Ok; } }}/** * Querry the current domain. * @param nav Specifies the connection to the DVD navigator. * @param Domain Will contain the current domain. * * @return If successful DVD_E_Ok is returned. Otherwise an error code * is returned. * * @retval DVD_E_Ok Success. * @retval DVD_E_FailedToSend Failed to send the request. */DVDResult_t DVDGetCurrentDomain(DVDNav_t *nav, DVDDomain_t *const Domain){ MsgEvent_t ev; int32_t serial; ev.type = MsgEventQDVDCtrl; DVD_SETSERIAL(nav, ev.dvdctrl.cmd); serial = ev.dvdctrl.cmd.any.serial; ev.dvdctrl.cmd.type = DVDCtrlGetCurrentDomain; if(MsgSendEvent(nav->msgq, nav->client, &ev, 0) == -1) { return DVD_E_FailedToSend; } while(1) { if(MsgNextEvent(nav->msgq, &ev) == -1) { return DVD_E_Unspecified; } if((ev.type == MsgEventQDVDCtrl) && (ev.dvdctrl.cmd.type == DVDCtrlRetVal) && (ev.dvdctrl.cmd.retval.serial == serial)) { return ev.dvdctrl.cmd.retval.val; } if((ev.type == MsgEventQDVDCtrl) && (ev.dvdctrl.cmd.type == DVDCtrlCurrentDomain)) { *Domain = ev.dvdctrl.cmd.domain.domain; return DVD_E_Ok; } } }/** * Get the current location information. * @param nav Specifies the connection to the DVD navigator. * @param Location Will contain the current location information. * * @return If successful DVD_E_Ok is returned. Otherwise an error code * is returned. * * @retval DVD_E_Ok Success. * @retval DVD_E_FailedToSend Failed to send the request. */DVDResult_t DVDGetCurrentLocation(DVDNav_t *nav, DVDLocation_t *const Location){ MsgEvent_t ev; int32_t serial; ev.type = MsgEventQDVDCtrl; DVD_SETSERIAL(nav, ev.dvdctrl.cmd); serial = ev.dvdctrl.cmd.any.serial; ev.dvdctrl.cmd.type = DVDCtrlGetCurrentLocation; if(MsgSendEvent(nav->msgq, nav->client, &ev, 0) == -1) { return DVD_E_FailedToSend; } while(1) { if(MsgNextEvent(nav->msgq, &ev) == -1) { return DVD_E_Unspecified; } if((ev.type == MsgEventQDVDCtrl) && (ev.dvdctrl.cmd.type == DVDCtrlRetVal) && (ev.dvdctrl.cmd.retval.serial == serial)) { return ev.dvdctrl.cmd.retval.val; } if((ev.type == MsgEventQDVDCtrl) && (ev.dvdctrl.cmd.type == DVDCtrlCurrentLocation)) { *Location = ev.dvdctrl.cmd.location.location; return DVD_E_Ok; } } }/** * Querry the number of Part's (Chapters) for a Title track. * @param nav Specifies the connection to the DVD navigator. * @param Title The Title track number. * @param PartsAvailable Will contain the number of Title tracks. * * @return If successful DVD_E_Ok is returned. Otherwise an error code * is returned. * * @retval DVD_E_Ok Success. * @retval DVD_E_FailedToSend Failed to send the request. */DVDResult_t DVDGetNumberOfPTTs(DVDNav_t *nav, DVDTitle_t Title, int *const PartsAvailable){ MsgEvent_t ev; int32_t serial; ev.type = MsgEventQDVDCtrl; DVD_SETSERIAL(nav, ev.dvdctrl.cmd); serial = ev.dvdctrl.cmd.any.serial; ev.dvdctrl.cmd.type = DVDCtrlGetNumberOfPTTs; ev.dvdctrl.cmd.parts.title = Title; if(MsgSendEvent(nav->msgq, nav->client, &ev, 0) == -1) { return DVD_E_FailedToSend; } while(1) { if(MsgNextEvent(nav->msgq, &ev) == -1) { return DVD_E_Unspecified; } if((ev.type == MsgEventQDVDCtrl) && (ev.dvdctrl.cmd.type == DVDCtrlRetVal) && (ev.dvdctrl.cmd.retval.serial == serial)) { return ev.dvdctrl.cmd.retval.val; } if((ev.type == MsgEventQDVDCtrl) && (ev.dvdctrl.cmd.type == DVDCtrlNumberOfPTTs)) { *PartsAvailable = ev.dvdctrl.cmd.parts.ptts; return DVD_E_Ok; } }}/** * @todo Implement function. * * @param nav Specifies the connection to the DVD navigator. * * @return If successful DVD_E_Ok is returned. Otherwise an error code * is returned. * * @retval DVD_E_Ok Success. * @retval DVD_E_NotImplemented The function is not implemented. */DVDResult_t DVDGetCurrentVideoAttributes(DVDNav_t *nav, DVDVideoAttributes_t *const Attr){ return DVD_E_NotImplemented;}/** * Get the number of available subpicture streams and the current one. * @todo handle more return events. * @todo more return values. * * @param nav Specifies the connection to the DVD navigator. * @param StreamsAvailable Points to where the number of available * streams will be written. * @param CurrentStream Points to where the current stream will be written. * @param Display Specifies if the subpicture display is on or off * * @return If successful DVD_E_Ok is returned. Otherwise an error code * is returned. * * @retval DVD_E_Ok Success. * @retval DVD_E_FailedToSend Failed to send the request. */DVDResult_t DVDGetCurrentSubpicture(DVDNav_t *nav, int *const StreamsAvailable, DVDSubpictureStream_t *const CurrentStream, DVDBool_t *const Display){ MsgEvent_t ev; int32_t serial; ev.type = MsgEventQDVDCtrl; DVD_SETSERIAL(nav, ev.dvdctrl.cmd); serial = ev.dvdctrl.cmd.any.serial; ev.dvdctrl.cmd.type = DVDCtrlGetCurrentSubpicture; if(MsgSendEvent(nav->msgq, nav->client, &ev, 0) == -1) { return DVD_E_FailedToSend; } while(1) { if(MsgNextEvent(nav->msgq, &ev) == -1) { return DVD_E_Unspecified; } if((ev.type == MsgEventQDVDCtrl) && (ev.dvdctrl.cmd.type == DVDCtrlRetVal) && (ev.dvdctrl.cmd.retval.serial == serial)) { return ev.dvdctrl.cmd.retval.val; } if((ev.type == MsgEventQDVDCtrl) && (ev.dvdctrl.cmd.type == DVDCtrlCurrentSubpicture)) { *StreamsAvailable = ev.dvdctrl.cmd.currentsubpicture.nrofstreams; *CurrentStream = ev.dvdctrl.cmd.currentsubpicture.currentstream; *Display = ev.dvdctrl.cmd.currentsubpicture.display; return DVD_E_Ok; } } }/** * Checks if the specified subpicture stream is available. * @todo handle other return events * @todo more return values * * @param nav Specifies the connection to the DVD navigator. * @param StreamNr Specifies the subpicture stream to retrieve information * for. * @param Enabled Specifies if the subpicture stream is enabled or disabled. * * @return If successful DVD_E_Ok is returned. Otherwise an error code * is returned. * * @retval DVD_E_Ok Success. * @retval DVD_E_FailedToSend Failed to send the request. */DVDResult_t DVDIsSubpictureStreamEnabled(DVDNav_t *nav, DVDSubpictureStream_t StreamNr, DVDBool_t *const Enabled){ MsgEvent_t ev; int32_t serial; ev.type = MsgEventQDVDCtrl; DVD_SETSERIAL(nav, ev.dvdctrl.cmd); serial = ev.dvdctrl.cmd.any.serial; ev.dvdctrl.cmd.type = DVDCtrlIsSubpictureStreamEnabled; ev.dvdctrl.cmd.subpicturestreamenabled.streamnr = StreamNr; if(MsgSendEvent(nav->msgq, nav->client, &ev, 0) == -1) { return DVD_E_FailedToSend; } while(1) { if(MsgNextEvent(nav->msgq, &ev) == -1) { return DVD_E_Unspecified; } if((ev.type == MsgEventQDVDCtrl) && (ev.dvdctrl.cmd.type == DVDCtrlRetVal) && (ev.dvdctrl.cmd.retval.serial == serial)) { return ev.dvdctrl.cmd.retval.val; } if((ev.type == MsgEventQDVDCtrl) && (ev.dvdctrl.cmd.type == DVDCtrlSubpictureStreamEnabled)) { if(ev.dvdctrl.cmd.subpicturestreamenabled.streamnr == StreamNr) { *Enabled = ev.dvdctrl.cmd.subpicturestreamenabled.enabled; return DVD_E_Ok; } } } }/** * Get the attributes of the specified subpicture stream. * @todo handle other return events. * @todo more return values. * * @param nav Specifies the connection to the DVD navigator. * @param StreamNr Specifies which subpicture stream attributes * will be retrieved for. * @param Attr Points to where the attributes of the specified * subpicture stream will be written. * * @return If successful DVD_E_Ok is returned and the attributes * pointed to by Attr have been updated. Otherwise an error code * is returned. * * @retval DVD_E_Ok Success. * @retval DVD_E_FailedToSend Failed to send the request. */DVDResult_t DVDGetSubpictureAttributes(DVDNav_t *nav, DVDSubpictureStream_t StreamNr, DVDSubpictureAttributes_t *const Attr){ MsgEvent_t ev; int32_t serial; ev.type = MsgEventQDVDCtrl; DVD_SETSERIAL(nav, ev.dvdctrl.cmd); serial = ev.dvdctrl.cmd.any.serial; ev.dvdctrl.cmd.type = DVDCtrlGetSubpictureAttributes; ev.dvdctrl.cmd.subpictureattributes.streamnr = StreamNr; if(MsgSendEvent(nav->msgq, nav->client, &ev, 0) == -1) { return DVD_E_FailedToSend; } while(1) { if(MsgNextEvent(nav->msgq, &ev) == -1) { return DVD_E_Unspecified; } if((ev.type == MsgEventQDVDCtrl) && (ev.dvdctrl.cmd.type == DVDCtrlRetVal) && (ev.dvdctrl.cmd.retval.serial == serial)) { return ev.dvdctrl.cmd.retval.val; } if((ev.type == MsgEventQDVDCtrl) && (ev.dvdctrl.cmd.type == DVDCtrlSubpictureAttributes)) { if(ev.dvdctrl.cmd.subpictureattributes.streamnr == StreamNr) { memcpy((void *)Attr, (void *)&(ev.dvdctrl.cmd.subpictureattributes.attr), sizeof(DVDSubpictureAttributes_t)); return DVD_E_Ok; } } } }/** * Get the language of an subpicture stream. * @todo Implement function. * * @param nav Specifies the connection to the DVD navigator. * @param StreamNr Specifies the subpicture stream which laguage code * will be retrieved. * @param Language Points to where the language code of the * specified subpicture stream will be written. * * @return If successful DVD_E_Ok is returned. Otherwise an error code * is returned. * * @retval DVD_E_Ok Success. * @retval DVD_E_NotImplemented The function is not implemented. */DVDResult_t DVDGetSubpictureLanguage(DVDNav_t *nav, DVDSubpictureStream_t StreamNr, DVDLangID_t *const Language){ return DVD_E_NotImplemented;}/** * @todo Implement function. * * @param nav Specifies the connection to the DVD navigator. * * @return If successful DVD_E_Ok is returned. Otherwise an error code * is returned. * * @retval DVD_E_Ok Success. * @retval DVD_E_NotImplemented The function is not implemented. */DVDResult_t DVDGetDefaultSubpictureLanguage(DVDNav_t *nav, DVDLangID_t *const Language, DVDSubpictureLangExt_t *const SubpictureExtension){ return DVD_E_NotImplemented;}/** * Get the state * @todo handle other return events. * @todo more return values. * * @param nav Specifies the connection to the DVD navigator. * @param state This will be set to point to the returned state. * Use free() when not needed any more. * * @return If successful DVD_E_Ok is returned and the char pointer pointed * to by state will be updated. Otherwise an error code is returned. * * @retval DVD_E_Ok Success.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -