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


Python UIAssistantUtteranceView.dialogIdentifier方法代码示例

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


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

示例1: play

# 需要导入模块: from siriObjects.uiObjects import UIAssistantUtteranceView [as 别名]
# 或者: from siriObjects.uiObjects.UIAssistantUtteranceView import dialogIdentifier [as 别名]
 def play(self, results, language):
     collection = MPTitleCollection()
     collection.items = []
     for result in results:
         if not hasattr(result, "genre"):
             result.genre = ""
         if not hasattr(result, "trackNumber"):
             result.trackNumber = ""
         if not hasattr(result, "artist"):
             result.artist = ""
         if not hasattr(result, "title"):
             result.title = ""
         if not hasattr(result, "sortTitle"):
             result.sortTitle = ""
         if not hasattr(result, "playCount"):
             result.playCount = ""
         if not hasattr(result, "rating"):
             result.rating = ""
         if not hasattr(result, "album"):
             result.album = ""
         if not hasattr(result, "identifier"):
             result.identifier = ""
         song = MPSong()
         song.album = result.album
         song.artist = result.artist
         song.genre = result.genre
         song.playCount = result.playCount
         song.rating = result.rating
         song.sortTitle = result.sortTitle
         song.title = result.title
         song.trackNumber = result.trackNumber
         song.identifier = result.identifier
         collection.items.append(song)
         collection.sortTitle = result.title
         collection.title = result.sortTitle
     collection.identifier = result.identifier
     complete = MPSetQueue(self.refId)
     complete.mediaItems = collection
     self.getResponseForRequest(complete)
     commands = MPSetState(self.refId)
     commands.state = "Playing"
     commands2 = MPEnableShuffle(self.refId)
     commands2.enable = False
     code = 0
     root = UIAddViews(self.refId)
     root.dialogPhase = "Summary"
     assistant = UIAssistantUtteranceView()
     assistant.dialogIdentifier = "PlayMedia#nowPlayingMediaItemByTitle"
     assistant.speakableText = assistant.text = res["play"][language]
     root.views = [(assistant)]
     root.callbacks = [ResultCallback([commands, commands2], code)]
     callback = [ResultCallback([root], code)]
     self.send_object(RequestCompleted(self.refId, callback))
     self.complete_request()
开发者ID:sm0ker,项目名称:SiriServerCore,代码行数:56,代码来源:__init__.py

示例2: pause

# 需要导入模块: from siriObjects.uiObjects import UIAssistantUtteranceView [as 别名]
# 或者: from siriObjects.uiObjects.UIAssistantUtteranceView import dialogIdentifier [as 别名]
 def pause(self, language):
     commands = MPSetState(self.refId)
     commands.state = "Paused"
     code = 0
     root = UIAddViews(self.refId)
     root.dialogPhase = "Summary"
     assistant = UIAssistantUtteranceView()
     assistant.dialogIdentifier = "PlayMedia#Paused"
     assistant.speakableText = assistant.text = res["pause"][language]
     root.views = [(assistant)]
     root.callbacks = [ResultCallback([commands], code)]
     callback = [ResultCallback([root], code)]
     self.send_object(RequestCompleted(self.refId, callback))
     self.complete_request()
开发者ID:sm0ker,项目名称:SiriServerCore,代码行数:16,代码来源:__init__.py

示例3: beginning

# 需要导入模块: from siriObjects.uiObjects import UIAssistantUtteranceView [as 别名]
# 或者: from siriObjects.uiObjects.UIAssistantUtteranceView import dialogIdentifier [as 别名]
 def beginning(self, language):
     commands = MPSetState(self.refId)
     commands.state = "Playing"
     commands2 = MPSetPlaybackPosition(self.refId)
     commands2.position = "Beginning"
     code = 0
     root = UIAddViews(self.refId)
     root.dialogPhase = "Summary"
     assistant = UIAssistantUtteranceView()
     assistant.dialogIdentifier = "PlayMedia#SkipToBeginning"
     assistant.speakableText = assistant.text = res["beginning"][language]
     root.views = [(assistant)]
     root.callbacks = [ResultCallback([commands, commands2], code)]
     callback = [ResultCallback([root], code)]
     self.send_object(RequestCompleted(self.refId, callback))
     self.complete_request()
开发者ID:sm0ker,项目名称:SiriServerCore,代码行数:18,代码来源:__init__.py


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