Re: [Banshee-List] Part Shuffle Plugin



On Tue, 2006-01-31 at 10:35 +0100, Thijs Vermeir wrote:
> Hello,
> 
> I started to make another plug-in for banshee : Party Shuffle.
> Target Functions are the same as the party shuffle function in iTunes.
> 
> I hope noone already started with this plug-in. ;-)
> 
> But a couple of questions about the playlists :
> 
> Can I add a playlist with this code? ( works visually, but maybe some  
> er)
>                  partyList = new PlaylistSource();
>                  partyList.Rename("Party Shuffle");
>                  partyList.Commit();
>                  SourceManager.AddSource(partyList);
> 
> Can I delete a playlist with this code?
>              partyList.Delete();
> 
> Can I detect that a playlist excist (the name) with this code?  
> (Doesn't want to work)
> 	IDataReader reader = Globals.Library.Db.Query("SELECT PlaylistID  
> FROM Playlists");
>              while(reader.Read()) {
>                  PlaylistSource playlist = new PlaylistSource 
> (Convert.ToInt32(reader[0]));
>                  if (playlist.Name.Equals("Party Shuffle"))
>                          partyList = playlist;
>              }
>              reader.Dispose();

If I get this right, you are adding a playlist called "Party Shuffle",
which get priority above anything that's playing? (In other words: are
you implementing this the same way rhythmbox does it?)

WARNING: I might be wrong, check abock to be sure, but:
As we have the playingIter in PlaylistModel, wouldn't it be more sane if
a party shuffle plugin modified that iterator. Also, this way, you
wouldn't need a playlist for this, which also means that you can
implement a custom* view (which abock just recently made possible), one
that's more suited for the task than a simple playlist view (as this
would not be very intuitive).

Offcourse, that's just my 2 €c, feel free to discard it.

Kind regards,
   Ruben

* or is it hybrid here? ;-)


--
Ruben Vermeersch (rubenv)
http://www.Lambda1.be/



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