コード例 #1
0
        public LicenseService(GlobalFrontendService globalFrontendService)
        {
            Argument.IsNotNull(() => globalFrontendService);

            _globalFrontendService = globalFrontendService;
            _globalFrontendService.ApplicationState.SystemCode = SystemCodeInfo.getSystemInfo();
        }
コード例 #2
0
 public CommandBase(IServiceLocator serviceLocator)
 {
     ServiceLocator        = serviceLocator;
     ApplicationService    = serviceLocator.ResolveType <IApplicationService>();
     GlobalService         = serviceLocator.ResolveType <GlobalService>();
     GlobalFrontendService = serviceLocator.ResolveType <GlobalFrontendService>();
 }
コード例 #3
0
        public SettingsViewModel(
            IRuntimeConfigurationService configurationService,
            ILicenseService licenseService,
            ICommandManager commandManager, DataPersisterService dataPersisterService,
            GlobalFrontendService globalFrontendService, GlobalService globalService,
            IAdvancedMessageService advancedMessageService,
            AudioService audioService, MidiService midiService
            )
        {
            Argument.IsNotNull(() => configurationService);
            Argument.IsNotNull(() => commandManager);
            Argument.IsNotNull(() => licenseService);

            _configurationService   = configurationService;
            _commandManager         = commandManager;
            _globalService          = globalService;
            _advancedMessageService = advancedMessageService;

            ApplicationState = globalFrontendService.ApplicationState;

            OpenVstWorkerLogDirectory = new Command(OnOpenVstWorkerLogDirectoryExecute);
            OpenDataDirectory         = new Command(OnOpenDataDirectoryExecute);
            Title = "Settings";

            PresetDatabaseStatistics = dataPersisterService.GetStorageStatistics();

            TotalPresets = (from p in PresetDatabaseStatistics select p.PresetCount).Sum();
            TotalPresetsUncompressedSize = (from p in PresetDatabaseStatistics select p.PresetUncompressedSize).Sum();
            TotalPresetsCompressedSize   = (from p in PresetDatabaseStatistics select p.PresetCompressedSize).Sum();
            SavedSpace         = (from p in PresetDatabaseStatistics select p.SavedSpace).Sum();
            SavedSpacePercent  = (double)TotalPresetsCompressedSize / TotalPresetsUncompressedSize;
            AudioOutputDevices = audioService.GetOutputDevices();
            MidiInputDevices   = midiService.GetInputDevices();
        }
コード例 #4
0
        public AbstractCurrentPresetEditorCommandContainer(string command, ICommandManager commandManager,
                                                           GlobalFrontendService globalFrontendService)
            : base(command, commandManager)
        {
            _globalFrontendService = globalFrontendService;

            _globalFrontendService.ApplicationState.PropertyChanged += ApplicationStateOnPropertyChanged;
        }
コード例 #5
0
 public HelpCreateFeatureRequestCommandContainer(ICommandManager commandManager,
                                                 IUIVisualizerService uiVisualizerService, GlobalService globalService,
                                                 GlobalFrontendService globalFrontendService)
     : base(Commands.Help.CreateFeatureRequest, commandManager)
 {
     _uiVisualizerService   = uiVisualizerService;
     _globalFrontendService = globalFrontendService;
     _globalService         = globalService;
 }
コード例 #6
0
 public HelpRequestSupportCommandContainer(ICommandManager commandManager,
                                           IUIVisualizerService uiVisualizerService, GlobalService globalService,
                                           GlobalFrontendService globalFrontendService)
     : base(Commands.Help.RequestSupport, commandManager)
 {
     _uiVisualizerService   = uiVisualizerService;
     _globalFrontendService = globalFrontendService;
     _globalService         = globalService;
 }
