public DaapPlaylistSource(DAAP.Playlist playlist, DaapSource parent) : base(playlist.Name, parent) { IsTemporary = true; this.parent = parent; Save (); int count = 0; if (playlist.Tracks.Count > 0) { //IList<DAAP.Track> tracks = playlist.Tracks; int [] external_ids = new int [playlist.Tracks.Count]; int i = 0; foreach (DAAP.Track track in playlist.Tracks) { external_ids[i++] = track == null ? -1 : track.Id; if (track != null) { count++; } } if (count > 0) { ServiceManager.DbConnection.Execute (insert_track_command, DbId, parent.DbId, external_ids); } } SavedCount = count; ThreadAssist.ProxyToMain (delegate { OnUpdated (); }); }
public DaapSource (DAAP.Service service) : base (Catalog.GetString ("Music Share"), service.Name, (service.Address.ToString () + service.Port).Replace (":", "").Replace (".", ""), 300, true) { this.service = service; Properties.SetString ("UnmapSourceActionLabel", Catalog.GetString ("Disconnect")); Properties.SetString ("UnmapSourceActionIconName", "gtk-disconnect"); SupportsPlaylists = false; SavedCount = 0; UpdateIcon (); AfterInitialized (); }
public void UnregisterDatabase(DAAP.Database database) { databases.Remove(database); }
public void RegisterDatabase(DAAP.Database database) { databases.Add(database); }
protected virtual void StreamTrack(Socket client, DAAP.Database database, DAAP.Track song, long offset) { long length; Stream stream = database.StreamTrack(song, offset, out length); WriteResponseStream(client, stream, length, song.FileName, offset < 0 ? 0 : offset); stream.Close(); client.Close(); }
protected void StreamTrack(Socket client, DAAP.Database database, DAAP.Track song) { StreamTrack (client, database, song, -1); }
public void OnDatabaseTrackRemoved(object o, DAAP.TrackArgs args) { //RemoveTrack ( }
public void OnDatabaseTrackAdded(object o, DAAP.TrackArgs args) { DaapTrackInfo track = new DaapTrackInfo (args.Track, this); track.Save (); }