Example #1
0
def speaker_filter_sound(self, context):
    if not self.filter_sound:
        remove_filter_handlers()
        return
    # stop playback and go to frame 1
    screen = context.screen
    scene = context.scene
    filter_sound(self, self.animation_data.action, context)
    playing = screen.is_animation_playing
    if playing:
        # this will stop it
        bpy.ops.screen.animation_play()
    scene.frame_set(1)

    self.muted = self.filter_sound
    h = bpy.app.driver_namespace.get("ST_handle")
    if not self.filter_sound:
        if h and h.status:
            h.stop()
        return None

    b = bpy.app.driver_namespace.get("ST_buffer")
    if not b:
        if setup_buffer(context):
            b = bpy.app.driver_namespace["ST_buffer"] = mix_buffer(context)

    if not h:
        bpy.app.driver_namespace["ST_handle"] = play_buffer(b)
    if playing:
        # this will restart it
        bpy.ops.screen.animation_play()
    setup_filter_handlers()
    return None
Example #2
0
def speaker_channel_buffer(self, context):
    dns = bpy.app.driver_namespace

    #b = dns.get("ST_buffer")
    h = dns.get("ST_handle")
    b = dns["ST_buffer"] = mix_buffer(context)
    if h:
        h.stop()
    return None
Example #3
0
def speaker_channel_buffer(self, context):
    dns = bpy.app.driver_namespace

    #b = dns.get("ST_buffer")
    h = dns.get("ST_handle")
    b = dns["ST_buffer"] = mix_buffer(context)
    if h:
        h.stop()
    return None