コード例 #7
0
        public RibbonView(GlobalFrontendService globalFrontendService, GlobalService globalService)
        {
            _globalFrontendService = globalFrontendService;
            _globalService         = globalService;
            InitializeComponent();
            Ribbon.AddAboutButton();

            _globalFrontendService.ApplicationState.PropertyChanged += ApplicationStateOnPropertyChanged;
            ScreenTip.HelpPressed += OnScreenTipHelpPressed;
        }
コード例 #8
0
        public MainViewModel(ICommandManager commandManager, GlobalFrontendService globalFrontendService)
        {
            _layoutDocumentPane = ServiceLocator.Default.ResolveType <LayoutDocumentPane>();
            _layoutDocumentPane.PropertyChanged += LayoutDocumentPaneOnPropertyChanged;
            _commandManager        = commandManager;
            _globalFrontendService = globalFrontendService;

            AvalonDockHelper.CreateDocument <VstPluginsViewModel>(activateDocument: true);
            AvalonDockHelper.CreateDocument <PresetExportListViewModel>();
        }
コード例 #9
0
        public RuntimeConfigurationService()
        {
            _globalFrontendService = ServiceLocator.Default.ResolveType <GlobalFrontendService>();
            _globalService         = ServiceLocator.Default.ResolveType <GlobalService>();
            _audioService          = ServiceLocator.Default.ResolveType <AudioService>();


            _jsonSerializer = new JsonSerializer {
                Formatting = Formatting.Indented
            };
        }
コード例 #10
0
 protected ApplicationNotBusyCommandContainer(string command, ICommandManager commandManager,
                                              IServiceLocator serviceLocator, bool allowDuringEditing = false)
     : base(command, commandManager)
 {
     ServiceLocator = serviceLocator;
     RuntimeConfigurationService = ServiceLocator.ResolveType <IRuntimeConfigurationService>();
     ApplicationService          = ServiceLocator.ResolveType <IApplicationService>();
     _globalFrontendService      = ServiceLocator.ResolveType <GlobalFrontendService>();
     _allowDuringEditing         = allowDuringEditing;
     _globalFrontendService.ApplicationState.PropertyChanged += OnApplicationBusyChanged;
 }
コード例 #11
0
        public VstPluginPresetsViewModel(Plugin plugin, GlobalService globalService,
                                         IUIVisualizerService visualizerService,
                                         DataPersisterService dataPersisterService, IViewModelFactory viewModelFactory,
                                         IAdvancedMessageService advancedMessageService, RemoteVstService remoteVstService,
                                         GlobalFrontendService globalFrontendService,
                                         PresetDataPersisterService presetDataPersisterService)
        {
            _messageService        = advancedMessageService;
            _visualizerService     = visualizerService;
            _viewModelFactory      = viewModelFactory;
            _dataPersisterService  = dataPersisterService;
            _remoteVstService      = remoteVstService;
            _globalService         = globalService;
            _globalFrontendService = globalFrontendService;
            _presetDataPersister   = presetDataPersisterService;

            Plugin = plugin;

            PresetsView = (ListCollectionView)CollectionViewSource.GetDefaultView(Plugin.Presets);
            PresetsView.IsLiveSorting   = false;
            PresetsView.IsLiveFiltering = false;

            Title = $"{plugin.PluginName}: Presets";

            GlobalCharacteristicCollection =
                (ListCollectionView)CollectionViewSource.GetDefaultView(globalService.GlobalCharacteristics);
            GlobalCharacteristicCollection.SortDescriptions.Add(
                new SortDescription(nameof(Characteristic.EffectiveCharacteristicName), ListSortDirection.Ascending));
            GlobalCharacteristicCollection.IsLiveSorting   = false;
            GlobalCharacteristicCollection.IsLiveFiltering = false;

            GlobalTypeCollection = (ListCollectionView)CollectionViewSource.GetDefaultView(globalService.GlobalTypes);
            GlobalTypeCollection.SortDescriptions.Add(new SortDescription(nameof(Type.EffectiveFullTypeName),
                                                                          ListSortDirection.Ascending));
            GlobalTypeCollection.IsLiveSorting   = false;
            GlobalTypeCollection.IsLiveFiltering = false;

            SelectedPresets.CollectionChanged += SelectedPresetsOnCollectionChanged;
            PreviewNotePlayers = globalService.PreviewNotePlayers;
            RenameBankCommand  = new TaskCommand(OnRenameBankCommandExecute, RenameBankCommandCanExecute);
            AddBankCommand     = new TaskCommand(OnAddBankCommandExecute, AddBankCommandCanExecute);
            DeleteBankCommand  = new TaskCommand(OnDeleteBankCommandExecute, DeleteBankCommandCanExecute);

            LoadPluginCommand = new TaskCommand(OnLoadPluginCommandExecute, LoadPluginCommandCanExecute);
            LoadPresetCommand = new TaskCommand(OnLoadPresetCommandExecute, LoadPresetCommandCanExecute);
            ShowEditorCommand = new TaskCommand(OnShowEditorCommandExecute, ShowEditorCommandCanExecute);

            AddToExportListCommand = new TaskCommand(OnAddToExportListCommandExecute, AddToExportListCommandCanExecute);


            Revert = new Command <string>(OnRevertExecute);
        }
