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(); }
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; }
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; }
public VstFolderListViewModel(IRuntimeConfigurationService configurationService, ISelectDirectoryService selectDirectoryService) { Argument.IsNotNull(() => configurationService); Argument.IsNotNull(() => selectDirectoryService); _selectDirectoryService = selectDirectoryService; AddDefaultVstFolders = new Command(OnAddDefaultVstFoldersExecute); AddFolder = new TaskCommand(OnAddFolderExecute); RemoveFolder = new Command <object>(OnRemoveFolderExecute); VstDirectories = configurationService.EditableConfiguration.VstDirectories; }
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); }
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(); }
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"; }