snaums
/
PiPlayer
Archived
1
0
Fork 0
Simple GUI around OMXPlayer for Raspberry Pi
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 

42 lines
1.6 KiB

## @package genericThread
# a generic thread-object to be used for any thread-function
import threading
## @class genericThread
# used as a wrapper around the threading.thread, can be used for any function
# you want to be called from a seperate thread
class genericThread ( threading.Thread ):
## constructor, will set default values (but not useful)
# @param self object ptr
# @param threadID a (hopefully) unique number identifying the thread
# @param name a useful and readable name of the thread
# @param counter - not quite sure what that is.
def __init__ (self, threadID, name, counter):
threading.Thread.__init__(self);
## a unique thread-id identifying the thread
self.threadID = threadID
## a human-readable name for the thread
self.name = name
## a counter - not quite sure what that is for
self.counter = counter
## a function to be called inside the new thread
self.fn = None;
## arguments for the function to be called (as array!)
self.args=[];
## runs the thread itself, will be called from the start-function of the
# base-threading.thread-object as a new thread
# @param self object ptr
def run( self ):
self.fn(self.args);
## set the function and its arguments (as array) to be called from within
# a new thread, when the object is started
# @param self object ptr
# @param fn a function-object to be called when the thread is started
# @param args arguments (as array) for the thread-function
def setFn ( self, fn, args ):
self.fn = fn
self.args = args