"""A D-Fuzz station"""
def __init__(self):
-
- self.work_dir = os.environ['HOME']+'.d-fuzz'
+
+ self.version = '0.1'
self.conf = []
self.id = 999999
self.buffer_size = 0xFFFF
self.rand_list = []
def prog_info(self):
- return """
- d-fuzz : easy and light streaming tool
-
- Copyright (c) 2007-2007 Guillaume Pellerin <pellerin@parisson.com>
+ desc = '\n d-fuzz : easy and light streaming tool\n'
+ version = ' version : ' + self.version +'\n\n'
+ info = """ Copyright (c) 2007-2007 Guillaume Pellerin <pellerin@parisson.com>
All rights reserved.
This software is licensed as described in the file COPYING, which
see http://parisson.com/d-fuzz/ for more details
"""
+ text = desc + version + info
+ return text
def get_conf_dict(self):
confile = open(self.conf_file,'r')
lp = len(playlist)
self.rand_list = range(0,lp)
random.shuffle(self.rand_list)
- print self.rand_list
+ #print self.rand_list
self.id = 0
else:
self.id = self.id + 1
index = self.rand_list[self.id]
- print str(self.id) +':'+ str(index)
+ #print str(self.id) +':'+ str(index)
return playlist, playlist[index]
def core_process(self, command, buffer_size):
yield __chunk
def stream(self, conf_file):
+
+ print "D-fuzz v"+self.version
+
self.conf_file = conf_file
self.get_conf_dict()
#for station in conf_dict['station']:
station = self.conf['station']
- print station
+ #print station
s = shout.Shout()
print "Using libshout version %s" % shout.version()
# (keys are shout.SHOUT_AI_BITRATE, shout.SHOUT_AI_SAMPLERATE,
# shout.SHOUT_AI_CHANNELS, shout.SHOUT_AI_QUALITY)
- command = 'cat '
playlist = self.get_playlist()
lp = len(playlist)
print 'Playlist :'
playlist, media = self.get_next_media_lin(playlist)
file_name = string.replace(media, self.media_dir + os.sep, '')
- print 'Streaming file : %s' % file_name
+ print 'D-fuzz file : %s' % file_name
s.set_metadata({'song': file_name})
command = 'cat "%s"' % media
stream = self.core_process(command, self.buffer_size)