當前位置: 首頁>>代碼示例>>Python>>正文


Python Playlist.get_filelist方法代碼示例

本文整理匯總了Python中Playlist.Playlist.get_filelist方法的典型用法代碼示例。如果您正苦於以下問題:Python Playlist.get_filelist方法的具體用法?Python Playlist.get_filelist怎麽用?Python Playlist.get_filelist使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Playlist.Playlist的用法示例。


在下文中一共展示了Playlist.get_filelist方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: run_command

# 需要導入模塊: from Playlist import Playlist [as 別名]
# 或者: from Playlist.Playlist import get_filelist [as 別名]
    def run_command(self,*args) :
        
        # args[0] is command 

        if args[0] == "play_pause" :
            return self.remote.play_pause()
        
        elif args[0] == "next":
            return self.remote.next()
        
        elif args[0] == "previous":
            return self.remote.previous()
        
        elif args[0] == "add_playlist":
            playlist_name = args[1]
            player_id = args[2]
            playlist_repo = GetPlaylist()
            playlist_repo.add_playlist(playlist_name,player_id)

        elif args[0] == "delete_file_pl":
            playlist_name = args[1]
            file_repo = FileRepo()
            file_repo.delete_from_playlist(self.player_ip,playlist_name)

        elif args[0] == "add_file_to_pl":
            file_name = args[1]
            playlist_name = args[2]
            file_repo = FileRepo()
            file_repo.add(file_name,self.player_ip,playlist_name)

        elif args[0] == "get_playlist_songs":
            playlist_name = args[1]
            player_id = args[2]
            pl = Playlist(playlist_name,player_id)
            pl.update_filelist(self.player_ip)
            file_list =  pl.get_filelist()
            return_list = []
            for song in file_list:
                return_list.append(song.get_file_name())
            return return_list

        elif args[0] == "remove":
            file_management = FileManagment()
            file_name = args[1]
            file_management.remove(file_name,self.player_ip)
            file_repo = FileRepo()
            file_repo.delete_file(file_name,self.player_ip)

        else:
            #Play Song 
            file_queue = []
            check = 1
            file_list = args[2]
            file_name = args[1]
            for file_ in file_list:
                if check and  file_.get_file_name() != file_name:
                    pass
                else:
                    check = 0
                    file_queue.append(file_.get_file_name())
            return self.remote.play_song(file_queue)
開發者ID:CE-KMITL-OOAD-2014,項目名稱:Online-Music-Controller,代碼行數:63,代碼來源:Player.py


注:本文中的Playlist.Playlist.get_filelist方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。