How to get the playableUrl only when the track is about to be played?

Matěj Laitl matej at laitl.cz
Sat Jan 14 09:54:44 UTC 2012


On 13. 1. 2012 Dirley wrote:
> Hello, there.

Hi Dirley,
 
> I've been hacking into Amarok, trying to add an internet service. Turns out
> that my service is a little bit... uncommon. When the tracks come from the
> service, they don't have a "playable url". I have to ask the service a url
> for each track I want to play. How would I do that on Amarok?
> 
> I've considered using the MultiSourceCapability, but it didnt work, since
> the "first" url is always invalid, so the engine skips the song. The
> MultiPlayableCapability almost works, since the engine do wait for the
> first source to be fetched.
> 
> So I'm missing something? Is it feasible or should I give up and run a http
> server inside my service that redirects to the playable url?

I think you can inherit Meta::Track directly and just implement
virtual void prepareToPlay()
Engine controller apparently calls it when it is about to play a song and it 
is called nowhere else in Amarok AFAICS. I would return empty playableUrl() 
and false in isPlayable() before prepareToPlay() is called.

Regards,
			Matěj


More information about the Amarok-devel mailing list