Exemplo n.º 1
0
        public SongsPageViewModel(
            ILibraryCollectionService libraryCollectionService,
            ILibraryService libraryService,
            ISettingsUtility settingsUtility,
            IPlayerService playerService)
        {
            _libraryCollectionService = libraryCollectionService;
            _settingsUtility          = settingsUtility;
            _playerService            = playerService;
            LibraryService            = libraryService;

            SortItems =
                Enum.GetValues(typeof(TrackSort))
                .Cast <TrackSort>()
                .Select(sort => new ListBoxItem {
                Content = sort.GetEnumText(), Tag = sort
            })
                .ToList();
            SortChangedCommand = new DelegateCommand <ListBoxItem>(SortChangedExecute);
            ShuffleAllCommand  = new DelegateCommand(ShuffleAllExecute);

            var defaultSort = _settingsUtility.Read(ApplicationSettingsConstants.SongSort,
                                                    TrackSort.DateAdded,
                                                    SettingsStrategy.Roam);

            DefaultSort = SortItems.IndexOf(SortItems.FirstOrDefault(p => (TrackSort)p.Tag == defaultSort));
            ChangeSort(defaultSort);
        }
Exemplo n.º 2
0
        public static HomePage NavigateTo(IWebDriver driver, ISettingsUtility settingsUtility)
        {
            var url = Util.BuildUriString(settingsUtility.BaseUrl, "/");

            driver.Navigate().GoToUrl(url);
            return(new HomePage(driver, settingsUtility));
        }
Exemplo n.º 3
0
        public static SignInPage NavigateTo(IWebDriver driver, ISettingsUtility settingsUtility)
        {
            var url = Util.BuildUriString(settingsUtility.BaseUrl, settingsUtility.SignInRoute);

            driver.Navigate().GoToUrl(url);
            return(new SignInPage(driver, settingsUtility));
        }
Exemplo n.º 4
0
        public ArtistPageViewModel(
            INavigationService navigationService,
            ILibraryService libraryService,
            IEnumerable <IMetadataProvider> metadataProviders,
            IConverter <WebAlbum, Album> webAlbumConverter,
            IConverter <WebArtist, Artist> webArtistConverter,
            IConverter <WebSong, Track> webSongConverter,
            ISettingsUtility settingsUtility)
        {
            _navigationService = navigationService;
            _libraryService    = libraryService;
            _webAlbumConverter = webAlbumConverter;
            _metadataProviders = metadataProviders.FilterAndSort <IExtendedMetadataProvider>();

            _webArtistConverter = webArtistConverter;
            _webSongConverter   = webSongConverter;
            _settingsUtility    = settingsUtility;

            AlbumClickCommand    = new DelegateCommand <ItemClickEventArgs>(AlbumClickExecute);
            WebAlbumClickCommand = new DelegateCommand <ItemClickEventArgs>(WebAlbumClickExecute);

            if (IsInDesignMode)
            {
                OnNavigatedTo("Childish Gambino", NavigationMode.New, new Dictionary <string, object>());
            }
        }
Exemplo n.º 5
0
        public SongsPageViewModel(
            ILibraryCollectionService libraryCollectionService,
            ILibraryService libraryService,
            ISettingsUtility settingsUtility,
            IPlayerService playerService)
        {
            _libraryCollectionService = libraryCollectionService;
            _settingsUtility = settingsUtility;
            _playerService = playerService;
            LibraryService = libraryService;

            SortItems =
                Enum.GetValues(typeof (TrackSort))
                    .Cast<TrackSort>()
                    .Select(sort => new ListBoxItem { Content = sort.GetEnumText(), Tag = sort })
                    .ToList();
            SortChangedCommand = new DelegateCommand<ListBoxItem>(SortChangedExecute);
            ShuffleAllCommand = new DelegateCommand(ShuffleAllExecute);

            var defaultSort = _settingsUtility.Read(ApplicationSettingsConstants.SongSort,
                TrackSort.DateAdded,
                SettingsStrategy.Roam);
            DefaultSort = SortItems.IndexOf(SortItems.FirstOrDefault(p => (TrackSort)p.Tag == defaultSort));
            ChangeSort(defaultSort);
        }
