MediaPlayerBox should have a start_position, end_position and an "end-reached" signal
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Quickly Widgets |
New
|
Undecided
|
Unassigned |
Bug Description
It should be possible to set a starting and ending position of the media being played. We should also be able to react to the end of the media. For instance, this would make it very easy to implement a loop function. Or you could have "bookmarks" in a media player, with a list of highlights to jump to. I'm thinking it should work something like this for a looper:
import gtk
from quickly.
# Loops a media sequence
def end_reached(widget, data=None):
widget.position = widget.
widget.play()
win = gtk.Window()
win.set_
player = MediaPlayerBox()
player.
player.end_position = 150
player.
player.uri = "somefile.ogg"
win.add(player)
win.show_all()
player.play()
gtk.main()
The end-reached signal could also be used for something like a "play again" button.
summary: |
- MediaPlayerBox should have a set_start_position, set_end_position and an - "end-reached" signal + MediaPlayerBox should have a start_position, end_position and an "end- + reached" signal |
description: | updated |
I think these are all already taken care of, though not simply.
- There already is an "end-of-file" signal which is set up for exactly your setting up looping and going to the next tracj.
- You can set the "seek" position very easily.
- You can get ahold of the slider in the player, and set the range, attach to events on it, poll the position, etc...
So, you can do what you suggest already, but it might be nice though to: set_range( start,stop)
- offer a convenience function like
player.
These could take -1 for either slot, which would mean just start at the beginning or the end.
Then we would have to decide if we want a different signal as you suggest, or to change the name of the existing signal to cover the scenario.
I wonder if a signal for a certain position reached in the media might be nice.
player. signal_ at_position( time, callback)
then you wouldn't have to poll to do things at different times.