Performing an Action Before a Certain Track Plays

Maximilian Kossick maximilian.kossick at googlemail.com
Fri Aug 1 08:28:59 CEST 2008


On Thu, Jul 31, 2008 at 8:48 PM, Alejandro Wainzinger
<aikawarazuni at gmail.com> wrote:
> Since MTP devices can't be played directly off of, the only way to
> play their tracks would be to copy them to a KTemporaryFile for
> playing.  However, this would mean that the entire device of songs
> would have to be copied off in order to play without problems.  A
> solution I would want is to just keep a list of KTemporaryFiles with
> the proposed paths/urls, and to only perform the copy to these files
> right before attempting to play them.  Is there a way that I can
> detect when a song is about to be played, stop the song from being
> played until it's done copying, and then give the go-ahead signal to
> keep playing?

No. The only way to detect when a song is about to be played is a call
to playableUrl() (I can't remember whether it is used in other places
in lieu of a prettyUrl() method (I can't even remember if we have a
method like that). If you do not want to or cannot do the downloading
of the file in playableUrl(), you might have to add an
aboutToBePlayed() method to Meta::Track which would be called a few
seconds before we need the file.


More information about the Amarok-devel mailing list