Re: [Banshee-List] Open URI from Banshee Extension
- From: Bertrand Lorentz <bertrand lorentz gmail com>
- To: banshee-list gnome org
- Subject: Re: [Banshee-List] Open URI from Banshee Extension
- Date: Sat, 2 Oct 2010 16:50:54 +0200
I think the following should work :
ServiceManager.PlayerEngine.Open (new SafeUri (uri));
ServiceManager.PlayerEngine.Play ();
You need to explicitly tell the engine to start playing.
--
Bertrand
On Thu, Sep 30, 2010 at 8:11 AM, Frank <funtastix googlemail com> wrote:
> As far as I can remember (sorry, at the moment in the process of
> setting up my environment again) you'd rather have to find the
> TrackInfo/DatabaseTrackInfo object in the MusicLibrary source and then
> do a TrackInfo.Play()
>
> So say in words of your second example:
>
> Banshee.Collection.TrackInfo currTrack =
> ServiceManager.PlayerEngine.CurrentTrack;
> currTrack.Play();
>
> ...
>
> or create a new DatabaseTrackInfo, which I wouldn't think was much of
> a good idea, as you'd want the track to play that is already in the
> library, right?
>
> BR
>
> Frank
>
> 2010/9/30 nstamato <nstamato gmail com>:
>>
>> Hello,
>>
>> I'm writing an Extension for Banshee where one can control Banshee from his
>> phone. Right now I have it set up so that a user can select a song on his
>> phone, my application sends the URI of the song to my extension in Banshee
>> and then I was hoping that Banshee would play the selected song by calling:
>>
>> ServiceManager.PlayerEngine.Open(new SafeUri(s));
>>
>> where s is the String with the URI of the selected song. This doesn't seem
>> to work. Just as a check to make sure I'm not passing a corrupt URI, I
>> tried:
>>
>> Banshee.Collection.TrackInfo currTrack =
>> ServiceManager.PlayerEngine.CurrentTrack;
>> SafeUri s = currTrack.Uri;
>> ServiceManager.PlayerEngine.Open(s);
>>
>> which should just start again the song that's playing, but that's not
>> working either. I'm probably following the wrong approach for doing what I
>> would like.
>>
>> Any ideas?
>>
>> thanks
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]