import sys

from rv import commands 
from rv import rvtypes


class PlaybackTest(rvtypes.MinorMode):
    def __init__(self):
        rvtypes.MinorMode.__init__(self)

        self.enabled = False

        self.modename = "playback-check"
        self.init(self.modename, 
                [], None, 
                [("Plugins", [("Test", [("Playback", self.run, None, None)])])]
                )

    def run(self, dummy_event):
        self.enabled = True
        from PySide import QtGui, QtCore, QtOpenGL
        QtCore.QTimer.singleShot(50, lambda: self.start_play())
        self.start_play()

    def stop_play(self):
        from PySide import QtCore
        from rv import commands
        from random import randint
        commands.stop()
        QtCore.QTimer.singleShot(50, lambda: self.start_play())
        frame = randint(1, commands.frameEnd())
        commands.setFrame(frame)

    def start_play(self):
        from PySide import QtCore
        from rv import commands
        from random import randint
        commands.play()
        # From 0.5sec to 5secs
        playtime = randint(500, 5000)
        QtCore.QTimer.singleShot(playtime, lambda: self.stop_play())

def createMode():
    return PlaybackTest()


236cb854342010b769ebfec756295f35df6fa2ef
<mask token>


class PlaybackTest(rvtypes.MinorMode):
    <mask token>
    <mask token>
    <mask token>

    def start_play(self):
        from PySide import QtCore
        from rv import commands
        from random import randint
        commands.play()
        playtime = randint(500, 5000)
        QtCore.QTimer.singleShot(playtime, lambda : self.stop_play())


<mask token>

<mask token>


class PlaybackTest(rvtypes.MinorMode):
    <mask token>

    def run(self, dummy_event):
        self.enabled = True
        from PySide import QtGui, QtCore, QtOpenGL
        QtCore.QTimer.singleShot(50, lambda : self.start_play())
        self.start_play()
    <mask token>

    def start_play(self):
        from PySide import QtCore
        from rv import commands
        from random import randint
        commands.play()
        playtime = randint(500, 5000)
        QtCore.QTimer.singleShot(playtime, lambda : self.stop_play())


<mask token>

<mask token>


class PlaybackTest(rvtypes.MinorMode):

    def __init__(self):
        rvtypes.MinorMode.__init__(self)
        self.enabled = False
        self.modename = 'playback-check'
        self.init(self.modename, [], None, [('Plugins', [('Test', [(
            'Playback', self.run, None, None)])])])

    def run(self, dummy_event):
        self.enabled = True
        from PySide import QtGui, QtCore, QtOpenGL
        QtCore.QTimer.singleShot(50, lambda : self.start_play())
        self.start_play()

    def stop_play(self):
        from PySide import QtCore
        from rv import commands
        from random import randint
        commands.stop()
        QtCore.QTimer.singleShot(50, lambda : self.start_play())
        frame = randint(1, commands.frameEnd())
        commands.setFrame(frame)

    def start_play(self):
        from PySide import QtCore
        from rv import commands
        from random import randint
        commands.play()
        playtime = randint(500, 5000)
        QtCore.QTimer.singleShot(playtime, lambda : self.stop_play())


def createMode():
    return PlaybackTest()

import sys
from rv import commands
from rv import rvtypes


class PlaybackTest(rvtypes.MinorMode):

    def __init__(self):
        rvtypes.MinorMode.__init__(self)
        self.enabled = False
        self.modename = 'playback-check'
        self.init(self.modename, [], None, [('Plugins', [('Test', [(
            'Playback', self.run, None, None)])])])

    def run(self, dummy_event):
        self.enabled = True
        from PySide import QtGui, QtCore, QtOpenGL
        QtCore.QTimer.singleShot(50, lambda : self.start_play())
        self.start_play()

    def stop_play(self):
        from PySide import QtCore
        from rv import commands
        from random import randint
        commands.stop()
        QtCore.QTimer.singleShot(50, lambda : self.start_play())
        frame = randint(1, commands.frameEnd())
        commands.setFrame(frame)

    def start_play(self):
        from PySide import QtCore
        from rv import commands
        from random import randint
        commands.play()
        playtime = randint(500, 5000)
        QtCore.QTimer.singleShot(playtime, lambda : self.stop_play())


def createMode():
    return PlaybackTest()

import sys

from rv import commands 
from rv import rvtypes


class PlaybackTest(rvtypes.MinorMode):
    def __init__(self):
        rvtypes.MinorMode.__init__(self)

        self.enabled = False

        self.modename = "playback-check"
        self.init(self.modename, 
                [], None, 
                [("Plugins", [("Test", [("Playback", self.run, None, None)])])]
                )

    def run(self, dummy_event):
        self.enabled = True
        from PySide import QtGui, QtCore, QtOpenGL
        QtCore.QTimer.singleShot(50, lambda: self.start_play())
        self.start_play()

    def stop_play(self):
        from PySide import QtCore
        from rv import commands
        from random import randint
        commands.stop()
        QtCore.QTimer.singleShot(50, lambda: self.start_play())
        frame = randint(1, commands.frameEnd())
        commands.setFrame(frame)

    def start_play(self):
        from PySide import QtCore
        from rv import commands
        from random import randint
        commands.play()
        # From 0.5sec to 5secs
        playtime = randint(500, 5000)
        QtCore.QTimer.singleShot(playtime, lambda: self.stop_play())

def createMode():
    return PlaybackTest()

