├── gfx ├── icoconvert.txt ├── logo.ai ├── logo.ico ├── logo.png └── logo.xaml ├── src ├── Micser.Engine │ ├── ManualStart.ps1 │ ├── Properties │ │ └── launchSettings.json │ ├── appsettings.json │ ├── Api │ │ ├── StatusProcessor.cs │ │ └── SettingsProcessor.cs │ ├── ServiceBaseLifetimeHostExtensions.cs │ └── Micser.Engine.csproj ├── Micser.App.Infrastructure │ ├── Themes │ │ ├── Colors.Default.ini │ │ ├── ResourceRegistry.cs │ │ ├── IResourceRegistry.cs │ │ ├── Thumbs.xaml │ │ └── LinePanel.xaml │ ├── ToolBars │ │ ├── ToolBarLabel.cs │ │ ├── ToolBarSeparator.cs │ │ ├── ToolBarDescription.cs │ │ ├── ToolBarButton.cs │ │ └── IToolBarRegistry.cs │ ├── Menu │ │ ├── MenuItemRegistry.cs │ │ └── IMenuItemRegistry.cs │ ├── Controls │ │ ├── EditableSlider.cs │ │ └── InfoButton.cs │ ├── Interaction │ │ └── MessageBoxView.xaml.cs │ ├── IViewModel.cs │ ├── Converter │ │ ├── BooleanToDoubleConverter.cs │ │ ├── BooleanInvertConverter.cs │ │ ├── BooleanToVisibilityConverter.cs │ │ ├── RelativeCenterPlacementConverter.cs │ │ ├── ConverterExtension.cs │ │ ├── DoubleToRectConverter.cs │ │ └── IconToBitmapSourceConverter.cs │ ├── ISelectable.cs │ ├── Widgets │ │ ├── UnsavedAttribute.cs │ │ ├── AudioWidgetControls.xaml.cs │ │ ├── IWidgetRegistry.cs │ │ ├── WidgetRegistry.cs │ │ ├── IWidgetFactory.cs │ │ ├── ConnectorViewModel.cs │ │ ├── WidgetToolbox.cs │ │ ├── WidgetDescription.cs │ │ └── ConnectorChangedEventHandler.cs │ ├── DataAccess │ │ ├── DesignTimeFactory.cs │ │ └── AppDbContext.cs │ ├── IApplicationStateService.cs │ ├── AssemblyInfo.cs │ ├── IAppModule.cs │ ├── Settings │ │ └── SettingsPanel.cs │ ├── TypeTemplateSelector.cs │ ├── ProxyModule.cs │ ├── Api │ │ ├── UpdatesRequestProcessor.cs │ │ ├── StatusApiClient.cs │ │ ├── ApiEventRequestProcessor.cs │ │ └── ApiEvent.cs │ ├── ApplicationStateService.cs │ ├── CommandBindingToCommand.cs │ └── Extensions │ │ └── ItemsControlExtensions.cs ├── Micser.Plugins.Main │ ├── Themes │ │ ├── Colors.Light.ini │ │ └── Generic.xaml │ ├── Audio │ │ ├── CompressorType.cs │ │ ├── FilterDescription.cs │ │ ├── SpectrumFftProvider.cs │ │ └── GainSampleProcessor.cs │ ├── Api │ │ ├── SpectrumDataEvent.cs │ │ ├── SpectrumData.cs │ │ └── SpectrumRequestProcessor.cs │ ├── Widgets │ │ ├── GainWidget.xaml.cs │ │ ├── PitchWidget.xaml.cs │ │ ├── SpectrumWidget.xaml.cs │ │ ├── DeviceInputWidget.xaml.cs │ │ ├── DeviceOutputWidget.xaml.cs │ │ ├── LoopbackDeviceInputViewModel.cs │ │ ├── DeviceInputViewModel.cs │ │ ├── DeviceOutputViewModel.cs │ │ ├── GainViewModel.cs │ │ ├── SpectrumWidget.xaml │ │ └── PitchViewModel.cs │ ├── Modules │ │ ├── GainModule.cs │ │ ├── EqualizerModule.cs │ │ └── LoopbackDeviceInputModule.cs │ ├── AssemblyInfo.cs │ └── MainEngineModule.cs ├── Micser.Vac.Driver │ ├── VerifyInf.ps1 │ └── kshelper.h ├── Micser.Common │ ├── Api │ │ ├── DefaultRequestProcessor.cs │ │ ├── IApiClientConfiguration.cs │ │ ├── IApiServerConfiguration.cs │ │ ├── IApiConfiguration.cs │ │ ├── IMessageSerializer.cs │ │ ├── ApiMessage.cs │ │ ├── ApiConfiguration.cs │ │ ├── IRequestProcessorFactory.cs │ │ ├── IApiServer.cs │ │ ├── IRequestProcessor.cs │ │ ├── ConnectionState.cs │ │ ├── ServerState.cs │ │ ├── ApiResponse.cs │ │ ├── IApiClient.cs │ │ ├── MessagePackMessageSerializer.cs │ │ ├── ApiRequest.cs │ │ └── RequestProcessorNameAttribute.cs │ ├── DataAccess │ │ ├── IDbContextFactory.cs │ │ ├── DbContextFactory.cs │ │ └── Entities │ │ │ ├── Entity.cs │ │ │ └── SettingValue.cs │ ├── Settings │ │ ├── SettingsRegistry.cs │ │ ├── ISettingsRegistry.cs │ │ ├── SettingValueDto.cs │ │ ├── ISettingHandlerFactory.cs │ │ ├── SettingHandlerFactory.cs │ │ └── ISettingsService.cs │ ├── IIdentifiable.cs │ ├── MissingConfigurationException.cs │ ├── Updates │ │ ├── HttpUpdateSettings.cs │ │ ├── GitHub │ │ │ ├── Asset.cs │ │ │ └── Release.cs │ │ └── UpdateManifest.cs │ ├── DisposableBase.cs │ ├── Extensions │ │ ├── DbContextFactoryExtensions.cs │ │ ├── ServiceExtensions.cs │ │ └── ApiClientExtensions.cs │ ├── Devices │ │ └── DeviceType.cs │ ├── Modules │ │ ├── ModulesExportDto.cs │ │ ├── SaveStateAttribute.cs │ │ ├── ModuleDto.cs │ │ └── ModuleConnectionDto.cs │ ├── IItemRegistry.cs │ ├── DependencyOverride.cs │ ├── Micser.Common.csproj │ ├── IContainerProvider.cs │ └── ItemRegistry.cs ├── Micser.App.Prism │ ├── Navigation │ │ └── IDestructible.cs │ ├── Modularity │ │ ├── ModuleInfo.Desktop.cs │ │ ├── IModuleGroupsCatalog.cs │ │ ├── IModuleInfoGroup.cs │ │ ├── IModuleInfo.cs │ │ ├── IModuleInitializer.cs │ │ ├── IConfigurationStore.Desktop.cs │ │ ├── IAssemblyResolver.Desktop.cs │ │ ├── IModuleCatalogItem.cs │ │ ├── InitializationMode.cs │ │ ├── IModule.cs │ │ ├── ConfigurationStore.Desktop.cs │ │ ├── DuplicateModuleException.Desktop.cs │ │ ├── CyclicDependencyFoundException.Desktop.cs │ │ ├── ModuleInitializeException.Desktop.cs │ │ ├── ModuleTypeLoadingException.Desktop.cs │ │ ├── ModuleTypeLoaderNotFoundException.Desktop.cs │ │ ├── ModuleNotFoundException.Desktop.cs │ │ ├── ModulesConfigurationSection.Desktop.cs │ │ ├── ModuleAttribute.Desktop.cs │ │ ├── ModuleDependencyAttribute.cs │ │ ├── ModuleManager.Desktop.cs │ │ └── IModuleManager.cs │ ├── Services │ │ └── Dialogs │ │ │ ├── ButtonResult.cs │ │ │ ├── DialogParameters.cs │ │ │ ├── IDialogWindowExtensions.cs │ │ │ ├── IDialogResult.cs │ │ │ ├── DialogWindow.xaml.cs │ │ │ ├── DialogWindow.xaml │ │ │ ├── IDialogParameters.cs │ │ │ ├── DialogResult.cs │ │ │ ├── IDialogWindow.cs │ │ │ ├── IDialogService.cs │ │ │ └── IDialogAware.cs │ ├── Ioc │ │ ├── IContainerProvider.cs │ │ ├── PrismIocExtensions.cs │ │ ├── IContainerExtension.cs │ │ ├── IContainerRegistry.cs │ │ └── IContainerProviderExtensions.cs │ ├── Interactivity │ │ ├── DefaultPopupWindows │ │ │ ├── DefaultWindow.xaml │ │ │ ├── DefaultWindow.xaml.cs │ │ │ ├── DefaultNotificationWindow.xaml │ │ │ └── DefaultNotificationWindow.xaml.cs │ │ └── InteractionRequest │ │ │ ├── IConfirmation.cs │ │ │ ├── INotification.cs │ │ │ ├── Confirmation.cs │ │ │ ├── Notification.cs │ │ │ ├── IInteractionRequest.cs │ │ │ ├── InteractionRequestTrigger.cs │ │ │ ├── IInteractionRequestAware.cs │ │ │ └── InteractionRequestedEventArgs.cs │ ├── Regions │ │ ├── SyncActiveStateAttribute.cs │ │ ├── IRegionBehavior.cs │ │ ├── IJournalAware.cs │ │ ├── IRegionNavigationJournalEntry.cs │ │ ├── IRegionMemberLifetime.cs │ │ ├── IViewsCollection.cs │ │ ├── IRegionAdapter.cs │ │ ├── Behaviors │ │ │ ├── IHostAwareRegionBehavior.cs │ │ │ ├── RegionCreationException.Desktop.cs │ │ │ └── IDestructibleRegionBehavior.cs │ │ ├── UpdateRegionsException.Desktop.cs │ │ ├── SingleActiveRegion.cs │ │ ├── IConfirmNavigationRequest.cs │ │ ├── ViewRegistrationException.Desktop.cs │ │ ├── RegionMemberLifetimeAttribute.cs │ │ ├── IRegionNavigationContentLoader.cs │ │ ├── ViewSortHintAttribute.cs │ │ ├── ViewRegisteredEventArgs.cs │ │ ├── AllActiveRegion.cs │ │ ├── IRegionNavigationService.cs │ │ ├── INavigationAware.cs │ │ └── RegionNavigationJournalEntry.cs │ ├── Events │ │ ├── IDelegateReference.cs │ │ ├── ThreadOption.cs │ │ ├── IEventAggregator.cs │ │ ├── DataEventArgs.cs │ │ ├── IEventSubscription.cs │ │ └── WeakDelegatesManager.cs │ ├── Logging │ │ ├── ILoggerFacade.cs │ │ ├── Category.cs │ │ ├── Priority.cs │ │ ├── EmptyLogger.cs │ │ ├── TraceLogger.cs │ │ └── DebugLogger.cs │ ├── IActiveAware.cs │ ├── PrismApplication.cs │ └── Micser.App.Prism.csproj ├── Micser.App.Infrastructure.Test │ ├── Test.ini │ └── IniFileTest.cs ├── Micser.Engine.Infrastructure.Test │ └── Services │ │ └── ModuleServiceTest.cs ├── Micser.Setup │ ├── App.config │ └── Properties │ │ └── AssemblyInfo.cs ├── Micser.App │ ├── Views │ │ ├── AboutView.xaml.cs │ │ ├── StatusView.xaml.cs │ │ ├── MainMenuView.xaml.cs │ │ ├── SettingsView.xaml.cs │ │ ├── StartupView.xaml.cs │ │ ├── ToolBarView.xaml.cs │ │ ├── MainStatusBarView.xaml.cs │ │ ├── MainView.xaml.cs │ │ ├── StartupView.xaml │ │ ├── MainStatusBarView.xaml │ │ └── ToolBarView.xaml │ ├── appsettings.json │ ├── MicserApplication.xaml │ ├── Settings │ │ └── ShellState.cs │ └── ViewModels │ │ ├── MainStatusBarViewModel.cs │ │ ├── LibraryInfo.cs │ │ ├── ToolBarViewModel.cs │ │ └── MainMenuViewModel.cs ├── Micser.Vac.Package │ ├── runsdvui.cmd │ └── Micser.Vac.Package.vcxproj.filters ├── Directory.Build.props ├── Micser.DriverUtility │ ├── DriverGlobals.cs │ └── Micser.DriverUtility.csproj ├── Micser.TestCommon │ ├── Micser.TestCommon.csproj │ ├── TestOutputLogger.cs │ ├── TestOutputHelperTarget.cs │ └── TestFileManager.cs ├── Micser.Engine.Test │ ├── Api │ │ └── StatusProcessorTest.cs │ └── Micser.Engine.Test.csproj ├── Micser.Engine.Infrastructure │ ├── DataAccess │ │ └── DesignTimeFactory.cs │ ├── IEngineModule.cs │ ├── Audio │ │ ├── SampleProcessor.cs │ │ └── ISampleProcessor.cs │ ├── Extensions │ │ └── ContainerProviderExtensions.cs │ └── Micser.Engine.Infrastructure.csproj ├── Micser.Common.Test │ ├── Extensions │ │ ├── RegexExtensionsTest.cs │ │ └── MathExtensionsTest.cs │ ├── Updates │ │ └── GitHubUpdateServiceTest.cs │ ├── Api │ │ └── ApiTestHelper.cs │ └── Micser.Common.Test.csproj ├── Micser.sln.DotSettings └── Micser.Plugins.Main.Test │ └── Micser.Plugins.Main.Test.csproj ├── docs ├── ReleaseNotes.md └── audio │ └── Reiss-Tutorialondynamicrangecompression.pdf └── .github └── workflows └── ci.yml /gfx/icoconvert.txt: -------------------------------------------------------------------------------- 1 | https://icoconvert.com/ -------------------------------------------------------------------------------- /src/Micser.Engine/ManualStart.ps1: -------------------------------------------------------------------------------- 1 | & .\Micser.Engine.exe --console -------------------------------------------------------------------------------- /gfx/logo.ai: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loreggia/micser/HEAD/gfx/logo.ai -------------------------------------------------------------------------------- /gfx/logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loreggia/micser/HEAD/gfx/logo.ico -------------------------------------------------------------------------------- /gfx/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loreggia/micser/HEAD/gfx/logo.png -------------------------------------------------------------------------------- /src/Micser.App.Infrastructure/Themes/Colors.Default.ini: -------------------------------------------------------------------------------- 1 | [General] 2 | Name = Default -------------------------------------------------------------------------------- /src/Micser.Plugins.Main/Themes/Colors.Light.ini: -------------------------------------------------------------------------------- 1 | [General] 2 | Name = "Light" 3 | Description = "" -------------------------------------------------------------------------------- /src/Micser.Vac.Driver/VerifyInf.ps1: -------------------------------------------------------------------------------- 1 | & "C:\Program Files (x86)\Windows Kits\10\Tools\x64\infverif.exe" Micser.Vac.Driver.inf /stampinf -------------------------------------------------------------------------------- /docs/ReleaseNotes.md: -------------------------------------------------------------------------------- 1 | # 2.1.0 (2020-03-05) 2 | * Use official Prism package for .NET Core 3 | * Dialogs refactoring 4 | * Data access refactoring 5 | -------------------------------------------------------------------------------- /docs/audio/Reiss-Tutorialondynamicrangecompression.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loreggia/micser/HEAD/docs/audio/Reiss-Tutorialondynamicrangecompression.pdf -------------------------------------------------------------------------------- /src/Micser.Plugins.Main/Themes/Generic.xaml: -------------------------------------------------------------------------------- 1 | 3 | -------------------------------------------------------------------------------- /src/Micser.Common/Api/DefaultRequestProcessor.cs: -------------------------------------------------------------------------------- 1 | namespace Micser.Common.Api 2 | { 3 | internal class DefaultRequestProcessor : RequestProcessor 4 | { 5 | } 6 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Navigation/IDestructible.cs: -------------------------------------------------------------------------------- 1 | namespace Prism.Navigation 2 | { 3 | public interface IDestructible 4 | { 5 | void Destroy(); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/Micser.Common/Api/IApiClientConfiguration.cs: -------------------------------------------------------------------------------- 1 | namespace Micser.Common.Api 2 | { 3 | public interface IApiClientConfiguration : IApiConfiguration 4 | { 5 | } 6 | } -------------------------------------------------------------------------------- /src/Micser.Common/Api/IApiServerConfiguration.cs: -------------------------------------------------------------------------------- 1 | namespace Micser.Common.Api 2 | { 3 | public interface IApiServerConfiguration : IApiConfiguration 4 | { 5 | } 6 | } -------------------------------------------------------------------------------- /src/Micser.App.Infrastructure.Test/Test.ini: -------------------------------------------------------------------------------- 1 | [Section1] 2 | Key1 = 1 3 | 4 | Key2=Value2 5 | Key3 = "Text value" 6 | 7 | [Section2] 8 | Key1 = 11 9 | #Key2= 42 10 | Key3 =Null 11 | -------------------------------------------------------------------------------- /src/Micser.Plugins.Main/Audio/CompressorType.cs: -------------------------------------------------------------------------------- 1 | namespace Micser.Plugins.Main.Audio 2 | { 3 | public enum CompressorType 4 | { 5 | Upward, 6 | Downward 7 | } 8 | } -------------------------------------------------------------------------------- /src/Micser.Engine/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "Micser.Engine": { 4 | "commandName": "Project", 5 | "commandLineArgs": "--console" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /src/Micser.Engine.Infrastructure.Test/Services/ModuleServiceTest.cs: -------------------------------------------------------------------------------- 1 | namespace Micser.Engine.Infrastructure.Test.Services 2 | { 3 | public class ModuleServiceTest 4 | { 5 | // todo 6 | } 7 | } -------------------------------------------------------------------------------- /src/Micser.Plugins.Main/Api/SpectrumDataEvent.cs: -------------------------------------------------------------------------------- 1 | using Prism.Events; 2 | 3 | namespace Micser.Plugins.Main.Api 4 | { 5 | public class SpectrumDataEvent : PubSubEvent 6 | { 7 | } 8 | } -------------------------------------------------------------------------------- /src/Micser.Setup/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/Micser.App.Prism/Modularity/ModuleInfo.Desktop.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | using System; 4 | 5 | namespace Prism.Modularity 6 | { 7 | [Serializable] 8 | public partial class ModuleInfo 9 | { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Micser.Common/DataAccess/IDbContextFactory.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | 3 | namespace Micser.Common.DataAccess 4 | { 5 | public interface IDbContextFactory 6 | { 7 | DbContext Create(); 8 | } 9 | } -------------------------------------------------------------------------------- /src/Micser.App/Views/AboutView.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace Micser.App.Views 2 | { 3 | public partial class AboutView 4 | { 5 | public AboutView() 6 | { 7 | InitializeComponent(); 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /src/Micser.App/Views/StatusView.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace Micser.App.Views 2 | { 3 | public partial class StatusView 4 | { 5 | public StatusView() 6 | { 7 | InitializeComponent(); 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /src/Micser.App/Views/MainMenuView.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace Micser.App.Views 2 | { 3 | public partial class MainMenuView 4 | { 5 | public MainMenuView() 6 | { 7 | InitializeComponent(); 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /src/Micser.App/Views/SettingsView.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace Micser.App.Views 2 | { 3 | public partial class SettingsView 4 | { 5 | public SettingsView() 6 | { 7 | InitializeComponent(); 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /src/Micser.App/Views/StartupView.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace Micser.App.Views 2 | { 3 | public partial class StartupView 4 | { 5 | public StartupView() 6 | { 7 | InitializeComponent(); 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /src/Micser.App/Views/ToolBarView.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace Micser.App.Views 2 | { 3 | public partial class ToolBarView 4 | { 5 | public ToolBarView() 6 | { 7 | InitializeComponent(); 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /src/Micser.Common/Settings/SettingsRegistry.cs: -------------------------------------------------------------------------------- 1 | namespace Micser.Common.Settings 2 | { 3 | /// 4 | public class SettingsRegistry : ItemRegistry, ISettingsRegistry 5 | { 6 | } 7 | } -------------------------------------------------------------------------------- /src/Micser.App.Infrastructure/ToolBars/ToolBarLabel.cs: -------------------------------------------------------------------------------- 1 | namespace Micser.App.Infrastructure.ToolBars 2 | { 3 | /// 4 | /// A tool bar text item. 5 | /// 6 | public class ToolBarLabel : ToolBarItem 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /src/Micser.App/Views/MainStatusBarView.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace Micser.App.Views 2 | { 3 | public partial class MainStatusBarView 4 | { 5 | public MainStatusBarView() 6 | { 7 | InitializeComponent(); 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /src/Micser.Plugins.Main/Widgets/GainWidget.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace Micser.Plugins.Main.Widgets 2 | { 3 | public partial class GainWidget 4 | { 5 | public GainWidget() 6 | { 7 | InitializeComponent(); 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /src/Micser.Plugins.Main/Widgets/PitchWidget.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace Micser.Plugins.Main.Widgets 2 | { 3 | public partial class PitchWidget 4 | { 5 | public PitchWidget() 6 | { 7 | InitializeComponent(); 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /src/Micser.Vac.Package/runsdvui.cmd: -------------------------------------------------------------------------------- 1 | cd /d "C:\Users\lucas\Source\Repos\micser\src\Micser.Vac.Package" &msbuild "Micser.Vac.Package.vcxproj" /t:sdvViewer /p:configuration="Debug" /p:platform="Win32" /p:SolutionDir="C:\Users\lucas\Source\Repos\micser\src" 2 | exit %errorlevel% -------------------------------------------------------------------------------- /src/Micser.App.Prism/Modularity/IModuleGroupsCatalog.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.ObjectModel; 2 | 3 | namespace Prism.Modularity 4 | { 5 | public interface IModuleGroupsCatalog 6 | { 7 | Collection Items { get; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Micser.Plugins.Main/Widgets/SpectrumWidget.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace Micser.Plugins.Main.Widgets 2 | { 3 | public partial class SpectrumWidget 4 | { 5 | public SpectrumWidget() 6 | { 7 | InitializeComponent(); 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /src/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 2.1.0 4 | latest 5 | 6 | 7 | Debug;Release;Test 8 | 9 | -------------------------------------------------------------------------------- /src/Micser.Common/Settings/ISettingsRegistry.cs: -------------------------------------------------------------------------------- 1 | namespace Micser.Common.Settings 2 | { 3 | /// 4 | /// Registry containing settings definitions. 5 | /// 6 | public interface ISettingsRegistry : IItemRegistry 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /src/Micser.App.Infrastructure/ToolBars/ToolBarSeparator.cs: -------------------------------------------------------------------------------- 1 | namespace Micser.App.Infrastructure.ToolBars 2 | { 3 | /// 4 | /// A separator item shown as a line in a tool bar. 5 | /// 6 | public class ToolBarSeparator : ToolBarItem 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /src/Micser.Plugins.Main/Widgets/DeviceInputWidget.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace Micser.Plugins.Main.Widgets 2 | { 3 | public partial class DeviceInputWidget 4 | { 5 | public DeviceInputWidget() 6 | { 7 | InitializeComponent(); 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /src/Micser.Plugins.Main/Widgets/DeviceOutputWidget.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace Micser.Plugins.Main.Widgets 2 | { 3 | public partial class DeviceOutputWidget 4 | { 5 | public DeviceOutputWidget() 6 | { 7 | InitializeComponent(); 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /src/Micser.App.Infrastructure/Menu/MenuItemRegistry.cs: -------------------------------------------------------------------------------- 1 | using Micser.Common; 2 | 3 | namespace Micser.App.Infrastructure.Menu 4 | { 5 | /// 6 | public class MenuItemRegistry : ItemRegistry, IMenuItemRegistry 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /src/Micser.Common/Api/IApiConfiguration.cs: -------------------------------------------------------------------------------- 1 | namespace Micser.Common.Api 2 | { 3 | /// 4 | /// Contains configuration properties for the API end points. 5 | /// 6 | public interface IApiConfiguration 7 | { 8 | string PipeName { get; } 9 | } 10 | } -------------------------------------------------------------------------------- /src/Micser.App/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "ConnectionStrings": { 3 | "DefaultConnection": "Data Source=|DataDirectory|\\Micser.App.sqlite;" 4 | }, 5 | "Update": { 6 | "HttpUpdateSettings": { 7 | "ManifestUrl": "https://micser.lloreggia.ch/update/manifest-x64.json" 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /src/Micser.Engine/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "ConnectionStrings": { 3 | "DefaultConnection": "Data Source=|DataDirectory|\\Micser.Engine.sqlite;" 4 | }, 5 | "Update": { 6 | "HttpUpdateSettings": { 7 | "ManifestUrl": "https://micser.lloreggia.ch/update/manifest-x64.json" 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /src/Micser.App.Infrastructure/Controls/EditableSlider.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Controls; 2 | 3 | namespace Micser.App.Infrastructure.Controls 4 | { 5 | /// 6 | /// A slider control with attached input box. 7 | /// 8 | public class EditableSlider : Slider 9 | { 10 | } 11 | } -------------------------------------------------------------------------------- /src/Micser.App.Infrastructure/Interaction/MessageBoxView.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace Micser.App.Infrastructure.Interaction 2 | { 3 | public partial class MessageBoxView 4 | { 5 | /// 6 | public MessageBoxView() 7 | { 8 | InitializeComponent(); 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /src/Micser.App.Infrastructure/Themes/ResourceRegistry.cs: -------------------------------------------------------------------------------- 1 | using Micser.Common; 2 | using System.Windows; 3 | 4 | namespace Micser.App.Infrastructure.Themes 5 | { 6 | /// 7 | public class ResourceRegistry : ItemRegistry, IResourceRegistry 8 | { 9 | } 10 | } -------------------------------------------------------------------------------- /src/Micser.Common/Api/IMessageSerializer.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Threading.Tasks; 3 | 4 | namespace Micser.Common.Api 5 | { 6 | public interface IMessageSerializer 7 | { 8 | Task DeserializeAsync(Stream stream); 9 | 10 | Task SerializeAsync(Stream stream, T value); 11 | } 12 | } -------------------------------------------------------------------------------- /src/Micser.App.Infrastructure/Menu/IMenuItemRegistry.cs: -------------------------------------------------------------------------------- 1 | using Micser.Common; 2 | 3 | namespace Micser.App.Infrastructure.Menu 4 | { 5 | /// 6 | /// Contains main menu item registrations. 7 | /// 8 | public interface IMenuItemRegistry : IItemRegistry 9 | { 10 | } 11 | } -------------------------------------------------------------------------------- /src/Micser.App.Infrastructure/IViewModel.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | 3 | namespace Micser.App.Infrastructure 4 | { 5 | /// 6 | /// View model base interface. Derives from . 7 | /// 8 | public interface IViewModel : INotifyPropertyChanged 9 | { 10 | } 11 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Services/Dialogs/ButtonResult.cs: -------------------------------------------------------------------------------- 1 | namespace Prism.Services.Dialogs 2 | { 3 | public enum ButtonResult 4 | { 5 | Abort = 3, 6 | Cancel = 2, 7 | Ignore = 5, 8 | No = 7, 9 | None = 0, 10 | OK = 1, 11 | Retry = 4, 12 | Yes = 6 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/Micser.Common/IIdentifiable.cs: -------------------------------------------------------------------------------- 1 | namespace Micser.Common 2 | { 3 | /// 4 | /// Describes an object with an ID. 5 | /// 6 | public interface IIdentifiable 7 | { 8 | /// 9 | /// Gets or sets the object's ID. 10 | /// 11 | long Id { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /src/Micser.DriverUtility/DriverGlobals.cs: -------------------------------------------------------------------------------- 1 | namespace Micser.DriverUtility 2 | { 3 | public static class DriverGlobals 4 | { 5 | public const string DeviceSymLink = @"\\.\Micser.Vac.Driver.Device"; 6 | 7 | public static class IoControlCodes 8 | { 9 | public const uint Reload = 0x800; 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Services/Dialogs/DialogParameters.cs: -------------------------------------------------------------------------------- 1 | using Prism.Regions; 2 | 3 | namespace Prism.Services.Dialogs 4 | { 5 | public class DialogParameters : NavigationParameters, IDialogParameters 6 | { 7 | public DialogParameters() : base() { } 8 | 9 | public DialogParameters(string query) : base(query) { } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Micser.App.Infrastructure/Converter/BooleanToDoubleConverter.cs: -------------------------------------------------------------------------------- 1 | namespace Micser.App.Infrastructure.Converter 2 | { 3 | /// 4 | /// A value converter that converts a value to a specific value. 5 | /// 6 | public class BooleanToDoubleConverter : BooleanConverter 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /src/Micser.App/MicserApplication.xaml: -------------------------------------------------------------------------------- 1 | 5 | -------------------------------------------------------------------------------- /src/Micser.App.Infrastructure/Controls/InfoButton.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Controls.Primitives; 2 | 3 | namespace Micser.App.Infrastructure.Controls 4 | { 5 | /// 6 | /// A that contains an icon and shows it's content as a popup. 7 | /// 8 | public class InfoButton : ToggleButton 9 | { 10 | } 11 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Services/Dialogs/IDialogWindowExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace Prism.Services.Dialogs 2 | { 3 | internal static class IDialogWindowExtensions 4 | { 5 | internal static IDialogAware GetDialogViewModel(this IDialogWindow dialogWindow) 6 | { 7 | return (IDialogAware)dialogWindow.DataContext; 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Micser.Common/MissingConfigurationException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Micser.Common 4 | { 5 | public class MissingConfigurationException : Exception 6 | { 7 | public MissingConfigurationException(string section) 8 | { 9 | Section = section; 10 | } 11 | 12 | public string Section { get; } 13 | } 14 | } -------------------------------------------------------------------------------- /src/Micser.Plugins.Main/Api/SpectrumData.cs: -------------------------------------------------------------------------------- 1 | namespace Micser.Plugins.Main.Api 2 | { 3 | public class SpectrumData 4 | { 5 | public SpectrumValue[] Values { get; set; } 6 | 7 | public struct SpectrumValue 8 | { 9 | public float Frequency { get; set; } 10 | public float Value { get; set; } 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /src/Micser.Engine/Api/StatusProcessor.cs: -------------------------------------------------------------------------------- 1 | using Micser.Common; 2 | using Micser.Common.Api; 3 | 4 | namespace Micser.Engine.Api 5 | { 6 | [RequestProcessorName(Globals.ApiResources.Status)] 7 | public class StatusProcessor : RequestProcessor 8 | { 9 | public StatusProcessor() 10 | { 11 | AddAction(null, _ => true); 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /src/Micser.App.Infrastructure/Themes/IResourceRegistry.cs: -------------------------------------------------------------------------------- 1 | using Micser.Common; 2 | using System.Windows; 3 | 4 | namespace Micser.App.Infrastructure.Themes 5 | { 6 | /// 7 | /// Registry containing WPF resource dictionaries from all modules. 8 | /// 9 | public interface IResourceRegistry : IItemRegistry 10 | { 11 | } 12 | } -------------------------------------------------------------------------------- /src/Micser.App/Settings/ShellState.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | namespace Micser.App.Settings 4 | { 5 | public class ShellState 6 | { 7 | public double Height { get; set; } 8 | public double Left { get; set; } 9 | public WindowState State { get; set; } 10 | public double Top { get; set; } 11 | public double Width { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /src/Micser.App.Infrastructure/ISelectable.cs: -------------------------------------------------------------------------------- 1 | namespace Micser.App.Infrastructure 2 | { 3 | /// 4 | /// Describes an object that is selectable. 5 | /// 6 | public interface ISelectable 7 | { 8 | /// 9 | /// Gets or sets whether the object is selected. 10 | /// 11 | bool IsSelected { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /src/Micser.App.Infrastructure/Widgets/UnsavedAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Micser.App.Infrastructure.Widgets 4 | { 5 | /// 6 | /// Declares that the state of the widget is not automatically saved when this property is changed. 7 | /// 8 | [AttributeUsage(AttributeTargets.Property)] 9 | public class UnsavedAttribute : Attribute 10 | { 11 | } 12 | } -------------------------------------------------------------------------------- /src/Micser.TestCommon/Micser.TestCommon.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1 5 | false 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/Micser.Common/Updates/HttpUpdateSettings.cs: -------------------------------------------------------------------------------- 1 | namespace Micser.Common.Updates 2 | { 3 | /// 4 | /// Contains settings for the . 5 | /// 6 | public class HttpUpdateSettings 7 | { 8 | /// 9 | /// Gets or sets the URL of the update manifest. 10 | /// 11 | public string ManifestUrl { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /src/Micser.App/Views/MainView.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace Micser.App.Views 2 | { 3 | public partial class MainView 4 | { 5 | public MainView() 6 | { 7 | InitializeComponent(); 8 | 9 | Loaded += MainView_Loaded; 10 | } 11 | 12 | private void MainView_Loaded(object sender, System.Windows.RoutedEventArgs e) 13 | { 14 | WidgetPanel.Focus(); 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /src/Micser.App.Infrastructure/Converter/BooleanInvertConverter.cs: -------------------------------------------------------------------------------- 1 | namespace Micser.App.Infrastructure.Converter 2 | { 3 | /// 4 | /// A value converter that inverses a boolean value. 5 | /// 6 | public class BooleanInvertConverter : BooleanConverter 7 | { 8 | /// 9 | public BooleanInvertConverter() 10 | : base(false, true) 11 | { 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Services/Dialogs/IDialogResult.cs: -------------------------------------------------------------------------------- 1 | namespace Prism.Services.Dialogs 2 | { 3 | public interface IDialogResult 4 | { 5 | /// 6 | /// The parameters from the dialog 7 | /// 8 | IDialogParameters Parameters { get; } 9 | 10 | /// 11 | /// The result of the dialog. 12 | /// 13 | ButtonResult Result { get; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Micser.Plugins.Main/Widgets/LoopbackDeviceInputViewModel.cs: -------------------------------------------------------------------------------- 1 | using Micser.Common.Devices; 2 | using Micser.Plugins.Main.Modules; 3 | using System; 4 | 5 | namespace Micser.Plugins.Main.Widgets 6 | { 7 | public class LoopbackDeviceInputViewModel : DeviceInputViewModel 8 | { 9 | public override Type ModuleType => typeof(LoopbackDeviceInputModule); 10 | 11 | protected override DeviceType DeviceType => DeviceType.Output; 12 | } 13 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Ioc/IContainerProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Prism.Ioc 4 | { 5 | public interface IContainerProvider 6 | { 7 | object Resolve(Type type); 8 | 9 | object Resolve(Type type, params (Type Type, object Instance)[] parameters); 10 | 11 | object Resolve(Type type, string name); 12 | 13 | object Resolve(Type type, string name, params (Type Type, object Instance)[] parameters); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Micser.App.Prism/Modularity/IModuleInfoGroup.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | 4 | namespace Prism.Modularity 5 | { 6 | // IList must be supported in Silverlight 2 to be able to add items from XAML 7 | public interface IModuleInfoGroup : IModuleCatalogItem, IList, IList 8 | { 9 | InitializationMode InitializationMode { get; set; } 10 | 11 | string Ref { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Micser.Common/Api/ApiMessage.cs: -------------------------------------------------------------------------------- 1 | namespace Micser.Common.Api 2 | { 3 | public abstract class ApiMessage 4 | { 5 | public ApiMessage() 6 | { 7 | } 8 | 9 | public ApiMessage(object content) 10 | { 11 | Content = content; 12 | } 13 | 14 | /// 15 | /// Gets or sets the message content. 16 | /// 17 | public object Content { get; set; } 18 | } 19 | } -------------------------------------------------------------------------------- /src/Micser.App.Infrastructure/Widgets/AudioWidgetControls.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace Micser.App.Infrastructure.Widgets 2 | { 3 | /// 4 | /// Control containing the default control elements for an . 5 | /// 6 | public partial class AudioWidgetControls 7 | { 8 | /// 9 | public AudioWidgetControls() 10 | { 11 | InitializeComponent(); 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /src/Micser.Common/DisposableBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Micser.Common 4 | { 5 | public abstract class DisposableBase : IDisposable 6 | { 7 | ~DisposableBase() 8 | { 9 | Dispose(false); 10 | } 11 | 12 | public void Dispose() 13 | { 14 | Dispose(true); 15 | GC.SuppressFinalize(this); 16 | } 17 | 18 | protected abstract void Dispose(bool disposing); 19 | } 20 | } -------------------------------------------------------------------------------- /src/Micser.Common/Extensions/DbContextFactoryExtensions.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using Micser.Common.DataAccess; 3 | 4 | namespace Micser.Common.Extensions 5 | { 6 | public static class DbContextFactoryExtensions 7 | { 8 | public static TDbContext Create(this IDbContextFactory factory) 9 | where TDbContext : DbContext 10 | { 11 | return (TDbContext)factory.Create(); 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Services/Dialogs/DialogWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | namespace Prism.Services.Dialogs 4 | { 5 | /// 6 | /// Interaction logic for DialogWindow.xaml 7 | /// 8 | public partial class DialogWindow : Window, IDialogWindow 9 | { 10 | public IDialogResult Result { get; set; } 11 | 12 | public DialogWindow() 13 | { 14 | InitializeComponent(); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Micser.Common/Api/ApiConfiguration.cs: -------------------------------------------------------------------------------- 1 | namespace Micser.Common.Api 2 | { 3 | /// 4 | public class ApiConfiguration : IApiServerConfiguration, IApiClientConfiguration 5 | { 6 | public ApiConfiguration() 7 | { 8 | } 9 | 10 | public ApiConfiguration(string pipeName) 11 | { 12 | PipeName = pipeName; 13 | } 14 | 15 | public string PipeName { get; set; } 16 | } 17 | } -------------------------------------------------------------------------------- /src/Micser.Common/Devices/DeviceType.cs: -------------------------------------------------------------------------------- 1 | namespace Micser.Common.Devices 2 | { 3 | /// 4 | /// The type of an audio device. 5 | /// 6 | public enum DeviceType 7 | { 8 | /// 9 | /// An input/capture device (i.e. microphone). 10 | /// 11 | Input, 12 | 13 | /// 14 | /// An output/render device (i.e. speakers). 15 | /// 16 | Output 17 | } 18 | } -------------------------------------------------------------------------------- /src/Micser.Plugins.Main/Modules/GainModule.cs: -------------------------------------------------------------------------------- 1 | using Micser.Common.Modules; 2 | using Micser.Engine.Infrastructure.Audio; 3 | using Micser.Plugins.Main.Audio; 4 | 5 | namespace Micser.Plugins.Main.Modules 6 | { 7 | public class GainModule : AudioModule 8 | { 9 | public GainModule() 10 | { 11 | AddSampleProcessor(new GainSampleProcessor(this)); 12 | } 13 | 14 | [SaveState(0f)] 15 | public float Gain { get; set; } 16 | } 17 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Modularity/IModuleInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.ObjectModel; 2 | 3 | namespace Prism.Modularity 4 | { 5 | public interface IModuleInfo : IModuleCatalogItem 6 | { 7 | Collection DependsOn { get; set; } 8 | InitializationMode InitializationMode { get; set; } 9 | string ModuleName { get; set; } 10 | string ModuleType { get; set; } 11 | string Ref { get; set; } 12 | ModuleState State { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Interactivity/DefaultPopupWindows/DefaultWindow.xaml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/Micser.App.Prism/Regions/SyncActiveStateAttribute.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | 8 | namespace Prism.Regions 9 | { 10 | /// 11 | /// Defines that a view is synchronized with its parent view's Active state. 12 | /// 13 | [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] 14 | public sealed class SyncActiveStateAttribute : Attribute 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Micser.App.Infrastructure/ToolBars/ToolBarDescription.cs: -------------------------------------------------------------------------------- 1 | using Micser.Common; 2 | 3 | namespace Micser.App.Infrastructure.ToolBars 4 | { 5 | /// 6 | /// A tool bar subregistry containing its s. 7 | /// 8 | public class ToolBarDescription : ItemRegistry 9 | { 10 | /// 11 | /// Gets or sets the name of the tool bar. 12 | /// 13 | public string Name { get; set; } 14 | } 15 | } -------------------------------------------------------------------------------- /src/Micser.App.Infrastructure/Widgets/IWidgetRegistry.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Micser.App.Infrastructure.Widgets 4 | { 5 | /// 6 | /// Registry containing the widget descriptions of all loaded plugins. 7 | /// 8 | public interface IWidgetRegistry 9 | { 10 | /// 11 | /// Gets the descriptions for all available widgets. 12 | /// 13 | IEnumerable Widgets { get; } 14 | } 15 | } -------------------------------------------------------------------------------- /src/Micser.Common/Settings/SettingValueDto.cs: -------------------------------------------------------------------------------- 1 | namespace Micser.Common.Settings 2 | { 3 | /// 4 | /// DTO for transferring setting values via API. 5 | /// 6 | public sealed class SettingValueDto 7 | { 8 | /// 9 | /// The setting key. 10 | /// 11 | public string Key { get; set; } 12 | 13 | /// 14 | /// The setting value. 15 | /// 16 | public object Value { get; set; } 17 | } 18 | } -------------------------------------------------------------------------------- /src/Micser.Vac.Package/Micser.Vac.Package.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {8E41214B-6785-4CFE-B992-037D68949A14} 6 | inf;inv;inx;mof;mc; 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/Micser.App.Prism/Modularity/IModuleInitializer.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | namespace Prism.Modularity 4 | { 5 | /// 6 | /// Declares a service which initializes the modules into the application. 7 | /// 8 | public interface IModuleInitializer 9 | { 10 | /// 11 | /// Initializes the specified module. 12 | /// 13 | /// The module to initialize 14 | void Initialize(IModuleInfo moduleInfo); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/Micser.App.Infrastructure/ToolBars/ToolBarButton.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Input; 2 | 3 | namespace Micser.App.Infrastructure.ToolBars 4 | { 5 | /// 6 | /// Describes a tool bar button that executes an when clicked. 7 | /// 8 | public class ToolBarButton : ToolBarItem 9 | { 10 | /// 11 | /// Gets or sets a command that is executed when the button is clicked. 12 | /// 13 | public ICommand Command { get; set; } 14 | } 15 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Modularity/IConfigurationStore.Desktop.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | namespace Prism.Modularity 4 | { 5 | /// 6 | /// Defines a store for the module metadata. 7 | /// 8 | public interface IConfigurationStore 9 | { 10 | /// 11 | /// Gets the module configuration data. 12 | /// 13 | /// A instance. 14 | ModulesConfigurationSection RetrieveModuleConfigurationSection(); 15 | } 16 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Services/Dialogs/DialogWindow.xaml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/Micser.Common/DataAccess/DbContextFactory.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using System; 3 | 4 | namespace Micser.Common.DataAccess 5 | { 6 | public class DbContextFactory : IDbContextFactory 7 | { 8 | private readonly Func _factoryFunc; 9 | 10 | public DbContextFactory(Func factoryFunc) 11 | { 12 | _factoryFunc = factoryFunc; 13 | } 14 | 15 | public DbContext Create() 16 | { 17 | return _factoryFunc(); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /src/Micser.Plugins.Main/Audio/FilterDescription.cs: -------------------------------------------------------------------------------- 1 | namespace Micser.Plugins.Main.Audio 2 | { 3 | public class FilterDescription 4 | { 5 | public FilterDescription() 6 | { 7 | Frequency = 1000; 8 | BandWidth = 18; 9 | PeakGainDb = 0; 10 | Ratio = 1; 11 | } 12 | 13 | public double BandWidth { get; set; } 14 | public double Frequency { get; set; } 15 | public double PeakGainDb { get; set; } 16 | public double Ratio { get; set; } 17 | } 18 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Modularity/IAssemblyResolver.Desktop.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | namespace Prism.Modularity 4 | { 5 | /// 6 | /// Interface for classes that are responsible for resolving and loading assembly files. 7 | /// 8 | public interface IAssemblyResolver 9 | { 10 | /// 11 | /// Load an assembly when it's required by the application. 12 | /// 13 | /// 14 | void LoadAssemblyFrom(string assemblyFilePath); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/Micser.App.Prism/Modularity/IModuleCatalogItem.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | namespace Prism.Modularity 4 | { 5 | /// 6 | /// Marker interface that allows both s and s to be 7 | /// added to the from code and XAML. 8 | /// 9 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1040:AvoidEmptyInterfaces", Justification = "This is a marker interface")] 10 | public interface IModuleCatalogItem 11 | { 12 | 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/Micser.Plugins.Main/Modules/EqualizerModule.cs: -------------------------------------------------------------------------------- 1 | using Micser.Engine.Infrastructure.Audio; 2 | using Micser.Plugins.Main.Audio; 3 | using System.Collections.Generic; 4 | 5 | namespace Micser.Plugins.Main.Modules 6 | { 7 | public class EqualizerModule : AudioModule 8 | { 9 | protected EqualizerModule() 10 | { 11 | Filters = new List(); 12 | 13 | AddSampleProcessor(new EqualizerSampleProcessor(this)); 14 | } 15 | 16 | public List Filters { get; } 17 | } 18 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Regions/IRegionBehavior.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | namespace Prism.Regions 4 | { 5 | /// 6 | /// Interface for allowing extensible behavior on regions. 7 | /// 8 | public interface IRegionBehavior 9 | { 10 | /// 11 | /// The region that this behavior is extending. 12 | /// 13 | IRegion Region { get; set; } 14 | 15 | /// 16 | /// Attaches the behavior to the specified region. 17 | /// 18 | void Attach(); 19 | 20 | } 21 | } -------------------------------------------------------------------------------- /src/Micser.TestCommon/TestOutputLogger.cs: -------------------------------------------------------------------------------- 1 | using NLog; 2 | using NLog.Config; 3 | using Xunit.Abstractions; 4 | 5 | namespace Micser.TestCommon 6 | { 7 | public static class TestOutputLogger 8 | { 9 | public static void Configure(ITestOutputHelper testOutputHelper) 10 | { 11 | var config = new LoggingConfiguration(); 12 | config.AddTarget("Test", new TestOutputHelperTarget(testOutputHelper)); 13 | config.AddRuleForAllLevels("Test"); 14 | LogManager.Configuration = config; 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Events/IDelegateReference.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | using System; 5 | 6 | namespace Prism.Events 7 | { 8 | /// 9 | /// Represents a reference to a . 10 | /// 11 | public interface IDelegateReference 12 | { 13 | /// 14 | /// Gets the referenced object. 15 | /// 16 | /// A instance if the target is valid; otherwise . 17 | Delegate Target { get; } 18 | } 19 | } -------------------------------------------------------------------------------- /src/Micser.Common/Modules/ModulesExportDto.cs: -------------------------------------------------------------------------------- 1 | namespace Micser.Common.Modules 2 | { 3 | /// 4 | /// DTO used for serializing module data. 5 | /// 6 | public class ModulesExportDto 7 | { 8 | /// 9 | /// Gets or sets the connections between the modules. 10 | /// 11 | public ModuleConnectionDto[] Connections { get; set; } 12 | 13 | /// 14 | /// Gets or sets the modules. 15 | /// 16 | public ModuleDto[] Modules { get; set; } 17 | } 18 | } -------------------------------------------------------------------------------- /src/Micser.Common/Api/IRequestProcessorFactory.cs: -------------------------------------------------------------------------------- 1 | namespace Micser.Common.Api 2 | { 3 | /// 4 | /// Provides functionality to create a request processor for an incoming request. 5 | /// 6 | public interface IRequestProcessorFactory 7 | { 8 | /// 9 | /// Creates a request processor that was registered using the attribute. 10 | /// 11 | /// The processor name. 12 | IRequestProcessor Create(string name); 13 | } 14 | } -------------------------------------------------------------------------------- /src/Micser.Vac.Driver/kshelper.h: -------------------------------------------------------------------------------- 1 | /* 2 | Module Name: 3 | kshelper.h 4 | 5 | Abstract: 6 | Helper functions for msvad 7 | */ 8 | #ifndef __KSHELPER_H_ 9 | #define __KSHELPER_H_ 10 | 11 | #include 12 | #include 13 | 14 | PWAVEFORMATEX GetWaveFormatEx(IN PKSDATAFORMAT pDataFormat); 15 | 16 | NTSTATUS PropertyHandler_BasicSupport(IN PPCPROPERTY_REQUEST PropertyRequest, IN ULONG Flags, IN DWORD PropTypeSetId); 17 | 18 | NTSTATUS ValidatePropertyParams(IN PPCPROPERTY_REQUEST PropertyRequest, IN ULONG cbValueSize, IN ULONG cbInstanceSize = 0); 19 | #endif 20 | -------------------------------------------------------------------------------- /src/Micser.Common/IItemRegistry.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Micser.Common 4 | { 5 | /// 6 | /// Generic item registry container. 7 | /// 8 | public interface IItemRegistry 9 | { 10 | /// 11 | /// Gets the items stored in this registry. 12 | /// 13 | IEnumerable Items { get; } 14 | 15 | /// 16 | /// Adds a new item to this registry. Does not check for duplicates. 17 | /// 18 | void Add(T item); 19 | } 20 | } -------------------------------------------------------------------------------- /src/Micser.Engine.Test/Api/StatusProcessorTest.cs: -------------------------------------------------------------------------------- 1 | using Micser.Engine.Api; 2 | using System.Threading.Tasks; 3 | using Xunit; 4 | 5 | namespace Micser.Engine.Test.Api 6 | { 7 | public class StatusProcessorTest 8 | { 9 | [Fact] 10 | public async Task GetStatus() 11 | { 12 | var statusProcessor = new StatusProcessor(); 13 | 14 | var result = await statusProcessor.ProcessAsync(null, null).ConfigureAwait(false); 15 | 16 | Assert.NotNull(result); 17 | Assert.True(result.IsSuccess); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /src/Micser.Common/Settings/ISettingHandlerFactory.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Micser.Common.Settings 4 | { 5 | /// 6 | /// A factory for creating instances. 7 | /// 8 | public interface ISettingHandlerFactory 9 | { 10 | /// 11 | /// Creates a setting handler of the specified type. 12 | /// 13 | /// The type of the setting handler. Has to implement . 14 | ISettingHandler Create(Type type); 15 | } 16 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Regions/IJournalAware.cs: -------------------------------------------------------------------------------- 1 | namespace Prism.Regions 2 | { 3 | /// 4 | /// Provides a way for objects involved in navigation to opt-out of being added to the IRegionNavigationJournal backstack. 5 | /// 6 | public interface IJournalAware 7 | { 8 | /// 9 | /// Determines if the current obect is going to be added to the navigation journal's backstack. 10 | /// 11 | /// True, add to backstack. False, remove from backstack. 12 | bool PersistInHistory(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/Micser.Common/DataAccess/Entities/Entity.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | using System.ComponentModel.DataAnnotations.Schema; 3 | 4 | namespace Micser.Common.DataAccess.Entities 5 | { 6 | /// 7 | /// Base class for persisted model objects. 8 | /// 9 | public class Entity : IIdentifiable 10 | { 11 | /// 12 | /// Gets or sets the ID key property. 13 | /// 14 | [Key] 15 | [DatabaseGenerated(DatabaseGeneratedOption.Identity)] 16 | public long Id { get; set; } 17 | } 18 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Interactivity/InteractionRequest/IConfirmation.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Prism.Interactivity.InteractionRequest 4 | { 5 | /// 6 | /// Represents an interaction request used for confirmations. 7 | /// 8 | [Obsolete("Please use the new IDialogService for an improved dialog experience.")] 9 | public interface IConfirmation : INotification 10 | { 11 | /// 12 | /// Gets or sets a value indicating that the confirmation is confirmed. 13 | /// 14 | bool Confirmed { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/Micser.App.Prism/Ioc/PrismIocExtensions.cs: -------------------------------------------------------------------------------- 1 | using Prism.Ioc; 2 | using Unity; 3 | 4 | namespace Prism.Unity 5 | { 6 | public static class PrismIocExtensions 7 | { 8 | public static IUnityContainer GetContainer(this IContainerProvider containerProvider) 9 | { 10 | return ((IContainerExtension)containerProvider).Instance; 11 | } 12 | 13 | public static IUnityContainer GetContainer(this IContainerRegistry containerRegistry) 14 | { 15 | return ((IContainerExtension)containerRegistry).Instance; 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /src/Micser.Common/Updates/GitHub/Asset.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace Micser.Common.Updates.GitHub 4 | { 5 | public class Asset 6 | { 7 | [JsonProperty("content_type")] 8 | public string ContentType { get; set; } 9 | 10 | [JsonProperty("browser_download_url")] 11 | public string DownloadUrl { get; set; } 12 | 13 | [JsonProperty("id")] 14 | public long Id { get; set; } 15 | 16 | [JsonProperty("name")] 17 | public string Name { get; set; } 18 | 19 | [JsonProperty("state")] 20 | public string State { get; set; } 21 | } 22 | } -------------------------------------------------------------------------------- /src/Micser.App.Infrastructure/DataAccess/DesignTimeFactory.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using Microsoft.EntityFrameworkCore.Design; 3 | 4 | namespace Micser.App.Infrastructure.DataAccess 5 | { 6 | // ReSharper disable once UnusedMember.Global 7 | public class DesignTimeFactory : IDesignTimeDbContextFactory 8 | { 9 | public AppDbContext CreateDbContext(string[] args) 10 | { 11 | var builder = new DbContextOptionsBuilder(); 12 | builder.UseSqlite("DesignTimeAppDb.db"); 13 | return new AppDbContext(builder.Options); 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /src/Micser.App.Infrastructure/IApplicationStateService.cs: -------------------------------------------------------------------------------- 1 | namespace Micser.App.Infrastructure 2 | { 3 | /// 4 | /// Provides global application state information. 5 | /// 6 | public interface IApplicationStateService 7 | { 8 | /// 9 | /// Gets a value that indicates whether the program finished loading all available modules. 10 | /// 11 | bool ModulesLoaded { get; } 12 | 13 | /// 14 | /// Initialized the service and registers it's event handlers. 15 | /// 16 | void Initialize(); 17 | } 18 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Modularity/InitializationMode.cs: -------------------------------------------------------------------------------- 1 | namespace Prism.Modularity 2 | { 3 | /// 4 | /// Specifies on which stage the Module group will be initialized. 5 | /// 6 | public enum InitializationMode 7 | { 8 | /// 9 | /// The module will be initialized when it is available on application start-up. 10 | /// 11 | WhenAvailable, 12 | 13 | /// 14 | /// The module will be initialized when requested, and not automatically on application start-up. 15 | /// 16 | OnDemand 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Micser.App.Prism/Services/Dialogs/IDialogParameters.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Prism.Services.Dialogs 4 | { 5 | //TODO: this can eventually be replaced with INavigationParameters 6 | public interface IDialogParameters 7 | { 8 | void Add(string key, object value); 9 | 10 | bool ContainsKey(string key); 11 | 12 | int Count { get; } 13 | 14 | IEnumerable Keys { get; } 15 | 16 | T GetValue(string key); 17 | 18 | IEnumerable GetValues(string key); 19 | 20 | bool TryGetValue(string key, out T value); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Micser.Common/Extensions/ServiceExtensions.cs: -------------------------------------------------------------------------------- 1 | using Micser.Common.Settings; 2 | 3 | namespace Micser.Common.Extensions 4 | { 5 | /// 6 | /// Provides extension methods for services. 7 | /// 8 | public static class ServiceExtensions 9 | { 10 | /// 11 | /// Gets the value for the specified setting converted to type . 12 | /// 13 | public static T GetSetting(this ISettingsService settingsService, string key) 14 | { 15 | return settingsService.GetSetting(key).ToType(); 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Ioc/IContainerExtension.cs: -------------------------------------------------------------------------------- 1 | namespace Prism.Ioc 2 | { 3 | public interface IContainerExtension : IContainerExtension 4 | { 5 | /// 6 | /// The instance of the wrapped container 7 | /// 8 | TContainer Instance { get; } 9 | } 10 | 11 | public interface IContainerExtension : IContainerProvider, IContainerRegistry 12 | { 13 | /// 14 | /// Used to perform any final steps for configuring the extension that may be required by the container. 15 | /// 16 | void FinalizeExtension(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Micser.Engine.Infrastructure/DataAccess/DesignTimeFactory.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using Microsoft.EntityFrameworkCore.Design; 3 | 4 | namespace Micser.Engine.Infrastructure.DataAccess 5 | { 6 | // ReSharper disable once UnusedMember.Global 7 | public class DesignTimeFactory : IDesignTimeDbContextFactory 8 | { 9 | public EngineDbContext CreateDbContext(string[] args) 10 | { 11 | var builder = new DbContextOptionsBuilder(); 12 | builder.UseSqlite("DesignTimeEngineDb.db"); 13 | return new EngineDbContext(builder.Options); 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /src/Micser.DriverUtility/Micser.DriverUtility.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 8 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/Micser.Common/DependencyOverride.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Micser.Common 4 | { 5 | public class DependencyOverride 6 | { 7 | public DependencyOverride(Type dependencyType, object instance) 8 | { 9 | DependencyType = dependencyType; 10 | Instance = instance; 11 | } 12 | 13 | public Type DependencyType { get; } 14 | public object Instance { get; } 15 | } 16 | 17 | public class DependencyOverride : DependencyOverride 18 | { 19 | public DependencyOverride(T instance) 20 | : base(typeof(T), instance) 21 | { 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /src/Micser.Setup/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | [assembly: AssemblyTitle("Micser.Setup")] 5 | [assembly: AssemblyDescription("")] 6 | [assembly: AssemblyConfiguration("")] 7 | [assembly: AssemblyTrademark("")] 8 | [assembly: ComVisible(false)] 9 | [assembly: Guid("c9a243e5-6443-4a00-acac-c20a61286264")] 10 | [assembly: AssemblyProduct("Micser Setup")] 11 | [assembly: AssemblyCompany("Lucas Loreggia")] 12 | [assembly: AssemblyCopyright("Copyright © Lucas Loreggia 2019")] 13 | [assembly: AssemblyCulture("")] 14 | [assembly: AssemblyVersion("1.0.*")] 15 | [assembly: AssemblyFileVersion("1.0.0.0")] -------------------------------------------------------------------------------- /src/Micser.Plugins.Main/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | [assembly: ThemeInfo( 4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 5 | //(used if a resource is not found in the page, 6 | // or application resource dictionaries) 7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 8 | //(used if a resource is not found in the page, 9 | // app, or any theme specific resource dictionaries) 10 | )] 11 | -------------------------------------------------------------------------------- /src/Micser.App.Infrastructure/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | [assembly: ThemeInfo( 4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 5 | //(used if a resource is not found in the page, 6 | // or application resource dictionaries) 7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 8 | //(used if a resource is not found in the page, 9 | // app, or any theme specific resource dictionaries) 10 | )] 11 | -------------------------------------------------------------------------------- /src/Micser.Plugins.Main/Widgets/DeviceInputViewModel.cs: -------------------------------------------------------------------------------- 1 | using Micser.App.Infrastructure.Widgets; 2 | using Micser.Common.Devices; 3 | using Micser.Plugins.Main.Modules; 4 | using System; 5 | 6 | namespace Micser.Plugins.Main.Widgets 7 | { 8 | public class DeviceInputViewModel : DeviceWidgetViewModel 9 | { 10 | public const string OutputConnectorName = "Output1"; 11 | 12 | public DeviceInputViewModel() 13 | { 14 | AddOutput(OutputConnectorName); 15 | } 16 | 17 | public override Type ModuleType => typeof(DeviceInputModule); 18 | protected override DeviceType DeviceType => DeviceType.Input; 19 | } 20 | } -------------------------------------------------------------------------------- /src/Micser.Plugins.Main/Widgets/DeviceOutputViewModel.cs: -------------------------------------------------------------------------------- 1 | using Micser.App.Infrastructure.Widgets; 2 | using Micser.Common.Devices; 3 | using Micser.Plugins.Main.Modules; 4 | using System; 5 | 6 | namespace Micser.Plugins.Main.Widgets 7 | { 8 | public class DeviceOutputViewModel : DeviceWidgetViewModel 9 | { 10 | public const string InputConnectorName = "Input1"; 11 | 12 | public DeviceOutputViewModel() 13 | { 14 | AddInput(InputConnectorName); 15 | } 16 | 17 | public override Type ModuleType => typeof(DeviceOutputModule); 18 | 19 | protected override DeviceType DeviceType => DeviceType.Output; 20 | } 21 | } -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: micser CI 2 | 3 | on: [push] 4 | 5 | jobs: 6 | build: 7 | runs-on: windows-latest 8 | 9 | steps: 10 | - name: Checkout 11 | uses: actions/checkout@v2 12 | 13 | - name: Setup .NET Core 14 | uses: actions/setup-dotnet@v1 15 | with: 16 | dotnet-version: 3.1.100 17 | 18 | - name: Setup Build 19 | uses: warrenbuckley/Setup-MSBuild@v1 20 | 21 | - name: Build 22 | working-directory: src 23 | run: msbuild Micser.sln /p:Platform=x64 /p:Configuration=Debug /restore 24 | 25 | - name: Test 26 | working-directory: src 27 | run: dotnet test Micser.sln --configuration Test 28 | -------------------------------------------------------------------------------- /src/Micser.App.Prism/Regions/IRegionNavigationJournalEntry.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | using System; 4 | namespace Prism.Regions 5 | { 6 | /// 7 | /// An entry in an IRegionNavigationJournal representing the URI navigated to. 8 | /// 9 | public interface IRegionNavigationJournalEntry 10 | { 11 | /// 12 | /// Gets or sets the URI. 13 | /// 14 | /// The URI. 15 | Uri Uri { get; set; } 16 | 17 | /// 18 | /// Gets or sets the NavigationParameters instance. 19 | /// 20 | NavigationParameters Parameters { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Micser.App.Prism/Logging/ILoggerFacade.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | namespace Prism.Logging 5 | { 6 | /// 7 | /// Defines a simple logger façade to be used by the Prism Library. 8 | /// 9 | public interface ILoggerFacade 10 | { 11 | /// 12 | /// Write a new log entry with the specified category and priority. 13 | /// 14 | /// Message body to log. 15 | /// Category of the entry. 16 | /// The priority of the entry. 17 | void Log(string message, Category category, Priority priority); 18 | } 19 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Modularity/IModule.cs: -------------------------------------------------------------------------------- 1 | using Prism.Ioc; 2 | 3 | namespace Prism.Modularity 4 | { 5 | /// 6 | /// Defines the contract for the modules deployed in the application. 7 | /// 8 | public interface IModule 9 | { 10 | /// 11 | /// Used to register types with the container that will be used by your application. 12 | /// 13 | void RegisterTypes(IContainerRegistry containerRegistry); 14 | 15 | /// 16 | /// Notifies the module that it has been initialized. 17 | /// 18 | void OnInitialized(IContainerProvider containerProvider); 19 | } 20 | } -------------------------------------------------------------------------------- /src/Micser.Common/Settings/SettingHandlerFactory.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Micser.Common.Settings 4 | { 5 | /// 6 | public class SettingHandlerFactory : ISettingHandlerFactory 7 | { 8 | private readonly Func _factoryMethod; 9 | 10 | /// 11 | public SettingHandlerFactory(Func factoryMethod) 12 | { 13 | _factoryMethod = factoryMethod; 14 | } 15 | 16 | /// 17 | public ISettingHandler Create(Type type) 18 | { 19 | return _factoryMethod(type); 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Regions/IRegionMemberLifetime.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | using Prism.Regions.Behaviors; 4 | 5 | namespace Prism.Regions 6 | { 7 | /// 8 | /// When implemented, allows an instance placed in a 9 | /// that uses a to indicate 10 | /// it should be removed when it transitions from an activated to deactived state. 11 | /// 12 | public interface IRegionMemberLifetime 13 | { 14 | /// 15 | /// Gets a value indicating whether this instance should be kept-alive upon deactivation. 16 | /// 17 | bool KeepAlive { get; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Micser.App.Infrastructure/Widgets/WidgetRegistry.cs: -------------------------------------------------------------------------------- 1 | using Micser.Common; 2 | using Micser.Common.Extensions; 3 | using System.Collections.Generic; 4 | 5 | namespace Micser.App.Infrastructure.Widgets 6 | { 7 | /// 8 | public class WidgetRegistry : IWidgetRegistry 9 | { 10 | private readonly IContainerProvider _container; 11 | 12 | /// 13 | public WidgetRegistry(IContainerProvider container) 14 | { 15 | _container = container; 16 | } 17 | 18 | /// 19 | public IEnumerable Widgets => _container.ResolveAll(); 20 | } 21 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Services/Dialogs/DialogResult.cs: -------------------------------------------------------------------------------- 1 | namespace Prism.Services.Dialogs 2 | { 3 | public class DialogResult : IDialogResult 4 | { 5 | public IDialogParameters Parameters { get; private set; } = new DialogParameters(); 6 | 7 | public ButtonResult Result { get; private set; } = ButtonResult.None; 8 | 9 | public DialogResult() { } 10 | 11 | public DialogResult(ButtonResult result) 12 | { 13 | Result = result; 14 | } 15 | 16 | public DialogResult(ButtonResult result, IDialogParameters parameters) 17 | { 18 | Result = result; 19 | Parameters = parameters; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Micser.TestCommon/TestOutputHelperTarget.cs: -------------------------------------------------------------------------------- 1 | using NLog; 2 | using NLog.Targets; 3 | using Xunit.Abstractions; 4 | 5 | namespace Micser.TestCommon 6 | { 7 | [Target("Test")] 8 | public class TestOutputHelperTarget : TargetWithLayout 9 | { 10 | private readonly ITestOutputHelper _testOutputHelper; 11 | 12 | public TestOutputHelperTarget(ITestOutputHelper testOutputHelper) 13 | { 14 | _testOutputHelper = testOutputHelper; 15 | } 16 | 17 | protected override void Write(LogEventInfo logEvent) 18 | { 19 | var message = Layout.Render(logEvent); 20 | _testOutputHelper.WriteLine(message); 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /src/Micser.App.Infrastructure/Widgets/IWidgetFactory.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Micser.App.Infrastructure.Widgets 4 | { 5 | /// 6 | /// Provides methods to instantiate widgets and widget view models. 7 | /// 8 | public interface IWidgetFactory 9 | { 10 | /// 11 | /// Creates a instance of the specified type. 12 | /// 13 | WidgetViewModel CreateViewModel(Type widgetVmType); 14 | 15 | /// 16 | /// Creates a corresponding widget view for the specified view model. 17 | /// 18 | Widget CreateWidget(WidgetViewModel viewModel); 19 | } 20 | } -------------------------------------------------------------------------------- /src/Micser.Common/Api/IApiServer.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | 3 | namespace Micser.Common.Api 4 | { 5 | /// 6 | /// An API endpoint that acts as the server when establishing a connection. 7 | /// 8 | public interface IApiServer 9 | { 10 | /// 11 | /// Gets the current server state. 12 | /// 13 | ServerState State { get; } 14 | 15 | /// 16 | /// Starts listening for connections. 17 | /// 18 | Task StartAsync(); 19 | 20 | /// 21 | /// Stops listening for connections. 22 | /// 23 | void Stop(); 24 | } 25 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Logging/Category.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | namespace Prism.Logging 5 | { 6 | /// 7 | /// Defines values for the categories used by . 8 | /// 9 | public enum Category 10 | { 11 | /// 12 | /// Debug category. 13 | /// 14 | Debug, 15 | 16 | /// 17 | /// Exception category. 18 | /// 19 | Exception, 20 | 21 | /// 22 | /// Informational category. 23 | /// 24 | Info, 25 | 26 | /// 27 | /// Warning category. 28 | /// 29 | Warn 30 | } 31 | } -------------------------------------------------------------------------------- /src/Micser.Common/Updates/GitHub/Release.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | 4 | namespace Micser.Common.Updates.GitHub 5 | { 6 | public class Release 7 | { 8 | [JsonProperty("assets")] 9 | public Asset[] Assets { get; set; } 10 | 11 | [JsonProperty("body")] 12 | public string Body { get; set; } 13 | 14 | [JsonProperty("html_url")] 15 | public string HtmlUrl { get; set; } 16 | 17 | [JsonProperty("id")] 18 | public long Id { get; set; } 19 | 20 | [JsonProperty("name")] 21 | public string Name { get; set; } 22 | 23 | [JsonProperty("published_at")] 24 | public DateTime PublishedAt { get; set; } 25 | } 26 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Modularity/ConfigurationStore.Desktop.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | using System.Configuration; 4 | 5 | namespace Prism.Modularity 6 | { 7 | /// 8 | /// Defines a store for the module metadata. 9 | /// 10 | public class ConfigurationStore : IConfigurationStore 11 | { 12 | /// 13 | /// Gets the module configuration data. 14 | /// 15 | /// A instance. 16 | public ModulesConfigurationSection RetrieveModuleConfigurationSection() 17 | { 18 | return ConfigurationManager.GetSection("modules") as ModulesConfigurationSection; 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Services/Dialogs/IDialogWindow.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel; 3 | using System.Windows; 4 | 5 | namespace Prism.Services.Dialogs 6 | { 7 | public interface IDialogWindow 8 | { 9 | object Content { get; set; } 10 | 11 | void Close(); 12 | 13 | Window Owner { get; set; } 14 | 15 | void Show(); 16 | 17 | bool? ShowDialog(); 18 | 19 | object DataContext { get; set; } 20 | 21 | event RoutedEventHandler Loaded; 22 | 23 | event EventHandler Closed; 24 | 25 | event CancelEventHandler Closing; 26 | 27 | IDialogResult Result { get; set; } 28 | 29 | Style Style { get; set; } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Micser.App.Prism/Logging/Priority.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | namespace Prism.Logging 5 | { 6 | /// 7 | /// Defines values for the priorities used by . 8 | /// 9 | public enum Priority 10 | { 11 | /// 12 | /// No priority specified. 13 | /// 14 | None = 0, 15 | 16 | /// 17 | /// High priority entry. 18 | /// 19 | High = 1, 20 | 21 | /// 22 | /// Medium priority entry. 23 | /// 24 | Medium, 25 | 26 | /// 27 | /// Low priority entry. 28 | /// 29 | Low 30 | } 31 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Interactivity/InteractionRequest/INotification.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Prism.Interactivity.InteractionRequest 4 | { 5 | /// 6 | /// Represents an interaction request used for notifications. 7 | /// 8 | [Obsolete("Please use the new IDialogService for an improved dialog experience.")] 9 | public interface INotification 10 | { 11 | /// 12 | /// Gets or sets the title to use for the notification. 13 | /// 14 | string Title { get; set; } 15 | 16 | /// 17 | /// Gets or sets the content of the notification. 18 | /// 19 | object Content { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Micser.App.Prism/Interactivity/InteractionRequest/Confirmation.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace Prism.Interactivity.InteractionRequest 10 | { 11 | /// 12 | /// Basic implementation of . 13 | /// 14 | [Obsolete("Please use the new IDialogService for an improved dialog experience.")] 15 | public class Confirmation : Notification, IConfirmation 16 | { 17 | /// 18 | /// Gets or sets a value indicating that the confirmation is confirmed. 19 | /// 20 | public bool Confirmed { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Micser.App.Prism/Ioc/IContainerRegistry.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Prism.Ioc 4 | { 5 | public interface IContainerRegistry 6 | { 7 | IContainerRegistry RegisterInstance(Type type, object instance); 8 | 9 | IContainerRegistry RegisterInstance(Type type, object instance, string name); 10 | 11 | IContainerRegistry RegisterSingleton(Type from, Type to); 12 | 13 | IContainerRegistry RegisterSingleton(Type from, Type to, string name); 14 | 15 | IContainerRegistry Register(Type from, Type to); 16 | 17 | IContainerRegistry Register(Type from, Type to, string name); 18 | 19 | bool IsRegistered(Type type); 20 | 21 | bool IsRegistered(Type type, string name); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Micser.App.Infrastructure/IAppModule.cs: -------------------------------------------------------------------------------- 1 | using Micser.Common; 2 | 3 | namespace Micser.App.Infrastructure 4 | { 5 | /// 6 | /// Base interface for all UI modules. 7 | /// 8 | public interface IAppModule 9 | { 10 | /// 11 | /// Initializes the module (after all modules have registered their types in the DI container). 12 | /// 13 | /// The fully registered container. 14 | void OnInitialized(IContainerProvider container); 15 | 16 | /// 17 | /// Lets the module register its types in the DI container. 18 | /// 19 | void RegisterTypes(IContainerProvider container); 20 | } 21 | } -------------------------------------------------------------------------------- /src/Micser.Common.Test/Extensions/RegexExtensionsTest.cs: -------------------------------------------------------------------------------- 1 | using Micser.Common.Extensions; 2 | using System.Text.RegularExpressions; 3 | using Xunit; 4 | 5 | namespace Micser.Common.Test.Extensions 6 | { 7 | public class RegexExtensionsTest 8 | { 9 | [Fact] 10 | public void ReplaceGroup() 11 | { 12 | var regex = new Regex(@"Assembly(File)?Version\s*\(\s*""(?[^""]+)""\s*\)"); 13 | var input = @" 14 | [assembly: AssemblyVersion(""1.0.0.0"")] 15 | [assembly: AssemblyFileVersion(""1.0.0.0"")] 16 | "; 17 | 18 | var output = regex.ReplaceGroup(input, "version", "1.2.3.4"); 19 | 20 | Assert.Contains("1.2.3.4", output); 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /src/Micser.Common/DataAccess/Entities/SettingValue.cs: -------------------------------------------------------------------------------- 1 | namespace Micser.Common.DataAccess.Entities 2 | { 3 | /// 4 | /// Contains a JSON-serialized setting value. 5 | /// 6 | public class SettingValue : Entity 7 | { 8 | /// 9 | /// Gets or sets the unique setting key name. 10 | /// 11 | public string Key { get; set; } 12 | 13 | /// 14 | /// Gets or sets the serialized value. 15 | /// 16 | public string ValueJson { get; set; } 17 | 18 | /// 19 | /// Gets or sets the assembly-qualified type name of the value object. 20 | /// 21 | public string ValueType { get; set; } 22 | } 23 | } -------------------------------------------------------------------------------- /src/Micser.Engine.Infrastructure/IEngineModule.cs: -------------------------------------------------------------------------------- 1 | using Micser.Common; 2 | 3 | namespace Micser.Engine.Infrastructure 4 | { 5 | /// 6 | /// Base interface for engine plugins. 7 | /// 8 | public interface IEngineModule 9 | { 10 | /// 11 | /// Initializes the module (after all modules have registered their types in the DI container). 12 | /// 13 | /// The fully registered container. 14 | void OnInitialized(IContainerProvider container); 15 | 16 | /// 17 | /// Lets the module register its types in the DI container. 18 | /// 19 | void RegisterTypes(IContainerProvider container); 20 | } 21 | } -------------------------------------------------------------------------------- /src/Micser.Plugins.Main/Widgets/GainViewModel.cs: -------------------------------------------------------------------------------- 1 | using Micser.App.Infrastructure.Widgets; 2 | using Micser.Common.Modules; 3 | using Micser.Plugins.Main.Modules; 4 | using System; 5 | 6 | namespace Micser.Plugins.Main.Widgets 7 | { 8 | public class GainViewModel : AudioWidgetViewModel 9 | { 10 | private float _gain; 11 | 12 | public GainViewModel() 13 | { 14 | AddInput("Input1"); 15 | AddOutput("Output1"); 16 | Volume = 1f; 17 | } 18 | 19 | [SaveState(0f)] 20 | public float Gain 21 | { 22 | get => _gain; 23 | set => SetProperty(ref _gain, value); 24 | } 25 | 26 | public override Type ModuleType => typeof(GainModule); 27 | } 28 | } -------------------------------------------------------------------------------- /src/Micser.App.Infrastructure/Settings/SettingsPanel.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | using System.Windows.Controls; 3 | 4 | namespace Micser.App.Infrastructure.Settings 5 | { 6 | /// 7 | /// An that hosts a list of settings. 8 | /// 9 | public class SettingsPanel : ItemsControl 10 | { 11 | /// 12 | protected override DependencyObject GetContainerForItemOverride() 13 | { 14 | return new SettingContainer(); 15 | } 16 | 17 | /// 18 | /// Always false. 19 | /// 20 | protected override bool IsItemItsOwnContainerOverride(object item) 21 | { 22 | return false; 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Regions/IViewsCollection.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | using System.Collections.Generic; 4 | using System.Collections.Specialized; 5 | 6 | namespace Prism.Regions 7 | { 8 | /// 9 | /// Defines a view of a collection. 10 | /// 11 | public interface IViewsCollection : IEnumerable, INotifyCollectionChanged 12 | { 13 | /// 14 | /// Determines whether the collection contains a specific value. 15 | /// 16 | /// The object to locate in the collection. 17 | /// if is found in the collection; otherwise, . 18 | bool Contains(object value); 19 | } 20 | } -------------------------------------------------------------------------------- /src/Micser.Common/Micser.Common.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1 5 | 8 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/Micser.App.Infrastructure/Widgets/ConnectorViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace Micser.App.Infrastructure.Widgets 2 | { 3 | /// 4 | /// Represents a widget connector (input/output). 5 | /// 6 | public class ConnectorViewModel : ViewModel 7 | { 8 | /// 9 | public ConnectorViewModel(string name, WidgetViewModel widget) 10 | { 11 | Name = name; 12 | Widget = widget; 13 | } 14 | 15 | /// 16 | /// Gets the connector's name. 17 | /// 18 | public string Name { get; } 19 | 20 | /// 21 | /// Gets the connector's parent widget. 22 | /// 23 | public WidgetViewModel Widget { get; } 24 | } 25 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Events/ThreadOption.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | namespace Prism.Events 6 | { 7 | /// 8 | /// Specifies on which thread a subscriber will be called. 9 | /// 10 | public enum ThreadOption 11 | { 12 | /// 13 | /// The call is done on the same thread on which the was published. 14 | /// 15 | PublisherThread, 16 | 17 | /// 18 | /// The call is done on the UI thread. 19 | /// 20 | UIThread, 21 | 22 | /// 23 | /// The call is done asynchronously on a background thread. 24 | /// 25 | BackgroundThread 26 | } 27 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Regions/IRegionAdapter.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | namespace Prism.Regions 5 | { 6 | /// 7 | /// Defines an interfaces to adapt an object and bind it to a new . 8 | /// 9 | public interface IRegionAdapter 10 | { 11 | /// 12 | /// Adapts an object and binds it to a new . 13 | /// 14 | /// The object to adapt. 15 | /// The name of the region to be created. 16 | /// The new instance of that the is bound to. 17 | IRegion Initialize(object regionTarget, string regionName); 18 | } 19 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Events/IEventAggregator.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | namespace Prism.Events 6 | { 7 | /// 8 | /// Defines an interface to get instances of an event type. 9 | /// 10 | public interface IEventAggregator 11 | { 12 | /// 13 | /// Gets an instance of an event type. 14 | /// 15 | /// The type of event to get. 16 | /// An instance of an event object of type . 17 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter")] 18 | TEventType GetEvent() where TEventType : EventBase, new(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Micser.App.Prism/IActiveAware.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Prism 4 | { 5 | /// 6 | /// Interface that defines if the object instance is active 7 | /// and notifies when the activity changes. 8 | /// 9 | public interface IActiveAware 10 | { 11 | /// 12 | /// Gets or sets a value indicating whether the object is active. 13 | /// 14 | /// if the object is active; otherwise . 15 | bool IsActive { get; set; } 16 | 17 | /// 18 | /// Notifies that the value for property has changed. 19 | /// 20 | event EventHandler IsActiveChanged; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Micser.App.Prism/Modularity/DuplicateModuleException.Desktop.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | using System; 4 | using System.Runtime.Serialization; 5 | 6 | namespace Prism.Modularity 7 | { 8 | [Serializable] 9 | public partial class DuplicateModuleException 10 | { 11 | /// 12 | /// Initializes a new instance of the class 13 | /// with the serialization data. 14 | /// 15 | /// Holds the serialized object data about the exception being thrown. 16 | /// Contains contextual information about the source or destination. 17 | protected DuplicateModuleException(SerializationInfo info, StreamingContext context) : base(info, context) { } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Micser.Common/Api/IRequestProcessor.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | 3 | namespace Micser.Common.Api 4 | { 5 | /// 6 | /// Classes implementing this interface can receive incoming API requests for processing. 7 | /// 8 | public interface IRequestProcessor 9 | { 10 | /// 11 | /// Processes the incoming message and returns a response to send back. 12 | /// 13 | /// The action name that was sent in . 14 | /// The deserialized message content. 15 | /// A that will be sent back. 16 | Task ProcessAsync(string action, object content); 17 | } 18 | } -------------------------------------------------------------------------------- /src/Micser.Engine.Infrastructure/Audio/SampleProcessor.cs: -------------------------------------------------------------------------------- 1 | using CSCore; 2 | 3 | namespace Micser.Engine.Infrastructure.Audio 4 | { 5 | /// 6 | /// Abstract base class implementing the interface. 7 | /// 8 | public abstract class SampleProcessor : ISampleProcessor 9 | { 10 | /// 11 | protected SampleProcessor() 12 | { 13 | IsEnabled = true; 14 | Priority = 0; 15 | } 16 | 17 | /// 18 | public bool IsEnabled { get; set; } 19 | 20 | /// 21 | public int Priority { get; set; } 22 | 23 | /// 24 | public abstract void Process(WaveFormat waveFormat, float[] channelSamples); 25 | } 26 | } -------------------------------------------------------------------------------- /src/Micser.App.Infrastructure/Converter/BooleanToVisibilityConverter.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | namespace Micser.App.Infrastructure.Converter 4 | { 5 | /// 6 | /// A value converter that converts a value to a value. 7 | /// 8 | public class BooleanToVisibilityConverter : BooleanConverter 9 | { 10 | /// 11 | /// Creates an instance of the class. 12 | /// The default values are: true -> , false -> . 13 | /// 14 | public BooleanToVisibilityConverter() 15 | : base(Visibility.Visible, Visibility.Collapsed) 16 | { 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Interactivity/DefaultPopupWindows/DefaultWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Data; 9 | using System.Windows.Documents; 10 | using System.Windows.Input; 11 | using System.Windows.Media; 12 | using System.Windows.Media.Imaging; 13 | using System.Windows.Shapes; 14 | 15 | namespace Prism.Interactivity.DefaultPopupWindows 16 | { 17 | /// 18 | /// Interaction logic for DefaultWindow.xaml 19 | /// 20 | public partial class DefaultWindow : Window 21 | { 22 | public DefaultWindow() 23 | { 24 | InitializeComponent(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Micser.App.Infrastructure/Widgets/WidgetToolbox.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | using System.Windows.Controls; 3 | 4 | namespace Micser.App.Infrastructure.Widgets 5 | { 6 | /// 7 | /// An to display all available widgets. 8 | /// 9 | public class WidgetToolbox : ItemsControl 10 | { 11 | /// 12 | /// Creates a . 13 | /// 14 | protected override DependencyObject GetContainerForItemOverride() 15 | { 16 | return new WidgetToolboxItem(); 17 | } 18 | 19 | /// 20 | protected override bool IsItemItsOwnContainerOverride(object item) 21 | { 22 | return item is WidgetToolboxItem; 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Modularity/CyclicDependencyFoundException.Desktop.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | using System; 4 | using System.Runtime.Serialization; 5 | 6 | namespace Prism.Modularity 7 | { 8 | [Serializable] 9 | public partial class CyclicDependencyFoundException 10 | { 11 | /// 12 | /// Initializes a new instance of the class 13 | /// with the serialization data. 14 | /// 15 | /// Holds the serialized object data about the exception being thrown. 16 | /// Contains contextual information about the source or destination. 17 | protected CyclicDependencyFoundException(SerializationInfo info, StreamingContext context) : base(info, context) { } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Micser.App/ViewModels/MainStatusBarViewModel.cs: -------------------------------------------------------------------------------- 1 | using Micser.App.Infrastructure; 2 | using Prism.Events; 3 | 4 | namespace Micser.App.ViewModels 5 | { 6 | public class MainStatusBarViewModel : ViewModelNavigationAware 7 | { 8 | private string _statusText; 9 | 10 | public MainStatusBarViewModel(IEventAggregator eventAggregator) 11 | { 12 | var statusEvent = eventAggregator.GetEvent(); 13 | statusEvent.Subscribe(OnStatusChange); 14 | } 15 | 16 | public string StatusText 17 | { 18 | get => _statusText; 19 | set => SetProperty(ref _statusText, value); 20 | } 21 | 22 | private void OnStatusChange(string text) 23 | { 24 | StatusText = text; 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /src/Micser.Engine/ServiceBaseLifetimeHostExtensions.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | using Microsoft.Extensions.Hosting; 3 | using System.Threading; 4 | using System.Threading.Tasks; 5 | 6 | namespace Micser.Engine 7 | { 8 | public static class ServiceBaseLifetimeHostExtensions 9 | { 10 | public static Task RunAsServiceAsync(this IHostBuilder hostBuilder, CancellationToken cancellationToken = default) 11 | { 12 | return hostBuilder.UseServiceBaseLifetime().Build().RunAsync(cancellationToken); 13 | } 14 | 15 | public static IHostBuilder UseServiceBaseLifetime(this IHostBuilder hostBuilder) 16 | { 17 | return hostBuilder.ConfigureServices((hostContext, services) => services.AddSingleton()); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Modularity/ModuleInitializeException.Desktop.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | using System; 4 | using System.Runtime.Serialization; 5 | 6 | namespace Prism.Modularity 7 | { 8 | [Serializable] 9 | public partial class ModuleInitializeException 10 | { 11 | /// 12 | /// Initializes a new instance with serialized data. 13 | /// 14 | /// The that holds the serialized object data about the exception being thrown. 15 | /// The that contains contextual information about the source or destination. 16 | protected ModuleInitializeException(SerializationInfo info, StreamingContext context) 17 | : base(info, context) 18 | { 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Micser.App.Prism/Logging/EmptyLogger.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | namespace Prism.Logging 5 | { 6 | /// 7 | /// Implementation of that does nothing. This 8 | /// implementation is useful when the application does not need logging 9 | /// but there are infrastructure pieces that assume there is a logger. 10 | /// 11 | public class EmptyLogger : ILoggerFacade 12 | { 13 | /// 14 | /// This method does nothing. 15 | /// 16 | /// Message body to log. 17 | /// Category of the entry. 18 | /// The priority of the entry. 19 | public void Log(string message, Category category, Priority priority) 20 | { 21 | 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Modularity/ModuleTypeLoadingException.Desktop.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | using System; 4 | using System.Runtime.Serialization; 5 | 6 | namespace Prism.Modularity 7 | { 8 | [Serializable] 9 | public partial class ModuleTypeLoadingException 10 | { 11 | /// 12 | /// Initializes a new instance with serialized data. 13 | /// 14 | /// The that holds the serialized object data about the exception being thrown. 15 | /// The that contains contextual information about the source or destination. 16 | protected ModuleTypeLoadingException(SerializationInfo info, StreamingContext context) 17 | : base(info, context) 18 | { 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Micser.Plugins.Main/Api/SpectrumRequestProcessor.cs: -------------------------------------------------------------------------------- 1 | using Micser.Common.Api; 2 | using Prism.Events; 3 | 4 | namespace Micser.Plugins.Main.Api 5 | { 6 | [RequestProcessorName("spectrum")] 7 | public class SpectrumRequestProcessor : RequestProcessor 8 | { 9 | private readonly IEventAggregator _eventAggregator; 10 | 11 | public SpectrumRequestProcessor(IEventAggregator eventAggregator) 12 | { 13 | AddAction(null, data => Process(data)); 14 | _eventAggregator = eventAggregator; 15 | } 16 | 17 | private object Process(SpectrumData data) 18 | { 19 | if (data == null) 20 | { 21 | return false; 22 | } 23 | 24 | _eventAggregator.GetEvent().Publish(data); 25 | return true; 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Modularity/ModuleTypeLoaderNotFoundException.Desktop.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | using System; 4 | using System.Runtime.Serialization; 5 | 6 | namespace Prism.Modularity 7 | { 8 | [Serializable] 9 | public partial class ModuleTypeLoaderNotFoundException 10 | { 11 | /// 12 | /// Initializes a new instance with serialized data. 13 | /// 14 | /// The that holds the serialized object data about the exception being thrown. 15 | /// The that contains contextual information about the source or destination. 16 | protected ModuleTypeLoaderNotFoundException(SerializationInfo info, StreamingContext context) 17 | : base(info, context) 18 | { 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Micser.App/Views/StartupView.xaml: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/Micser.Plugins.Main/MainEngineModule.cs: -------------------------------------------------------------------------------- 1 | using Micser.Common; 2 | using Micser.Engine.Infrastructure; 3 | using Micser.Engine.Infrastructure.Extensions; 4 | using Micser.Plugins.Main.Modules; 5 | 6 | namespace Micser.Plugins.Main 7 | { 8 | public class MainEngineModule : IEngineModule 9 | { 10 | public void OnInitialized(IContainerProvider container) 11 | { 12 | } 13 | 14 | public void RegisterTypes(IContainerProvider container) 15 | { 16 | container.RegisterAudioModules( 17 | typeof(DeviceInputModule), 18 | typeof(LoopbackDeviceInputModule), 19 | typeof(DeviceOutputModule), 20 | typeof(CompressorModule), 21 | typeof(GainModule), 22 | typeof(SpectrumModule), 23 | typeof(PitchModule)); 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Interactivity/InteractionRequest/Notification.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace Prism.Interactivity.InteractionRequest 10 | { 11 | /// 12 | /// Basic implementation of . 13 | /// 14 | [Obsolete("Please use the new IDialogService for an improved dialog experience.")] 15 | public class Notification : INotification 16 | { 17 | /// 18 | /// Gets or sets the title to use for the notification. 19 | /// 20 | public string Title { get; set; } 21 | 22 | /// 23 | /// Gets or sets the content of the notification. 24 | /// 25 | public object Content { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Micser.App/Views/MainStatusBarView.xaml: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/Micser.App.Prism/Regions/Behaviors/IHostAwareRegionBehavior.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | using System.Windows; 4 | 5 | namespace Prism.Regions.Behaviors 6 | { 7 | /// 8 | /// Defines a that not allows extensible behaviors on regions which also interact 9 | /// with the target element that the is attached to. 10 | /// 11 | public interface IHostAwareRegionBehavior : IRegionBehavior 12 | { 13 | /// 14 | /// Gets or sets the that the is attached to. 15 | /// 16 | /// A that the is attached to. 17 | /// This is usually a that is part of the tree. 18 | DependencyObject HostControl { get; set; } 19 | } 20 | } -------------------------------------------------------------------------------- /src/Micser.Common/Api/ConnectionState.cs: -------------------------------------------------------------------------------- 1 | namespace Micser.Common.Api 2 | { 3 | /// 4 | /// Defines connection states for an . 5 | /// 6 | public enum ConnectionState 7 | { 8 | /// 9 | /// The end point has no active connection and is not currently connecting. 10 | /// 11 | Disconnected, 12 | 13 | /// 14 | /// The end point has lost a connection and is currently cleaning up connection resources. 15 | /// 16 | Disconnecting, 17 | 18 | /// 19 | /// The end point is connected and ready to send or receive messages. 20 | /// 21 | Connected, 22 | 23 | /// 24 | /// The end point is currently connecting. 25 | /// 26 | Connecting 27 | } 28 | } -------------------------------------------------------------------------------- /src/Micser.Common/Modules/SaveStateAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Micser.Common.Modules 4 | { 5 | /// 6 | /// Declares a property to be serialized into the module's state. 7 | /// 8 | [AttributeUsage(AttributeTargets.Property)] 9 | public class SaveStateAttribute : Attribute 10 | { 11 | /// 12 | /// Creates an instance of the class with the specified default value. 13 | /// 14 | /// The value to use if the property is not set. 15 | public SaveStateAttribute(object defaultValue) 16 | { 17 | DefaultValue = defaultValue; 18 | } 19 | 20 | /// 21 | /// Gets the property's default value. 22 | /// 23 | public object DefaultValue { get; } 24 | } 25 | } -------------------------------------------------------------------------------- /src/Micser.App.Infrastructure/TypeTemplateSelector.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | using System.Windows.Controls; 3 | 4 | namespace Micser.App.Infrastructure 5 | { 6 | /// 7 | /// Generic template selector that selects a template using the object's type as a template resource key. 8 | /// 9 | public class TypeTemplateSelector : DataTemplateSelector 10 | { 11 | /// 12 | public override DataTemplate SelectTemplate(object item, DependencyObject container) 13 | { 14 | if (item != null && container is FrameworkElement element) 15 | { 16 | if (element.TryFindResource(item.GetType()) is DataTemplate template) 17 | { 18 | return template; 19 | } 20 | } 21 | 22 | return base.SelectTemplate(item, container); 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Interactivity/InteractionRequest/IInteractionRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | using System; 4 | 5 | namespace Prism.Interactivity.InteractionRequest 6 | { 7 | /// 8 | /// Represents a request from user interaction. 9 | /// 10 | /// 11 | /// View models can expose interaction request objects through properties and raise them when user interaction 12 | /// is required so views associated with the view models can materialize the user interaction using an appropriate 13 | /// mechanism. 14 | /// 15 | [Obsolete("Please use the new IDialogService for an improved dialog experience.")] 16 | public interface IInteractionRequest 17 | { 18 | /// 19 | /// Fired when the interaction is needed. 20 | /// 21 | event EventHandler Raised; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Micser.Plugins.Main/Audio/SpectrumFftProvider.cs: -------------------------------------------------------------------------------- 1 | using CSCore.DSP; 2 | 3 | namespace Micser.Plugins.Main.Audio 4 | { 5 | public class SpectrumFftProvider : FftProvider 6 | { 7 | public SpectrumFftProvider(int sampleRate, int channels, FftSize fftSize) 8 | : base(channels, fftSize) 9 | { 10 | Channels = channels; 11 | SampleRate = sampleRate; 12 | } 13 | 14 | public int Channels { get; } 15 | public int SampleRate { get; } 16 | 17 | public int GetFftBandIndex(float frequency) 18 | { 19 | var fftSize = (int)FftSize; 20 | return (int)(frequency / SampleRate * fftSize); 21 | } 22 | 23 | public float GetFftFrequency(int index) 24 | { 25 | var fftSize = (int)FftSize; 26 | return index * SampleRate / (float)fftSize; 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /src/Micser.App.Infrastructure/ToolBars/IToolBarRegistry.cs: -------------------------------------------------------------------------------- 1 | using Micser.Common; 2 | 3 | namespace Micser.App.Infrastructure.ToolBars 4 | { 5 | /// 6 | /// Registry containing all tool bar items. 7 | /// 8 | public interface IToolBarRegistry : IItemRegistry 9 | { 10 | /// 11 | /// Adds a tool bar item to the registry. 12 | /// 13 | /// The name of the tool bar. 14 | /// The tool bar item. 15 | void AddItem(string toolBarName, ToolBarItem item); 16 | 17 | /// 18 | /// Gets a containing it's items. 19 | /// 20 | /// The name of the tool bar. 21 | ToolBarDescription GetToolBar(string toolBarName); 22 | } 23 | } -------------------------------------------------------------------------------- /src/Micser.sln.DotSettings: -------------------------------------------------------------------------------- 1 | 2 | C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe 3 | 4294967293 4 | 99e23c7a-3483-4963-bc40-de7062a45461;6824c944-0750-41d6-898e-f05cdf0fb90a 5 | True -------------------------------------------------------------------------------- /src/Micser.Common/IContainerProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace Micser.Common 5 | { 6 | public interface IContainerProvider : IDisposable 7 | { 8 | void RegisterFactory(Type from, Func factory, string name = null); 9 | 10 | void RegisterInstance(Type from, object instance, string name = null); 11 | 12 | void RegisterInstance(T instance, string name = null); 13 | 14 | void RegisterSingleton(Type from, Type to, string name = null); 15 | 16 | void RegisterType(Type from, Type to, string name = null); 17 | 18 | void RegisterType(Type type, string name = null); 19 | 20 | object Resolve(Type type, string name = null); 21 | 22 | object Resolve(Type type, string name, params DependencyOverride[] dependencyOverrides); 23 | 24 | IEnumerable ResolveAll(Type type); 25 | } 26 | } -------------------------------------------------------------------------------- /src/Micser.Common/ItemRegistry.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | 4 | namespace Micser.Common 5 | { 6 | /// /> 7 | public class ItemRegistry : IItemRegistry 8 | { 9 | private readonly IList _items; 10 | 11 | /// 12 | public ItemRegistry() 13 | { 14 | _items = new List(); 15 | } 16 | 17 | /// 18 | /// Gets all items currently registered in this registry. 19 | /// 20 | public IEnumerable Items => _items.AsEnumerable(); 21 | 22 | /// 23 | /// Adds an item to this registry. 24 | /// 25 | public virtual void Add(T item) 26 | { 27 | if (item != null) 28 | { 29 | _items.Add(item); 30 | } 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /src/Micser.Common/Updates/UpdateManifest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Micser.Common.Updates 4 | { 5 | /// 6 | /// Contains information about an application update package. 7 | /// 8 | public class UpdateManifest 9 | { 10 | /// 11 | /// Gets or sets the release date. 12 | /// 13 | public DateTime Date { get; set; } 14 | 15 | /// 16 | /// Gets or sets the description (i.e. change log). 17 | /// 18 | public string Description { get; set; } 19 | 20 | /// 21 | /// Gets or sets the file name of the update package. 22 | /// 23 | public string FileName { get; set; } 24 | 25 | /// 26 | /// Gets or sets the version string. 27 | /// 28 | public string Version { get; set; } 29 | } 30 | } -------------------------------------------------------------------------------- /src/Micser.App.Infrastructure/ProxyModule.cs: -------------------------------------------------------------------------------- 1 | using Prism.Ioc; 2 | using Prism.Modularity; 3 | using Prism.Unity; 4 | using Unity; 5 | 6 | namespace Micser.App.Infrastructure 7 | { 8 | public class ProxyModule : IModule 9 | where TAppModule : IAppModule, new() 10 | { 11 | public ProxyModule() 12 | { 13 | AppModule = new TAppModule(); 14 | } 15 | 16 | public TAppModule AppModule { get; } 17 | 18 | public void OnInitialized(IContainerProvider containerProvider) 19 | { 20 | AppModule.OnInitialized(containerProvider.Resolve()); 21 | } 22 | 23 | public void RegisterTypes(IContainerRegistry containerRegistry) 24 | { 25 | var container = containerRegistry.GetContainer(); 26 | AppModule.RegisterTypes(container.Resolve()); 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /src/Micser.Common/Modules/ModuleDto.cs: -------------------------------------------------------------------------------- 1 | namespace Micser.Common.Modules 2 | { 3 | /// 4 | /// DTO representing a module. 5 | /// 6 | public class ModuleDto : IIdentifiable 7 | { 8 | /// 9 | /// Gets or sets the ID of this module. 10 | /// 11 | public long Id { get; set; } 12 | 13 | /// 14 | /// Gets or sets the assembly-qualified type name of the module's class. 15 | /// 16 | public string ModuleType { get; set; } 17 | 18 | /// 19 | /// Gets or sets the module's current state. 20 | /// 21 | public ModuleState State { get; set; } 22 | 23 | /// 24 | /// Gets or sets the assembly-qualified type name of the module's UI/widget class. 25 | /// 26 | public string WidgetType { get; set; } 27 | } 28 | } -------------------------------------------------------------------------------- /src/Micser.Plugins.Main/Widgets/SpectrumWidget.xaml: -------------------------------------------------------------------------------- 1 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/Micser.App.Infrastructure/Converter/RelativeCenterPlacementConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | 4 | namespace Micser.App.Infrastructure.Converter 5 | { 6 | /// 7 | /// Converts a value using the formula y = -x/2. 8 | /// 9 | public class RelativeCenterPlacementConverter : ConverterExtension 10 | { 11 | /// 12 | public override object Convert(object value, Type targetType, object parameter, CultureInfo culture) 13 | { 14 | if (value is double d) 15 | { 16 | return -(d / 2d); 17 | } 18 | 19 | return value; 20 | } 21 | 22 | /// 23 | public override object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 24 | { 25 | throw new NotImplementedException(); 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Modularity/ModuleNotFoundException.Desktop.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | using System; 4 | using System.Runtime.Serialization; 5 | 6 | namespace Prism.Modularity 7 | { 8 | /// 9 | /// Exception thrown when a requested is not found. 10 | /// 11 | [Serializable] 12 | public partial class ModuleNotFoundException 13 | { 14 | /// 15 | /// Initializes a new instance of the class 16 | /// with the serialization data. 17 | /// 18 | /// Holds the serialized object data about the exception being thrown. 19 | /// Contains contextual information about the source or destination. 20 | protected ModuleNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context) 21 | { 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Micser.Common/Extensions/ApiClientExtensions.cs: -------------------------------------------------------------------------------- 1 | using Micser.Common.Api; 2 | using System.Threading; 3 | using System.Threading.Tasks; 4 | 5 | namespace Micser.Common.Extensions 6 | { 7 | public static class ApiClientExtensions 8 | { 9 | public static Task ConnectAsync(this IApiClient apiClient) 10 | { 11 | return apiClient.ConnectAsync(CancellationToken.None); 12 | } 13 | 14 | public static Task SendMessageAsync(this IApiClient apiClient, ApiRequest request) 15 | { 16 | return apiClient.SendMessageAsync(request, CancellationToken.None); 17 | } 18 | 19 | public static Task SendMessageAsync(this IApiClient apiClient, string resourceName, string action = null, object content = null) 20 | { 21 | return apiClient.SendMessageAsync(new ApiRequest(resourceName, action, content), CancellationToken.None); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /src/Micser.Engine.Infrastructure/Extensions/ContainerProviderExtensions.cs: -------------------------------------------------------------------------------- 1 | using Micser.Common; 2 | using Micser.Common.Extensions; 3 | using Micser.Engine.Infrastructure.Audio; 4 | using System; 5 | 6 | namespace Micser.Engine.Infrastructure.Extensions 7 | { 8 | /// 9 | /// Contains helper extension methods for the class. 10 | /// 11 | public static class ContainerProviderExtensions 12 | { 13 | /// 14 | /// Registers all specified types as available audio modules. 15 | /// 16 | public static void RegisterAudioModules(this IContainerProvider container, params Type[] moduleTypes) 17 | { 18 | foreach (var moduleType in moduleTypes) 19 | { 20 | container.RegisterType(moduleType); 21 | } 22 | 23 | container.RegisterTypes(moduleTypes); 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /src/Micser.Plugins.Main/Audio/GainSampleProcessor.cs: -------------------------------------------------------------------------------- 1 | using CSCore; 2 | using Micser.Common.Audio; 3 | using Micser.Engine.Infrastructure.Audio; 4 | using Micser.Plugins.Main.Modules; 5 | using System; 6 | 7 | namespace Micser.Plugins.Main.Audio 8 | { 9 | public class GainSampleProcessor : SampleProcessor 10 | { 11 | private readonly GainModule _module; 12 | 13 | public GainSampleProcessor(GainModule module) 14 | { 15 | _module = module; 16 | } 17 | 18 | public override void Process(WaveFormat waveFormat, float[] channelSamples) 19 | { 20 | var gain = _module.Gain; 21 | 22 | for (int c = 0; c < waveFormat.Channels; c++) 23 | { 24 | var dbValue = AudioHelper.LinearToDb(Math.Abs(channelSamples[c])); 25 | channelSamples[c] = Math.Sign(channelSamples[c]) * AudioHelper.DbToLinear(dbValue + gain); 26 | } 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Regions/Behaviors/RegionCreationException.Desktop.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | using System; 4 | using System.Runtime.Serialization; 5 | 6 | namespace Prism.Regions.Behaviors 7 | { 8 | /// 9 | /// 10 | /// 11 | [Serializable] 12 | public partial class RegionCreationException 13 | { 14 | /// 15 | /// Initializes a new instance of the class with serialized data. 16 | /// 17 | /// The that holds the serialized object data about the exception being thrown. 18 | /// The that contains contextual information about the source or destination. 19 | protected RegionCreationException(SerializationInfo info, StreamingContext context) 20 | : base(info, context) 21 | { 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Micser.Common/Api/ServerState.cs: -------------------------------------------------------------------------------- 1 | namespace Micser.Common.Api 2 | { 3 | /// 4 | /// Defines state the API server can be in. 5 | /// 6 | public enum ServerState 7 | { 8 | /// 9 | /// Stopped. The server is not listening for connections and cannot be connected to. 10 | /// 11 | Stopped, 12 | 13 | /// 14 | /// The method has been called on the server but not completed yet. 15 | /// 16 | Stopping, 17 | 18 | /// 19 | /// The server is started. Use the property to get the current connection state. 20 | /// 21 | Started, 22 | 23 | /// 24 | /// The method has been called on the server but not completed yet. 25 | /// 26 | Starting 27 | } 28 | } -------------------------------------------------------------------------------- /src/Micser.App.Infrastructure.Test/IniFileTest.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Xunit; 3 | 4 | namespace Micser.App.Infrastructure.Test 5 | { 6 | public class IniFileTest 7 | { 8 | [Fact] 9 | public void LoadInvalidFileThrowsException() 10 | { 11 | Assert.Throws(() => new IniFile("asdf.ini")); 12 | } 13 | 14 | [Fact] 15 | public void LoadValidFile() 16 | { 17 | var iniFile = new IniFile("Test.ini"); 18 | 19 | Assert.Equal("1", iniFile.GetValue("section1", "key1")); 20 | Assert.Equal("Value2", iniFile.GetValue("Section1", "Key2")); 21 | Assert.Equal("Text value", iniFile.GetValue("Section1", "Key3")); 22 | 23 | Assert.Equal("11", iniFile.GetValue("Section2", "Key1")); 24 | Assert.Null(iniFile.GetValue("Section2", "Key2")); 25 | Assert.Equal("Null", iniFile.GetValue("Section2", "Key3")); 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Ioc/IContainerProviderExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Prism.Ioc 4 | { 5 | public static class IContainerProviderExtensions 6 | { 7 | public static T Resolve(this IContainerProvider provider) 8 | { 9 | return (T)provider.Resolve(typeof(T)); 10 | } 11 | 12 | public static T Resolve(this IContainerProvider provider, params (Type Type, object Instance)[] parameters) 13 | { 14 | return (T)provider.Resolve(typeof(T), parameters); 15 | } 16 | 17 | public static T Resolve(this IContainerProvider provider, string name, params (Type Type, object Instance)[] parameters) 18 | { 19 | return (T)provider.Resolve(typeof(T), name, parameters); 20 | } 21 | 22 | public static T Resolve(this IContainerProvider provider, string name) 23 | { 24 | return (T)provider.Resolve(typeof(T), name); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Micser.Common/Api/ApiResponse.cs: -------------------------------------------------------------------------------- 1 | namespace Micser.Common.Api 2 | { 3 | /// 4 | /// A message that represents the response from an API call. 5 | /// 6 | public class ApiResponse : ApiMessage 7 | { 8 | /// 9 | public ApiResponse() 10 | { 11 | } 12 | 13 | /// 14 | public ApiResponse(bool isSuccess, object content = null, string message = null) 15 | : base(content) 16 | { 17 | IsSuccess = isSuccess; 18 | Content = content; 19 | Message = message; 20 | } 21 | 22 | /// 23 | /// Indicates whether the call was successful. 24 | /// 25 | public bool IsSuccess { get; set; } 26 | 27 | /// 28 | /// An optional message that describes the result of the call. 29 | /// 30 | public string Message { get; set; } 31 | } 32 | } -------------------------------------------------------------------------------- /src/Micser.Common/Api/IApiClient.cs: -------------------------------------------------------------------------------- 1 | using System.Threading; 2 | using System.Threading.Tasks; 3 | 4 | namespace Micser.Common.Api 5 | { 6 | public interface IApiClient 7 | { 8 | /// 9 | /// Gets the current connection state. 10 | /// 11 | ConnectionState State { get; } 12 | 13 | /// 14 | /// Tries to connect to the remote end point. 15 | /// 16 | Task ConnectAsync(CancellationToken token); 17 | 18 | /// 19 | /// Disconnects the client connection. 20 | /// 21 | void Disconnect(); 22 | 23 | /// 24 | /// Sends a message to the connected endpoint. 25 | /// 26 | /// The request message. 27 | /// The cancellation token. 28 | Task SendMessageAsync(ApiRequest request, CancellationToken token); 29 | } 30 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Regions/UpdateRegionsException.Desktop.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | using System; 4 | using System.Runtime.Serialization; 5 | 6 | namespace Prism.Regions 7 | { 8 | /// 9 | /// Represents errors that occured during the regions' update. 10 | /// 11 | [Serializable] 12 | public partial class UpdateRegionsException 13 | { 14 | /// 15 | /// Initializes a new instance of the class with serialized data. 16 | /// 17 | /// The that holds the serialized object data about the exception being thrown. 18 | /// The that contains contextual information about the source or destination. 19 | protected UpdateRegionsException(SerializationInfo info, StreamingContext context) 20 | : base(info, context) 21 | { 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Micser.App/Views/ToolBarView.xaml: -------------------------------------------------------------------------------- 1 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/Micser.App.Infrastructure/Widgets/WidgetDescription.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Micser.App.Infrastructure.Widgets 4 | { 5 | /// 6 | /// Describes a widget to be added to the widget registry. 7 | /// 8 | public class WidgetDescription 9 | { 10 | /// 11 | /// Gets or sets the description/help text that is displayed in the widget tool box. 12 | /// 13 | public object Description { get; set; } 14 | 15 | /// 16 | /// Gets or sets the default name of the widget. 17 | /// 18 | public object Name { get; set; } 19 | 20 | /// 21 | /// Gets or sets the type of the widget's view model. 22 | /// 23 | public Type ViewModelType { get; set; } 24 | 25 | /// 26 | /// Gets or sets the type of the widget's view. 27 | /// 28 | public Type ViewType { get; set; } 29 | } 30 | } -------------------------------------------------------------------------------- /src/Micser.Plugins.Main/Widgets/PitchViewModel.cs: -------------------------------------------------------------------------------- 1 | using Micser.App.Infrastructure.Widgets; 2 | using Micser.Common.Modules; 3 | using Micser.Plugins.Main.Modules; 4 | using System; 5 | 6 | namespace Micser.Plugins.Main.Widgets 7 | { 8 | public class PitchViewModel : AudioWidgetViewModel 9 | { 10 | private float _pitch; 11 | private int _quality; 12 | 13 | public PitchViewModel() 14 | { 15 | AddInput("Input1"); 16 | AddOutput("Output1"); 17 | } 18 | 19 | public override Type ModuleType => typeof(PitchModule); 20 | 21 | [SaveState(PitchModule.Defaults.Pitch)] 22 | public float Pitch 23 | { 24 | get => _pitch; 25 | set => SetProperty(ref _pitch, value); 26 | } 27 | 28 | [SaveState(PitchModule.Defaults.Quality)] 29 | public int Quality 30 | { 31 | get => _quality; 32 | set => SetProperty(ref _quality, value); 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Events/DataEventArgs.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | using System; 5 | 6 | namespace Prism.Events 7 | { 8 | /// 9 | /// Generic arguments class to pass to event handlers that need to receive data. 10 | /// 11 | /// The type of data to pass. 12 | public class DataEventArgs : EventArgs 13 | { 14 | private readonly TData _value; 15 | 16 | /// 17 | /// Initializes the DataEventArgs class. 18 | /// 19 | /// Information related to the event. 20 | public DataEventArgs(TData value) 21 | { 22 | _value = value; 23 | } 24 | 25 | /// 26 | /// Gets the information related to the event. 27 | /// 28 | /// Information related to the event. 29 | public TData Value 30 | { 31 | get { return _value; } 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /src/Micser.Common/Api/MessagePackMessageSerializer.cs: -------------------------------------------------------------------------------- 1 | using MessagePack; 2 | using MessagePack.Formatters; 3 | using MessagePack.Resolvers; 4 | using System.IO; 5 | using System.Threading.Tasks; 6 | 7 | namespace Micser.Common.Api 8 | { 9 | public class MessagePackMessageSerializer : IMessageSerializer 10 | { 11 | static MessagePackMessageSerializer() 12 | { 13 | CompositeResolver.RegisterAndSetAsDefault( 14 | new IMessagePackFormatter[] { TypelessFormatter.Instance }, 15 | new[] { ContractlessStandardResolver.Instance }); 16 | } 17 | 18 | public async Task DeserializeAsync(Stream stream) 19 | { 20 | return await MessagePackSerializer.DeserializeAsync(stream).ConfigureAwait(false); 21 | } 22 | 23 | public async Task SerializeAsync(Stream stream, T value) 24 | { 25 | await MessagePackSerializer.SerializeAsync(stream, value).ConfigureAwait(false); 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /src/Micser.App.Infrastructure/Converter/ConverterExtension.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using System.Windows.Data; 4 | using System.Windows.Markup; 5 | 6 | namespace Micser.App.Infrastructure.Converter 7 | { 8 | /// 9 | /// Base class for converters. This is a markup extension that allows inline declaration of the converter. 10 | /// 11 | public abstract class ConverterExtension : MarkupExtension, IValueConverter 12 | { 13 | /// 14 | public abstract object Convert(object value, Type targetType, object parameter, CultureInfo culture); 15 | 16 | /// 17 | public abstract object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture); 18 | 19 | /// 20 | /// Returns this instance. 21 | /// 22 | public override object ProvideValue(IServiceProvider serviceProvider) 23 | { 24 | return this; 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Modularity/ModulesConfigurationSection.Desktop.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | using System.Configuration; 4 | 5 | namespace Prism.Modularity 6 | { 7 | /// 8 | /// A for module configuration. 9 | /// 10 | public class ModulesConfigurationSection : ConfigurationSection 11 | { 12 | /// 13 | /// Gets or sets the collection of modules configuration. 14 | /// 15 | /// A of . 16 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] 17 | [ConfigurationProperty("", IsDefaultCollection = true, IsKey = false)] 18 | public ModuleConfigurationElementCollection Modules 19 | { 20 | get { return (ModuleConfigurationElementCollection)base[""]; } 21 | set { base[""] = value; } 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Regions/SingleActiveRegion.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | using System.Linq; 4 | 5 | namespace Prism.Regions 6 | { 7 | /// 8 | /// Region that allows a maximum of one active view at a time. 9 | /// 10 | public class SingleActiveRegion : Region 11 | { 12 | /// 13 | /// Marks the specified view as active. 14 | /// 15 | /// The view to activate. 16 | /// If there is an active view before calling this method, 17 | /// that view will be deactivated automatically. 18 | public override void Activate(object view) 19 | { 20 | object currentActiveView = ActiveViews.FirstOrDefault(); 21 | 22 | if (currentActiveView != null && currentActiveView != view && this.Views.Contains(currentActiveView)) 23 | { 24 | base.Deactivate(currentActiveView); 25 | } 26 | base.Activate(view); 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Logging/TraceLogger.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | using System.Diagnostics; 4 | 5 | namespace Prism.Logging 6 | { 7 | /// 8 | /// Implementation of that logs to .NET class. 9 | /// 10 | public class TraceLogger : ILoggerFacade 11 | { 12 | /// 13 | /// Write a new log entry with the specified category and priority. 14 | /// 15 | /// Message body to log. 16 | /// Category of the entry. 17 | /// The priority of the entry. 18 | public void Log(string message, Category category, Priority priority) 19 | { 20 | if (category == Category.Exception) 21 | { 22 | Trace.TraceError(message); 23 | } 24 | else 25 | { 26 | Trace.TraceInformation(message); 27 | } 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /src/Micser.App.Infrastructure/Api/UpdatesRequestProcessor.cs: -------------------------------------------------------------------------------- 1 | using Micser.App.Infrastructure.Updates; 2 | using Micser.Common; 3 | using Micser.Common.Api; 4 | using Micser.Common.Updates; 5 | 6 | namespace Micser.App.Infrastructure.Api 7 | { 8 | /// 9 | /// Handles notifications from the engine when an application update is available. 10 | /// 11 | [RequestProcessorName(Globals.ApiResources.Updates)] 12 | public class UpdatesRequestProcessor : RequestProcessor 13 | { 14 | private readonly UpdateHandler _updateHandler; 15 | 16 | /// 17 | public UpdatesRequestProcessor(UpdateHandler updateHandler) 18 | { 19 | _updateHandler = updateHandler; 20 | AddAction("UpdateAvailable", p => UpdateAvailable(p)); 21 | } 22 | 23 | private object UpdateAvailable(UpdateManifest updateManifest) 24 | { 25 | _updateHandler.ShowUpdateAvailable(updateManifest); 26 | return true; 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /src/Micser.App.Infrastructure/ApplicationStateService.cs: -------------------------------------------------------------------------------- 1 | using Prism.Events; 2 | 3 | namespace Micser.App.Infrastructure 4 | { 5 | /// 6 | public class ApplicationStateService : IApplicationStateService 7 | { 8 | private readonly IEventAggregator _eventAggregator; 9 | 10 | private bool _isInitialized; 11 | 12 | /// 13 | public ApplicationStateService(IEventAggregator eventAggregator) 14 | { 15 | _eventAggregator = eventAggregator; 16 | } 17 | 18 | /// 19 | public bool ModulesLoaded { get; private set; } 20 | 21 | /// 22 | public void Initialize() 23 | { 24 | if (_isInitialized) 25 | { 26 | return; 27 | } 28 | 29 | _eventAggregator.GetEvent().Subscribe(() => ModulesLoaded = true); 30 | 31 | _isInitialized = true; 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /src/Micser.App.Infrastructure/DataAccess/AppDbContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using Micser.Common.DataAccess.Entities; 3 | 4 | namespace Micser.App.Infrastructure.DataAccess 5 | { 6 | /// 7 | /// The entity framework database context for the app. 8 | /// 9 | public class AppDbContext : DbContext 10 | { 11 | /// 12 | public AppDbContext(DbContextOptions options) 13 | : base(options) 14 | { 15 | } 16 | 17 | // ReSharper disable once UnusedMember.Global 18 | /// 19 | /// The application setting store. 20 | /// 21 | public DbSet Settings { get; set; } 22 | 23 | protected override void OnModelCreating(ModelBuilder modelBuilder) 24 | { 25 | modelBuilder.Entity() 26 | .HasIndex(x => x.Key) 27 | .IsUnique(); 28 | 29 | base.OnModelCreating(modelBuilder); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Regions/IConfirmNavigationRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | using System; 4 | 5 | namespace Prism.Regions 6 | { 7 | /// 8 | /// Provides a way for objects involved in navigation to determine if a navigation request should continue. 9 | /// 10 | public interface IConfirmNavigationRequest : INavigationAware 11 | { 12 | /// 13 | /// Determines whether this instance accepts being navigated away from. 14 | /// 15 | /// The navigation context. 16 | /// The callback to indicate when navigation can proceed. 17 | /// 18 | /// Implementors of this method do not need to invoke the callback before this method is completed, 19 | /// but they must ensure the callback is eventually invoked. 20 | /// 21 | void ConfirmNavigationRequest(NavigationContext navigationContext, Action continuationCallback); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Micser.Common/Api/ApiRequest.cs: -------------------------------------------------------------------------------- 1 | namespace Micser.Common.Api 2 | { 3 | /// 4 | /// A message that represents the request of an API call. 5 | /// 6 | public class ApiRequest : ApiMessage 7 | { 8 | /// 9 | public ApiRequest() 10 | { 11 | } 12 | 13 | /// 14 | /// Creates an instance of the class requesting a specific resource. 15 | /// 16 | public ApiRequest(string resource, string action = null, object content = null) 17 | : base(content) 18 | { 19 | Resource = resource; 20 | Action = action; 21 | Content = content; 22 | } 23 | 24 | /// 25 | /// The action to execute. 26 | /// 27 | public string Action { get; set; } 28 | 29 | /// 30 | /// The resource component. 31 | /// 32 | public string Resource { get; set; } 33 | } 34 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Regions/Behaviors/IDestructibleRegionBehavior.cs: -------------------------------------------------------------------------------- 1 | using Prism.Common; 2 | using Prism.Navigation; 3 | using System; 4 | using System.Collections.Specialized; 5 | 6 | namespace Prism.Regions.Behaviors 7 | { 8 | public class IDestructibleRegionBehavior : RegionBehavior 9 | { 10 | public const string BehaviorKey = "IDestructibleRegionBehavior"; 11 | 12 | protected override void OnAttach() 13 | { 14 | Region.Views.CollectionChanged += Views_CollectionChanged; 15 | } 16 | 17 | private void Views_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) 18 | { 19 | if (e.Action == NotifyCollectionChangedAction.Remove) 20 | { 21 | foreach (var item in e.OldItems) 22 | { 23 | Action invocation = destructible => destructible.Destroy(); 24 | MvvmHelpers.ViewAndViewModelAction(item, invocation); 25 | } 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Micser.App.Infrastructure/Api/StatusApiClient.cs: -------------------------------------------------------------------------------- 1 | using Micser.Common; 2 | using Micser.Common.Api; 3 | using Micser.Common.Extensions; 4 | using System.Threading.Tasks; 5 | 6 | namespace Micser.App.Infrastructure.Api 7 | { 8 | /// 9 | /// API service client that allows checking if the service API is available. 10 | /// 11 | public class StatusApiClient 12 | { 13 | private const string ResourceName = Globals.ApiResources.Status; 14 | private readonly IApiClient _apiClient; 15 | 16 | /// 17 | public StatusApiClient(IApiClient apiClient) 18 | { 19 | _apiClient = apiClient; 20 | } 21 | 22 | /// 23 | /// Returns true if the API is available. 24 | /// 25 | public async Task> GetStatus() 26 | { 27 | var response = await _apiClient.SendMessageAsync(ResourceName).ConfigureAwait(false); 28 | return new ServiceResult(response); 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Services/Dialogs/IDialogService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Prism.Services.Dialogs 4 | { 5 | public interface IDialogService 6 | { 7 | /// 8 | /// Shows a non-modal dialog 9 | /// 10 | /// The name of the dialog to show 11 | /// The parameters to pass to the dialog 12 | /// The action to perform when the dialog is closed. 13 | void Show(string name, IDialogParameters parameters, Action callback); 14 | 15 | /// 16 | /// Shows a modal dialog 17 | /// 18 | /// The name of the dialog to show 19 | /// The parameters to pass to the dialog 20 | /// The action to perform when the dialog is closed. 21 | void ShowDialog(string name, IDialogParameters parameters, Action callback); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Micser.Engine.Infrastructure/Micser.Engine.Infrastructure.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1 5 | 8 6 | 7 | 8 | 9 | 10 | all 11 | runtime; build; native; contentfiles; analyzers; buildtransitive 12 | 13 | 14 | all 15 | runtime; build; native; contentfiles; analyzers; buildtransitive 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/Micser.Common.Test/Updates/GitHubUpdateServiceTest.cs: -------------------------------------------------------------------------------- 1 | using Micser.Common.Updates; 2 | using Micser.TestCommon; 3 | using NLog; 4 | using System.Threading.Tasks; 5 | using Xunit; 6 | using Xunit.Abstractions; 7 | 8 | namespace Micser.Common.Test.Updates 9 | { 10 | public class GitHubUpdateServiceTest 11 | { 12 | public GitHubUpdateServiceTest(ITestOutputHelper testOutputHelper) 13 | { 14 | TestOutputLogger.Configure(testOutputHelper); 15 | } 16 | 17 | [Fact] 18 | public async Task GetUpdateManifest() 19 | { 20 | var service = new GitHubUpdateService(LogManager.GetCurrentClassLogger()); 21 | 22 | var result = await service.GetUpdateManifestAsync(); 23 | 24 | // TODO currently only for debugging purposes 25 | //Assert.NotNull(result); 26 | //Assert.NotNull(result.FileName); 27 | //Assert.NotNull(result.Description); 28 | //Assert.NotEqual(new DateTime(), result.Date); 29 | //Assert.NotNull(result.Version); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Modularity/ModuleAttribute.Desktop.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | using System; 4 | 5 | namespace Prism.Modularity 6 | { 7 | /// 8 | /// Indicates that the class should be considered a named module using the 9 | /// provided module name. 10 | /// 11 | [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] 12 | public sealed class ModuleAttribute : Attribute 13 | { 14 | /// 15 | /// Gets or sets the name of the module. 16 | /// 17 | /// The name of the module. 18 | public string ModuleName { get; set; } 19 | 20 | /// 21 | /// Gets or sets the value indicating whether the module should be loaded OnDemand. 22 | /// 23 | /// When (default value), it indicates the module should be loaded as soon as it's dependencies are satisfied. 24 | /// Otherwise you should explicitily load this module via the . 25 | public bool OnDemand { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Micser.Common/Modules/ModuleConnectionDto.cs: -------------------------------------------------------------------------------- 1 | namespace Micser.Common.Modules 2 | { 3 | /// 4 | /// DTO representing a module connection. 5 | /// 6 | public class ModuleConnectionDto : IIdentifiable 7 | { 8 | /// 9 | /// Gets or sets the ID of this connection. 10 | /// 11 | public long Id { get; set; } 12 | 13 | /// 14 | /// Gets or sets the name of the connector on the source module. 15 | /// 16 | public string SourceConnectorName { get; set; } 17 | 18 | /// 19 | /// Gets or sets the source module ID. 20 | /// 21 | public long SourceId { get; set; } 22 | 23 | /// 24 | /// Gets or sets the name of the connector on the target module. 25 | /// 26 | public string TargetConnectorName { get; set; } 27 | 28 | /// 29 | /// Gets or sets the target module ID. 30 | /// 31 | public long TargetId { get; set; } 32 | } 33 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Regions/ViewRegistrationException.Desktop.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | using System; 4 | using System.Runtime.Serialization; 5 | 6 | namespace Prism.Regions 7 | { 8 | /// 9 | /// Exception that's thrown when something goes wrong while Registering a View with a region name in the class. 10 | /// 11 | [Serializable] 12 | public partial class ViewRegistrationException 13 | { 14 | /// 15 | /// Initializes a new instance of the class with serialized data. 16 | /// 17 | /// The that holds the serialized 18 | /// object data about the exception being thrown. 19 | /// The that contains contextual information about the source or destination. 20 | protected ViewRegistrationException(SerializationInfo info, StreamingContext context) 21 | : base(info, context) 22 | { 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /src/Micser.Common.Test/Api/ApiTestHelper.cs: -------------------------------------------------------------------------------- 1 | using Micser.Common.Api; 2 | using Moq; 3 | using System; 4 | 5 | namespace Micser.Common.Test.Api 6 | { 7 | public static class ApiTestHelper 8 | { 9 | public static ApiConfiguration GetConfiguration() 10 | { 11 | return new ApiConfiguration { PipeName = "Micser.Common.Test." + Guid.NewGuid() }; 12 | } 13 | 14 | public static IMessageSerializer GetMessageSerializer() 15 | { 16 | return new MessagePackMessageSerializer(); 17 | } 18 | 19 | public static IRequestProcessorFactory GetRequestProcessorFactory() 20 | { 21 | var processorMock = new Mock(); 22 | processorMock.Setup(p => p.ProcessAsync(It.IsAny(), It.IsAny())).ReturnsAsync((string n, object c) => new ApiResponse(true, c)); 23 | var factoryMock = new Mock(); 24 | factoryMock.Setup(f => f.Create(It.IsAny())).Returns(processorMock.Object); 25 | return factoryMock.Object; 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /src/Micser.Common/Api/RequestProcessorNameAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Micser.Common.Api 4 | { 5 | /// 6 | /// Specifies the name of a request processor for automatic registration. 7 | /// 8 | public class RequestProcessorNameAttribute : Attribute 9 | { 10 | /// 11 | /// The name of the default request processor that is used when a request did not specify a resource name. 12 | /// 13 | public const string DefaultName = Globals.ApiResources.Default; 14 | 15 | /// 16 | /// Creates an instance of the class with the specified name. 17 | /// 18 | /// The (resource) name of the request processor. 19 | public RequestProcessorNameAttribute(string name) 20 | { 21 | Name = name; 22 | } 23 | 24 | /// 25 | /// Gets the name of the associated request processor. 26 | /// 27 | public string Name { get; } 28 | } 29 | } -------------------------------------------------------------------------------- /src/Micser.App.Prism/Events/IEventSubscription.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | using System; 5 | 6 | namespace Prism.Events 7 | { 8 | /// 9 | /// Defines a contract for an event subscription to be used by . 10 | /// 11 | public interface IEventSubscription 12 | { 13 | /// 14 | /// Gets or sets a that identifies this . 15 | /// 16 | /// A token that identifies this . 17 | SubscriptionToken SubscriptionToken { get; set; } 18 | 19 | /// 20 | /// Gets the execution strategy to publish this event. 21 | /// 22 | /// An with the execution strategy, or if the is no longer valid. 23 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")] 24 | Action GetExecutionStrategy(); 25 | } 26 | } -------------------------------------------------------------------------------- /src/Micser.App.Infrastructure/Themes/Thumbs.xaml: -------------------------------------------------------------------------------- 1 | 4 | 14 | 15 | 24 | -------------------------------------------------------------------------------- /src/Micser.App.Prism/Regions/RegionMemberLifetimeAttribute.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | using System; 4 | using Prism.Regions.Behaviors; 5 | 6 | namespace Prism.Regions 7 | { 8 | /// 9 | /// When is applied to class provides data 10 | /// the can use to determine if the instance should 11 | /// be removed when it is deactivated. 12 | /// 13 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, AllowMultiple = true, Inherited = true )] 14 | public sealed class RegionMemberLifetimeAttribute : Attribute 15 | { 16 | /// 17 | /// Instantiates an instance of 18 | /// 19 | public RegionMemberLifetimeAttribute() 20 | { 21 | KeepAlive = true; 22 | } 23 | 24 | /// 25 | /// Determines if the region member should be kept-alive 26 | /// when deactivated. 27 | /// 28 | public bool KeepAlive { get; set; } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Micser.App.Prism/Interactivity/InteractionRequest/InteractionRequestTrigger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.Xaml.Behaviors; 3 | 4 | namespace Prism.Interactivity.InteractionRequest 5 | { 6 | /// 7 | /// Custom event trigger for using with objects. 8 | /// 9 | /// 10 | /// The standard class can be used instead, as long as the 'Raised' event 11 | /// name is specified. 12 | /// 13 | [Obsolete("Please use the new IDialogService for an improved dialog experience.")] 14 | public class InteractionRequestTrigger : EventTrigger 15 | { 16 | /// 17 | /// Specifies the name of the Event this EventTriggerBase is listening for. 18 | /// 19 | /// This implementation always returns the Raised event name for ease of connection with . 20 | protected override string GetEventName() 21 | { 22 | return "Raised"; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Micser.App.Prism/Modularity/ModuleDependencyAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Prism.Modularity 4 | { 5 | /// 6 | /// Specifies that the current module has a dependency on another module. This attribute should be used on classes that implement . 7 | /// 8 | [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)] 9 | public sealed class ModuleDependencyAttribute : Attribute 10 | { 11 | 12 | /// 13 | /// Initializes a new instance of . 14 | /// 15 | /// The name of the module that this module is dependant upon. 16 | public ModuleDependencyAttribute(string moduleName) 17 | { 18 | ModuleName = moduleName; 19 | } 20 | 21 | /// 22 | /// Gets the name of the module that this module is dependant upon. 23 | /// 24 | /// The name of the module that this module is dependant upon. 25 | public string ModuleName { get; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Micser.App.Prism/Interactivity/DefaultPopupWindows/DefaultNotificationWindow.xaml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |