本文整理汇总了Python中lib.buffer_utils.BufferUtils.warmup方法的典型用法代码示例。如果您正苦于以下问题:Python BufferUtils.warmup方法的具体用法?Python BufferUtils.warmup怎么用?Python BufferUtils.warmup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lib.buffer_utils.BufferUtils
的用法示例。
在下文中一共展示了BufferUtils.warmup方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from lib.buffer_utils import BufferUtils [as 别名]
# 或者: from lib.buffer_utils.BufferUtils import warmup [as 别名]
def __init__(self, app):
super(Mixer, self).__init__()
self._app = app
self._net = app.net
self._playlist = None
self._scene = app.scene
self._tick_rate = self._app.settings.get('mixer')['tick-rate']
self._in_transition = False
self._start_transition = False
self._transition_duration = self._app.settings.get('mixer')['transition-duration']
self._transition_slop = self._app.settings.get('mixer')['transition-slop']
self._tick_timer = None
self._duration = self._app.settings.get('mixer')['preset-duration']
self._elapsed = 0.0
self._running = False
self._enable_rendering = True
self._main_buffer = None
self._max_fixtures = 0
self._max_pixels = 0
self._tick_time_data = dict()
self._num_frames = 0
self._last_frame_time = 0.0
self._start_time = 0.0
self._stop_time = 0.0
self._strand_keys = list()
self._enable_profiling = self._app.args.profile
self._paused = self._app.settings.get('mixer').get('paused', False)
self._frozen = False
self._random_transition = False
self._last_onset_time = 0.0
self._onset_holdoff = self._app.settings.get('mixer')['onset-holdoff']
self._onset = False
self._reset_onset = False
self._global_dimmer = 1.0
self._global_speed = 1.0
self._render_in_progress = False
# Load transitions
self.set_transition_mode(self._app.settings.get('mixer')['transition'])
if not self._scene:
log.warn("No scene assigned to mixer. Preset rendering and transitions are disabled.")
self._transition_duration = 0.0
self._enable_rendering = False
else:
log.info("Initializing preset rendering buffer")
fh = self._scene.fixture_hierarchy()
for strand in fh:
self._strand_keys.append(strand)
(maxs, maxf, maxp) = self._scene.get_matrix_extents()
self._main_buffer = BufferUtils.create_buffer(self._app)
self._secondary_buffer = BufferUtils.create_buffer(self._app)
self._max_fixtures = maxf
self._max_pixels = maxp
log.info("Warming up BufferUtils cache...")
BufferUtils.warmup(self._app)
log.info("Completed BufferUtils cache warmup")