当前位置: 首页>>代码示例>>C++>>正文


C++ OMXPlayerSubtitles::GetDelay方法代码示例

本文整理汇总了C++中OMXPlayerSubtitles::GetDelay方法的典型用法代码示例。如果您正苦于以下问题:C++ OMXPlayerSubtitles::GetDelay方法的具体用法?C++ OMXPlayerSubtitles::GetDelay怎么用?C++ OMXPlayerSubtitles::GetDelay使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OMXPlayerSubtitles的用法示例。


在下文中一共展示了OMXPlayerSubtitles::GetDelay方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: PrintSubtitleInfo

void PrintSubtitleInfo()
{
  auto count = m_omx_reader.SubtitleStreamCount();
  size_t index = 0;

  if(m_has_external_subtitles)
  {
    ++count;
    if(!m_player_subtitles.GetUseExternalSubtitles())
      index = m_player_subtitles.GetActiveStream() + 1;
  }
  else if(m_has_subtitle)
  {
      index = m_player_subtitles.GetActiveStream();
  }

  printf("Subtitle count: %d, state: %s, index: %d, delay: %d\n",
         count,
         m_has_subtitle && m_player_subtitles.GetVisible() ? " on" : "off",
         index+1,
         m_has_subtitle ? m_player_subtitles.GetDelay() : 0);
}
开发者ID:flavioalsoares,项目名称:omxplayer,代码行数:22,代码来源:omxplayer.cpp

示例2: main


//.........这里部分代码省略.........
        break;
      case 'm':
        if(m_has_subtitle)
        {
          if(m_player_subtitles.GetUseExternalSubtitles())
          {
            if(m_omx_reader.SubtitleStreamCount())
            {
              assert(m_player_subtitles.GetActiveStream() == 0);
              m_player_subtitles.SetUseExternalSubtitles(false);
            }
          }
          else
          {
            auto new_index = m_player_subtitles.GetActiveStream()+1;
            if(new_index < (size_t) m_omx_reader.SubtitleStreamCount())
              m_player_subtitles.SetActiveStream(new_index);
          }

          m_player_subtitles.SetVisible(true);
          PrintSubtitleInfo();
        }
        break;
      case 's':
        if(m_has_subtitle)
        {
          m_player_subtitles.SetVisible(!m_player_subtitles.GetVisible());
          PrintSubtitleInfo();
        }
        break;
      case 'd':
        if(m_has_subtitle && m_player_subtitles.GetVisible())
        {
          m_player_subtitles.SetDelay(m_player_subtitles.GetDelay() - 250);
          PrintSubtitleInfo();
        }
        break;
      case 'f':
        if(m_has_subtitle && m_player_subtitles.GetVisible())
        {
          m_player_subtitles.SetDelay(m_player_subtitles.GetDelay() + 250);
          PrintSubtitleInfo();
        }
        break;
      case 'q':
        m_stop = true;
        goto do_exit;
        break;
      case 0x5b44: // key left
        if(m_omx_reader.CanSeek()) m_incr = -30.0;
        break;
      case 0x5b43: // key right
        if(m_omx_reader.CanSeek()) m_incr = 30.0;
        break;
      case 0x5b41: // key up
        if(m_omx_reader.CanSeek()) m_incr = 600.0;
        break;
      case 0x5b42: // key down
        if(m_omx_reader.CanSeek()) m_incr = -600.0;
        break;
      case ' ':
      case 'p':
        m_Pause = !m_Pause;
        if(m_Pause)
        {
          SetSpeed(OMX_PLAYSPEED_PAUSE);
开发者ID:flavioalsoares,项目名称:omxplayer,代码行数:67,代码来源:omxplayer.cpp


注:本文中的OMXPlayerSubtitles::GetDelay方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。