Exemplo n.º 6
0
        public ArtistPageViewModel(
            INavigationService navigationService,
            ILibraryService libraryService,
            IEnumerable<IMetadataProvider> metadataProviders,
            IConverter<WebAlbum, Album> webAlbumConverter,
            IConverter<WebArtist, Artist> webArtistConverter,
            IConverter<WebSong, Track> webSongConverter,
            ISettingsUtility settingsUtility)
        {
            _navigationService = navigationService;
            _libraryService = libraryService;
            _webAlbumConverter = webAlbumConverter;
            _metadataProviders = metadataProviders.FilterAndSort<IExtendedMetadataProvider>();

            _webArtistConverter = webArtistConverter;
            _webSongConverter = webSongConverter;
            _settingsUtility = settingsUtility;

            AlbumClickCommand = new DelegateCommand<ItemClickEventArgs>(AlbumClickExecute);
            WebAlbumClickCommand = new DelegateCommand<ItemClickEventArgs>(WebAlbumClickExecute);

            if (IsInDesignMode)
            {
                OnNavigatedTo("Childish Gambino", NavigationMode.New, new Dictionary<string, object>());
            }
        }
Exemplo n.º 7
0
 public AppSettingsUtility(ISettingsUtility settingsUtility)
 {
     _settingsUtility = settingsUtility;
     DownloadsPath = settingsUtility.Read("DownloadsPath", "virtual://Music/Audiotica/");
     TempDownloadsPath = settingsUtility.Read("TempDownloadsPath", ApplicationData.Current.TemporaryFolder.Path);
     _theme = _settingsUtility.Read(ApplicationSettingsConstants.Theme, (int)ElementTheme.Default);
     _ads = _settingsUtility.Read(ApplicationSettingsConstants.Ads, true);
 }
Exemplo n.º 8
0
 public MoviesViewModel(INavigationService navigationService, ISettingsUtility settingsUtility)
 {
     _navigationService = navigationService;
     _settingsUtility   = settingsUtility;
     MovieClickCommand  = new Command <ItemClickEventArgs>(MovieClickExecute);
     SearchEnterCommand = new Command <string>(SearchEnterExecute);
     HelpCommand        = new Command(HelpExecute);
 }
Exemplo n.º 9
0
 public AppSettingsUtility(ISettingsUtility settingsUtility)
 {
     _settingsUtility  = settingsUtility;
     DownloadsPath     = settingsUtility.Read("DownloadsPath", "virtual://Music/Audiotica/");
     TempDownloadsPath = settingsUtility.Read("TempDownloadsPath", ApplicationData.Current.TemporaryFolder.Path);
     _theme            = _settingsUtility.Read(ApplicationSettingsConstants.Theme, (int)ElementTheme.Default);
     _ads = _settingsUtility.Read(ApplicationSettingsConstants.Ads, true);
 }
Exemplo n.º 10
0
        public NavigationService(Frame frame, ISettingsUtility settingsUtility, IInsightsService insightsService)
        {
            _settingsUtility   = settingsUtility;
            _insightsService   = insightsService;
            _frame             = new NavigationFacade(frame);
            _frame.Navigating += (s, e) => NavigatedFrom(false);

            _currentView = SystemNavigationManager.GetForCurrentView();
        }
Exemplo n.º 11
0
        public NavigationService(Frame frame, ISettingsUtility settingsUtility, IInsightsService insightsService)
        {
            _settingsUtility = settingsUtility;
            _insightsService = insightsService;
            _frame = new NavigationFacade(frame);
            _frame.Navigating += (s, e) => NavigatedFrom(false);

            _currentView = SystemNavigationManager.GetForCurrentView();
        }
