RESULT eServiceDVD::setFastForward(int trick) { eDebug("setTrickmode(%d)", trick); while (m_current_trick > trick && m_current_trick != -64) { ddvd_send_key(m_ddvdconfig, DDVD_KEY_FBWD); if (m_current_trick == 0) m_current_trick = -2; else if (m_current_trick > 0) { m_current_trick /= 2; if (abs(m_current_trick) == 1) m_current_trick=0; } else m_current_trick *= 2; } while (m_current_trick < trick && m_current_trick != 64) { ddvd_send_key(m_ddvdconfig, DDVD_KEY_FFWD); if (m_current_trick == 0) m_current_trick = 2; else if (m_current_trick < 0) { m_current_trick /= 2; if (abs(m_current_trick) == 1) m_current_trick=0; } else m_current_trick *= 2; } return 0; }
RESULT eServiceDVD::setFastForward(int trick) { eDebug("[eServiceDVD] setTrickmode(%d)", trick); ddvd_send_key(m_ddvdconfig, trick < 0 ? DDVD_KEY_FASTBWD : DDVD_KEY_FASTFWD); ddvd_send_key(m_ddvdconfig, trick); return 0; }
// iPausableService RESULT eServiceDVD::setSlowMotion(int ratio) { eDebug("[eServiceDVD] setSlowmode(%d)", ratio); // pass ratio as repeat factor. // ratio=2 means 1/2 speed // ratio=3 means 1/3 speed ddvd_send_key(m_ddvdconfig, ratio < 0 ? DDVD_KEY_SLOWBWD : DDVD_KEY_SLOWFWD); ddvd_send_key(m_ddvdconfig, ratio); return 0; }
RESULT eServiceDVD::stop() { ASSERT(m_state != stIdle); if (m_state == stStopped) return -1; eDebug("DVD: stop %s", m_ref.path.c_str()); m_state = stStopped; ddvd_send_key(m_ddvdconfig, DDVD_KEY_EXIT); return 0; }
RESULT eServiceDVD::keyPressed(int key) { switch(key) { case iServiceKeys::keyLeft: ddvd_send_key(m_ddvdconfig, DDVD_KEY_LEFT); break; case iServiceKeys::keyRight: ddvd_send_key(m_ddvdconfig, DDVD_KEY_RIGHT); break; case iServiceKeys::keyUp: ddvd_send_key(m_ddvdconfig, DDVD_KEY_UP); break; case iServiceKeys::keyDown: ddvd_send_key(m_ddvdconfig, DDVD_KEY_DOWN); break; case iServiceKeys::keyOk: ddvd_send_key(m_ddvdconfig, DDVD_KEY_OK); break; case iServiceKeys::keyUser: ddvd_send_key(m_ddvdconfig, DDVD_KEY_AUDIO); break; case iServiceKeys::keyUser+1: ddvd_send_key(m_ddvdconfig, DDVD_KEY_SUBTITLE); break; case iServiceKeys::keyUser+2: ddvd_send_key(m_ddvdconfig, DDVD_KEY_AUDIOMENU); break; case iServiceKeys::keyUser+3: ddvd_send_key(m_ddvdconfig, DDVD_KEY_NEXT_CHAPTER); break; case iServiceKeys::keyUser+4: ddvd_send_key(m_ddvdconfig, DDVD_KEY_PREV_CHAPTER); break; case iServiceKeys::keyUser+5: ddvd_send_key(m_ddvdconfig, DDVD_KEY_NEXT_TITLE); break; case iServiceKeys::keyUser+6: ddvd_send_key(m_ddvdconfig, DDVD_KEY_PREV_TITLE); break; case iServiceKeys::keyUser+7: ddvd_send_key(m_ddvdconfig, DDVD_KEY_MENU); break; case iServiceKeys::keyUser+8: ddvd_send_key(m_ddvdconfig, DDVD_KEY_ANGLE); break; default: return -1; } return 0; }
RESULT eServiceDVD::unpause() { eDebug("set unpause!\n"); ddvd_send_key(m_ddvdconfig, DDVD_KEY_PLAY); return 0; }
RESULT eServiceDVD::unpause() { eDebug("[eServiceDVD] unpause sending key\n"); ddvd_send_key(m_ddvdconfig, DDVD_KEY_PLAY); return 0; }