Пример #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Playlists"/> class.
        /// </summary>
        /// <param name="log">The log.</param>
        /// <param name="repo">The repo.</param>
        /// <param name="dialogViewModel">The dialog view model.</param>
        public Playlists(ILocalizationService translationService, IMapleLog log, IPlaylistMapper playlistMapper, Func <IMediaRepository> repo, ISequenceProvider sequenceProvider)
            : base(log, translationService, sequenceProvider)
        {
            _repositoryFactory = repo ?? throw new ArgumentNullException(nameof(repo));
            _playlistMapper    = playlistMapper ?? throw new ArgumentNullException(nameof(playlistMapper));

            AddCommand = new RelayCommand(Add, CanAdd);
        }
Пример #2
0
        public UrlParseResult(IMapleLog log, Core.Playlist item, ParseResultType type) : this(log, type)
        {
            Playlists = new List <Core.Playlist>()
            {
                item
            };

            Log();
        }
Пример #3
0
        public UrlParseResult(IMapleLog log, Core.MediaItem item, ParseResultType type) : this(log, type)
        {
            MediaItems = new List <Core.MediaItem>()
            {
                item
            };

            Log();
        }
Пример #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MediaPlayers"/> class.
 /// </summary>
 /// <param name="manager">The manager.</param>
 /// <param name="playerFactory">The player factory.</param>
 /// <param name="repo">The repo.</param>
 /// <param name="devices">The devices.</param>
 /// <param name="dialog">The dialog.</param>
 public MediaPlayers(IMapleLog log, ILocalizationService translationService, IMediaPlayerMapper mediaPlayerMapper, Func <IMediaPlayer> playerFactory, Func <IMediaRepository> repo, AudioDevices devices, DialogViewModel dialog, ISequenceProvider sequenceProvider)
     : base(log, translationService, sequenceProvider)
 {
     _playerFactory     = playerFactory ?? throw new ArgumentNullException(nameof(playerFactory));
     _devices           = devices ?? throw new ArgumentNullException(nameof(devices));
     _dialog            = dialog ?? throw new ArgumentNullException(nameof(dialog));
     _repositoryFactory = repo ?? throw new ArgumentNullException(nameof(repo));
     _mediaPlayerMapper = mediaPlayerMapper ?? throw new ArgumentNullException(nameof(mediaPlayerMapper));
 }
Пример #5
0
        public NotifyTaskCompletion(Task <TResult> task, IMapleLog log)
        {
            _task = task ?? throw new ArgumentNullException(nameof(task));
            _log  = log ?? throw new ArgumentNullException(nameof(log));

            if (!task.IsCompleted)
            {
                var _ = WatchTaskAsync(task);
            }
        }
Пример #6
0
        public NAudioMediaPlayer(IMapleLog log) : base()
        {
            _log      = log;
            _settings = new MediaFoundationReader.MediaFoundationReaderSettings
            {
                RepositionInRead   = true,
                SingleReaderObject = false,
                RequestFloatOutput = false,
            };

            AudioDeviceChanging += OnAudioDeviceChanging;
            AudioDeviceChanged  += OnAudioDeviceChanged;

            _player = WavePlayerFactory.GetPlayer();
            _player.PlaybackStopped += PlaybackStopped;

            PlayingMediaItem += OnPlaybackStarted;

            OnPropertyChanged(nameof(VolumeMin));
            OnPropertyChanged(nameof(VolumeMax));
        }
Пример #7
0
 public SequenceService(IMapleLog log)
 {
     _log = log ?? throw new ArgumentNullException(nameof(log));
 }
Пример #8
0
        public UrlParseResult(IMapleLog log, List <Core.MediaItem> items, ParseResultType type) : this(log, type)
        {
            MediaItems = items;

            Log();
        }
Пример #9
0
 public LocalizationService(ITranslationProvider provider, IMapleLog log)
 {
     _log = log ?? throw new ArgumentNullException(nameof(log));
     TranslationProvider = provider ?? throw new ArgumentNullException(nameof(provider));
     _currentLanguage    = Thread.CurrentThread.CurrentUICulture;
 }
Пример #10
0
 public SplashScreenViewModel(IMapleLog log, IVersionService version) : this(log)
 {
     Version = version.Get();
     InitializeCommands();
 }
Пример #11
0
 private SplashScreenViewModel(IMapleLog log) : this()
 {
     _log = log ?? throw new ArgumentNullException(nameof(log));
     _log.LogMessageReceived += LogMessageReceived;
 }
Пример #12
0
 public BaseMapper(ILocalizationService translationService, ISequenceProvider sequenceProvider, IMapleLog log, IValidator <T> validator)
 {
     _translationService = translationService ?? throw new ArgumentNullException(nameof(translationService));
     _sequenceProvider   = sequenceProvider ?? throw new ArgumentNullException(nameof(sequenceProvider));
     _log       = log ?? throw new ArgumentNullException(nameof(log));
     _validator = validator ?? throw new ArgumentNullException(nameof(validator));
 }
