Mercurial > code > home > repos > light9
changeset 331:c579174d73b2
go button now skips intros
author | Drew Perttula <drewp@bigasterisk.com> |
---|---|
date | Mon, 19 Jun 2006 01:08:07 +0000 |
parents | 1a34a0e118cc |
children | d4aff817a304 |
files | bin/ascoltami |
diffstat | 1 files changed, 9 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/bin/ascoltami Mon Jun 19 00:29:36 2006 +0000 +++ b/bin/ascoltami Mon Jun 19 01:08:07 2006 +0000 @@ -205,6 +205,9 @@ self.mpd.seek(seconds=time, song=1) self.last_autopause_time = time + def skip_intro(self): + self.seek_to(0) + def in_post(self): return (self.current_time.get() > self.total_time.get() + self.song_pad_time) @@ -250,6 +253,8 @@ return "play", self.player.play if state == 'play': + if self.player.current_time.get() < 0: + return "skip intro", self.player.skip_intro if self.player.in_post(): return "<nothing>", lambda: None return "skip to post", self.player.skip_to_post @@ -380,7 +385,7 @@ relief='raised',bd=1,font='arial 9', **appstyle).pack(side='left',fill='y') l = tk.Label(self,width=7, anchor='w', text=var.get(), - relief='sunken',bd=1,font='arial 12 bold', + relief='ridge',bd=1,font='arial 12 bold', padx=2,pady=2, bg='#800000',fg='white') l.pack(side='left',expand=1, fill='x') @@ -417,8 +422,7 @@ ('pause', 'Pause\nC-p', player.play_pause_toggle, "<Control-p>"), ('skip intro', - 'Skip Intro\nC-i',lambda: player.seek_to(0), - "<Control-i>"), + 'Skip Intro\nC-i', player.skip_intro, "<Control-i>"), ('skip to post', 'Skip to Post\nC-t', player.skip_to_post, "<Control-t>"), ('go', 'Go\nspace', self.goButton.action, "<Key-space>"), @@ -477,10 +481,10 @@ seeker = Seeker(root, player) goRow = tk.Frame(root) - tk.Label(goRow, text="Go button action:", + tk.Label(goRow, text="Go button action", font='arial 9', **appstyle).pack(side='left', fill='both') goStatus = tk.Label(goRow, font='arial 12 bold', **appstyle) - goStatus.config(bg='#800000', fg='white') + goStatus.config(bg='#800000', fg='white', relief='ridge') goStatus.pack(side='left', expand=True, fill='x') go = GoButton(player, goStatus, songfiles)