Exemplo n.º 12
0
 public PlayerService(ISettingsUtility settingsUtility, IDispatcherUtility dispatcherUtility,
     IMatchEngineService matchEngineService, IConverter<WebSong, Track> webSongConverter)
 {
     _settingsUtility = settingsUtility;
     _dispatcherUtility = dispatcherUtility;
     _matchEngineService = matchEngineService;
     _webSongConverter = webSongConverter;
     // Setup the initialization lock
     _backgroundAudioTaskStarted = new AutoResetEvent(false);
     _settingsUtility.Write(ApplicationSettingsConstants.AppState, AppState.Active);
     PlaybackQueue = new OptimizedObservableCollection<QueueTrack>();
 }
Exemplo n.º 13
0
 public PlayerService(ISettingsUtility settingsUtility, IDispatcherUtility dispatcherUtility,
                      IMatchEngineService matchEngineService, IConverter <WebSong, Track> webSongConverter)
 {
     _settingsUtility    = settingsUtility;
     _dispatcherUtility  = dispatcherUtility;
     _matchEngineService = matchEngineService;
     _webSongConverter   = webSongConverter;
     // Setup the initialization lock
     _backgroundAudioTaskStarted = new AutoResetEvent(false);
     _settingsUtility.Write(ApplicationSettingsConstants.AppState, AppState.Active);
     PlaybackQueue = new OptimizedObservableCollection <QueueTrack>();
 }
Exemplo n.º 14
0
 public MainViewModel(IRepository repository, IDateTime dateTimeProvider,
                      ValidationMessageViewModel validationMessageViewModel, ISignalRClient signalRClient,
                      ISettingsUtility settingsUtility)
 {
     _repository = repository;
     _dateTime   = dateTimeProvider;
     _validationMessageViewModel = validationMessageViewModel;
     _selectedTimeSegment        = null;
     _client = signalRClient;
     _client.ConnectToServer();
     LoadActivities();
     _settings     = settingsUtility.Settings;
     _dailySummary = new DailySummary(settingsUtility, repository);
 }
Exemplo n.º 15
0
        public PlayerWrapper(SmtcWrapper smtcWrapper, ForegroundMessenger foregroundMessenger,
            ISettingsUtility settingsUtility)
        {
            _smtcWrapper = smtcWrapper;
            _foregroundMessenger = foregroundMessenger;
            _settingsUtility = settingsUtility;

            SubscribeToMessenger();
            SubscribeToSmtc();

            // Add handlers for MediaPlayer
            BackgroundMediaPlayer.Current.CurrentStateChanged += Current_CurrentStateChanged;

            // Read persisted state of foreground app
            ForegroundAppState = _settingsUtility.Read(ApplicationSettingsConstants.AppState, AppState.Unknown);
        }
Exemplo n.º 16
0
        public PlayerWrapper(SmtcWrapper smtcWrapper, ForegroundMessenger foregroundMessenger,
                             ISettingsUtility settingsUtility)
        {
            _smtcWrapper         = smtcWrapper;
            _foregroundMessenger = foregroundMessenger;
            _settingsUtility     = settingsUtility;

            SubscribeToMessenger();
            SubscribeToSmtc();

            // Add handlers for MediaPlayer
            BackgroundMediaPlayer.Current.CurrentStateChanged += Current_CurrentStateChanged;

            // Read persisted state of foreground app
            ForegroundAppState = _settingsUtility.Read(ApplicationSettingsConstants.AppState, AppState.Unknown);
        }
