コード例 #1
0
ファイル: scanner.py プロジェクト: muckebox/muckebox
class Scanner:
    def __init__(self, path):
        self.path = path
        self.queue = Queue.PriorityQueue()
        self.watcher = Watcher(path, self.queue)
        self.walker = Walker(path, self.queue, Settings.is_rescan_forced())
        self.reader = Reader(self.queue)
        self.validator = Validator(self.queue)

    def start(self):
        self.validator.start()
        self.watcher.start()
        self.walker.start()
        self.reader.start()

    def stop(self):
        self.watcher.stop()
        self.reader.stop()

        self.validator.join()
        self.walker.join()
        self.watcher.join()
        self.reader.join()
コード例 #2
0
from reader import Reader
from omxplayer2 import OMXPlayer2

o = OMXPlayer2('media/test.apple.mp4')

print('got here')

def changeVideo( video ):
    print('Change video called')

    global o
    o.stop()
    o = OMXPlayer2(video[1])

print('1')

r = Reader(onNewMedia = changeVideo)
print( changeVideo )

print('2')

try:
    while True:
        True
except (KeyboardInterrupt, SystemExit):
    o.stop()
    r.stop()