Hi Richard,
thanks for the patch! Before commenting on it, I have to admit that I'm not yet fully convinced whether this feature is something really useful for a general audience. So it would be nice to get some support from other people. On the other hand, the implementation is clean and not intrusive, so I'm not too reluctant to apply the patch.
Here my comments:
On 12.08.05, Richard Smith wrote:
The following patch adds play speed controls to pytone. Diffed from svn but should apply and work for any recient version of PyTone.
'f' plays faster 's' plays slower 'd' resets to the original speed.
These default key bindings look a bit dangerous to me. Couldn't we use a combination like [, ] and ^ (other suggestions would be welcome, too).
Concerning the implemenation:
Index: trunk/src/services/players/internal.py =================================================================== --- trunk/src/services/players/internal.py (revision 28) +++ trunk/src/services/players/internal.py (working copy) @@ -355,7 +355,16 @@ song = self.songs[0] song.seekrelative(seconds) self.audiodev.flush() + + def _playerplayfaster(self): + self.songs[0].playfaster() + + def _playerplayslower(self): + self.songs[0].playslower()
+ def _playerspeedreset(self): + self.songs[0].resetplayspeed() +
Here, you have to checks whether self.songs is non-empty, otherwise this raises an exception when no song is being played.
Jörg