Exemplo n.º 17
0
        public Reporter(string featureName, string scenarioName, IWebDriver driver, ISettingsUtility settingsUtility, DateTime executionTimeStamp)
        {
            _scenarioName    = scenarioName;
            _driver          = driver;
            _settingsUtility = settingsUtility;

            _tableBody = string.Empty;
            _imageBody = string.Empty;

            var timestampDirectory = $"{Constants.TestResultsDirectory}/{executionTimeStamp.ToString(Constants.DateTimeFormat)}";

            _featureDirectory            = $"{timestampDirectory}/{featureName}";
            _scenarioScreenshotDirectory = $"{_featureDirectory}/Screenshots";

            Directory.CreateDirectory(Constants.TestResultsDirectory);
            Directory.CreateDirectory(timestampDirectory);
            Directory.CreateDirectory(_featureDirectory);
            Directory.CreateDirectory(_scenarioScreenshotDirectory);
        }
Exemplo n.º 18
0
        public AlbumPageViewModel(ILibraryService libraryService, INavigationService navigationService,
            IEnumerable<IMetadataProvider> metadataProviders, IConverter<WebAlbum, Album> webAlbumConverter,
            ISettingsUtility settingsUtility, IPlayerService playerService, ITrackSaveService trackSaveService)
        {
            _libraryService = libraryService;
            _navigationService = navigationService;
            _webAlbumConverter = webAlbumConverter;
            _settingsUtility = settingsUtility;
            _playerService = playerService;
            _trackSaveService = trackSaveService;
            _metadataProviders = metadataProviders.FilterAndSort<IExtendedMetadataProvider>();
            
            ViewInCatalogCommand = new DelegateCommand(ViewInCatalogExecute);
            PlayAllCommand = new DelegateCommand(PlayAllExecute);
            SaveAllCommand = new DelegateCommand<object>(SaveAllExecute);

            if (IsInDesignMode)
                OnNavigatedTo(new AlbumPageParameter("Kauai", "Childish Gambino"), NavigationMode.New,
                    new Dictionary<string, object>());
        }
Exemplo n.º 19
0
        public AlbumPageViewModel(ILibraryService libraryService, INavigationService navigationService,
                                  IEnumerable <IMetadataProvider> metadataProviders, IConverter <WebAlbum, Album> webAlbumConverter,
                                  ISettingsUtility settingsUtility, IPlayerService playerService, ITrackSaveService trackSaveService)
        {
            _libraryService    = libraryService;
            _navigationService = navigationService;
            _webAlbumConverter = webAlbumConverter;
            _settingsUtility   = settingsUtility;
            _playerService     = playerService;
            _trackSaveService  = trackSaveService;
            _metadataProviders = metadataProviders.FilterAndSort <IExtendedMetadataProvider>();

            ViewInCatalogCommand = new DelegateCommand(ViewInCatalogExecute);
            PlayAllCommand       = new DelegateCommand(PlayAllExecute);
            SaveAllCommand       = new DelegateCommand <object>(SaveAllExecute);

            if (IsInDesignMode)
            {
                OnNavigatedTo(new AlbumPageParameter("Kauai", "Childish Gambino"), NavigationMode.New,
                              new Dictionary <string, object>());
            }
        }
Exemplo n.º 20
0
 public CredentialUtility(ISettingsUtility settingsUtility, string ecryptionKey)
 {
     _settingsUtility = settingsUtility;
     _encryptionKey   = ecryptionKey;
 }
Exemplo n.º 21
0
 public Mp3MinerProvider(IEnumerable<ISongTypeValidator> validators, ISettingsUtility settingsUtility)
     : base(validators, settingsUtility)
 {
 }
 protected MetadataProviderWithSearchBase(ISettingsUtility settingsUtility) : base(settingsUtility)
 {
 }
Exemplo n.º 23
0
 public MainViewModel(ISettingsUtility settingsUtility, string localPath, ValidationMessageViewModel validationMessageViewModel) :
     this(new Repository(new SqliteContext(localPath)),
          new SystemDateTime(), validationMessageViewModel,
          new SignalRClient(settingsUtility.Settings.ServerUrl), settingsUtility)
 {
 }
Exemplo n.º 24
0
 public AnyMazaMatchProvider(IEnumerable<ISongTypeValidator> validators, ISettingsUtility settingsUtility)
     : base(validators, settingsUtility)
 {
 }