コード例 #12
0
 protected AbstractOpenDialogCommandContainer(string commandName, string viewModel,
                                              bool allowDuringApplicationBusy,
                                              ICommandManager commandManager, IServiceLocator serviceLocator)
     : base(commandName, commandManager)
 {
     UiVisualizerService          = serviceLocator.ResolveType <IUIVisualizerService>();
     ViewModelFactory             = serviceLocator.ResolveType <IViewModelFactory>();
     _viewModel                   = viewModel;
     _allowDuringApplicationBusy  = allowDuringApplicationBusy;
     _runtimeConfigurationService = serviceLocator.ResolveType <IRuntimeConfigurationService>();
     _globalFrontendService       = serviceLocator.ResolveType <GlobalFrontendService>();
     _globalFrontendService.ApplicationState.PropertyChanged += OnApplicationBusyChanged;
 }
コード例 #13
0
        public RibbonViewModel(
            GlobalFrontendService globalFrontendService,
            GlobalService globalService
            )
        {
            ApplicationState     = globalFrontendService.ApplicationState;
            RuntimeConfiguration = globalService.RuntimeConfiguration;

            Title           = AssemblyHelper.GetEntryAssembly().Title();
            ShowAboutDialog = new TaskCommand(OnShowAboutDialogExecuteAsync);
            ShowThemeTest   = new TaskCommand(OnShowThemeTestExecuteAsync);
            DoSomething     = new TaskCommand(OnDoSomethingExecuteAsync);

            RuntimeConfiguration.PropertyChanged += RuntimeConfigurationOnPropertyChanged;
        }
コード例 #14
0
        public PresetExportListViewModel()
        {
            _globalFrontendService = ServiceLocator.Default.ResolveType <GlobalFrontendService>();

            PresetExportList           = _globalFrontendService.PresetExportList;
            ApplicationState           = _globalFrontendService.ApplicationState;
            ApplicationOperationStatus = ServiceLocator.Default.ResolveType <IApplicationService>()
                                         .GetApplicationOperationStatus();

            ServiceLocator.Default.RegisterInstance(this);

            SelectedPresets = _globalFrontendService.SelectedPresets;

            Title = "Preset Export List";
        }
コード例 #15
0
        public StatusBarViewModel(IUpdateService updateService,
                                  IApplicationInitializationService applicationInitializationService,
                                  IRuntimeConfigurationService runtimeConfigurationService, GlobalService globalService,
                                  GlobalFrontendService globalFrontendService)
        {
            Argument.IsNotNull(() => updateService);
            Argument.IsNotNull(() => applicationInitializationService);
            Argument.IsNotNull(() => runtimeConfigurationService);

            _updateService = updateService;
            _applicationInitializationService = applicationInitializationService as ApplicationInitializationService;
            _globalService   = globalService;
            ApplicationState = globalFrontendService.ApplicationState;

            InstallUpdate = new TaskCommand(OnInstallUpdateExecute);
        }
