Changeset - 26a73a4647cb
[Not reviewed]
default
0 1 0
Drew Perttula - 18 years ago 2007-06-17 22:57:43
drewp@bigasterisk.com
ascoltami cache filling
1 file changed with 10 insertions and 0 deletions:
0 comments (0 inline, 0 general)
bin/ascoltami
Show inline comments
 
@@ -196,12 +196,22 @@ class Player:
 
        self.mpd.add(showconfig.songInMpd(MUS['preSong']))
 
        self.mpd.add(showconfig.songInMpd(song))
 
        self.mpd.add(showconfig.songInMpd(MUS['postSong']))
 

	
 
        self.fillCache(song)
 
        
 
        self.filename_var.set(graph.value(song, L9['showPath']))
 
        self.song_uri = song
 

	
 
        self.set_total_time(song)
 
        self.seek_to(-4)
 

	
 
    def fillCache(self, song):
 
        """read the song's entire wav file into memory just before
 
        playing, so that mpd should never hit the disk during
 
        playback. On score in 2007, we had some mpd stutters that were
 
        always timed with a disk read."""
 
        open(showconfig.songOnDisk(song)).read()
 

	
 
    def check_autopause(self):
 
        pause_time = self.total_time.get() + self.song_pad_time
 
        t = self.current_time.get()
0 comments (0 inline, 0 general)