Permalink
Browse files

Version 1.2.1c 27/4/2013

  • Loading branch information...
KenT2 committed Apr 27, 2013
1 parent 05e934d commit df56f6e343f8ad7aa10cff07bb00956a7afc184c
Showing with 100 additions and 45 deletions.
  1. +3 −1 README.md
  2. +6 −1 ReleaseNotes.txt
  3. +12 −1 changelog.txt
  4. +2 −1 pipresents.py
  5. +2 −1 pp_audioplayer.py
  6. +5 −6 pp_definitions.py
  7. +61 −32 pp_editor.py
  8. +4 −1 pp_gpio.py
  9. +2 −1 pp_messageplayer.py
  10. +3 −0 pp_options.py
View
@@ -152,5 +152,7 @@ Bug Reports and Feature Requests
================================
I am keen to develop Pi Presents further and would welcome bug reports and ideas for real world additional features and uses.
Please use the Issues tab on Github https://github.com/KenT2/pipresents-next/issues or the Pi Presents thread http://www.raspberrypi.org/phpBB3/viewtopic.php?f=38&t=29397 on the Raspberry Pi forum. ?????????
Please use the Issues tab on Github https://github.com/KenT2/pipresents-next/issues or the Pi Presents thread http://www.raspberrypi.org/phpBB3/viewtopic.php?f=38&t=39985 on the Raspberry Pi forum.
For more information on how Pi Presents is being used, Hints and Tips on how to use it and all the latest news hop over to the Pi Presents website http://pipresents.wordpress.com/
View
@@ -1,5 +1,10 @@
Version 1.2.1 beta 1
Version 1.2.1c (beta)
There has been a change of profile since 1.2.1 I have added 'message-justify' to messages. Hoowever I have not changed the profile version number since this is a beta. You must however update the profiles; to do this run the editor with the --forceupdate command line option.
To ease the updating task there is a now editor menu option 'tools>update' which will update all profiles in a pp_home.
Version 1.2.1
MPlayer must now be installed before using Pi Presents - sudo apt-get install mplayer
This version has many new fields so the version number has increased from 1.1 to 1.2
View
@@ -1,6 +1,17 @@
Version 1.2.1 beta 1 8/4/2013
1.2.1c 27/4/2013
PLEASE READ RELEASE NOTES
new - messageplayer now has a justify field to justify the text.
new - in the editor use tools>update all to update all profiles in pp_home
new - new editor command line option --forceupdate to force updating a profile if editor and profile versions are the same (useful for beta testers).
enhancement - increase number of lines and font size in the editor's text field
enhancement - add .wma to audio types
fixed - shutdown using a button now works again
fixed - playing an audio track does not reset backgound colour to black
Version 1.2.1 beta 1 8/4/2013
Major improvements:
AUDIO PLAYER
View
@@ -29,6 +29,7 @@
from pp_resourcereader import ResourceReader
from pp_timeofday import TimeOfDay
class PiPresents:
# Constants for list of start shows
@@ -319,7 +320,7 @@ def shutdown_pressed(self):
self.root.after(5000,self.on_shutdown_delay)
def on_shutdown_delay(self):
if self.ppio.is_pressed(self.PPIO.SHUTDOWN):
if self.ppio.is_pressed('shutdown'):
self.shutdown_required=True
self.on_break_key()
View
@@ -424,8 +424,9 @@ def _stop_mplayer(self):
# *****************
def display_image(self):
self.canvas.config(bg='black')
if self.background_file<>'' or self.show_params['show-text']<> '' or self.track_params['track-text']<> '' or self.enable_menu== True or self.track_params['clear-screen']=='yes':
self.canvas.config(bg='black')
self.canvas.delete(ALL)
if self.background_file<>'':
self.background_img_file = self.complete_path(self.background_file)
View
@@ -2,8 +2,7 @@ class PPdefinitions:
IMAGE_FILES=('Image files', '.gif','.jpg','.jpeg','.bmp','.png','.tif')
VIDEO_FILES=('Video files','.mp4','.mkv','.avi','.mp2','.wmv','.m4v')
AUDIO_FILES=('Audio files','.mp3','.wav','.ogg')
AUDIO_FILES=('Audio files','.mp3','.wav','.ogg','.wma')
show_types={
@@ -73,8 +72,6 @@ class PPdefinitions:
'menu-x':{'param':'menu-x','shape':'entry','text':'Menu x Position','must':'no','read-only':'no'},
'menu-y':{'param':'menu-y','shape':'entry','text':'Menu y Position','must':'no','read-only':'no'},
'menu-spacing':{'param':'menu-spacing','shape':'entry','text':'Entry Spacing','must':'no','read-only':'no'},
'message-font':{'param':'message-font','shape':'entry','text':'Text Font','must':'yes','read-only':'no'},
'message-colour':{'param':'message-colour','shape':'entry','text':'Text Colour','must':'yes','read-only':'no'},
'mplayer-audio':{'param':'mplayer-audio','shape':'option-menu','text':'MPlayer Audio','must':'no','read-only':'no',
'values':['hdmi','local']},
'mplayer-other-options':{'param':'mplayer-other-options','shape':'entry','text':'Other MPlayer Options','must':'no','read-only':'no'},
@@ -121,7 +118,7 @@ class PPdefinitions:
new_tracks={
'video':{'title':'New Video','track-ref':'','type':'video','location':'','omx-audio':'','omx-volume':'','omx-window':'','omx-loop':'no','track-text':'','track-text-font':'',
'track-text-colour':'','track-text-x':'0','track-text-y':'0','animate-begin':'','animate-clear':'no','animate-end':''},
'message':{'title':'New Message','track-ref':'','type':'message','text':'','duration':'5','message-font':'Helvetica 30 bold','message-colour':'white','background-colour':'','background-image':''},
'message':{'title':'New Message','track-ref':'','type':'message','text':'','duration':'5','message-font':'Helvetica 30 bold','message-colour':'white','message-justify':'left','background-colour':'','background-image':''},
'show':{'title':'New Show','track-ref':'','type':'show','sub-show':''},
'image':{'title':'New Image','track-ref':'','type':'image','location':'','duration':'','transition':'','track-text':'','track-text-font':'',
'track-text-colour':'','track-text-x':'0','track-text-y':'0','animate-begin':'','animate-clear':'no','animate-end':''},
@@ -133,7 +130,7 @@ class PPdefinitions:
}
track_types={'video':['type','title','track-ref','location','omx-audio','omx-volume','omx-window','omx-loop','track-text','track-text-font','track-text-colour','track-text-x','track-text-y','animate-begin','animate-clear','animate-end'],
'message':['type','title','track-ref','text','duration','message-font','message-colour','background-colour','background-image'],
'message':['type','title','track-ref','text','duration','message-font','message-colour','message-justify','background-colour','background-image'],
'show':['type','title','track-ref','sub-show'],
'image':['type','title','track-ref','location','duration','transition','track-text','track-text-font','track-text-colour',
'track-text-x','track-text-y','animate-begin','animate-clear','animate-end'],
@@ -155,6 +152,8 @@ class PPdefinitions:
'values':['yes','no']},
'duration':{'param':'duration','shape':'entry','text':'Duration (secs)','must':'no','read-only':'no'},
'location':{'param':'location','shape':'browse','text':'Location','must':'no','read-only':'no'},
'message-justify':{'param':'message-justify','shape':'option-menu','text':'Justification','must':'no','read-only':'no',
'values':['left','center','right']},
'message-font':{'param':'message-font','shape':'entry','text':'Text Font','must':'no','read-only':'no'},
'message-colour':{'param':'message-colour','shape':'entry','text':'Text Colour','must':'no','read-only':'no'},
'mplayer-audio':{'param':'mplayer-audio','shape':'option-menu','text':'MPlayer Audio','must':'no','read-only':'no',
View
@@ -138,6 +138,9 @@ def __init__(self):
typemenu.add_command(label='Child Show', command = self.new_child_show_track)
trackmenu.add_cascade(label='New', menu = typemenu)
toolsmenu = Menu(menubar, tearoff=0, bg="grey", fg="black")
menubar.add_cascade(label='Tools', menu = toolsmenu)
toolsmenu.add_command(label='Update All', command = self.update_all)
optionsmenu = Menu(menubar, tearoff=0, bg="grey", fg="black")
menubar.add_cascade(label='Options', menu = optionsmenu)
@@ -375,8 +378,37 @@ def new_liveshow_profile(self):
profile = self.pp_dir+"/pp_home/pp_profiles/ppt_liveshow"
self.new_profile(profile)
# *********************************************
# update profile
# **********************************************
def update_all(self):
self.init()
for profile_file in os.listdir(self.pp_home_dir+os.sep+'pp_profiles'):
# self.mon.log (self,"Updating "+profile_file)
self.pp_profile_dir = self.pp_home_dir+os.sep+'pp_profiles'+ os.sep + profile_file
if not os.path.exists(self.pp_profile_dir+os.sep+"pp_showlist.json"):
tkMessageBox.showwarning("Pi Presents","Not a profile, skipping "+self.pp_profile_dir)
else:
self.current_showlist=ShowList()
#self.mon.log (self,"Checking version "+profile_file)
self.current_showlist.open_json(self.pp_profile_dir+os.sep+"pp_showlist.json")
if float(self.current_showlist.sissue())<float(self.editor_issue):
self.update_profile()
self.mon.log(self,"Version of profile "+profile_file+ " has been updated to "+self.editor_issue)
elif (self.command_options['forceupdate'] == True and float(self.current_showlist.sissue())==float(self.editor_issue)):
self.update_profile()
self.mon.log(self, "Forced update of " + profile_file + ' to '+self.editor_issue)
elif float(self.current_showlist.sissue())>float(self.editor_issue):
tkMessageBox.showwarning("Pi Presents", "Version of profile " +profile_file+ " is greater than editor, skipping")
else:
self.mon.log(self," Profile " + profile_file + " Already up to date ")
self.init()
tkMessageBox.showwarning("Pi Presents","All profiles updated")
def update_profile(self):
#open showlist and update its shows
#open showlist and update its shows
# self.mon.log (self,"Updating show ")
ifile = open(self.pp_profile_dir + os.sep + "pp_showlist.json", 'rb')
shows = json.load(ifile)['shows']
ifile.close()
@@ -389,6 +421,7 @@ def update_profile(self):
# UPDATE MEDIALISTS AND THEIR TRACKS
for file in os.listdir(self.pp_profile_dir):
if file.endswith(".json") and file<>'pp_showlist.json':
# self.mon.log (self,"Updating medialist " + file)
#open a medialist and update its tracks
ifile = open(self.pp_profile_dir + os.sep + file, 'rb')
tracks = json.load(ifile)['tracks']
@@ -403,20 +436,19 @@ def update_tracks(self,old_tracks):
# get correct spec from type of field
replacement_tracks=[]
for old_track in old_tracks:
#print '\nold track ',old_track
track_type=old_track['type']
spec_fields=PPdefinitions.new_tracks[track_type]
left_overs=dict()
# go through track and delete fields not in spec
while True:
to_delete=""
for track_field in old_track:
if track_field not in spec_fields:
to_delete=track_field
if to_delete<>"":
del old_track[to_delete]
else:
break
for key in old_track.keys():
if key in spec_fields:
left_overs[key]=old_track[key]
#print '\n leftovers',left_overs
replacement_track=copy.deepcopy(PPdefinitions.new_tracks[track_type])
replacement_track.update(old_track)
#print '\n before update', replacement_track
replacement_track.update(left_overs)
#print '\nafter update',replacement_track
replacement_tracks.append(copy.deepcopy(replacement_track))
return replacement_tracks
@@ -427,18 +459,14 @@ def update_shows(self,old_shows):
for old_show in old_shows:
show_type=old_show['type']
spec_fields=PPdefinitions.new_shows[show_type]
# go through show and delete fields not in spec
while True:
to_delete=""
for show_field in old_show:
if show_field not in spec_fields:
to_delete=show_field
if to_delete<>"":
del old_show[to_delete]
else:
break
left_overs=dict()
# go through track and delete fields not in spec
for key in old_show.keys():
if key in spec_fields:
left_overs[key]=old_show[key]
# print '\n leftovers',left_overs
replacement_show=copy.deepcopy(PPdefinitions.new_shows[show_type])
replacement_show.update(old_show)
replacement_show.update(left_overs)
replacement_shows.append(copy.deepcopy(replacement_show))
return replacement_shows
@@ -453,7 +481,7 @@ def open_showlist(self,dir):
self.app_exit()
self.current_showlist=ShowList()
self.current_showlist.open_json(showlist_file)
if float(self.current_showlist.sissue())<float(self.editor_issue):
if float(self.current_showlist.sissue())<float(self.editor_issue) or (self.command_options['forceupdate'] == True and float(self.current_showlist.sissue())==float(self.editor_issue)):
self.update_profile()
self.mon.err(self,"Version of profile has been updated to "+self.editor_issue+", please re-open")
return False
@@ -673,12 +701,12 @@ def move_track_down(self):
def new_track(self,fields,values):
if self.current_medialist<>None:
print '\nfields ', fields
print '\nvalues ', values
#print '\nfields ', fields
#print '\nvalues ', values
new_track=copy.deepcopy(fields)
print ',\new track ',new_track
#print ',\new track ',new_track
self.current_medialist.append(new_track)
print '\nbefore values ',self.current_medialist.print_list()
#print '\nbefore values ',self.current_medialist.print_list()
if values<>None:
self.current_medialist.update(self.current_medialist.length()-1,values)
self.current_medialist.select(self.current_medialist.length()-1)
@@ -1019,10 +1047,10 @@ def make_entry(self,master,field,row,values):
bg='white'
Label(master,text=field['text'], anchor=W).grid(row=row,column=0,sticky=W)
if field['shape']=="entry":
obj=Entry(master,bg=bg,width=40,font='arial 10')
obj=Entry(master,bg=bg,width=40,font='arial 11')
obj.insert(END,self.tp[field['param']])
elif field['shape']in("text",'csv'):
obj=Text(master,bg=bg,height=4,width=40,font='arial 10')
obj=Text(master,bg=bg,height=8,width=40,font='arial 11')
obj.insert(END,self.tp[field['param']])
elif field['shape']=='spinbox':
obj=Spinbox(master,bg=bg,values=values,wrap=True)
@@ -1067,10 +1095,11 @@ def apply(self):
def parse_animate(self,text):
lines = int(text.index('end').split('.')[0]) - 1 # returns line count
print lines
#print lines
for line in range(lines):
print self.text_eol(line)
print "text", text.get(self.text_index(line,0),self.text_eol(line))
pass
#print self.text_eol(line)
#print "text", text.get(self.text_index(line,0),self.text_eol(line))
return
def text_index(self,line,column):
View
@@ -170,8 +170,11 @@ def reset_inputs(self):
pin[PPIO.PRESSED]==False
pin[PPIO.LAST]==False
# index is of the pins array, provided by the callback ***** needs to be name
# name is the symbolic name.
def is_pressed(self,name):
for index, pin in enumerate(PPIO.pins):
if name == pin[PPIO.NAME]:
break
return PPIO.pins[index][PPIO.PRESSED]
def do_buttons(self):
View
@@ -165,7 +165,8 @@ def _start_dwell(self):
self.canvas.create_text(int(self.canvas['width'])/2, int(self.canvas['height'])/2,
text=self.text.rstrip('\n'),
fill=self.track_params['message-colour'],
font=self.track_params['message-font'])
font=self.track_params['message-font'],
justify=self.track_params['message-justify'])
# display instructions (hint)
if self.enable_menu==True:
View
@@ -34,5 +34,8 @@ def ed_options():
parser.add_argument( '-d','--debug',
action='store_true',
help='Debug output to terminal window')
parser.add_argument( '--forceupdate',
action='store_true',
help='Force Update')
args=parser.parse_args()
return vars(args)

0 comments on commit df56f6e

Please sign in to comment.