def __init__(self, show_params, root, canvas, showlist, pp_dir, pp_home, pp_profile): """ canvas - the canvas that the tracks of the event show are to be written on show_params - the name of the configuration dictionary section for the hyperlinkshow showlist - the showlist, to enable runningnof show type tracks. pp_home - Pi presents data_home directory pp_profile - Pi presents profile directory """ self.mon = Monitor() self.mon.on() #instantiate arguments self.show_params = show_params self.root = root self.showlist = showlist self.canvas = canvas self.pp_dir = pp_dir self.pp_home = pp_home self.pp_profile = pp_profile # open resources self.rr = ResourceReader() #create a path stack self.path = PathManager() # init variables self.drawn = None self.player = None self.shower = None self.timeout_running = None self.error = False
def __init__(self, widget, pp_dir): self.widget = widget self.pp_dir = pp_dir self.mon = Monitor() self.start_play_signal = False self.end_play_signal = False self.end_play_reason = 'nothing' self.duration = 0 self.video_position = 0 self.pause_at_end_required = False self.paused_at_end = False self.pause_at_end_time = 0 # self.pause_before_play_required='before-first-frame' #no,before-first-frame, after-first-frame # self.pause_before_play_required='no' self.paused_at_start = 'False' self.paused = False self.terminate_reason = '' # dbus and subprocess self._process = None self.__iface_root = None self.__iface_props = None self.__iface_player = None
def __init__(self, canvas, cd, track_params): """ canvas - the canvas onto which the image is to be drawn cd - configuration dictionary for the show from which player was called """ self.mon = Monitor() self.mon.on() self.canvas = canvas self.cd = cd self.track_params = track_params # get config from medialist if there. if 'duration' in self.track_params and self.track_params[ 'duration'] <> "": self.duration = int(self.track_params['duration']) else: self.duration = int(self.cd['duration']) # keep dwell and porch as an integer multiple of tick self.tick = 100 # tick time for image display (milliseconds) self.dwell = (1000 * self.duration) self.centre_x = int(self.canvas['width']) / 2 self.centre_y = int(self.canvas['height']) / 2
def __init__(self, show_params, root, canvas, showlist, pp_dir, pp_home, pp_profile): self.mon = Monitor() self.mon.on() #instantiate arguments self.show_params = show_params self.showlist = showlist self.root = root self.canvas = canvas self.pp_dir = pp_dir self.pp_home = pp_home self.pp_profile = pp_profile # open resources self.rr = ResourceReader() #create and instance of TimeOfDay scheduler so we can add events self.tod = TimeOfDay() # Init variables self.player = None self.shower = None self.end_liveshow_signal = False self.end_trigger_signal = False self.play_child_signal = False self.error = False self.egg_timer = None self.duration_timer = None self.state = 'closed' self.livelist = None self.new_livelist = None
def __init__(self, show, canvas, showlist, pp_home, pp_profile): """ canvas - the canvas that the menu is to be written on show - the name of the configuration dictionary section for the menu cf - the configuration object pp_home - Pi presents data_home directory pp_profile - Pi presents profile directory""" self.mon=Monitor() self.mon.on() #instantiate arguments self.show=show self.showlist=showlist self.canvas=canvas self.pp_home=pp_home self.pp_profile=pp_profile # open resources self.rr=ResourceReader() # init variables self.drawn = None self.player=None self.shower=None self.menu_timeout_running=None self.error=False
def __init__(self, widget, pp_dir): self.widget = widget self.pp_dir = pp_dir self.mon = Monitor() self.start_play_signal = False self.end_play_signal = False self.end_play_reason = 'nothing' self.duration = 0 self.video_position = 0 self.pause_at_end_required = False self.paused_at_end = False self.pause_before_play_required = True self.paused_at_start = False self.paused = False self.terminate_reason = '' # dbus and subprocess self._process = None self.__iface_root = None self.__iface_props = None self.__iface_player = None # legacy self.xbefore = 'not used - legacy' self.xafter = 'not used - legacy'
def __init__(self, canvas, cd, track_params ): """ canvas - the canvas onto which the video is to be drawn (not!!) cd - configuration dictionary track_params - config dictionary for this track overides cd """ self.mon=Monitor() self.mon.on() #instantiate arguments self.cd=cd #configuration dictionary for the videoplayer self.canvas = canvas #canvas onto which video should be played but isn't! Use as widget for alarm self.track_params=track_params # get config from medialist if there. if 'omx-audio' in self.track_params and self.track_params['omx-audio']<>"": self.omx_audio= self.track_params['omx-audio'] else: self.omx_audio= self.cd['omx-audio'] if self.omx_audio<>"": self.omx_audio= "-o "+ self.omx_audio # could put instance generation in play, not sure which is better. self.omx=OMXDriver() self._tick_timer=None self.error=False self.terminate_required=False self._init_play_state_machine()
def __init__(self, show, canvas, showlist, pp_home, pp_profile): """ canvas - the canvas that the show is to be written on showlist - used jus to check the issue of medialist against showlist show - the dictionary for the show to be played pp_home - Pi presents data_home directory pp_profile - Pi presents profile directory """ self.mon = Monitor() self.mon.on() #instantiate arguments self.show = show self.showlist = showlist self.canvas = canvas self.pp_home = pp_home self.pp_profile = pp_profile # open resources self.rr = ResourceReader() # Init variables self.player = None self.shower = None self._end_liveshow_signal = False self._play_child_signal = False self.error = False self._livelist = None self._new_livelist = None
def __init__(self,sequence): self.mon=Monitor() self.sequence=sequence self._tracks=[] self._num_tracks=0 self.last_num_tracks=-1 self.llf = LiveListFetcher() # start livelist fetcher
def __init__(self, show_id, root, canvas, show_params, track_params, pp_dir, pp_home, pp_profile): """ show_id - show instance that player is run from (for monitoring only) canvas - the canvas onto which the image is to be drawn show_params - dictionary of show parameters track_params - disctionary of track paramters pp_home - data home directory pp_dir - path of pipresents directory pp_profile - profile name """ self.mon = Monitor() self.show_id = show_id self.root = root self.canvas = canvas self.show_params = show_params self.track_params = track_params self.pp_dir = pp_dir self.pp_home = pp_home self.pp_profile = pp_profile self.plugin_timer = None self.plugin = None self.plugin_redraw_time = 0 self.draw_objects = []
def __init__(self,widget): self.widget=widget self.mon=Monitor() self.mon.on() self._process=None self.fifo=''
def __init__(self, widget): self.widget = widget self.mon = Monitor() self.mon.off() self._process = None self.paused = None
def __init__(self, widget, pp_dir): self.widget = widget self.pp_dir = pp_dir self.mon = Monitor() self._process = None self.paused = False
def __init__(self, show_params, root, canvas, showlist, pp_dir, pp_home, pp_profile): """ canvas - the canvas that the menu is to be written on show - the dictionary fo the show to be played pp_home - Pi presents data_home directory pp_profile - Pi presents profile directory """ self.mon=Monitor() self.mon.on() #instantiate arguments self.show_params =show_params self.showlist=showlist self.root=root self.canvas=canvas self.pp_dir=pp_dir self.pp_home=pp_home self.pp_profile=pp_profile # open resources self.rr=ResourceReader() # Init variables self.player=None self.shower=None self.poll_for_interval_timer=None self.poll_for_continue_timer=None self.waiting_for_interval=False self.interval_timer=None self.duration_timer=None self.error=False self.interval_timer_signal=False self.end_trigger_signal=False self.end_mediashow_signal=False self.next_track_signal=False self.previous_track_signal=False self.play_child_signal = False self.req_next='nil' #create and instance of TimeOfDay scheduler so we can add events self.tod=TimeOfDay() #NIK self.paused = False #pause state self.state='closed'
def init(self,pp_profile,show_command_callback,input_event_callback,output_event_callback): self.pp_profile=pp_profile self.show_command_callback=show_command_callback self.input_event_callback=input_event_callback self.output_event_callback=output_event_callback self.mon=Monitor() config_file=self.pp_profile + os.sep +'pp_io_config'+os.sep+ 'osc.cfg' if not os.path.exists(config_file): self.mon.err(self, 'OSC Configuration file nof found: '+config_file) return'error','OSC Configuration file nof found: '+config_file self.mon.log(self, 'OSC Configuration file found at: '+config_file) self.options=OSCConfig() # only reads the data for required unit_type if self.options.read(config_file) ==False: return 'error','failed to read osc.cfg' self.prefix='/pipresents' self.this_unit='/' + self.options.this_unit_name self.this_unit_type = self.options.this_unit_type self.reply_client=None self.command_client=None self.client=None self.server=None if self.this_unit_type not in ('master','slave','master+slave'): return 'error','this unit type not known: '+self.this_unit_type if self.this_unit_type in('slave','master+slave'): #start the client that sends replies to controlling unit self.reply_client=OSC.OSCClient() self.mon.log(self, 'sending replies to controller at: '+self.options.controlled_by_ip+':'+self.options.controlled_by_port) self.reply_client.connect((self.options.controlled_by_ip,int(self.options.controlled_by_port))) self.mon.log(self,'sending repiles to: '+ str(self.reply_client)) self.client=self.reply_client if self.this_unit_type in ('master','master+slave'): #start the client that sends commands to the controlled unit self.command_client=OSC.OSCClient() self.command_client.connect((self.options.controlled_unit_1_ip,int(self.options.controlled_unit_1_port))) self.mon.log(self, 'sending commands to controled unit at: '+self.options.controlled_unit_1_ip+':'+self.options.controlled_unit_1_port) self.mon.log(self,'sending commands to: '+str(self.command_client)) self.client=self.command_client #start the listener's server self.mon.log(self, 'listen to commands from controlled by unit and replies from controlled units on: ' + self.options.this_unit_ip+':'+self.options.this_unit_port) self.server=myOSCServer((self.options.this_unit_ip,int(self.options.this_unit_port)),self.client) # return_port=int(self.options.controlled_by_port) self.mon.log(self,'listening on: '+str(self.server)) self.add_initial_handlers() return 'normal','osc.cfg read'
def __init__(self, show_id, showlist, show_params, root, canvas, pp_dir, pp_profile, pp_home): self.show_id = show_id self.showlist = showlist self.show_params = show_params self.root = root self.show_canvas = canvas self.pp_dir = pp_dir self.pp_profile = pp_profile self.pp_home = pp_home self.mon = Monitor()
def __init__(self, show_id, showlist, show_params, root, pp_dir, pp_profile, pp_home): self.show_id = show_id self.showlist = showlist self.show_params = show_params self.root = root self.pp_dir = pp_dir self.pp_profile = pp_profile self.pp_home = pp_home self.dm = DisplayManager() self.mon = Monitor()
def __init__(self,show_id,root,canvas,show_params,track_params,pp_dir,pp_home,pp_profile): self.mon=Monitor() self.mon.on() self.root=root self.canvas=canvas self.show_id=show_id self.track_params=track_params self.show_params=show_params self.pp_dir=pp_dir self.pp_home=pp_home self.pp_profile=pp_profile # get config from medialist if there. if 'duration' in self.track_params and self.track_params['duration']<>"": self.duration= int(self.track_params['duration']) else: self.duration= int(self.show_params['duration']) # get background image from profile. self.background_file='' if self.track_params['background-image']<>"": self.background_file= self.track_params['background-image'] else: if self.track_params['display-show-background']=='yes': self.background_file= self.show_params['background-image'] # get background colour from profile. if self.track_params['background-colour']<>"": self.background_colour= self.track_params['background-colour'] else: self.background_colour= self.show_params['background-colour'] self.centre_x = int(self.canvas['width'])/2 self.centre_y = int(self.canvas['height'])/2 # keep tick as an integer sub-multiple of 1 second self.tick = 100 # tick time for image display (milliseconds) self.dwell = 1000*self.duration #get animation instructions from profile self.animate_begin_text=self.track_params['animate-begin'] self.animate_end_text=self.track_params['animate-end'] # open the plugin Manager self.pim=PluginManager(self.show_id,self.root,self.canvas,self.show_params,self.track_params,self.pp_dir,self.pp_home,self.pp_profile) #create an instance of PPIO so we can create gpio events self.ppio = PPIO()
def __init__(self,widget): self.widget=widget self.mon=Monitor() self.mon.on() self.paused=None #NIK # for pausing video while moving back and forth through slideshow self.delayed_pause = False #NIK self._process=None
def __init__(self): # get command options self.command_options = remote_options() # get directory holding the code self.pp_dir = sys.path[0] if not os.path.exists(self.pp_dir + os.sep + "pipresents.py"): tkinter.messagebox.showwarning("Pi Presents", "Bad Application Directory") exit() # Initialise logging Monitor.log_path = self.pp_dir self.mon = Monitor() self.mon.init() Monitor.classes = ['OSCMonitor', 'OSCConfig', 'OSCEditor'] Monitor.log_level = int(self.command_options['debug']) self.mon.log(self, "Pi Presents Monitor is starting") self.mon.log(self, " OS and separator " + os.name + ' ' + os.sep) self.mon.log(self, "sys.path[0] - location of code: code " + sys.path[0]) self.root = Tk() # initialise OSC config class self.osc_config = OSCConfig() # read the options and allow their editing self.osc_config_file = self.pp_dir + os.sep + 'pp_config' + os.sep + 'pp_oscmonitor.cfg' self.read_create_osc() if self.osc_config.slave_enabled != 'yes': self.mon.err(self, 'OSC Slave is not enabled in pp_oscmonitor.cfg') exit() #build gui self.setup_gui() # initialise self.init() #and start the system self.root.after(1000, self.run_app) self.root.mainloop()
def __init__(self): self.editor_issue = "1.3" # get command options self.command_options = remote_options() # get directory holding the code self.pp_dir = sys.path[0] if not os.path.exists(self.pp_dir + os.sep + "pp_oscremote.py"): tkinter.messagebox.showwarning("Pi Presents", "Bad Application Directory") exit() # Initialise logging Monitor.log_path = self.pp_dir self.mon = Monitor() self.mon.init() Monitor.classes = ['OSCRemote', 'OSCConfig', 'OSCEditor'] Monitor.log_level = int(self.command_options['debug']) self.mon.log(self, "Pi Presents Remote is starting") self.mon.log(self, " OS and separator " + os.name + ' ' + os.sep) self.mon.log(self, "sys.path[0] - location of code: code " + sys.path[0]) self.root = Tk() # OSC config class self.osc_config = OSCConfig() self.osc_config_file = self.pp_dir + os.sep + 'pp_config' + os.sep + 'pp_oscremote.cfg' self.read_create_osc() self.setup_gui() if self.osc_config.this_unit_ip == '': self.mon.err(self, 'IP of own unit must be provided in oscremote.cfg') self.init() #and start the system self.root.after(1000, self.run_app) self.root.mainloop()
def __init__(self,widget,pp_dir): self.widget=widget self.pp_dir=pp_dir self.mon=Monitor() self.paused=False self._process=None # PRELOAD add some initilisation to cope with first iteration of preload state machine self.start_play_signal=False self.end_play_signal=True self.end_play_reason='nice_day' self.video_position=0 self.freeze_at_end_required=False
def __init__(self, show_id, showlist, show_params, root, canvas, pp_dir, pp_profile, pp_home): self.show_id = show_id self.showlist = showlist self.show_params = show_params self.root = root self.show_canvas = canvas self.pp_dir = pp_dir self.pp_profile = pp_profile self.pp_home = pp_home if not 'plugin' in self.show_params: self.show_params['plugin'] = '' self.pim = PluginManager(self.show_id, self.root, self.show_canvas, self.show_params, None, self.pp_dir, self.pp_home, self.pp_profile) self.mon = Monitor()
def __init__(self, parent, title, field_content, record_specs,field_specs,show_refs,initial_media_dir,pp_home_dir,initial_tab): self.mon=Monitor() # save the extra arg to instance variable self.field_content = field_content # dictionary - the track parameters to be edited self.record_specs= record_specs # list of field names and seps/tabs in the order that they appear self.field_specs=field_specs # dictionary of specs referenced by field name self.show_refs=show_refs self.show_refs.append('') self.initial_media_dir=initial_media_dir self.pp_home_dir=pp_home_dir self.initial_tab=initial_tab # list of stringvars from which to get edited values (for optionmenu only??) self.entries=[] # and call the base class _init_which calls body immeadiately and apply on OK pressed tkSimpleDialog.Dialog.__init__(self, parent, title)
def __init__(self): self.editor_issue = "1.3" # get command options self.command_options = remote_options() # get directory holding the code self.pp_dir = sys.path[0] if not os.path.exists(self.pp_dir + os.sep + "pipresents.py"): tkMessageBox.showwarning("Pi Presents", "Bad Application Directory") exit() # Initialise logging Monitor.log_path = self.pp_dir self.mon = Monitor() self.mon.init() Monitor.classes = ['OSCMonitor', 'OSCConfig', 'OSCEditor'] Monitor.log_level = int(self.command_options['debug']) self.mon.log(self, "Pi Presents Monitor is starting") self.mon.log(self, " OS and separator " + os.name + ' ' + os.sep) self.mon.log(self, "sys.path[0] - location of code: code " + sys.path[0]) self.setup_gui() # initialise OSC config class self.osc_config = OSCConfig() self.init() #and start the system self.root.after(1000, self.run_app) self.root.mainloop()
def __init__(self, canvas, cd, track_params): """ canvas - the canvas onto which the image is to be drawn cd - dictionary of show parameters track_params - disctionary of track paramters """ self.mon = Monitor() self.mon.on() self.canvas = canvas self.cd = cd self.track_params = track_params # open resources self.rr = ResourceReader() # get config from medialist if there. if 'duration' in self.track_params and self.track_params[ 'duration'] <> "": self.duration = int(self.track_params['duration']) else: self.duration = int(self.cd['duration']) if 'transition' in self.track_params and self.track_params[ 'transition'] <> "": self.transition = self.track_params['transition'] else: self.transition = self.cd['transition'] # keep dwell and porch as an integer multiple of tick self.porch = 1000 #length of pre and post porches for an image (milliseconds) self.tick = 100 # tick time for image display (milliseconds) self.dwell = (1000 * self.duration) - (2 * self.porch) if self.dwell < 0: self.dwell = 0 self.centre_x = int(self.canvas['width']) / 2 self.centre_y = int(self.canvas['height']) / 2
def __init__(self, show, canvas, showlist, pp_home, pp_profile): """ canvas - the canvas that the menu is to be written on show - the dictionary fo the show to be played pp_home - Pi presents data_home directory pp_profile - Pi presents profile directory """ self.mon = Monitor() self.mon.on() #instantiate arguments self.show = show self.showlist = showlist self.canvas = canvas self.pp_home = pp_home self.pp_profile = pp_profile # open resources self.rr = ResourceReader() # Init variables self.player = None self.shower = None self._poll_for_interval_timer = None self._poll_for_continue_timer = None self._waiting_for_interval = False self._interval_timer = None self.error = False self._interval_timer_signal = False self._end_mediashow_signal = False self._next_track_signal = False self._previous_track_signal = False self._play_child_signal = False self._req_next = 'nil' self._state = 'closed'
def base__init__(self, show_id, show_params, root, canvas, showlist, pp_dir, pp_home, pp_profile, command_callback): # instantiate arguments self.show_id = show_id self.show_params = show_params self.root = root self.show_canvas = canvas self.canvas = canvas['canvas-obj'] self.show_canvas_x1 = canvas['show-canvas-x1'] self.show_canvas_y1 = canvas['show-canvas-y1'] self.show_canvas_x2 = canvas['show-canvas-x2'] self.show_canvas_y2 = canvas['show-canvas-y2'] self.show_canvas_width = canvas['show-canvas-width'] self.show_canvas_height = canvas['show-canvas-height'] self.show_canvas_centre_x = canvas['show-canvas-centre-x'] self.show_canvas_centre_y = canvas['show-canvas-centre-y'] self.showlist = showlist self.pp_dir = pp_dir self.pp_home = pp_home self.pp_profile = pp_profile self.command_callback = command_callback # init things that will then be reinitialised by derived classes self.medialist = None # set up logging self.mon = Monitor() self.mon.set_log_level(16) # create and instance of TimeOfDay scheduler so we can add events self.tod = TimeOfDay() # create an instance of showmanager so we can init child/subshows self.show_manager = ShowManager(self.show_id, self.showlist, self.show_params, self.root, self.show_canvas, self.pp_dir, self.pp_profile, self.pp_home) # init variables self.current_player = None self.previous_player = None self.shower = None self.previous_shower = None self.user_stop_signal = False self.exit_signal = False self.terminate_signal = False self.show_timeout_signal = False self.egg_timer = None self.admin_message = None self.ending_reason = '' self.background_obj = None self.background_file = '' self.level = 0 self.subshow_kickback_signal = False self.kickback_for_next_track = False # get background image from profile. # print 'background', self.show_params['background-image'] if self.show_params['background-image'] != '': self.background_file = self.show_params['background-image']
def __init__(self): self.mon = Monitor()
def __init__(self): self.clear() self.mon = Monitor() self.mon.on()