Skip to content

Commit 0ad6fba

Browse files
mostly warning as errors, adding unused symbol warning
1 parent 7b1e373 commit 0ad6fba

File tree

12 files changed

+754
-16
lines changed

12 files changed

+754
-16
lines changed

Directory.Build.props

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Project>
2+
<PropertyGroup>
3+
<Deterministic>true</Deterministic>
4+
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
5+
<OtherFlags>$(OtherFlags) --warnon:1182</OtherFlags>
6+
<WarningLevel>5</WarningLevel>
7+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
8+
</PropertyGroup>
9+
</Project>

Midinette.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "bits", "bits", "{4DB40A2C-F
2222
EndProject
2323
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Midinette.Platform.RtMidi", "src\Midinette.Platform.RtMidi\Midinette.Platform.RtMidi.fsproj", "{1BDC05D1-A580-4692-B34D-FEEC335BD163}"
2424
EndProject
25+
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Midinette.Platform.Tests", "tests\Midinette.Platform.Tests\Midinette.Platform.Tests.fsproj", "{7DB16A0F-815C-45F3-8FF2-2A8892EA58F8}"
26+
EndProject
2527
Global
2628
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2729
Debug|Any CPU = Debug|Any CPU
@@ -48,6 +50,10 @@ Global
4850
{1BDC05D1-A580-4692-B34D-FEEC335BD163}.Debug|Any CPU.Build.0 = Debug|Any CPU
4951
{1BDC05D1-A580-4692-B34D-FEEC335BD163}.Release|Any CPU.ActiveCfg = Release|Any CPU
5052
{1BDC05D1-A580-4692-B34D-FEEC335BD163}.Release|Any CPU.Build.0 = Release|Any CPU
53+
{7DB16A0F-815C-45F3-8FF2-2A8892EA58F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
54+
{7DB16A0F-815C-45F3-8FF2-2A8892EA58F8}.Debug|Any CPU.Build.0 = Debug|Any CPU
55+
{7DB16A0F-815C-45F3-8FF2-2A8892EA58F8}.Release|Any CPU.ActiveCfg = Release|Any CPU
56+
{7DB16A0F-815C-45F3-8FF2-2A8892EA58F8}.Release|Any CPU.Build.0 = Release|Any CPU
5157
EndGlobalSection
5258
GlobalSection(SolutionProperties) = preSolution
5359
HideSolutionNode = FALSE

paket.dependencies

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ source ../portmidisharp/build/Debug/AnyCPU
33
source ../fsnative/build/Debug/AnyCPU
44
source https://nuget.org/api/v2
55
storage: none
6-
redirects: force
76
clitool dotnet-fable
87
github fsprojects/FSharp.UMX src/FSharp.UMX.fs
98
nuget Fable.Core
@@ -15,7 +14,17 @@ nuget fsnative
1514
nuget PortMidiSharp
1615
nuget RtMidi.Core = 1.0.59-alpha-3
1716

17+
1818
group Build
1919
source https://nuget.org/api/v2
2020
framework >= net461
21-
#nuget FAKE
21+
#nuget FAKE
22+
23+
group Test
24+
source https://nuget.org/api/v2
25+
storage: none
26+
27+
nuget Expecto.FsCheck
28+
nuget FsCheck.NUnit
29+
nuget Logary.Adapters.Facade prerelease
30+

paket.lock

Lines changed: 631 additions & 1 deletion
Large diffs are not rendered by default.

src/Midinette.Elektron/Elektron.MachineDrum.fs

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,18 @@ with
371371
| 6uy -> Mono
372372
| 7uy -> Level
373373
| v -> failwithf "unknown DelayParameter: %i" v
374-
374+
static member all =
375+
[|
376+
Time
377+
ModulationDepth
378+
ModulationFrequency
379+
Feedback
380+
FilterFrequency
381+
FilterWidth
382+
Mono
383+
Level
384+
|]
385+
375386
[<RequireQualifiedAccess>]
376387
type ReverbParameter =
377388
| DelayLevel
@@ -383,7 +394,7 @@ type ReverbParameter =
383394
| GateTime
384395
| Level
385396
with
386-
static member All =
397+
static member all =
387398
[|
388399
DelayLevel
389400
PreDelay
@@ -416,6 +427,7 @@ with
416427
| GateTime -> 6uy
417428
| Level -> 7uy
418429
>> UMX.tag_byte_7bits
430+
419431
[<RequireQualifiedAccess>]
420432
type EqualizerParameter =
421433
| LowShelfFrequency
@@ -461,7 +473,18 @@ with
461473
| 6uy -> OutputGain
462474
| 7uy -> Mix
463475
| v -> failwithf "unknown CompressorParameter: %i" v
464-
476+
static member all =
477+
[|
478+
Attack
479+
Release
480+
Threshold
481+
Ratio
482+
Knee
483+
SideChainHighPass
484+
OutputGain
485+
Mix
486+
|]
487+
465488
type EqualizerSettings(bytes: sysex_data) =
466489
let baseAddress = 0x497
467490
let getAt = SysexBufferEdit.getAt bytes baseAddress
@@ -951,6 +974,7 @@ type MachineDrumSysexRequests =
951974
| DumpPattern of pattern: byte_7bits
952975
| DumpSong of song: byte_7bits
953976
| QueryStatus of statusType: MachineDrumStatusType
977+
| LoadPattern of pattern: byte_7bits
954978
| LoadKit of kit: byte_7bits
955979
| SaveKit of kit: byte_7bits
956980
| SetCurrentKitName of string
@@ -965,6 +989,7 @@ with
965989
| DumpPattern _ -> 0x68uy
966990
| DumpSong _ -> 0x6auy
967991
| SetCurrentKitName _ -> 0x56uy
992+
| LoadPattern _ -> 0x57uy
968993
| LoadKit _ -> 0x58uy
969994
| SaveKit _ -> 0x59uy
970995
| QueryStatus _ -> 0x70uy
@@ -988,6 +1013,7 @@ with
9881013
| DumpPattern pattern -> pattern |> Array.singleton
9891014
| DumpSong song -> song |> Array.singleton
9901015
| QueryStatus status -> status.Id |> Array.singleton
1016+
| LoadPattern pattern -> pattern |> Array.singleton
9911017
| LoadKit kit -> kit |> Array.singleton
9921018
| SaveKit kit -> kit |> Array.singleton
9931019
| SetCurrentKitName name ->

src/Midinette.Elektron/Midinette.Elektron.fsproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33
<PropertyGroup>
44
<TargetFrameworks>netstandard2.0;net45</TargetFrameworks>
55
<OutputPath>..\..\build\$(Configuration)\$(Platform)</OutputPath>
6-
<OtherFlags>$(OtherFlags)</OtherFlags>
7-
<WarningLevel>4</WarningLevel>
8-
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
9-
<WarningsAsErrors />
106
</PropertyGroup>
117
<ItemGroup>
128
<ProjectReference Include="..\Midinette\Midinette.fsproj" />

src/Midinette.Platform.PortMidi/PortMidiMidinettePlatformImpl.fs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ module Impl =
77
let toMidiEvent (e :PortMidi.MidiEvent) = MidiEvent<int>(Midi.MidiMessage.FromWord e.Message.Word, e.Timestamp)
88
//let toMidiMessage (m: PortMidi.MidiMessage) = Midi.MidiMessage.FromWord m.Word
99
let fromMidiMessage (m: Midi.MidiMessage) = PortMidi.MidiMessage.FromWord m.Word
10-
10+
let toTaggedSysexEvent (h:IEvent<Handler<byte array>, byte array>) : IEvent<Handler<sysex_data>, sysex_data> = unbox h
11+
1112
open Impl
1213

1314
type PortMidiDeviceInfo = { deviceInfo: PortMidi.MidiDeviceInfo }
@@ -23,7 +24,7 @@ with
2324
[<CLIEvent>] member x.Error = x.inPort.Error
2425
[<CLIEvent>] member x.ChannelMessageReceived = x.inPort.ChannelMessageReceived |> Event.map toMidiEvent
2526
[<CLIEvent>] member x.SystemMessageReceived = x.inPort.SystemMessageReceived |> Event.map toMidiEvent
26-
[<CLIEvent>] member x.SysexReceived = x.inPort.SysexReceived
27+
[<CLIEvent>] member x.SysexReceived = x.inPort.SysexReceived |> Impl.toTaggedSysexEvent
2728
[<CLIEvent>] member x.RealtimeMessageReceived = x.inPort.RealtimeMessageReceived |> Event.map toMidiEvent
2829
member x.Open bufferSize = x.inPort.Open bufferSize
2930
member x.Close () = x.inPort.Close ()
@@ -37,7 +38,7 @@ with
3738
member x.Close () = x.outPort.Close ()
3839
member x.WriteMessage timestamp message = x.outPort.WriteMessage timestamp (fromMidiMessage message)
3940
member x.WriteMessages timestamp messages = x.outPort.WriteMessages timestamp (messages |> Array.map fromMidiMessage)
40-
member x.WriteSysex timestamp sysex = x.outPort.WriteSysex timestamp sysex
41+
member x.WriteSysex timestamp sysex = x.outPort.WriteSysex timestamp (UMX.untag_sysex sysex)
4142
member x.DeviceInfo = { deviceInfo = x.outPort.DeviceInfo } :> _
4243

4344

src/Midinette.Platform.RtMidi/RtMidinettePlatformImpl.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ type RtMidiMidinettePlatformImpl() as this =
7070
let rtmidi = RtMidi.Core.MidiDeviceManager.Default
7171
let watch = Stopwatch.StartNew()
7272
let platformEvents = MidiPlatformTrigger()
73-
let platformEventsPublish = platformEvents :> IMidiPlatformEvents<_>
74-
let iplatform = this :> IMidiPlatform<int64>
73+
//let platformEventsPublish = platformEvents :> IMidiPlatformEvents<_>
74+
let iplatform =this :> IMidiPlatform<int64>
7575
member x.Trigger = platformEvents
7676
//member x.Platform = x :> IMidiPlatformEvents<_>
7777

src/Midinette/Midinette.fsproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<PropertyGroup>
44
<TargetFrameworks>netstandard2.0;net45</TargetFrameworks>
55
<OutputPath>..\..\build\$(Configuration)\$(Platform)</OutputPath>
6-
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
76
</PropertyGroup>
87
<ItemGroup>
98
<Compile Include="..\..\paket-files\fsprojects\FSharp.UMX\src\FSharp.UMX.fs">
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// Learn more about F# at http://fsharp.org
2+
3+
open System
4+
open Hopac
5+
open Logary
6+
open Logary.Configuration
7+
open Logary.Adapters.Facade
8+
9+
open Expecto
10+
open Logary.Targets
11+
12+
let tests =
13+
testList "midinette"
14+
[
15+
test "simple" {
16+
let p = Midinette.Platform.RtMidi.RtMidiMidinettePlatformImpl()
17+
for i, device in p.InputDevices |> Seq.indexed do
18+
Expect.isNotNull (box device ) "devicenotnull"
19+
printfn "input [%i] %A" i device
20+
for i, device in p.OutputDevices |> Seq.indexed do
21+
printfn "output [%i] %A" i device
22+
23+
24+
25+
() //Expecto.equal "" ""
26+
}
27+
28+
test "loopback" {
29+
let p = Midinette.Platform.RtMidi.RtMidiMidinettePlatformImpl()
30+
for i, device in p.InputDevices |> Seq.indexed do
31+
Expect.isNotNull (box device ) "devicenotnull"
32+
printfn "input [%i] %A" i device
33+
for i, device in p.OutputDevices |> Seq.indexed do
34+
printfn "output [%i] %A" i device
35+
36+
37+
}
38+
]
39+
[<EntryPoint>]
40+
let main args =
41+
let logary =
42+
Config.create "MyProject.Tests" "localhost"
43+
|> Config.targets [ LiterateConsole.create LiterateConsole.empty "console" ]
44+
|> Config.processing (Events.events |> Events.sink ["console";])
45+
|> Config.build
46+
|> run
47+
LogaryFacadeAdapter.initialise<Expecto.Logging.Logger> logary
48+
49+
50+
runTestsWithArgs defaultConfig args tests

0 commit comments

Comments
 (0)