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


C++ Playlist::removeTrack方法代码示例

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


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

示例1: deleteTrack

void DatabaseBox::deleteTrack(UIListGenericTree *item)
{
    if (PlaylistTrack *delete_item = dynamic_cast<PlaylistCD*>(item) )
    {
        if (delete_item->nextSibling(1))
            tree->MoveDown();
        else if (delete_item->prevSibling(1))
            tree->MoveUp();

        UIListGenericTree *newItem = (UIListGenericTree *)delete_item->getParent();
        if (TreeCheckItem *item_owner = dynamic_cast<TreeCheckItem*>(newItem))
        {
            Playlist *owner =
                gMusicData->all_playlists->getPlaylist(item_owner->getID() * -1);

            if (owner)
                owner->removeTrack(delete_item->getID(), true);
        }
        else if (PlaylistTitle *item_owner = dynamic_cast<PlaylistTitle*>(newItem))
        {
            (void)item_owner;
            active_playlist->removeTrack(delete_item->getID(), true);
        }
        else
        {
            LOG(VB_GENERAL, LOG_ERR, "deleteTrack() - I don't know how to "
                                     "delete whatever you're trying to get "
                                     "rid of");
        }

        gMusicData->all_playlists->refreshRelevantPlaylists(alllists);
        checkTree();
    }
    else if (PlaylistTrack *delete_item = dynamic_cast<PlaylistTrack*>(item))
    {
        if (delete_item->nextSibling(1))
            tree->MoveDown();
        else if (delete_item->prevSibling(1))
            tree->MoveUp();

        UIListGenericTree *newItem = (UIListGenericTree *)delete_item->getParent();
        if (TreeCheckItem *item_owner = dynamic_cast<TreeCheckItem*>(newItem))
        {
            Playlist *owner =
                gMusicData->all_playlists->getPlaylist(item_owner->getID() * -1);

            if (owner)
                owner->removeTrack(delete_item->getID(), false);
        }
        else if (PlaylistTitle *item_owner = dynamic_cast<PlaylistTitle*>(newItem))
        {
            (void)item_owner;
            active_playlist->removeTrack(delete_item->getID(), false);
        }
        else
        {
            LOG(VB_GENERAL, LOG_ERR, "deleteTrack() - I don't know how to "
                                     "delete whatever you're trying to get "
                                     "rid of");
        }
        gMusicData->all_playlists->refreshRelevantPlaylists(alllists);
        checkTree();
    }
}
开发者ID:txase,项目名称:mythtv,代码行数:64,代码来源:databasebox.cpp


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