- Added permission check into playlist
- Fixed SVN muckup - Adding gloss execution script
|
@ -0,0 +1,46 @@
|
||||||
|
#!/bin/bash
|
||||||
|
install_dir=/usr/share/gloss
|
||||||
|
version="0.1"
|
||||||
|
|
||||||
|
print_help()
|
||||||
|
{
|
||||||
|
echo "Usage: gloss [options]"
|
||||||
|
echo "Options:"
|
||||||
|
echo " --help Display this text"
|
||||||
|
echo " --debug Start gloss in debug mode"
|
||||||
|
echo " --theme [theme name] Force use of a certain theme"
|
||||||
|
echo " --show-themes Prints a list of available themes"
|
||||||
|
echo " --version Display the gloss version"
|
||||||
|
exit
|
||||||
|
}
|
||||||
|
|
||||||
|
print_themes()
|
||||||
|
{
|
||||||
|
echo "Available themes:"
|
||||||
|
ls -1 --color=never $install_dir/themes
|
||||||
|
exit
|
||||||
|
}
|
||||||
|
|
||||||
|
print_version()
|
||||||
|
{
|
||||||
|
echo "Gloss version $version"
|
||||||
|
exit
|
||||||
|
}
|
||||||
|
|
||||||
|
arg_string=""
|
||||||
|
for i in $*
|
||||||
|
do
|
||||||
|
case $i in
|
||||||
|
--help ) print_help
|
||||||
|
;;
|
||||||
|
--show-themes ) print_themes
|
||||||
|
;;
|
||||||
|
--version ) print_version
|
||||||
|
;;
|
||||||
|
* ) arg_string=$arg_string" "$i
|
||||||
|
|
||||||
|
esac
|
||||||
|
|
||||||
|
done
|
||||||
|
|
||||||
|
python $install_dir/gloss.py $arg_string
|
7
gloss.py
|
@ -86,12 +86,13 @@ class MainApp:
|
||||||
|
|
||||||
def loadGloss(self):
|
def loadGloss(self):
|
||||||
theme = None
|
theme = None
|
||||||
|
debug = False
|
||||||
#loop through the args
|
#loop through the args
|
||||||
for i in range(0, len(self.args)):
|
for i in range(0, len(self.args)):
|
||||||
arg = self.args[i]
|
arg = self.args[i]
|
||||||
if arg == "--debug":
|
if arg == "--debug":
|
||||||
print "Using debug mode"
|
print "Using debug mode"
|
||||||
self.glossMgr.debug = True
|
debug = True
|
||||||
elif arg == "--tests":
|
elif arg == "--tests":
|
||||||
self.show_tests = True
|
self.show_tests = True
|
||||||
print "Showing tests"
|
print "Showing tests"
|
||||||
|
@ -101,9 +102,7 @@ class MainApp:
|
||||||
|
|
||||||
#Create the Gloss Manager
|
#Create the Gloss Manager
|
||||||
self.glossMgr = GlossMgr(self.stage, self.dbMgr, theme=theme)
|
self.glossMgr = GlossMgr(self.stage, self.dbMgr, theme=theme)
|
||||||
|
self.glossMgr.debug = debug
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#Update splash status msg
|
#Update splash status msg
|
||||||
self.splashScreen.set_msg("Creating menus")
|
self.splashScreen.set_msg("Creating menus")
|
||||||
|
|
|
@ -20,6 +20,7 @@ class MusicObjectRow(ImageRow):
|
||||||
ImageRow.__init__(self, glossMgr, width, height, columns)
|
ImageRow.__init__(self, glossMgr, width, height, columns)
|
||||||
self.music_player = music_player
|
self.music_player = music_player
|
||||||
self.sleep = False
|
self.sleep = False
|
||||||
|
self.glossMgr = glossMgr
|
||||||
|
|
||||||
self.objectLibrary = []
|
self.objectLibrary = []
|
||||||
self.timeline = None
|
self.timeline = None
|
||||||
|
@ -42,7 +43,7 @@ class MusicObjectRow(ImageRow):
|
||||||
start = self.loaded_objects
|
start = self.loaded_objects
|
||||||
for i in range(start, end):
|
for i in range(start, end):
|
||||||
object = self.objectLibrary[i]
|
object = self.objectLibrary[i]
|
||||||
print "loading: " + object.name
|
if self.glossMgr.debug: print "Music_Player: loading: " + object.name
|
||||||
if i > (self.num_columns + self.buffer):
|
if i > (self.num_columns + self.buffer):
|
||||||
pixbuf = object.get_default_image()
|
pixbuf = object.get_default_image()
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -22,7 +22,7 @@ class album:
|
||||||
pixbuf = song.get_image_from_ID3()
|
pixbuf = song.get_image_from_ID3()
|
||||||
if not pixbuf is None:
|
if not pixbuf is None:
|
||||||
return pixbuf
|
return pixbuf
|
||||||
|
|
||||||
#If nothing has been found return the default
|
#If nothing has been found return the default
|
||||||
return self.get_default_image()
|
return self.get_default_image()
|
||||||
|
|
||||||
|
|
|
@ -50,6 +50,7 @@ class song:
|
||||||
def get_image_from_ID3(self):
|
def get_image_from_ID3(self):
|
||||||
#Basic check first up to make sure the filename is set
|
#Basic check first up to make sure the filename is set
|
||||||
if self.filename is None:
|
if self.filename is None:
|
||||||
|
if self.music_player.glossMgr.debug: print "Music_Player: Attempting to load ID3 image from song '%s', but have no filename to look up" % self.name
|
||||||
return None
|
return None
|
||||||
|
|
||||||
tag = eyeD3.Tag()
|
tag = eyeD3.Tag()
|
||||||
|
@ -58,6 +59,7 @@ class song:
|
||||||
|
|
||||||
#Make sure the file exists and we can read it
|
#Make sure the file exists and we can read it
|
||||||
if not os.access(filename, os.R_OK):
|
if not os.access(filename, os.R_OK):
|
||||||
|
if self.music_player.glossMgr.debug: print "Music_Player: Attempting to read ID3 image on file '%s', however do not appear to have read permission" % filename
|
||||||
return None
|
return None
|
||||||
|
|
||||||
tag.link(filename)
|
tag.link(filename)
|
||||||
|
|
|
@ -282,6 +282,7 @@ class Module:
|
||||||
|
|
||||||
def update_main_img(self, data = None):
|
def update_main_img(self, data = None):
|
||||||
#clutter.threads_enter()
|
#clutter.threads_enter()
|
||||||
|
|
||||||
pixbuf = self.current_albums[self.list1.selected].get_image()
|
pixbuf = self.current_albums[self.list1.selected].get_image()
|
||||||
if not pixbuf is None:
|
if not pixbuf is None:
|
||||||
self.main_img.set_pixbuf(pixbuf)
|
self.main_img.set_pixbuf(pixbuf)
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import gobject
|
import gobject
|
||||||
|
import os
|
||||||
from multimedia.AudioController import AudioController
|
from multimedia.AudioController import AudioController
|
||||||
|
|
||||||
class Playlist(gobject.GObject):
|
class Playlist(gobject.GObject):
|
||||||
|
@ -43,6 +44,11 @@ class Playlist(gobject.GObject):
|
||||||
|
|
||||||
current_song = self.songs[self.position]
|
current_song = self.songs[self.position]
|
||||||
current_song_filename = self.musicPlayer.base_dir + "/" + current_song.directory + "/" + current_song.filename
|
current_song_filename = self.musicPlayer.base_dir + "/" + current_song.directory + "/" + current_song.filename
|
||||||
|
|
||||||
|
#Make sure the file exists and we can read it
|
||||||
|
if not os.access(current_song_filename, os.R_OK):
|
||||||
|
self.glossMgr.display_msg("Access Error", "Unable to playback file '%s'" % current_song_filename)
|
||||||
|
|
||||||
current_song_uri = "file://" + current_song_filename
|
current_song_uri = "file://" + current_song_filename
|
||||||
if self.glossMgr.debug: print "Music_Player: Attempting to play file '%s'" % current_song_filename
|
if self.glossMgr.debug: print "Music_Player: Attempting to play file '%s'" % current_song_filename
|
||||||
self.audio_controller.play_audio(current_song_uri)
|
self.audio_controller.play_audio(current_song_uri)
|
||||||
|
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 678 KiB After Width: | Height: | Size: 678 KiB |
Before Width: | Height: | Size: 388 KiB After Width: | Height: | Size: 388 KiB |
Before Width: | Height: | Size: 135 KiB After Width: | Height: | Size: 135 KiB |
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.4 KiB |
Before Width: | Height: | Size: 256 KiB After Width: | Height: | Size: 256 KiB |
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 76 KiB |
Before Width: | Height: | Size: 138 KiB After Width: | Height: | Size: 138 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 257 KiB After Width: | Height: | Size: 257 KiB |
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 163 KiB After Width: | Height: | Size: 163 KiB |
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 58 KiB |
Before Width: | Height: | Size: 517 KiB After Width: | Height: | Size: 517 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 8.2 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 47 KiB |
Before Width: | Height: | Size: 515 KiB After Width: | Height: | Size: 515 KiB |
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 47 KiB |