本文整理汇总了C++中PlaylistModel::currentSongItem方法的典型用法代码示例。如果您正苦于以下问题:C++ PlaylistModel::currentSongItem方法的具体用法?C++ PlaylistModel::currentSongItem怎么用?C++ PlaylistModel::currentSongItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlaylistModel
的用法示例。
在下文中一共展示了PlaylistModel::currentSongItem方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: keyPressedEvent
void PlaylistView::keyPressedEvent(const KeyEvent& keyEvent)
{
PlaylistModel *plsModel = static_cast<PlaylistModel*>(model());
switch (keyEvent.key()) {
case Hotkeys::PlaylistView::RemoveEntry:
removeSelectedSongs();
break;
case Hotkeys::PlaylistView::ClearPlaylist:
m_xmmsClient->playlistClear(plsModel->playlist());
break;
case Hotkeys::PlaylistView::ShufflePlaylist:
m_xmmsClient->playlistShuffle(plsModel->playlist());
break;
case Hotkeys::PlaylistView::GoToCurrentlyPlayingSong:
setCurrentItem(plsModel->currentSongItem());
break;
case Hotkeys::PlaylistView::MoveSelectedSongs:
moveSelectedSongs();
break;
case Hotkeys::PlaylistView::AddFileOrDirectory:
{
auto resultCallback = [this](const std::string& path, LineEdit::Result result)
{
if (result == LineEdit::Result::Accepted)
addPath(path);
};
StatusArea::askQuestion("Add path: ", resultCallback);
break;
}
case Hotkeys::PlaylistView::AddUrl:
{
auto resultCallback = [this](const std::string& url, LineEdit::Result result)
{
if (result == LineEdit::Result::Accepted)
addUrl(url);
};
StatusArea::askQuestion("Add url: ", resultCallback);
break;
}
case Hotkeys::PlaylistView::ShowSongInfo:
if (plsModel->itemsCount() && !isCurrentItemHidden()) {
int id = plsModel->song(currentItem()).id();
if (id > 0)
showSongInfo(id);
}
break;
case '+': // Select be regexp
selectSongsByRegExp();
break;
case '\\': // Unselect be regexp
unselectSongsByRegExp();
break;
default: ListViewAppIntegrated::keyPressedEvent(keyEvent);
}
}