本文整理汇总了C++中CGUIMessage::GetNumStringParams方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUIMessage::GetNumStringParams方法的具体用法?C++ CGUIMessage::GetNumStringParams怎么用?C++ CGUIMessage::GetNumStringParams使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGUIMessage
的用法示例。
在下文中一共展示了CGUIMessage::GetNumStringParams方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnMessage
bool CGUIWindowAddonBrowser::OnMessage(CGUIMessage& message)
{
switch ( message.GetMessage() )
{
case GUI_MSG_WINDOW_DEINIT:
{
CRepositoryUpdater::GetInstance().Events().Unsubscribe(this);
CAddonMgr::GetInstance().Events().Unsubscribe(this);
if (m_thumbLoader.IsLoading())
m_thumbLoader.StopThread();
}
break;
case GUI_MSG_WINDOW_INIT:
{
CRepositoryUpdater::GetInstance().Events().Subscribe(this, &CGUIWindowAddonBrowser::OnEvent);
CAddonMgr::GetInstance().Events().Subscribe(this, &CGUIWindowAddonBrowser::OnEvent);
SetProperties();
}
break;
case GUI_MSG_CLICKED:
{
int iControl = message.GetSenderId();
if (iControl == CONTROL_FOREIGNFILTER)
{
CServiceBroker::GetSettings().ToggleBool(CSettings::SETTING_GENERAL_ADDONFOREIGNFILTER);
CServiceBroker::GetSettings().Save();
Refresh();
return true;
}
else if (iControl == CONTROL_BROKENFILTER)
{
CServiceBroker::GetSettings().ToggleBool(CSettings::SETTING_GENERAL_ADDONBROKENFILTER);
CServiceBroker::GetSettings().Save();
Refresh();
return true;
}
else if (iControl == CONTROL_CHECK_FOR_UPDATES)
{
CRepositoryUpdater::GetInstance().CheckForUpdates(true);
return true;
}
else if (iControl == CONTROL_SETTINGS)
{
g_windowManager.ActivateWindow(WINDOW_SETTINGS_SYSTEM, "addons");
return true;
}
else if (m_viewControl.HasControl(iControl)) // list/thumb control
{
// get selected item
int iItem = m_viewControl.GetSelectedItem();
int iAction = message.GetParam1();
// iItem is checked for validity inside these routines
if (iAction == ACTION_SHOW_INFO)
{
if (!m_vecItems->Get(iItem)->GetProperty("Addon.ID").empty())
return CGUIDialogAddonInfo::ShowForItem((*m_vecItems)[iItem]);
return false;
}
}
}
break;
case GUI_MSG_NOTIFY_ALL:
{
if (message.GetParam1() == GUI_MSG_UPDATE_ITEM && IsActive() && message.GetNumStringParams() == 1)
{ // update this item
for (int i = 0; i < m_vecItems->Size(); ++i)
{
CFileItemPtr item = m_vecItems->Get(i);
if (item->GetProperty("Addon.ID") == message.GetStringParam())
{
UpdateStatus(item);
FormatAndSort(*m_vecItems);
return true;
}
}
}
else if (message.GetParam1() == GUI_MSG_UPDATE && IsActive())
SetProperties();
}
break;
default:
break;
}
return CGUIMediaWindow::OnMessage(message);
}
示例2: OnMessage
//.........这里部分代码省略.........
{
int iItem = m_viewControl.GetSelectedItem();
Update(m_vecItems->GetPath());
m_viewControl.SetSelectedItem(iItem);
}
else if (m_vecItems->IsRemovable())
{ // check that we have this removable share still
if (!m_rootDir.IsInSource(m_vecItems->GetPath()))
{ // don't have this share any more
if (IsActive()) Update("");
else
{
m_history.ClearPathHistory();
m_vecItems->SetPath("");
}
}
}
return true;
}
else if (message.GetParam1()==GUI_MSG_UPDATE_SOURCES)
{ // State of the sources changed, so update our view
if ((m_vecItems->IsVirtualDirectoryRoot() ||
m_vecItems->IsSourcesPath()) && IsActive())
{
int iItem = m_viewControl.GetSelectedItem();
Update(m_vecItems->GetPath());
m_viewControl.SetSelectedItem(iItem);
}
return true;
}
else if (message.GetParam1()==GUI_MSG_UPDATE && IsActive())
{
if (message.GetNumStringParams())
{
m_vecItems->SetPath(message.GetStringParam());
if (message.GetParam2()) // param2 is used for resetting the history
SetHistoryForPath(m_vecItems->GetPath());
}
// clear any cached listing
m_vecItems->RemoveDiscCache(GetID());
Update(m_vecItems->GetPath());
}
else if (message.GetParam1()==GUI_MSG_UPDATE_ITEM && message.GetItem())
{
CFileItemPtr newItem = boost::static_pointer_cast<CFileItem>(message.GetItem());
if (IsActive())
{
if (m_vecItems->UpdateItem(newItem.get()) && message.GetParam2() == 1)
{ // need the list updated as well
UpdateFileList();
}
}
else if (newItem)
{ // need to remove the disc cache
CFileItemList items;
CStdString path;
URIUtils::GetDirectory(newItem->GetPath(), path);
items.SetPath(path);
items.RemoveDiscCache(GetID());
}
}
else if (message.GetParam1()==GUI_MSG_UPDATE_PATH)
{
if (IsActive())
{
示例3: OnMessage
bool CGUIWindowMusicPlaylistEditor::OnMessage(CGUIMessage& message)
{
switch ( message.GetMessage() )
{
case GUI_MSG_WINDOW_DEINIT:
if (m_thumbLoader.IsLoading())
m_thumbLoader.StopThread();
if (m_playlistThumbLoader.IsLoading())
m_playlistThumbLoader.StopThread();
CGUIWindowMusicBase::OnMessage(message);
return true;
case GUI_MSG_WINDOW_INIT:
{
if (m_vecItems->GetPath() == "?")
m_vecItems->SetPath("");
CGUIWindowMusicBase::OnMessage(message);
if (message.GetNumStringParams())
LoadPlaylist(message.GetStringParam());
return true;
}
break;
case GUI_MSG_NOTIFY_ALL:
{
if (message.GetParam1()==GUI_MSG_REMOVED_MEDIA)
DeleteRemoveableMediaDirectoryCache();
}
break;
case GUI_MSG_CLICKED:
{
int control = message.GetSenderId();
if (control == CONTROL_PLAYLIST)
{
int item = GetCurrentPlaylistItem();
int action = message.GetParam1();
if (action == ACTION_CONTEXT_MENU || action == ACTION_MOUSE_RIGHT_CLICK)
OnPlaylistContext();
else if (action == ACTION_QUEUE_ITEM || action == ACTION_DELETE_ITEM || action == ACTION_MOUSE_MIDDLE_CLICK)
OnDeletePlaylistItem(item);
else if (action == ACTION_MOVE_ITEM_UP)
OnMovePlaylistItem(item, -1);
else if (action == ACTION_MOVE_ITEM_DOWN)
OnMovePlaylistItem(item, 1);
return true;
}
else if (control == CONTROL_LOAD_PLAYLIST)
{ // load a playlist
OnLoadPlaylist();
return true;
}
else if (control == CONTROL_SAVE_PLAYLIST)
{ // save the playlist
OnSavePlaylist();
return true;
}
else if (control == CONTROL_CLEAR_PLAYLIST)
{ // clear the playlist
ClearPlaylist();
return true;
}
}
break;
}
return CGUIWindowMusicBase::OnMessage(message);
}
示例4: OnMessage
bool CGUIWindowAddonBrowser::OnMessage(CGUIMessage& message)
{
switch ( message.GetMessage() )
{
case GUI_MSG_WINDOW_DEINIT:
{
if (m_thumbLoader.IsLoading())
m_thumbLoader.StopThread();
}
break;
case GUI_MSG_WINDOW_INIT:
{
m_rootDir.AllowNonLocalSources(false);
// is this the first time the window is opened?
if (m_vecItems->GetPath() == "?" && message.GetStringParam().IsEmpty())
m_vecItems->SetPath("");
}
break;
case GUI_MSG_CLICKED:
{
int iControl = message.GetSenderId();
if (iControl == CONTROL_AUTOUPDATE)
{
CSettings::Get().ToggleBool("general.addonautoupdate");
return true;
}
else if (iControl == CONTROL_SHUTUP)
{
CSettings::Get().ToggleBool("general.addonnotifications");
CSettings::Get().Save();
return true;
}
else if (iControl == CONTROL_FOREIGNFILTER)
{
CSettings::Get().ToggleBool("general.addonforeignfilter");
CSettings::Get().Save();
Refresh();
return true;
}
else if (m_viewControl.HasControl(iControl)) // list/thumb control
{
// get selected item
int iItem = m_viewControl.GetSelectedItem();
int iAction = message.GetParam1();
// iItem is checked for validity inside these routines
if (iAction == ACTION_SHOW_INFO)
{
if (!m_vecItems->Get(iItem)->GetProperty("Addon.ID").empty())
return CGUIDialogAddonInfo::ShowForItem((*m_vecItems)[iItem]);
return false;
}
}
}
break;
case GUI_MSG_NOTIFY_ALL:
{
if (message.GetParam1() == GUI_MSG_UPDATE_ITEM && IsActive() && message.GetNumStringParams() == 1)
{ // update this item
for (int i = 0; i < m_vecItems->Size(); ++i)
{
CFileItemPtr item = m_vecItems->Get(i);
if (item->GetProperty("Addon.ID") == message.GetStringParam())
{
SetItemLabel2(item);
return true;
}
}
}
}
break;
default:
break;
}
return CGUIMediaWindow::OnMessage(message);
}
示例5: OnMessage
bool CGUIWindowAddonBrowser::OnMessage(CGUIMessage& message)
{
switch ( message.GetMessage() )
{
case GUI_MSG_WINDOW_DEINIT:
{
if (m_thumbLoader.IsLoading())
m_thumbLoader.StopThread();
}
break;
case GUI_MSG_WINDOW_INIT:
{
m_rootDir.AllowNonLocalSources(false);
// is this the first time the window is opened?
if (m_vecItems->GetPath() == "?" && message.GetStringParam().empty())
m_vecItems->SetPath("");
SetProperties();
}
break;
case GUI_MSG_CLICKED:
{
int iControl = message.GetSenderId();
if (iControl == CONTROL_AUTOUPDATE)
{
const CGUIControl *control = GetControl(CONTROL_AUTOUPDATE);
if (control && control->GetControlType() == CGUIControl::GUICONTROL_BUTTON)
CSettings::GetInstance().SetInt(CSettings::SETTING_GENERAL_ADDONUPDATES, (CSettings::GetInstance().GetInt(CSettings::SETTING_GENERAL_ADDONUPDATES)+1) % AUTO_UPDATES_MAX);
else
CSettings::GetInstance().SetInt(CSettings::SETTING_GENERAL_ADDONUPDATES, (CSettings::GetInstance().GetInt(CSettings::SETTING_GENERAL_ADDONUPDATES) == 0) ? 1 : 0);
UpdateButtons();
return true;
}
else if (iControl == CONTROL_SHUTUP)
{
CSettings::GetInstance().ToggleBool(CSettings::SETTING_GENERAL_ADDONNOTIFICATIONS);
CSettings::GetInstance().Save();
return true;
}
else if (iControl == CONTROL_FOREIGNFILTER)
{
CSettings::GetInstance().ToggleBool(CSettings::SETTING_GENERAL_ADDONFOREIGNFILTER);
CSettings::GetInstance().Save();
Refresh();
return true;
}
else if (iControl == CONTROL_BROKENFILTER)
{
CSettings::GetInstance().ToggleBool(CSettings::SETTING_GENERAL_ADDONBROKENFILTER);
CSettings::GetInstance().Save();
Refresh();
return true;
}
else if (iControl == CONTROL_CHECK_FOR_UPDATES)
{
CRepositoryUpdater::GetInstance().CheckForUpdates(true);
return true;
}
else if (m_viewControl.HasControl(iControl)) // list/thumb control
{
// get selected item
int iItem = m_viewControl.GetSelectedItem();
int iAction = message.GetParam1();
// iItem is checked for validity inside these routines
if (iAction == ACTION_SHOW_INFO)
{
if (!m_vecItems->Get(iItem)->GetProperty("Addon.ID").empty())
return CGUIDialogAddonInfo::ShowForItem((*m_vecItems)[iItem]);
return false;
}
}
}
break;
case GUI_MSG_NOTIFY_ALL:
{
if (message.GetParam1() == GUI_MSG_UPDATE_ITEM && IsActive() && message.GetNumStringParams() == 1)
{ // update this item
for (int i = 0; i < m_vecItems->Size(); ++i)
{
CFileItemPtr item = m_vecItems->Get(i);
if (item->GetProperty("Addon.ID") == message.GetStringParam())
{
SetItemLabel2(item);
return true;
}
}
}
else if (message.GetParam1() == GUI_MSG_UPDATE && IsActive())
SetProperties();
}
break;
default:
break;
}
return CGUIMediaWindow::OnMessage(message);
}
示例6: OnMessage
//.........这里部分代码省略.........
if (m_vecItems->IsVirtualDirectoryRoot() && IsActive())
{
int iItem = m_viewControl.GetSelectedItem();
Update(m_vecItems->m_strPath);
m_viewControl.SetSelectedItem(iItem);
}
else if (m_vecItems->IsRemovable())
{ // check that we have this removable share still
if (!m_rootDir.IsInSource(m_vecItems->m_strPath))
{ // don't have this share any more
if (IsActive()) Update("");
else
{
m_history.ClearPathHistory();
m_vecItems->m_strPath="";
}
}
}
return true;
}
else if (message.GetParam1()==GUI_MSG_UPDATE_SOURCES)
{ // State of the sources changed, so update our view
if (m_vecItems->IsVirtualDirectoryRoot() && IsActive())
{
int iItem = m_viewControl.GetSelectedItem();
Update(m_vecItems->m_strPath);
m_viewControl.SetSelectedItem(iItem);
}
return true;
}
else if (message.GetParam1()==GUI_MSG_UPDATE && IsActive())
{
if (message.GetNumStringParams())
{
m_vecItems->m_strPath = message.GetStringParam();
if (message.GetParam2()) // param2 is used for resetting the history
SetHistoryForPath(m_vecItems->m_strPath);
}
Update(m_vecItems->m_strPath);
}
else if (message.GetParam1()==GUI_MSG_UPDATE_ITEM && message.GetItem())
{
CFileItemPtr newItem = boost::static_pointer_cast<CFileItem>(message.GetItem());
if (IsActive())
m_vecItems->UpdateItem(newItem.get());
else if (newItem)
{ // need to remove the disc cache
CFileItemList items;
CUtil::GetDirectory(newItem->m_strPath, items.m_strPath);
items.RemoveDiscCache();
}
}
else if (message.GetParam1()==GUI_MSG_UPDATE_PATH)
{
if (IsActive())
{
if((message.GetStringParam() == m_vecItems->m_strPath) ||
(m_vecItems->IsMultiPath() && DIRECTORY::CMultiPathDirectory::HasPath(m_vecItems->m_strPath, message.GetStringParam())))
{
Update(m_vecItems->m_strPath);
}
}
}
else
return CGUIWindow::OnMessage(message);
示例7: OnMessage
bool CGUIWindowMusicNav::OnMessage(CGUIMessage& message)
{
switch (message.GetMessage())
{
case GUI_MSG_WINDOW_RESET:
m_vecItems->m_strPath = "?";
break;
case GUI_MSG_WINDOW_DEINIT:
if (m_thumbLoader.IsLoading())
m_thumbLoader.StopThread();
break;
case GUI_MSG_WINDOW_INIT:
{
/* We don't want to show Autosourced items (ie removable pendrives, memorycards) in Library mode */
m_rootDir.AllowNonLocalSources(false);
// check for valid quickpath parameter
CStdString strDestination = message.GetNumStringParams() ? message.GetStringParam(0) : "";
CStdString strReturn = message.GetNumStringParams() > 1 ? message.GetStringParam(1) : "";
bool returning = strReturn.CompareNoCase("return") == 0;
if (!strDestination.IsEmpty())
{
message.SetStringParam("");
CLog::Log(LOGINFO, "Attempting to quickpath to: %s", strDestination.c_str());
}
// is this the first time the window is opened?
if (m_vecItems->m_strPath == "?" && strDestination.IsEmpty())
{
strDestination = g_settings.m_defaultMusicLibSource;
m_vecItems->m_strPath = strDestination;
CLog::Log(LOGINFO, "Attempting to default to: %s", strDestination.c_str());
}
CStdString destPath;
if (!strDestination.IsEmpty())
{
if (strDestination.Equals("$ROOT") || strDestination.Equals("Root"))
destPath = "";
else if (strDestination.Equals("Genres"))
destPath = "musicdb://1/";
else if (strDestination.Equals("Artists"))
destPath = "musicdb://2/";
else if (strDestination.Equals("Albums"))
destPath = "musicdb://3/";
else if (strDestination.Equals("Singles"))
destPath = "musicdb://10/";
else if (strDestination.Equals("Songs"))
destPath = "musicdb://4/";
else if (strDestination.Equals("Top100"))
destPath = "musicdb://5/";
else if (strDestination.Equals("Top100Songs"))
destPath = "musicdb://5/2/";
else if (strDestination.Equals("Top100Albums"))
destPath = "musicdb://5/1/";
else if (strDestination.Equals("RecentlyAddedAlbums"))
destPath = "musicdb://6/";
else if (strDestination.Equals("RecentlyPlayedAlbums"))
destPath = "musicdb://7/";
else if (strDestination.Equals("Compilations"))
destPath = "musicdb://8/";
else if (strDestination.Equals("Playlists"))
destPath = "special://musicplaylists/";
else if (strDestination.Equals("Years"))
destPath = "musicdb://9/";
else if (strDestination.Equals("Plugins"))
destPath = "plugin://music/";
else
{
CLog::Log(LOGWARNING, "Warning, destination parameter (%s) may not be valid", strDestination.c_str());
destPath = strDestination;
}
if (!returning || m_vecItems->m_strPath.Left(destPath.GetLength()) != destPath)
{ // we're not returning to the same path, so set our directory to the requested path
m_vecItems->m_strPath = destPath;
}
SetHistoryForPath(m_vecItems->m_strPath);
}
DisplayEmptyDatabaseMessage(false); // reset message state
if (!CGUIWindowMusicBase::OnMessage(message))
return false;
if (message.GetParam1() != WINDOW_INVALID)
{ // first time to this window - make sure we set the root path
m_startDirectory = returning ? destPath : "";
}
// base class has opened the database, do our check
DisplayEmptyDatabaseMessage(m_musicdatabase.GetSongsCount() <= 0);
if (m_bDisplayEmptyDatabaseMessage)
{
// no library - make sure we focus on a known control, and default to the root.
SET_CONTROL_FOCUS(CONTROL_BTNTYPE, 0);
m_vecItems->m_strPath = "";
SetHistoryForPath("");
Update("");
}
//.........这里部分代码省略.........
示例8: OnMessage
bool CGUIWindowVideoNav::OnMessage(CGUIMessage& message)
{
switch (message.GetMessage())
{
case GUI_MSG_WINDOW_RESET:
m_vecItems->SetPath("");
break;
case GUI_MSG_WINDOW_DEINIT:
if (m_thumbLoader.IsLoading())
m_thumbLoader.StopThread();
break;
case GUI_MSG_WINDOW_INIT:
{
/* We don't want to show Autosourced items (ie removable pendrives, memorycards) in Library mode */
m_rootDir.AllowNonLocalSources(false);
SetProperty("flattened", CSettings::Get().GetBool("myvideos.flatten"));
if (message.GetNumStringParams() && message.GetStringParam(0).Equals("Files") &&
CMediaSourceSettings::Get().GetSources("video")->empty())
{
message.SetStringParam("");
}
if (!CGUIWindowVideoBase::OnMessage(message))
return false;
return true;
}
break;
case GUI_MSG_CLICKED:
{
int iControl = message.GetSenderId();
if (iControl == CONTROL_BTNPARTYMODE)
{
if (g_partyModeManager.IsEnabled())
g_partyModeManager.Disable();
else
{
if (!g_partyModeManager.Enable(PARTYMODECONTEXT_VIDEO))
{
SET_CONTROL_SELECTED(GetID(),CONTROL_BTNPARTYMODE,false);
return false;
}
// Playlist directory is the root of the playlist window
if (m_guiState.get()) m_guiState->SetPlaylistDirectory("playlistvideo://");
return true;
}
UpdateButtons();
}
if (iControl == CONTROL_BTNSEARCH)
{
OnSearch();
}
else if (iControl == CONTROL_BTNSHOWMODE)
{
CMediaSettings::Get().CycleWatchedMode(m_vecItems->GetContent());
CSettings::Get().Save();
OnFilterItems(GetProperty("filter").asString());
return true;
}
else if (iControl == CONTROL_BTNSHOWALL)
{
if (CMediaSettings::Get().GetWatchedMode(m_vecItems->GetContent()) == WatchedModeAll)
CMediaSettings::Get().SetWatchedMode(m_vecItems->GetContent(), WatchedModeUnwatched);
else
CMediaSettings::Get().SetWatchedMode(m_vecItems->GetContent(), WatchedModeAll);
CSettings::Get().Save();
OnFilterItems(GetProperty("filter").asString());
return true;
}
else if (iControl == CONTROL_UPDATE_LIBRARY)
{
if (!g_application.IsVideoScanning())
OnScan("");
else
g_application.StopVideoScan();
return true;
}
}
break;
// update the display
case GUI_MSG_SCAN_FINISHED:
case GUI_MSG_REFRESH_THUMBS:
Refresh();
break;
}
return CGUIWindowVideoBase::OnMessage(message);
}