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


C++ IPlayer::ProcessExternalMessage方法代码示例

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


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

示例1: ProcessMessage


//.........这里部分代码省略.........
    {
      CKey key(pMsg->dwParam1);
      g_application.OnKey(key);
    }
    break;

    case TMSG_SEND_MOVE:
    {
      CPoint p = g_Mouse.GetLocation();
      XBMC_Event newEvent;
      newEvent.type = XBMC_MOUSEMOTION;

      RESOLUTION iRes = g_graphicsContext.GetVideoResolution();
      int m_screenX1 = g_settings.m_ResInfo[iRes].Overscan.left;
      int m_screenY1 = g_settings.m_ResInfo[iRes].Overscan.top;
      int m_screenX2 = g_settings.m_ResInfo[iRes].Overscan.right;
      int m_screenY2 = g_settings.m_ResInfo[iRes].Overscan.bottom;

      newEvent.motion.x = std::max(m_screenX1, std::min(m_screenX2 - 10, (int)(p.x + (int)pMsg->dwParam1)));
      newEvent.motion.y = std::max(m_screenY1, std::min(m_screenY2 - 10, (int)(p.y + (int)pMsg->dwParam2)));

      g_Mouse.HandleEvent(newEvent);
    }
    break;

	case TMSG_SHOW_PLAY_ERROR:
    {
	    CGUIDialogOK2::ShowAndGetInput(g_localizeStrings.Get(257), pMsg->strParam);
	    break;
    }

    case TMSG_EXECUTE_ON_MAIN_THREAD:
    {
      IGUIThreadTask *t = (IGUIThreadTask *)(pMsg->lpVoid);
      if (t)
      {
        t->DoWork();
        if (pMsg->dwParam1 == 1)
          delete t;
      }
      break; 
    }

    case TMSG_DELETE_PLAYER:
    {
      IPlayer *player = (IPlayer *)pMsg->lpVoid;
      printf("deleting player %p\n", player);
      if (player)
        delete player;
    }
      break;
    case TMSG_APP_HANDLE:
    {
      std::vector<CStdString> vecParams = pMsg->params;
      CStdString strContext = vecParams[0];
      CStdString strHandler = vecParams[1];
      CStdString strParam = vecParams[2];

      if(g_application.OnAppMessage(strHandler, strParam) == true)
      {
        break;
      }

      CLog::Log(LOGDEBUG, "TMSG_APP_HANDLE received for application %s, handler = %s, param = %s (apphandle)", strContext.c_str(), strHandler.c_str(), strParam.c_str());
      CStdString targetPath = _P("special://home/apps/");
      targetPath += strContext;

      CStdString partnerId = CAppManager::GetInstance().GetDescriptor(strContext).GetPartnerId();
      CStdString globalHandler = CAppManager::GetInstance().GetDescriptor(strContext).GetGlobalHandler();

      char* argv[2];

      argv[0] = new char[strHandler.size() + 1];
      strncpy(argv[0], strHandler.c_str(), strHandler.size());

      argv[1] = new char[strParam.size() + 1];
      strncpy(argv[1], strParam.c_str(), strParam.size());

      std::vector<CStdString> params;
      params.push_back(strHandler);
      params.push_back(strParam);

#ifdef HAS_PYTHON
      g_pythonParser.evalStringInContext(globalHandler, targetPath, strContext, partnerId, params);
#endif

      delete argv[0];
      delete argv[1];
    }
    break;
    case TMSG_GUI_INVOKE_FROM_BROWSER:
    {
      IPlayer* player = static_cast<IPlayer*> (pMsg->lpVoid);
      player->ProcessExternalMessage(pMsg);
    }
    break;
      
      //end Boxee
  }
}
开发者ID:marksuman,项目名称:boxee,代码行数:101,代码来源:ApplicationMessenger.cpp


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