⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dvdcontrol.c

📁 基于linux的DVD播放器程序
💻 C
📖 第 1 页 / 共 5 页
字号:
  MsgEvent_t ev;  ev.type = MsgEventQDVDCtrl;  DVD_SETSERIAL(nav, ev.dvdctrl.cmd);  ev.dvdctrl.cmd.type = DVDCtrlUpperButtonSelect;  if(MsgSendEvent(nav->msgq, nav->client, &ev, 0) == -1) {    return DVD_E_FailedToSend;  }    return DVD_E_Ok;}/**  * Selects the button below the current one. * @todo add mode return values * * @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 DVDLowerButtonSelect(DVDNav_t *nav){  MsgEvent_t ev;  ev.type = MsgEventQDVDCtrl;  DVD_SETSERIAL(nav, ev.dvdctrl.cmd);  ev.dvdctrl.cmd.type = DVDCtrlLowerButtonSelect;  if(MsgSendEvent(nav->msgq, nav->client, &ev, 0) == -1) {    return DVD_E_FailedToSend;  }    return DVD_E_Ok;}/**  * Activates the button currently selected. * @todo add mode return values * * @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 DVDButtonActivate(DVDNav_t *nav){  MsgEvent_t ev;  ev.type = MsgEventQDVDCtrl;  DVD_SETSERIAL(nav, ev.dvdctrl.cmd);  ev.dvdctrl.cmd.type = DVDCtrlButtonActivate;  if(MsgSendEvent(nav->msgq, nav->client, &ev, 0) == -1) {     return DVD_E_FailedToSend;  }   return DVD_E_Ok;}/**  * Selects the specified button. * @todo add mode return values * * @param nav Specifies the connection to the DVD navigator. * @param Button Specifies the button to select. * * @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 DVDButtonSelect(DVDNav_t *nav, int Button){  MsgEvent_t ev;  ev.type = MsgEventQDVDCtrl;  ev.dvdctrl.cmd.type = DVDCtrlButtonSelect;  DVD_SETSERIAL(nav, ev.dvdctrl.cmd);  ev.dvdctrl.cmd.button.nr = Button;    if(MsgSendEvent(nav->msgq, nav->client, &ev, 0) == -1) {    return DVD_E_FailedToSend;  }    return DVD_E_Ok;}/**  * Selects and activates the specified button. * @todo add mode return values * * @param nav Specifies the connection to the DVD navigator. * @param Button Specifies the button to select and activate. * * @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 DVDButtonSelectAndActivate(DVDNav_t *nav, int Button){  MsgEvent_t ev;  ev.type = MsgEventQDVDCtrl;  ev.dvdctrl.cmd.type = DVDCtrlButtonSelectAndActivate;  DVD_SETSERIAL(nav, ev.dvdctrl.cmd);  ev.dvdctrl.cmd.button.nr = Button;    if(MsgSendEvent(nav->msgq, nav->client, &ev, 0) == -1) {    return DVD_E_FailedToSend;  }    return DVD_E_Ok;}/**  * Selects the button at the specified position. * @todo add mode return values * * @param nav Specifies the connection to the DVD navigator. * @param x Specifies the x coordinate. * @param y Specifies the y coordinate. * * @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 DVDMouseSelect(DVDNav_t *nav, int x, int y){  MsgEvent_t ev;  ev.type = MsgEventQDVDCtrl;  DVD_SETSERIAL(nav, ev.dvdctrl.cmd);  ev.dvdctrl.cmd.type = DVDCtrlMouseSelect;  ev.dvdctrl.cmd.mouse.x = x;  ev.dvdctrl.cmd.mouse.y = y;    if(MsgSendEvent(nav->msgq, nav->client, &ev, 0) == -1) {    return DVD_E_FailedToSend;  }    return DVD_E_Ok;}/**  * Selects and activates the button at the specified position. * @todo add mode return values * * @param nav Specifies the connection to the DVD navigator. * @param x Specifies the x coordinate. * @param y Specifies the y coordinate. * * @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 DVDMouseActivate(DVDNav_t *nav, int x, int y){  MsgEvent_t ev;  ev.type = MsgEventQDVDCtrl;  DVD_SETSERIAL(nav, ev.dvdctrl.cmd);  ev.dvdctrl.cmd.type = DVDCtrlMouseActivate;  ev.dvdctrl.cmd.mouse.x = x;  ev.dvdctrl.cmd.mouse.y = y;  if(MsgSendEvent(nav->msgq, nav->client, &ev, 0) == -1) {    return DVD_E_FailedToSend;  }  return DVD_E_Ok;}/**  * Jumps to the specified menu. * @todo add more return values * * @param nav Specifies the connection to the DVD navigator. * @param MenuId Specifies the menu to display. * * @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 DVDMenuCall(DVDNav_t *nav, DVDMenuID_t MenuId){  MsgEvent_t ev;  ev.type = MsgEventQDVDCtrl;  DVD_SETSERIAL(nav, ev.dvdctrl.cmd);  ev.dvdctrl.cmd.type = DVDCtrlMenuCall;  ev.dvdctrl.cmd.menucall.menuid = MenuId;    if(MsgSendEvent(nav->msgq, nav->client, &ev, 0) == -1) {    return DVD_E_FailedToSend;  }    return DVD_E_Ok;}/**  * Resumes playback. * @todo add more return values. * * @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 DVDResume(DVDNav_t *nav){  MsgEvent_t ev;  ev.type = MsgEventQDVDCtrl;  DVD_SETSERIAL(nav, ev.dvdctrl.cmd);  ev.dvdctrl.cmd.type = DVDCtrlResume;    if(MsgSendEvent(nav->msgq, nav->client, &ev, 0) == -1) {    return DVD_E_FailedToSend;  }    return DVD_E_Ok;}/**  * Go up one level * @todo better description. * @todo add more return values. * * @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 DVDGoUp(DVDNav_t *nav){  MsgEvent_t ev;  ev.type = MsgEventQDVDCtrl;  DVD_SETSERIAL(nav, ev.dvdctrl.cmd);  ev.dvdctrl.cmd.type = DVDCtrlGoUp;    if(MsgSendEvent(nav->msgq, nav->client, &ev, 0) == -1) {    return DVD_E_FailedToSend;  }    return DVD_E_Ok;}/**  * Play forward at specified speed. * @todo better description. * @todo add more return values. * * @param nav Specifies the connection to the DVD navigator. * @param Speed Specifies the speed of play. * * @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 DVDForwardScan(DVDNav_t *nav, double Speed){  MsgEvent_t ev;  ev.type = MsgEventQDVDCtrl;  DVD_SETSERIAL(nav, ev.dvdctrl.cmd);  ev.dvdctrl.cmd.type = DVDCtrlForwardScan;  ev.dvdctrl.cmd.scan.speed = Speed;  if(MsgSendEvent(nav->msgq, nav->client, &ev, 0) == -1) {    return DVD_E_FailedToSend;  }    return DVD_E_Ok;}/**  * Play backward at specified speed. * @todo better description. * @todo add more return values. * * @param nav Specifies the connection to the DVD navigator. * @param Speed Specifies the speed of play. * * @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 DVDBackwardScan(DVDNav_t *nav, double Speed){  MsgEvent_t ev;  ev.type = MsgEventQDVDCtrl;  DVD_SETSERIAL(nav, ev.dvdctrl.cmd);  ev.dvdctrl.cmd.type = DVDCtrlBackwardScan;  ev.dvdctrl.cmd.scan.speed = Speed;  if(MsgSendEvent(nav->msgq, nav->client, &ev, 0) == -1) {    return DVD_E_FailedToSend;  }    return DVD_E_Ok;}/**  * Jump to the beginning of the next program * @todo more return values. * * @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 DVDNextPGSearch(DVDNav_t *nav){  MsgEvent_t ev;  ev.type = MsgEventQDVDCtrl;  DVD_SETSERIAL(nav, ev.dvdctrl.cmd);  ev.dvdctrl.cmd.type = DVDCtrlNextPGSearch;  if(MsgSendEvent(nav->msgq, nav->client, &ev, 0) == -1) {    return DVD_E_FailedToSend;  }    return DVD_E_Ok;}/**  * Jump to the beginning of the previous program * @todo more return values. * * @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 DVDPrevPGSearch(DVDNav_t *nav){  MsgEvent_t ev;  ev.type = MsgEventQDVDCtrl;  DVD_SETSERIAL(nav, ev.dvdctrl.cmd);  ev.dvdctrl.cmd.type = DVDCtrlPrevPGSearch;  if(MsgSendEvent(nav->msgq, nav->client, &ev, 0) == -1) {    return DVD_E_FailedToSend;  }    return DVD_E_Ok;}/**  * Jump to the beginning of the current PG. * @todo more return values. * * @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 DVDTopPGSearch(DVDNav_t *nav){  MsgEvent_t ev;  ev.type = MsgEventQDVDCtrl;  DVD_SETSERIAL(nav, ev.dvdctrl.cmd);  ev.dvdctrl.cmd.type = DVDCtrlTopPGSearch;  if(MsgSendEvent(nav->msgq, nav->client, &ev, 0) == -1) {    return DVD_E_FailedToSend;  }    return DVD_E_Ok;}/**  * Jump to beginning of the specified ptt in the current title. * @todo more return values. * * @param nav Specifies the connection to the DVD navigator. * @param PTT Specifies the PTT * * @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 DVDPTTSearch(DVDNav_t *nav, DVDPTT_t PTT){  MsgEvent_t ev;  ev.type = MsgEventQDVDCtrl;  DVD_SETSERIAL(nav, ev.dvdctrl.cmd);  ev.dvdctrl.cmd.type = DVDCtrlPTTSearch;  ev.dvdctrl.cmd.pttsearch.ptt = PTT;  if(MsgSendEvent(nav->msgq, nav->client, &ev, 0) == -1) {    return DVD_E_FailedToSend;  }    return DVD_E_Ok;}/**  * Jump to the beginning of the specified ptt in the specified title. * @todo more return values. * * @param nav Specifies the connection to the DVD navigator. * @param Title Specifies the Title. * @param PTT Specifies the PTT. * * @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 DVDPTTPlay(DVDNav_t *nav, DVDTitle_t Title, DVDPTT_t PTT){  MsgEvent_t ev;  ev.type = MsgEventQDVDCtrl;  DVD_SETSERIAL(nav, ev.dvdctrl.cmd);  ev.dvdctrl.cmd.type = DVDCtrlPTTPlay;  ev.dvdctrl.cmd.pttplay.title = Title;  ev.dvdctrl.cmd.pttplay.ptt = PTT;  if(MsgSendEvent(nav->msgq, nav->client, &ev, 0) == -1) {     return DVD_E_FailedToSend;  }   return DVD_E_Ok;}/**  * @todo more return values. * @todo better description. * * @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 DVDTitlePlay(DVDNav_t *nav, DVDTitle_t Title){  MsgEvent_t ev;  ev.type = MsgEventQDVDCtrl;  DVD_SETSERIAL(nav, ev.dvdctrl.cmd);  ev.dvdctrl.cmd.type = DVDCtrlTitlePlay;  ev.dvdctrl.cmd.titleplay.title = Title;  if(MsgSendEvent(nav->msgq, nav->client, &ev, 0) == -1) {    return DVD_E_FailedToSend;  }    return DVD_E_Ok;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -