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


C++ MediaPlayer::GetNextMode方法代码示例

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


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

示例1: PreparePlayerCommands

void MenuManager::PreparePlayerCommands(MediaPlayer& player)
{
	ITSMenu& mnu = GetMenu(MNU_PlayListModes);
	INT mode = 0;
	MediaPlayerNextMode mpm = player.GetNextMode(&mode);
	for (int i = MPNM_Normal; i < MPNM_Last; i++)
		mnu.CheckMenuItem(MENU_PlayModesHolder + i, mpm == i ? MF_CHECKED : MF_UNCHECKED );
	for (int i = RTM_All; i < RTM_Last; i++)
		mnu.CheckMenuItem(MENU_AutoContinueModeHolder + i, mode == i ? MF_CHECKED : MF_UNCHECKED );
}
开发者ID:KurzedMetal,项目名称:Jaangle,代码行数:10,代码来源:MenuManager.cpp

示例2: GetTitle

LPCTSTR PlayListPane::GetTitle(UINT idx)
{
	PrgAPI* pAPI = PRGAPI();
	switch (idx % 5)
	{
	case 0:
		return pAPI->GetString(IDS_PLAYLIST);
		break;//=== Show the default (at the end)
	case 1:
		{
			MediaPlayer* pl = pAPI->GetMediaPlayer();
			INT ACmode = 0;
			MediaPlayerNextMode mpm = pl->GetNextMode(&ACmode);
			if (mpm == MPNM_AutoContinue)
			{
				//INT mode = pAPI->GetOption(OPT_PL_AutoContinueMode);
				_sntprintf(m_stringBuffer, 500, _T("%s: %s [%s]"),
					pAPI->GetString(IDS_MODE),
					pAPI->GetStringForPlayListMode(mpm), 
					pAPI->GetStringForRandomMode(RandomTrackModeEnum(ACmode)));
			}
			else
				_sntprintf(m_stringBuffer, 500, _T("%s: %s"), 
					pAPI->GetString(IDS_MODE), 
					pAPI->GetStringForPlayListMode(MediaPlayerNextMode(mpm)));
		} 
		break;
	case 2:
		{
			MediaPlayer* pl = pAPI->GetMediaPlayer();
			INT totalTracks = pl->GetPlayListCount();
			_sntprintf(m_stringBuffer, 500, _T("%s: %d"), pAPI->GetString(IDS_TRACKS), totalTracks);
		} 
		break;
	case 3:
		{
			MediaPlayer* pl = pAPI->GetMediaPlayer();
			INT totalTracks = pl->GetPlayListCount();
			INT totalSeconds = 0;
			MediaPlayListItem mpli;
			BOOL bHasZeroLength = FALSE;
			for (INT i = 0; i < totalTracks; i++)
			{
				if (pl->GetPlayListItem(mpli, i))
				{
					if (mpli.length == 0)
						bHasZeroLength = TRUE;
					totalSeconds += mpli.length;
				}
			}
			TCHAR time[40];
			if (totalSeconds >= 3600)
				_sntprintf(time, 40, _T("%d:%02d:%02d"), INT (totalSeconds / 3600), INT((totalSeconds % 3600)/60), INT(totalSeconds) % 60);
			else
				_sntprintf(time, 40, _T("%d:%02d"), INT (totalSeconds / 60), INT(totalSeconds) % 60);

			_sntprintf(m_stringBuffer, 500, _T("%s: %s%s"), pAPI->GetString(IDS_DURATION),  time, bHasZeroLength ? _T(" +") : _T(""));
		} 
		break;
	case 4:
		_sntprintf(m_stringBuffer, 500, _T("%s: [F4]"), pAPI->GetString(IDS_FOCUS));
		break;
	default:
		ASSERT(0);
		return NULL;
	}
	return m_stringBuffer;
}
开发者ID:KurzedMetal,项目名称:Jaangle,代码行数:68,代码来源:PlayListPane.cpp

示例3: HandlePlayerCommands

BOOL MenuManager::HandlePlayerCommands(MediaPlayer& player, MenuCommandsEnum cmd, INT playlistPos)
{
	TRACEST(_T("MenuManager::HandlePlayerCommands"));
	PrgAPI* pAPI = PRGAPI();
	ActionManager* pAM = pAPI->GetActionManager();
	switch (cmd)
	{
		//=== Play Control =========================================
	case MENU_PlayControl:
		player.Start();
		break;
	case MENU_PauseControl:
		if (player.GetPlayState() == PS_Paused)
			player.Start();
		else
			player.Pause();
		break;
	case MENU_StopControl:
		player.Stop();
		break;
	case MENU_NextControl:
		player.Next();
		break;
	case MENU_PrevControl:
		player.Previous();
		break;
		//=== Playlist Serialization =========================================
	case MENU_LoadList:
		pAM->InsertPlayList(&player, -1);
		break;
	case MENU_SaveList:
		pAM->SavePlayList(&player);
		break;
	case MENU_InsertList:
		pAM->InsertPlayList(&player, playlistPos);
		break;
	default:
		//=== PlayModes =========================================
		if (cmd>= MENU_PlayModesHolder && cmd < MENU_PlayModesHolder + MPNM_Last)
			player.SetNextMode(MediaPlayerNextMode(cmd - MENU_PlayModesHolder), -1);
		else if (cmd >= MENU_AutoContinueModeHolder && cmd < MENU_AutoContinueModeHolder + RTM_Last)
		{
			player.SetNextMode(player.GetNextMode(NULL), cmd - MENU_AutoContinueModeHolder);
		}
		//=== Rating =========================================
		else if (cmd>= MENU_RatingHolder && cmd <= MENU_RatingHolder + 5)
		{
			int idx = playlistPos;
			if (idx >= 0)
			{
				SQLManager* pSM = PRGAPI()->GetSQLManager();
				MediaPlayListItem mpli;
				if (player.GetPlayListItem(mpli, idx))
				{
					FullTrackRecordSP rec;
					if (pSM->GetFullTrackRecordByLocation(rec, mpli.url))
					{
						FullTrackRecordCollection col;
						col.push_back(rec);
						ActionManager* pAM = PRGAPI()->GetActionManager();
						pAM->SetTrackRating(col, Stars2Rating((FLOAT)(cmd - MENU_RatingHolder)));
					}
				}
			}
		}

		else
			return FALSE;
	}
	return TRUE;
}
开发者ID:KurzedMetal,项目名称:Jaangle,代码行数:71,代码来源:MenuManager.cpp


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