Exemplo n.º 25
0
 public BasePage(IWebDriver driver, ISettingsUtility settingsUtility)
 {
     _driver          = driver;
     _settingsUtility = settingsUtility;
 }
Exemplo n.º 26
0
 public GrooveMetadataProvider(ISettingsUtility settingsUtility) : base(settingsUtility)
 {
     _client = XboxMusicClientFactory.CreateXboxMusicClient(ApiKeys.XboxClientId, ApiKeys.XboxClientSecret);
 }
Exemplo n.º 27
0
 protected MatchProviderBase(IEnumerable<ISongTypeValidator> validators, ISettingsUtility settingsUtility)
 {
     _validators = validators;
     _settingsUtility = settingsUtility;
 }
Exemplo n.º 28
0
 public DailySummary(ISettingsUtility settingsUtility, IRepository repository)
 {
     _settingsUtility = settingsUtility;
     _repository      = repository;
 }
Exemplo n.º 29
0
 public MusixMatchMetadataProvider(ISettingsUtility settingsUtility) : base(settingsUtility)
 {
 }
Exemplo n.º 30
0
 public GrooveMetadataProvider(ISettingsUtility settingsUtility) : base(settingsUtility)
 {
     _client = XboxMusicClientFactory.CreateXboxMusicClient(ApiKeys.XboxClientId, ApiKeys.XboxClientSecret);
 }
 public MusixMatchMetadataProvider(ISettingsUtility settingsUtility) : base(settingsUtility)
 {
 }
 protected MetadataProviderWithSearchBase(ISettingsUtility settingsUtility) : base(settingsUtility)
 {
 }
