Loading...
15 |
16 |
17 | An unhandled error has occurred.
18 |
Reload
19 |
🗙
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/KeySwitchManager/Sources/Runtime/Infrastructures/Storage.Spreadsheet.ClosedXml/KeySwitches/Export/ClosedXmlExportContentFileWriterFactory.cs:
--------------------------------------------------------------------------------
1 | using KeySwitchManager.Commons.Data;
2 | using KeySwitchManager.Infrastructures.Storage.KeySwitches;
3 | using KeySwitchManager.UseCase.KeySwitches.Export;
4 |
5 | namespace KeySwitchManager.Infrastructures.Storage.Spreadsheet.ClosedXml.KeySwitches.Export
6 | {
7 | public sealed class ClosedXmlExportContentFileWriterFactory : KeySwitchExportContentFileWriterFactory
8 | {
9 | public ClosedXmlExportContentFileWriterFactory()
10 | : this( new DefaultExportPathBuilder( ".xlsx" ) ) {}
11 |
12 | public ClosedXmlExportContentFileWriterFactory( IDirectoryPath outputDirectory )
13 | : base( new DefaultExportPathBuilder( ".xlsx", outputDirectory ) ) {}
14 |
15 | public ClosedXmlExportContentFileWriterFactory( IExportPathBuilder pathBuilder )
16 | : base( pathBuilder ) {}
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/KeySwitchManager/Sources/Runtime/Infrastructures/Storage.Xml/KeySwitches/StudioOne/Models/ExtraDataKeys.cs:
--------------------------------------------------------------------------------
1 | using KeySwitchManager.Domain.KeySwitches.Models.Values;
2 |
3 | namespace KeySwitchManager.Infrastructures.Storage.Xml.KeySwitches.StudioOne.Models
4 | {
5 | public static class ExtraDataKeys
6 | {
7 | public static readonly string ValueSeparator = ",";
8 |
9 | public static readonly ExtraDataKey Color = new ExtraDataKey( "StudioOne.Color" );
10 | public static readonly ExtraDataKey Momentary = new ExtraDataKey( "StudioOne.Momentary" );
11 |
12 | public static readonly ExtraDataKey NoteOnOff = new ExtraDataKey( "StudioOne.NoteOnOff" );
13 | public static readonly ExtraDataKey NoteOn = new ExtraDataKey( "StudioOne.NoteOn" );
14 | public static readonly ExtraDataKey NoteOff = new ExtraDataKey( "StudioOne.NoteOff" );
15 |
16 | public static readonly ExtraDataKey Bank = new ExtraDataKey( "StudioOne.Bank" );
17 | }
18 | }
--------------------------------------------------------------------------------
/KeySwitchManager/Sources/Runtime/Controllers/KeySwitches/CreateController.cs:
--------------------------------------------------------------------------------
1 | using System.Threading;
2 | using System.Threading.Tasks;
3 |
4 | using KeySwitchManager.Interactors.KeySwitches;
5 | using KeySwitchManager.UseCase.KeySwitches.Create;
6 | using KeySwitchManager.UseCase.KeySwitches.Export;
7 |
8 | namespace KeySwitchManager.Controllers.KeySwitches
9 | {
10 | public sealed class CreateController
11 | {
12 | public void Create( IExportStrategy strategy, ICreatePresenter presenter )
13 | => CreateAsync( strategy, presenter ).GetAwaiter().GetResult();
14 |
15 | public async Task CreateAsync( IExportStrategy strategy, ICreatePresenter presenter, CancellationToken cancellationToken = default )
16 | {
17 | var interactor = new CreateInteractor( presenter );
18 | var inputData = new CreateInputData( strategy );
19 |
20 | await interactor.HandleAsync( inputData, cancellationToken );
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/KeySwitchManager/Sources/Runtime/Infrastructures/Storage.Yaml/KeySwitches/Models/Aggregations/MidiControlChangeModel.cs:
--------------------------------------------------------------------------------
1 | using YamlDotNet.Serialization;
2 |
3 | namespace KeySwitchManager.Infrastructures.Storage.Yaml.KeySwitches.Models.Aggregations
4 | {
5 | public class MidiControlChangeModel : IMidiChannelVoiceMessageModel
6 | {
7 | [YamlIgnore]
8 | public int Status => 0xB0 | ( Channel & 0xF );
9 |
10 | [YamlMember( Alias = "Channel" )]
11 | public int Channel { get; set; }
12 |
13 | [YamlMember( Alias = "ControlNumber" )]
14 | public int Data1 { get; set; }
15 |
16 | [YamlMember( Alias = "Data" )]
17 | public int Data2 { get; set; }
18 |
19 | public MidiControlChangeModel() {}
20 |
21 | public MidiControlChangeModel( int channel, int data1, int data2 )
22 | {
23 | Channel = channel;
24 | Data1 = data1;
25 | Data2 = data2;
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/KeySwitchManager/Sources/Runtime/UseCases/KeySwitches/Export/BinaryContent.cs:
--------------------------------------------------------------------------------
1 | using System.IO;
2 | using System.Threading.Tasks;
3 |
4 | using RkHelper.Primitives;
5 |
6 | namespace KeySwitchManager.UseCase.KeySwitches.Export
7 | {
8 | public class BinaryContent : IContent
9 | {
10 | private readonly byte[] data;
11 | private readonly int offset;
12 | private readonly int length;
13 |
14 | public BinaryContent( byte[] data )
15 | : this( data, 0, data.Length ) {}
16 |
17 | public BinaryContent( byte[] data, int offset, int length )
18 | {
19 | ArrayHelper.ValidateArrayRange( data, offset, length );
20 | this.data = data;
21 | this.offset = offset;
22 | this.length = length;
23 | }
24 |
25 | public Task