本文整理汇总了Python中shinysdr.top.Top.get_sources方法的典型用法代码示例。如果您正苦于以下问题:Python Top.get_sources方法的具体用法?Python Top.get_sources怎么用?Python Top.get_sources使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类shinysdr.top.Top
的用法示例。
在下文中一共展示了Top.get_sources方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: AppRoot
# 需要导入模块: from shinysdr.top import Top [as 别名]
# 或者: from shinysdr.top.Top import get_sources [as 别名]
class AppRoot(ExportedState):
def __init__(self, devices, audio_config, features):
self.__receive_flowgraph = Top(
devices=devices,
audio_config=audio_config,
features=features)
# TODO: only one session while we sort out other things
self.__session = Session(
receive_flowgraph=self.__receive_flowgraph,
features=features)
@exported_block()
def get_receive_flowgraph(self): # TODO needs to go away
return self.__receive_flowgraph
@exported_block(persists=True)
def get_devices(self):
"""Return all existant devices.
This exists only for persistence purposes.
"""
return self.__receive_flowgraph.get_sources()
# TODO: should become something more like 'create new session'
def get_session(self):
return self.__session
def close_all_devices(self):
self.__receive_flowgraph.close_all_devices()