public PlaylistSubscriberStream() { _defaultController = new SimplePlaylistController(); _items = new ArrayList(); //_engine = new PlayEngine(this); _currentItemIndex = 0; _creationTime = System.Environment.TickCount; }
//private void OnItemEnded(TaskItem item) //{ // try // { // var playing = playlistController.Items.Where(x => x.Id == item.Id).FirstOrDefault(); // if (playing != null) // { // playing.ClearStatus(); // } // } // catch (Exception ex) // { // logger.Error(" PlaylistView.OnItemEnded", ex); // } //} public void Initialize(ILogger logger, IPlaylistController playlistController) { if (logger == null) { throw new ArgumentNullException("logger"); } if (playlistController == null) { throw new ArgumentNullException("playlistController"); } this.logger = logger; this.playlistController = playlistController; try { playlistController.AddStartedCallback(OnItemStarted); playlistController.AddPausedCallback(OnItemPaused); playlistController.AddResumedCallback(OnItemResumed); playlistController.AddStoppedCallback(OnItemStopped); playlistController.AddItemChangedCallback(OnItemChanged); //playlistController.AddResultsCallback(OnItemEnded); this.DataContext = playlistController.Playlist; var first = playlistController.Items.FirstOrDefault(); if (first != null) { //first.IsPlaying = true; first.IsSelected = true; } } catch (Exception ex) { logger.Error("PlaylistView.Initialize", ex); } }
public void SetPlaylistController(IPlaylistController controller) { _controller = controller; }
//private void OnItemEnded(TaskItem item) //{ // try // { // var playing = playlistController.Items.Where(x => x.Id == item.Id).FirstOrDefault(); // if (playing != null) // { // playing.ClearStatus(); // } // } // catch (Exception ex) // { // logger.Error(" PlaylistView.OnItemEnded", ex); // } //} public void Initialize(ILogger logger, IPlaylistController playlistController) { if (logger == null) throw new ArgumentNullException("logger"); if (playlistController == null) throw new ArgumentNullException("playlistController"); this.logger = logger; this.playlistController = playlistController; try { playlistController.AddStartedCallback(OnItemStarted); playlistController.AddPausedCallback(OnItemPaused); playlistController.AddResumedCallback(OnItemResumed); playlistController.AddStoppedCallback(OnItemStopped); playlistController.AddItemChangedCallback(OnItemChanged); //playlistController.AddResultsCallback(OnItemEnded); this.DataContext = playlistController.Playlist; var first = playlistController.Items.FirstOrDefault(); if (first != null) { //first.IsPlaying = true; first.IsSelected = true; } } catch (Exception ex) { logger.Error("PlaylistView.Initialize", ex); } }
internal ServerStream() { _defaultController = new SimplePlaylistController(); _items = new ArrayList(); _state = State.UNINIT; }