public ControlsViewModel( IRadio radio, [Import("CorePlayer")] ITrackPlayer player, Dispatcher dispatcher, IToastService toastService, ILoggerFacade logger) { _radio = radio; _radio.CurrentTrackChanged += RadioOnCurrentTrackChanged; _radio.UpcomingTrackChanged += RadioOnUpcomingTrackChanged; _radio.CurrentTrackStreamChanged += RadioOnCurrentTrackStreamChanged; _radio.TrackStreamQueued += RadioOnTrackStreamQueued; _player = player; _dispatcher = dispatcher; _toastService = toastService; _logger = logger; _player.IsPlayingChanged += (sender, args) => { RaisePropertyChanged("IsPlaying"); RefreshCommands(); }; NextTrackCommand = new ManualCommand(ExecuteNextTrack, CanExecuteNextTrack); TogglePlayPauseCommand = new ManualCommand(ExecuteTogglePlayPause, CanExecuteTogglePlayPause); ShareTrackCommand = new ManualCommand <Track>(ExecuteShareTrack, CanExecuteShareTrack); }
public NowPlayingViewModel(IRadio radio, [Import("CorePlayer")] ITrackPlayer player, Dispatcher dispatcher) { _radio = radio; _player = player; _dispatcher = dispatcher; _random = new Random(); _taskScheduler = TaskScheduler.FromCurrentSynchronizationContext(); NavigateBackCommand = new AutomaticCommand(ExecuteNavigateBack, CanExecuteNavigateBack); NextTrackCommand = new ManualCommand(ExecuteNextTrack, CanExecuteNextTrack); TogglePlayPauseCommand = new ManualCommand(ExecuteTogglePlayPause, CanExecuteTogglePlayPause); ShareTrackCommand = new ManualCommand <Track>(ExecuteShareTrack, CanExecuteShareTrack); }
public NowPlayingViewModel(IRadio radio, [Import("CorePlayer")] ITrackPlayer player, Dispatcher dispatcher) { _radio = radio; _player = player; _dispatcher = dispatcher; _random = new Random(); _taskScheduler = TaskScheduler.FromCurrentSynchronizationContext(); NavigateBackCommand = new AutomaticCommand(ExecuteNavigateBack, CanExecuteNavigateBack); NextTrackCommand = new ManualCommand(ExecuteNextTrack, CanExecuteNextTrack); TogglePlayPauseCommand = new ManualCommand(ExecuteTogglePlayPause, CanExecuteTogglePlayPause); ShareTrackCommand = new ManualCommand<Track>(ExecuteShareTrack, CanExecuteShareTrack); }
public CoreRadio( [Import("CorePlayer")]ITrackPlayer corePlayer, IDocumentStore documentStore, ILoadingIndicatorService loadingIndicatorService, IToastService toastService, ILoggerFacade logger, Dispatcher dispatcher) { _trackQueuePublic = new ObservableCollection<Track>(); _trackStreamQueuePublic = new ObservableCollection<ITrackStream>(); _trackStreamQueue = new ConcurrentQueue<ITrackStream>(); _trackQueue = new ConcurrentQueue<Track>(); _corePlayer = corePlayer; _documentStore = documentStore; _loadingIndicatorService = loadingIndicatorService; _toastService = toastService; _logger = logger; _dispatcher = dispatcher; _corePlayer.Volume = 0.2; _corePlayer.TrackComplete += OnTrackComplete; _corePlayer.Initialize(); }
public CoreRadio( [Import("CorePlayer")] ITrackPlayer corePlayer, IDocumentStore documentStore, ILoadingIndicatorService loadingIndicatorService, IToastService toastService, ILoggerFacade logger, Dispatcher dispatcher) { _trackQueuePublic = new ObservableCollection <Track>(); _trackStreamQueuePublic = new ObservableCollection <ITrackStream>(); _trackStreamQueue = new ConcurrentQueue <ITrackStream>(); _trackQueue = new ConcurrentQueue <Track>(); _corePlayer = corePlayer; _documentStore = documentStore; _loadingIndicatorService = loadingIndicatorService; _toastService = toastService; _logger = logger; _dispatcher = dispatcher; _corePlayer.Volume = 0.2; _corePlayer.TrackComplete += OnTrackComplete; _corePlayer.Initialize(); }