コード例 #16
0
        protected AbstractReportPluginsCommandContainer(string command, ICommandManager commandManager,
                                                        IServiceLocator serviceLocator)
            : base(command, commandManager, serviceLocator)
        {
            _licenseService       = serviceLocator.ResolveType <ILicenseService>();
            _applicationService   = serviceLocator.ResolveType <IApplicationService>();
            _dataPersisterService = serviceLocator.ResolveType <DataPersisterService>();
            GlobalService         = serviceLocator.ResolveType <GlobalService>();
            GlobalFrontendService = Catel.IoC.ServiceLocator.Default.ResolveType <GlobalFrontendService>();

            var wrapper = new ChangeNotificationWrapper(GlobalService.Plugins);

            wrapper.CollectionItemPropertyChanged += OnPluginItemPropertyChanged;
            wrapper.CollectionChanged             += OnPluginListChanged;

            ReportAll = false;
        }
コード例 #17
0
        public VstPluginsViewModel(
            IRuntimeConfigurationService runtimeConfigurationService
            )
        {
            _globalFrontendService = ServiceLocator.Default.ResolveType <GlobalFrontendService>();
            var globalService = ServiceLocator.Default.ResolveType <GlobalService>();


            ApplicationOperationStatus = ServiceLocator.Default.ResolveType <IApplicationService>()
                                         .GetApplicationOperationStatus();
            Plugins         = globalService.Plugins;
            SelectedPlugins = _globalFrontendService.SelectedPlugins;
            ServiceLocator.Default.RegisterInstance(this);

            Plugins.CollectionChanged += PluginsOnCollectionChanged;

            _globalFrontendService.SelectedPluginChanged += VstServiceOnSelectedPluginChanged;

            Title = "VST Plugins";
        }
コード例 #18
0
        public RegistrationViewModel(INavigationService navigationService,
                                     IRuntimeConfigurationService runtimeConfigurationService,
                                     ICommandManager commandManager, GlobalFrontendService globalFrontendService)
        {
            Argument.IsNotNull(() => navigationService);
            Argument.IsNotNull(() => runtimeConfigurationService);
            Argument.IsNotNull(() => commandManager);

            _navigationService           = navigationService;
            _commandManager              = commandManager;
            _globalFrontendService       = globalFrontendService;
            _runtimeConfigurationService = runtimeConfigurationService;

            _globalFrontendService.ApplicationState.PropertyChanged += ApplicationStateOnPropertyChanged;

            CloseApplication  = new TaskCommand(OnCloseApplicationExecuteAsync);
            GetLicense        = new TaskCommand(OnGetLicenseExecuteAsync);
            SelectLicenseFile = new TaskCommand(OnSelectLicenseFileExecuteAsync);
            SystemCode        = LicenseService.SystemCodeInfo.getSystemInfo();
        }
コード例 #19
0
        public ApplicationService(DataPersisterService dataPersisterService,
                                  IDispatcherService dispatcherService,
                                  ICustomStatusService statusService, IPleaseWaitService pleaseWaitService,
                                  IAdvancedMessageService messageService, GlobalService globalService,
                                  GlobalFrontendService globalFrontendService)
        {
            Argument.IsNotNull(() => statusService);
            Argument.IsNotNull(() => pleaseWaitService);
            Argument.IsNotNull(() => messageService);

            _pleaseWaitService          = pleaseWaitService;
            _statusService              = statusService;
            _messageService             = messageService;
            _dispatcherService          = dispatcherService;
            _dataPersisterService       = dataPersisterService;
            _globalService              = globalService;
            _globalFrontendService      = globalFrontendService;
            _applicationOperationStatus = new ApplicationOperationStatus();

            _updateWorkerPoolStatsTimer = new Timer(500);
            _updateDatabaseSizeTimer    = new Timer(2000);
        }