Exemplo n.º 33
0
        static void Main(string[] args)
        {
            try
            {
                #region IOC
                _container       = ConfigureStructureMap();
                _settingsUtility = _container.GetInstance <ISettingsUtility>();
                var commandLineUtility = _container.GetInstance <ICommandLineUtility>();
                _listingWrapper           = _container.GetInstance <IListingWrapper>();
                _illustratorActionWrapper = _container.GetInstance <IIllustratorActionWrapper>();
                _systemUtility            = _container.GetInstance <ISystemUtility>();

                #endregion

                var listItArgs = commandLineUtility.ParseCommandLineArguments(args);

                #region File System Exception Handling
                if (listItArgs.WorkingDirectory.IsNullOrEmpty())
                {
                    throw new EtsyListItException("Working directory can not be empty.");
                }

                if (listItArgs.OutputDirectory.IsNullOrEmpty())
                {
                    throw new EtsyListItException("Output directory can not be empty.");
                }

                var baseFiles = Directory.GetFiles(listItArgs.WorkingDirectory).Where(x => x.Contains(".ai")).ToList();

                if (!baseFiles.Any())
                {
                    throw new EtsyListItException("There are no files to list!");
                }
                #endregion

                foreach (var baseFile in baseFiles)
                {
                    var tempDirectoryPath = Path.Combine(listItArgs.WorkingDirectory, Path.GetFileNameWithoutExtension(baseFile));
                    Directory.CreateDirectory(tempDirectoryPath);

                    try
                    {
                        var artboardCount = _illustratorActionWrapper.CountArtboards(baseFile);

                        var zipFiles   = new List <string>();
                        var watermarks = new List <string>();

                        if (artboardCount > 1)
                        {
                            zipFiles   = ExportMultipleArtboards(tempDirectoryPath, baseFile);
                            watermarks = WatermarkMultipleArtboards(artboardCount, baseFile, tempDirectoryPath,
                                                                    listItArgs.WatermarkFile);
                        }
                        else
                        {
                            _illustratorActionWrapper.ExportAll(baseFile, tempDirectoryPath);
                            watermarks.Add(_illustratorActionWrapper.SaveFileWithWatermark(listItArgs.WatermarkFile,
                                                                                           baseFile,
                                                                                           listItArgs.WorkingDirectory));
                            zipFiles.Add(_systemUtility.CreateZipFileFromDirectory(baseFile, tempDirectoryPath));
                        }


                        bool.TryParse(listItArgs.AddToEtsy, out bool addToEtsy);

                        #region Etsy Export

                        if (addToEtsy)
                        {
                            Console.Write("Enter custom title: ");
                            var customTitle = Console.ReadLine();
                            Console.Write("Enter price: ");
                            var price = Console.ReadLine();
                            Console.Write("Enter tags: ");
                            var tags = Console.ReadLine();

                            var authToken = GetAuthToken(listItArgs);

                            if (!authToken.IsValidEtsyToken())
                            {
                                throw new EtsyListItException(
                                          "Invalid AuthToken.  Please use the correct Verifier key obtained from Etsy to generate your permanent token credentials.");
                            }

                            var listing = PopulateGraphicListing(watermarks, zipFiles, listItArgs, customTitle, price, tags);

                            listing = _listingWrapper.CreateDigitalListingWithImages(listing, authToken);
                            bool.TryParse(listItArgs.PublishListing, out bool publish);
                            if (publish)
                            {
                                listing.State = "active";
                                _listingWrapper.UpdateListing(listing, authToken);
                            }

                            Console.WriteLine($"Listing created. New listing ID: {listing.ID}");
                            Directory.Delete(tempDirectoryPath, true);
                            File.Move(baseFile, Path.Combine(listItArgs.OutputDirectory, Path.GetFileName(baseFile)));
                            foreach (var watermark in watermarks)
                            {
                                File.Delete(watermark);
                            }
                        }
                        else
                        {
                            Console.WriteLine("Add listing to Etsy feature turned OFF.  Use command line arg -add true to turn on.");
                        }
                        #endregion

                        Console.Write("Press any key to end.");
                        Console.ReadLine();
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.Message);
                        Directory.Delete(tempDirectoryPath, true);
                        throw;
                    }
                }
            }
            catch (Exception ex)

            {
                Console.WriteLine(ex.Message);
                Console.Write("Type any key to quit.");
                Console.ReadLine();
            }
        }
 protected MetadataProviderLyricsOnlyBase(ISettingsUtility settingsUtility) : base(settingsUtility)
 {
 }
Exemplo n.º 35
0
 public HomePage(IWebDriver driver, ISettingsUtility settingsUtility) : base(driver, settingsUtility)
 {
 }
Exemplo n.º 36
0
 public DeezerMetadataProvider(ISettingsUtility settingsUtility) : base(settingsUtility)
 {
 }
Exemplo n.º 37
0
 public LastFmMetadataProvider(ISettingsUtility settingsUtility) : base(settingsUtility)
 {
 }
Exemplo n.º 38
0
 public MiMp3SMatchProvider(IEnumerable <ISongTypeValidator> validators, ISettingsUtility settingsUtility)
     : base(validators, settingsUtility)
 {
 }
Exemplo n.º 39
0
 public SignInPage(IWebDriver driver, ISettingsUtility settingsUtility) : base(driver, settingsUtility)
 {
 }
 protected MetadataProviderLyricsOnlyBase(ISettingsUtility settingsUtility) : base(settingsUtility)
 {
 }
Exemplo n.º 41
0
 public ApplicationUtility(ISettingsUtility settingsUtility)
 {
     _settingsUtility = settingsUtility;
 }
Exemplo n.º 42
0
 public CredentialUtility(ISettingsUtility settingsUtility)
 {
     _settingsUtility = settingsUtility;
 }
Exemplo n.º 43
0
 protected MetadataProviderBase(ISettingsUtility settingsUtility)
 {
     _settingsUtility = settingsUtility;
 }
Exemplo n.º 44
0
 public SpotifyMetadataProvider(ISettingsUtility settingsUtility) : base(settingsUtility)
 {
 }