Re: [Banshee-List] How to detect whether a track is skipped


I connected�TrackInfo.PlaybackFinished event to my event handler, but the event handler is called only when a song is skipped. It's not called when a song plays to the end. That's quite weird. Is it because the song is streamed from the Internet?
Are there any other ways to detect whether a song is played to the end?

Thank you.

Chen Tao

On Tue, May 17, 2011 at 5:33 AM, Bertrand Lorentz <bertrand lorentz gmail com> wrote:
On Sun, May 15, 2011 at 10:03 AM, Chen Tao <pro711 gmail com> wrote:
> Hello everyone,
> I'm writing an extension for, an internet radio station�similar�to
> Pandora. The station tunes the music to the listener's taste by user
> feedback - "like", "dislike" or "skip". My extension plays the radio in
> Banshee and I have to distinguish whether a song played to the end or the
> user hit "Next" button and skipped it.
> I looked at Banshee.MediaEngine.PlayerEvent and tried the following
> events:�RequestNextTrack,�StartOfStream,�EndOfStream. My code is like this:
>> � � � � � � � � � � ServiceManager.PlayerEngine.ConnectEvent(Next,
>> PlayerEvent.RequestNextTrack);
>> � � � � � � � � � � ServiceManager.PlayerEngine.ConnectEvent(FinishSong,
>> PlayerEvent.EndOfStream);
>> � � � � � � � � � � ServiceManager.PlayerEngine.ConnectEvent(StartSong,
>> PlayerEvent.StartOfStream);
> RequestNextTrack does not seem to distinguish between the two
> cases.�StartOfStream is triggered when a song starts playing.�I thought
> EndOfStream would be triggered when a song is played to the end, but it
> didn't. So I can't find a solution to my problem.
> Can anyone help?

You might be able to use the TrackInfo.PlaybackFinished event,
especially if you're sub-classing TrackInfo. It will give you the
percentage of the track that was played.
See for example what is done for podcasts, to mark them as read :

Bertrand Lorentz
banshee-list mailing list
banshee-list gnome org �(unsubscribe here)

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]