This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var midiFile = MidiFile.Read("FileWithLyrics.mid"); | |
var tempoMap = midiFile.GetTempoMap(); | |
var lyricsWithTimestamps = midiFile | |
.GetTimedEvents() | |
.Where(e => e.Event.EventType == MidiEventType.Lyric) | |
.Select(e => new | |
{ | |
Text = ((LyricEvent)e.Event).Text, | |
TotalSecondsFromStart = e.TimeAs<MetricTimeSpan>(tempoMap).TotalSeconds | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace DualLibClassLibrary | |
{ | |
public static class Class | |
{ | |
public static int Bar() | |
{ | |
return ApiProvider.Api.Method() * 1000; | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace DualLibClassLibrary | |
{ | |
internal static class ApiProvider | |
{ | |
private static readonly bool Is64Bit = IntPtr.Size == 8; | |
private static Api _api; | |
public static Api Api |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Runtime.InteropServices; | |
namespace DualLibClassLibrary | |
{ | |
internal sealed class Api64 : Api | |
{ | |
[DllImport("test64")] | |
public static extern int Foo(); | |
public override int Method() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Runtime.InteropServices; | |
namespace DualLibClassLibrary | |
{ | |
internal sealed class Api32 : Api | |
{ | |
[DllImport("test32")] | |
public static extern int Foo(); | |
public override int Method() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace DualLibClassLibrary | |
{ | |
internal abstract class Api | |
{ | |
public abstract int Method(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Write-Host "Downloading winlibs..." | |
Invoke-WebRequest -Uri "https://github.com/brechtsanders/winlibs_mingw/releases/download/11.1.0-12.0.0-9.0.0-r1/winlibs-i686-posix-dwarf-gcc-11.1.0-mingw-w64-9.0.0-r1.zip" -OutFile "winlibs.zip" | |
Write-Host "Downloaded." | |
Write-Host "Extracting winlibs..." | |
Expand-Archive -LiteralPath 'winlibs.zip' -DestinationPath "winlibs" | |
Write-Host "Extracted." | |
Write-Host "Building DLL..." | |
$gccPath = Get-ChildItem -Path "winlibs" -File -Filter "i686-w64-mingw32-gcc.exe" -Recurse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
C:/ProgramData/Chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/ProgramData/Chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib\libuser32.a when searching for -luser32 | |
... | |
C:/ProgramData/Chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/libmsvcrt.a when searching for -lmsvcrt C:/ProgramData/Chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lmsvcrt collect2.exe: error: ld returned 1 exit status |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ItemGroup> | |
<None Include="test.dll"> | |
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | |
<PackagePath>build\</PackagePath> | |
<Pack>true</Pack> | |
</None> | |
<None Include="test.dylib"> | |
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | |
<PackagePath>build\</PackagePath> | |
<Pack>true</Pack> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<ItemGroup> | |
<None Include="$(MSBuildThisFileDirectory)test.dll"> | |
<Link>test.dll</Link> | |
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | |
</None> | |
<None Include="$(MSBuildThisFileDirectory)test.dylib"> | |
<Link>test.dylib</Link> | |
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
NewerOlder