Пример #13
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PlaylistMapper"/> class.
        /// </summary>
        /// <param name="dialogViewModel">The dialog view model.</param>
        public PlaylistMapper(IMediaItemMapper mediaItemMapper, DialogViewModel dialogViewModel, ILocalizationService translator, ISequenceProvider sequenceProvider, IMapleLog log, IValidator <Playlist> validator)
            : base(translator, sequenceProvider, log, validator)
        {
            _dialogViewModel = dialogViewModel ?? throw new ArgumentNullException(nameof(dialogViewModel));
            _mediaItemMapper = mediaItemMapper ?? throw new ArgumentNullException(nameof(mediaItemMapper));

            InitializeMapper();
        }
Пример #14
0
        public MediaPlayerMapper(ILocalizationService translator, IMediaPlayer mediaPlayer, AudioDevices devices, ISequenceProvider sequenceProvider, IMapleLog log, IValidator <MediaPlayer> validator)
            : base(translator, sequenceProvider, log, validator)
        {
            _mediaPlayer = mediaPlayer ?? throw new ArgumentNullException(nameof(mediaPlayer));
            _devices     = devices ?? throw new ArgumentNullException(nameof(devices));

            InitializeMapper();
        }
Пример #15
0
 public BaseDataListViewModel(IMapleLog log, ILocalizationService translationService, ISequenceProvider sequenceProvider)
 {
     _log = log ?? throw new ArgumentNullException(nameof(log));
     _translationService = translationService ?? throw new ArgumentNullException(nameof(translationService));
     _sequenceProvider   = sequenceProvider ?? throw new ArgumentNullException(nameof(sequenceProvider));
 }
Пример #16
0
 public UrlParseService(IMapleLog log)
 {
     _log = log;
 }
Пример #17
0
 public MediaItems(IMapleLog log, ILocalizationService translationService, ISequenceProvider sequenceProvider, IMediaItemMapper mediaItemMapper, Func <IMediaRepository> repo)
     : base(log, translationService, sequenceProvider)
 {
     _repositoryFactory = repo ?? throw new ArgumentNullException(nameof(repo));
     _mediaItemMapper   = mediaItemMapper ?? throw new ArgumentNullException(nameof(mediaItemMapper));
 }
Пример #18
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Scenes"/> class.
        /// </summary>
        /// <param name="manager">The manager.</param>
        /// <param name="log">The log.</param>
        public Scenes(ILocalizationService manager, IMapleLog log)
        {
            _manager = manager ?? throw new ArgumentNullException(nameof(manager));
            _log     = log ?? throw new ArgumentNullException(nameof(log));

            var content = new[]
            {
                new Scene(_manager)
                {
                    Content    = new MediaPlayerPage(_manager),
                    Key        = nameof(Resources.Playback),
                    IsSelected = true,
                    Sequence   = 100,
                },

                new Scene(_manager)
                {
                    Content    = new PlaylistsPage(_manager),
                    Key        = nameof(Resources.Playlists),
                    IsSelected = false,
                    Sequence   = 300,
                },

                new Scene(_manager)
                {
                    Content    = new ColorOptionsPage(_manager),
                    Key        = nameof(Resources.Themes),
                    IsSelected = false,
                    Sequence   = 500,
                },

                new Scene(_manager)
                {
                    Content    = new OptionsPage(_manager),
                    Key        = nameof(Resources.Options),
                    IsSelected = false,
                    Sequence   = 600,
                },

                new Scene(_manager)
                {
                    Content    = new MediaPlayersPage(_manager),
                    Key        = nameof(Resources.Director),
                    IsSelected = false,
                    Sequence   = 150,
                },
            };

            using (_busyStack.GetToken())
            {
                AddRange(content);

                SelectedItem = Items[0];

                using (View.DeferRefresh())
                {
                    View.SortDescriptions.Add(new SortDescription(nameof(Scene.Sequence), ListSortDirection.Ascending));
                }
            }

            InitializeCommands();
        }
Пример #19
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MediaItemMapper"/> class.
        /// </summary>
        public MediaItemMapper(IPlaylistContext context, ILocalizationService translator, ISequenceProvider sequenceProvider, IMapleLog log, IValidator <MediaItem> validator)
            : base(translator, sequenceProvider, log, validator)
        {
            _context = context ?? throw new ArgumentNullException(nameof(context));

            InitializeMapper();
        }
Пример #20
0
 /// <summary>
 /// essentially no data was returned, when using this constructor
 /// </summary>
 public UrlParseResult(IMapleLog log, ParseResultType type = ParseResultType.None) : this(log)
 {
     Type = type;
 }
Пример #21
0
 public Service(IMapleLog log)
 {
     _log = log;
 }
Пример #22
0
        public UrlParseResult(IMapleLog log, List <Core.Playlist> items, ParseResultType type) : this(log, type)
        {
            Playlists = items;

            Log();
        }