Exemple #1
0
 def __init__(self, collection=[]):
     providers.ProviderHandler.__init__(self, "dynamic_playlists")
     self.buffersize = settings.get_option("playback/dynamic_buffer", 5)
     self.collection = collection
     self.cachedir = os.path.join(xdg.get_cache_dir(), 'dynamic')
     if not os.path.exists(self.cachedir):
         os.makedirs(self.cachedir)
Exemple #2
0
    def __init__(self):
        providers.ProviderHandler.__init__(self, "lyrics")
        self.preferred_order = settings.get_option(
                'lyrics/preferred_order', [])
        self.cache = LyricsCache(os.path.join(xdg.get_cache_dir(), 'lyrics.cache'))

        event.add_callback(self.on_track_tags_changed, 'track_tags_changed')
Exemple #3
0
 def __init__(self, collection=[]):
     providers.ProviderHandler.__init__(self, "dynamic_playlists")
     self.buffersize = settings.get_option("playback/dynamic_buffer", 5)
     self.collection = collection
     self.cachedir = os.path.join(xdg.get_cache_dir(), 'dynamic')
     if not os.path.exists(self.cachedir):
         os.makedirs(self.cachedir)
Exemple #4
0
    def __init__(self):
        providers.ProviderHandler.__init__(self, "lyrics")
        self.preferred_order = settings.get_option(
                'lyrics/preferred_order', [])
        self.cache = LyricsCache(os.path.join(xdg.get_cache_dir(), 'lyrics.cache'))

        event.add_callback(self.on_track_tags_changed, 'track_tags_changed')
Exemple #5
0
    def __init__(self, limit=5, location=None, menu=None, callback=None):
        common.LimitedCache.__init__(self, limit)

        if location is None:
            location = os.path.join(xdg.get_cache_dir(), 'daaphistory.dat')
        self.location = location
        self.menu = menu
        self.callback = callback

        self.load()
Exemple #6
0
 def __init__(self, limit=5, location=None, menu=None, callback=None):
     common.LimitedCache.__init__(self, limit)
     
     if location is None:
         location = os.path.join(xdg.get_cache_dir(), 'daaphistory.dat')
     self.location = location
     self.menu = menu
     self.callback = callback
     
     self.load()
Exemple #7
0
 def __init__(self):
     """
         Initializes the somafm radio station
     """
     self.user_agent = main.exaile().get_user_agent_string('somafm')
     self.somafm_url = 'http://somafm.com/'
     self.channels_xml_url = self.somafm_url + 'channels.xml'
     self.cache_file = os.path.join(xdg.get_cache_dir(),'somafm.cache')
     self.channelist = ''
     self.data = {}
     self._load_cache()
     self.subs = {}
     self.playlists = {}
     self.playlist_id = 0
     logger.debug(self.user_agent)
Exemple #8
0
 def __init__(self):
     """
         Initializes the somafm radio station
     """
     self.user_agent = main.exaile().get_user_agent_string('somafm')
     self.somafm_url = 'https://somafm.com/'
     self.channels_xml_url = self.somafm_url + 'channels.xml'
     self.cache_file = os.path.join(xdg.get_cache_dir(), 'somafm.cache')
     self.channelist = ''
     self.data = {}
     self._load_cache()
     self.subs = {}
     self.playlists = {}
     self.playlist_id = 0
     logger.debug(self.user_agent)
Exemple #9
0
    def __init__(self, exaile):
        """
            Initializes the icecast radio station
        """
        self.exaile = exaile
        self.user_agent = exaile.get_user_agent_string('icecast')
        self.icecast_url = 'http://dir.xiph.org'
        self.genre_url = self.icecast_url + '/by_genre'
        self.search_url_prefix = self.icecast_url + '/search?search='
        self.cache_file = os.path.join(xdg.get_cache_dir(), 'icecast.cache')
        self.data = {}
        self._load_cache()
        self.subs = {}
        self.playlists = {}

        logger.debug(self.user_agent)
Exemple #10
0
    def __init__(self, exaile):
        """
            Initializes the icecast radio station
        """
        self.exaile = exaile
        self.user_agent = exaile.get_user_agent_string('icecast')
        self.icecast_url = 'http://dir.xiph.org'
        self.genre_url = self.icecast_url + '/by_genre'
        self.search_url_prefix = self.icecast_url + '/search?search='
        self.cache_file = os.path.join(xdg.get_cache_dir(), 'icecast.cache')
        self.data = {}
        self._load_cache()
        self.subs = {}
        self.playlists = {}

        logger.debug(self.user_agent)
 def _get_cover_url(self, track):
     trackid = track.get_tag_raw('__loc')
     trackhash = hashlib.sha1(trackid).hexdigest()
     if trackid not in self.cover_cache:
         cover_data = cover_manager.get_cover(track)
         if cover_data is not None:
             tempfile = os.path.join(xdg.get_cache_dir(), "cover-%s" % trackhash)
             try:
                 with open(tempfile, 'wb') as f:
                     f.write(cover_data)
             except BaseException as ex:
                 logger.error("Unable to export cover: %r" % ex)
                 return None
             self.cover_cache[trackid] = "file://%s" % tempfile
         else:
             return None
     return self.cover_cache[trackid]
Exemple #12
0
 def __init__(self):
      self.moodbar=''
      self.buff=''
      self.brush=None
      self.modwidth=0
      self.curpos=0
      self.modTimer=None
      self.haveMod=False
      self.playingTrack=''
      self.seeking=False
      self.setuped=False
      self.runed=False
      self.pid=0
      self.uptime=0
      self.ivalue=0
      self.qvalue=0
      self.moodsDir=os.path.join(xdg.get_cache_dir(), "moods")
      if not os.path.exists(self.moodsDir):
          os.mkdir(self.moodsDir)