diff --git a/bin/ascoltami b/bin/ascoltami --- a/bin/ascoltami +++ b/bin/ascoltami @@ -205,6 +205,9 @@ class Player: 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 @@ class GoButton: 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 "", lambda: None return "skip to post", self.player.skip_to_post @@ -380,7 +385,7 @@ class Seeker(tk.Frame): 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 @@ class ControlButtons(tk.Frame): ('pause', 'Pause\nC-p', player.play_pause_toggle, ""), ('skip intro', - 'Skip Intro\nC-i',lambda: player.seek_to(0), - ""), + 'Skip Intro\nC-i', player.skip_intro, ""), ('skip to post', 'Skip to Post\nC-t', player.skip_to_post, ""), ('go', 'Go\nspace', self.goButton.action, ""), @@ -477,10 +481,10 @@ songlist.pack(fill='both',exp=1) 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)