Re: [Banshee-List] How to update remotely the play queue



On Thu, Oct 7, 2010 at 8:29 PM, foo_fighter
<carlossanchezlopez gmail com> wrote:
>
> Hello. I am programming a web-based jukebox that connects to my Banshee music
> database. The web interface allows to add songs to the play queue table of
> the Banshee sqlite database.
>
> Here is the problem: Banshee will only recognize new songs in the play queue
> table of its sqlite database if they are added directly from Banshee's
> playlists. Now, I can make Banshee recognize songs added to the play queue
> through my web jukebox but only when I tell Banshee to play the next song.
> Only then, the new song will appear in Banshee's interface (play queue).
>
> This is giving me problems, because if Banshee is playing the last song in
> the play queue, the next song will be played from the "Music" playlist
> (default song list) and won't recognize the next song, which was added
> through the jukebox. If I wanted to recognize that particular song, I would
> have to add a song to the play queue directly from Banshee.
>
> My question is not that complicated: how does Banshee updates its play
> queue? In other words, when a user adds a song to the play queue directly
> from Banshee, the play queue is inmediately and automatically updated. Is
> there any way to achieve that from outside Banshee?

First of all, I'm not sure I understand how your web application
interacts with Banshee.
If it's connecting directly to the sqlite database, it might not be a
good idea, especially if Banshee is running at the same time :
accessing an sqlite database file from multiple processes can lead to
corruption.

I think what you're trying to achieve can be done using the various
d-bus interfaces provided by Banshee. In particular, the
org.bansheeproject.Banshee.PlayQueue has an EnqueueUri method that
adds a track to the playqueue, with its URL as a parameter.
You can try it with a d-bus tool like dbus-explorer.
Bonus tip for manual tests : you have to replace space by "%20" in the
URL, for example : file:///path/to/Some%20Name.mp3

Don't hesitate to ask if you have other questions.

-- 
Bertrand Lorentz


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