diff --git a/BassBoom.Basolia/Devices/DeviceTools.cs b/BassBoom.Basolia/Devices/DeviceTools.cs index 5625789..2ca73a8 100644 --- a/BassBoom.Basolia/Devices/DeviceTools.cs +++ b/BassBoom.Basolia/Devices/DeviceTools.cs @@ -18,9 +18,9 @@ // using BassBoom.Basolia.Helpers; +using BassBoom.Native; using BassBoom.Native.Interop.Init; using BassBoom.Native.Interop.Output; -using BassBoom.Native.Runtime; using System; using System.Collections.Generic; using System.Collections.ObjectModel; @@ -53,7 +53,7 @@ public static ReadOnlyDictionary GetDrivers() unsafe { // Query the drivers - var handle = Mpg123Instance._out123Handle; + var handle = MpgNative._out123Handle; int driversStatus = NativeOutputLib.out123_drivers(handle, ref names, ref descr); if (driversStatus == (int)mpg123_errors.MPG123_ERR) throw new BasoliaException("Can't query the drivers", mpg123_errors.MPG123_ERR); @@ -93,7 +93,7 @@ public static ReadOnlyDictionary GetDevices(string driver, ref s unsafe { // Query the devices - var handle = Mpg123Instance._out123Handle; + var handle = MpgNative._out123Handle; int devicesStatus = NativeOutputLib.out123_devices(handle, driver, out names, out descr, ref active); if (devicesStatus == (int)mpg123_errors.MPG123_ERR) throw new BasoliaException("Can't query the devices", mpg123_errors.MPG123_ERR); @@ -126,7 +126,7 @@ public static (string driver, string device) GetCurrent() unsafe { // Query the devices - var handle = Mpg123Instance._out123Handle; + var handle = MpgNative._out123Handle; IntPtr driverPtr = IntPtr.Zero; IntPtr devicePtr = IntPtr.Zero; int devicesStatus = NativeOutputLib.out123_driver_info(handle, ref driverPtr, ref devicePtr); diff --git a/BassBoom.Basolia/File/FileTools.cs b/BassBoom.Basolia/File/FileTools.cs index 674e46b..167eccf 100644 --- a/BassBoom.Basolia/File/FileTools.cs +++ b/BassBoom.Basolia/File/FileTools.cs @@ -19,9 +19,9 @@ using BassBoom.Basolia.Playback; using BassBoom.Basolia.Radio; +using BassBoom.Native; using BassBoom.Native.Interop.Init; using BassBoom.Native.Interop.Play; -using BassBoom.Native.Runtime; using System.Linq; using System.Net.Http; using System.Threading.Tasks; @@ -92,7 +92,7 @@ public static void OpenFile(string path) unsafe { // Open the file - var handle = Mpg123Instance._mpg123Handle; + var handle = MpgNative._mpg123Handle; int openStatus = NativeInput.mpg123_open(handle, path); if (openStatus == (int)mpg123_errors.MPG123_ERR) throw new BasoliaException("Can't open file", mpg123_errors.MPG123_ERR); @@ -143,7 +143,7 @@ public static async Task OpenUrlAsync(string path) unsafe { // Open the radio station - var handle = Mpg123Instance._mpg123Handle; + var handle = MpgNative._mpg123Handle; int openStatus = NativeInput.mpg123_open_feed(handle); if (openStatus == (int)mpg123_errors.MPG123_ERR) throw new BasoliaException("Can't open radio station", mpg123_errors.MPG123_ERR); @@ -175,7 +175,7 @@ public static void CloseFile() unsafe { // Close the file - var handle = Mpg123Instance._mpg123Handle; + var handle = MpgNative._mpg123Handle; int closeStatus = NativeInput.mpg123_close(handle); if (closeStatus == (int)mpg123_errors.MPG123_ERR) throw new BasoliaException("Can't close file", mpg123_errors.MPG123_ERR); diff --git a/BassBoom.Basolia/Format/AudioInfoTools.cs b/BassBoom.Basolia/Format/AudioInfoTools.cs index 3d5c9c5..defb452 100644 --- a/BassBoom.Basolia/Format/AudioInfoTools.cs +++ b/BassBoom.Basolia/Format/AudioInfoTools.cs @@ -17,7 +17,6 @@ // along with this program. If not, see . // -using BassBoom.Native.Runtime; using BassBoom.Native.Interop.Analysis; using BassBoom.Native.Interop.Init; using BassBoom.Basolia.File; @@ -31,6 +30,7 @@ using System.Linq; using SpecProbe.Platform; using BassBoom.Basolia.Enumerations; +using BassBoom.Native; namespace BassBoom.Basolia.Format { @@ -64,7 +64,7 @@ public static int GetDuration(bool scan) // We're now entering the dangerous zone unsafe { - var handle = Mpg123Instance._mpg123Handle; + var handle = MpgNative._mpg123Handle; if (scan) { lock (PlaybackPositioningTools.PositionLock) @@ -145,7 +145,7 @@ public static int GetFrameSize() unsafe { - var outHandle = Mpg123Instance._out123Handle; + var outHandle = MpgNative._out123Handle; // Get the output format to get the frame size int getStatus = NativeOutputLib.out123_getformat(outHandle, null, null, null, out frameSize); @@ -172,7 +172,7 @@ public static int GetFrameLength() unsafe { - var handle = Mpg123Instance._mpg123Handle; + var handle = MpgNative._mpg123Handle; // Get the frame length getStatus = NativeStatus.mpg123_framelength(handle); @@ -199,7 +199,7 @@ public static int GetSamplesPerFrame() unsafe { - var handle = Mpg123Instance._mpg123Handle; + var handle = MpgNative._mpg123Handle; // Get the samples per frame getStatus = NativeStatus.mpg123_spf(handle); @@ -226,7 +226,7 @@ public static int GetBufferSize() unsafe { - var handle = Mpg123Instance._mpg123Handle; + var handle = MpgNative._mpg123Handle; // Now, buffer the entire music file and create an empty array based on its size bufferSize = NativeLowIo.mpg123_outblock(handle); @@ -257,7 +257,7 @@ public static void GetId3Metadata(out Id3V1Metadata managedV1, out Id3V2Metadata IntPtr v2 = IntPtr.Zero; unsafe { - var handle = Mpg123Instance._mpg123Handle; + var handle = MpgNative._mpg123Handle; // We need to scan the file to get accurate info if (!FileTools.IsRadioStation) @@ -410,7 +410,7 @@ public static string GetIcyMetadata() string icy = ""; unsafe { - var handle = Mpg123Instance._mpg123Handle; + var handle = MpgNative._mpg123Handle; // We need to scan the file to get accurate info if (!FileTools.IsRadioStation) @@ -464,7 +464,7 @@ public static FrameInfo GetFrameInfo() mpg123_frameinfo_win frameInfo = default; unsafe { - var handle = Mpg123Instance._mpg123Handle; + var handle = MpgNative._mpg123Handle; // We need to scan the file to get accurate info, but it only works with files if (!FileTools.IsRadioStation) @@ -498,7 +498,7 @@ public static FrameInfo GetFrameInfo() mpg123_frameinfo frameInfo = default; unsafe { - var handle = Mpg123Instance._mpg123Handle; + var handle = MpgNative._mpg123Handle; // We need to scan the file to get accurate info if (!FileTools.IsRadioStation) diff --git a/BassBoom.Basolia/Format/DecodeTools.cs b/BassBoom.Basolia/Format/DecodeTools.cs index f088d7f..22d2afa 100644 --- a/BassBoom.Basolia/Format/DecodeTools.cs +++ b/BassBoom.Basolia/Format/DecodeTools.cs @@ -19,9 +19,9 @@ using BassBoom.Basolia.File; using BassBoom.Basolia.Helpers; +using BassBoom.Native; using BassBoom.Native.Interop.Init; using BassBoom.Native.Interop.Play; -using BassBoom.Native.Runtime; using System; using System.Linq; using System.Runtime.InteropServices; @@ -60,7 +60,7 @@ public static int DecodeFrame(ref int num, ref byte[] audio, ref int bytes) // We're now entering the dangerous zone unsafe { - var handle = Mpg123Instance._mpg123Handle; + var handle = MpgNative._mpg123Handle; // Get the frame IntPtr numPtr, bytesPtr, audioPtr = IntPtr.Zero; @@ -110,7 +110,7 @@ private static string GetCurrentDecoder() // Try to set the equalizer value unsafe { - var handle = Mpg123Instance._mpg123Handle; + var handle = MpgNative._mpg123Handle; IntPtr decoderPtr = NativeDecoder.mpg123_current_decoder(handle); return Marshal.PtrToStringAnsi(decoderPtr); } @@ -129,7 +129,7 @@ private static void SetCurrentDecoder(string decoderName) string[] supportedDecoders = GetDecoders(true); if (!supportedDecoders.Contains(decoderName)) throw new BasoliaException($"Decoder {decoderName} not supported by your device", mpg123_errors.MPG123_BAD_DECODER); - var handle = Mpg123Instance._mpg123Handle; + var handle = MpgNative._mpg123Handle; int status = NativeDecoder.mpg123_decoder(handle, decoderName); if (status != (int)mpg123_errors.MPG123_OK) throw new BasoliaException($"Can't set decoder to {decoderName}", (mpg123_errors)status); diff --git a/BassBoom.Basolia/Format/FormatTools.cs b/BassBoom.Basolia/Format/FormatTools.cs index 08dda35..5dcbf72 100644 --- a/BassBoom.Basolia/Format/FormatTools.cs +++ b/BassBoom.Basolia/Format/FormatTools.cs @@ -17,7 +17,6 @@ // along with this program. If not, see . // -using BassBoom.Native.Runtime; using BassBoom.Native.Interop.Play; using BassBoom.Native.Interop.Init; using System; @@ -26,6 +25,7 @@ using System.Runtime.InteropServices; using BassBoom.Native.Interop.Analysis; using SpecProbe.Platform; +using BassBoom.Native; namespace BassBoom.Basolia.Format { @@ -45,7 +45,7 @@ public static (long rate, int channels, int encoding) GetFormatInfo() // We're now entering the dangerous zone unsafe { - var handle = Mpg123Instance._mpg123Handle; + var handle = MpgNative._mpg123Handle; // Get the rate, the number of channels, and encoding int length = NativeOutput.mpg123_getformat(handle, out fileRate, out fileChannel, out fileEncoding); @@ -69,7 +69,7 @@ public static FormatInfo[] GetFormats() nint fmtlist = IntPtr.Zero; unsafe { - var outHandle = Mpg123Instance._out123Handle; + var outHandle = MpgNative._out123Handle; // Get the list of supported formats getStatus = NativeOutputLib.out123_formats(outHandle, IntPtr.Zero, 0, 0, 0, ref fmtlist); diff --git a/BassBoom.Basolia/InitBasolia.cs b/BassBoom.Basolia/InitBasolia.cs index 7289c7b..d233c06 100644 --- a/BassBoom.Basolia/InitBasolia.cs +++ b/BassBoom.Basolia/InitBasolia.cs @@ -17,10 +17,9 @@ // along with this program. If not, see . // -using BassBoom.Native.Interop; +using BassBoom.Native; using BassBoom.Native.Interop.Init; using BassBoom.Native.Interop.Output; -using BassBoom.Native.Runtime; using System; using System.Reflection; @@ -48,7 +47,7 @@ public static Version MpgLibVersion { if (!BasoliaInitialized) throw new BasoliaException("Can't get version until the library is initialized", mpg123_errors.MPG123_NOT_INITIALIZED); - return LibraryTools.MpgLibVersion; + return MpgNative.MpgLibVersion; } } @@ -61,7 +60,7 @@ public static Version OutLibVersion { if (!BasoliaInitialized) throw new BasoliaOutException("Can't get version until the library is initialized", out123_error.OUT123_ERR); - return LibraryTools.OutLibVersion; + return MpgNative.OutLibVersion; } } @@ -78,13 +77,13 @@ public static Version OutLibVersion public static void Init(string root = "") { if (string.IsNullOrEmpty(root)) - Mpg123Instance.InitializeLibrary(); + MpgNative.InitializeLibrary(); else { - string mpg = Mpg123Instance.GetAppropriateMpg123LibraryPath(root); - string @out = Mpg123Instance.GetAppropriateOut123LibraryPath(root); - string pthreads = Mpg123Instance.GetAppropriateWinpthreadsLibraryPath(root); - Mpg123Instance.InitializeLibrary(mpg, @out, pthreads); + string mpg = MpgNative.GetAppropriateMpg123LibraryPath(root); + string @out = MpgNative.GetAppropriateOut123LibraryPath(root); + string pthreads = MpgNative.GetAppropriateWinpthreadsLibraryPath(root); + MpgNative.InitializeLibrary(mpg, @out, pthreads); } _basoliaInited = true; } diff --git a/BassBoom.Basolia/Playback/PlaybackPositioningTools.cs b/BassBoom.Basolia/Playback/PlaybackPositioningTools.cs index 0c68bf6..6ca6b82 100644 --- a/BassBoom.Basolia/Playback/PlaybackPositioningTools.cs +++ b/BassBoom.Basolia/Playback/PlaybackPositioningTools.cs @@ -22,10 +22,10 @@ using BassBoom.Native.Interop.Init; using BassBoom.Native.Interop.Play; using BassBoom.Native.Interop.Output; -using BassBoom.Native.Runtime; using System; using System.Threading; using BassBoom.Basolia.Lyrics; +using BassBoom.Native; namespace BassBoom.Basolia.Playback { @@ -51,7 +51,7 @@ public static int GetCurrentDuration() // We're now entering the dangerous zone unsafe { - var handle = Mpg123Instance._mpg123Handle; + var handle = MpgNative._mpg123Handle; // Get the length length = NativePositioning.mpg123_tell(handle); @@ -95,8 +95,8 @@ public static void SeekToTheBeginning() // We're now entering the dangerous zone unsafe { - var handle = Mpg123Instance._mpg123Handle; - var outHandle = Mpg123Instance._out123Handle; + var handle = MpgNative._mpg123Handle; + var outHandle = MpgNative._out123Handle; // Get the length PlaybackTools.holding = true; @@ -128,8 +128,8 @@ public static void SeekToFrame(int frame) // We're now entering the dangerous zone unsafe { - var handle = Mpg123Instance._mpg123Handle; - var outHandle = Mpg123Instance._out123Handle; + var handle = MpgNative._mpg123Handle; + var outHandle = MpgNative._out123Handle; // Get the length PlaybackTools.holding = true; @@ -185,7 +185,7 @@ public static void Drop() // We're now entering the dangerous zone unsafe { - var outHandle = Mpg123Instance._out123Handle; + var outHandle = MpgNative._out123Handle; NativeOutputLib.out123_drop(outHandle); } } diff --git a/BassBoom.Basolia/Playback/PlaybackTools.cs b/BassBoom.Basolia/Playback/PlaybackTools.cs index 6e56952..7c88f91 100644 --- a/BassBoom.Basolia/Playback/PlaybackTools.cs +++ b/BassBoom.Basolia/Playback/PlaybackTools.cs @@ -22,7 +22,6 @@ using BassBoom.Native.Interop.Init; using BassBoom.Native.Interop.Output; using BassBoom.Native.Interop.Play; -using BassBoom.Native.Runtime; using System; using System.Diagnostics; using System.Threading; @@ -34,6 +33,7 @@ using System.Text; using System.Text.RegularExpressions; using BassBoom.Basolia.Enumerations; +using BassBoom.Native; namespace BassBoom.Basolia.Playback { @@ -96,8 +96,8 @@ public static void Play() // We're now entering the dangerous zone unsafe { - var handle = Mpg123Instance._mpg123Handle; - var outHandle = Mpg123Instance._out123Handle; + var handle = MpgNative._mpg123Handle; + var outHandle = MpgNative._out123Handle; // First, get formats and reset them var (rate, channels, encoding) = FormatTools.GetFormatInfo(); @@ -211,7 +211,7 @@ public static void SetVolume(double volume) // Try to set the volume unsafe { - var handle = Mpg123Instance._mpg123Handle; + var handle = MpgNative._mpg123Handle; int status = NativeVolume.mpg123_volume(handle, volume); if (status != (int)out123_error.OUT123_OK) throw new BasoliaOutException($"Can't set volume to {volume}", (out123_error)status); @@ -234,7 +234,7 @@ public static (double baseLinear, double actualLinear, double decibelsRva) GetVo // Try to get the volume unsafe { - var handle = Mpg123Instance._mpg123Handle; + var handle = MpgNative._mpg123Handle; int status = NativeVolume.mpg123_getvolume(handle, ref baseLinearAddr, ref actualLinearAddr, ref decibelsRvaAddr); if (status != (int)out123_error.OUT123_OK) throw new BasoliaOutException($"Can't get volume (base, really, and decibels)", (out123_error)status); @@ -258,7 +258,7 @@ public static void SetEqualizer(PlaybackChannels channels, int bandIdx, double v // Try to set the equalizer value unsafe { - var handle = Mpg123Instance._mpg123Handle; + var handle = MpgNative._mpg123Handle; int status = NativeVolume.mpg123_eq(handle, (mpg123_channels)channels, bandIdx, value); if (status != (int)mpg123_errors.MPG123_OK) throw new BasoliaException($"Can't set equalizer band {bandIdx + 1}/32 to {value} under {channels}", (mpg123_errors)status); @@ -280,7 +280,7 @@ public static void SetEqualizerRange(PlaybackChannels channels, int bandIdxStart // Try to set the equalizer value unsafe { - var handle = Mpg123Instance._mpg123Handle; + var handle = MpgNative._mpg123Handle; int status = NativeVolume.mpg123_eq_bands(handle, (int)channels, bandIdxStart, bandIdxEnd, value); if (status != (int)mpg123_errors.MPG123_OK) throw new BasoliaException($"Can't set equalizer bands {bandIdxStart + 1}/32 -> {bandIdxEnd + 1}/32 to {value} under {channels}", (mpg123_errors)status); @@ -300,7 +300,7 @@ public static double GetEqualizer(PlaybackChannels channels, int bandIdx) // Try to set the equalizer value unsafe { - var handle = Mpg123Instance._mpg123Handle; + var handle = MpgNative._mpg123Handle; double eq = NativeVolume.mpg123_geteq(handle, (mpg123_channels)channels, bandIdx); return eq; } @@ -317,7 +317,7 @@ public static void ResetEqualizer() // Try to set the equalizer value unsafe { - var handle = Mpg123Instance._mpg123Handle; + var handle = MpgNative._mpg123Handle; int status = NativeVolume.mpg123_reset_eq(handle); if (status != (int)mpg123_errors.MPG123_OK) throw new BasoliaException("Can't reset equalizer bands to their initial values!", (mpg123_errors)status); @@ -339,7 +339,7 @@ public static (long, double) GetNativeState(PlaybackStateType state) { long stateInt = 0; double stateDouble = 0; - var handle = Mpg123Instance._mpg123Handle; + var handle = MpgNative._mpg123Handle; int status = NativeStatus.mpg123_getstate(handle, (mpg123_state)state, ref stateInt, ref stateDouble); if (status != (int)mpg123_errors.MPG123_OK) throw new BasoliaException($"Can't get native state of {state}!", (mpg123_errors)status); @@ -354,7 +354,7 @@ internal static void FeedRadio() unsafe { - var handle = Mpg123Instance._mpg123Handle; + var handle = MpgNative._mpg123Handle; // Get the MP3 frame length first string metaIntStr = FileTools.CurrentFile.Headers.GetValues("icy-metaint").First(); @@ -395,7 +395,7 @@ internal static int PlayBuffer(byte[] buffer) { unsafe { - var outHandle = Mpg123Instance._out123Handle; + var outHandle = MpgNative._out123Handle; IntPtr bufferPtr = Marshal.AllocHGlobal(Marshal.SizeOf() * buffer.Length); Marshal.Copy(buffer, 0, bufferPtr, buffer.Length); int size = NativeOutputLib.out123_play(outHandle, bufferPtr, buffer.Length); diff --git a/BassBoom.Basolia/Radio/IcecastServer.cs b/BassBoom.Basolia/Radio/IcecastServer.cs index ce77cd8..efea30f 100644 --- a/BassBoom.Basolia/Radio/IcecastServer.cs +++ b/BassBoom.Basolia/Radio/IcecastServer.cs @@ -23,7 +23,6 @@ using HtmlAgilityPack; using System.Threading.Tasks; using System.Diagnostics; -using System.Net.Http; using System.Linq; namespace BassBoom.Basolia.Radio diff --git a/BassBoom.Native/Exceptions/BasoliaNativeLibraryException.cs b/BassBoom.Native/Exceptions/BasoliaNativeLibraryException.cs index aeee52b..ecac90d 100644 --- a/BassBoom.Native/Exceptions/BasoliaNativeLibraryException.cs +++ b/BassBoom.Native/Exceptions/BasoliaNativeLibraryException.cs @@ -17,7 +17,6 @@ // along with this program. If not, see . // -using BassBoom.Native.Runtime; using System; namespace BassBoom.Native.Exceptions @@ -26,17 +25,17 @@ internal class BasoliaNativeLibraryException : Exception { internal BasoliaNativeLibraryException() : base($"Native library error\n" + - $"Library path is {Mpg123Instance.mpg123LibPath}") + $"Library path is {MpgNative.mpg123LibPath}") { } internal BasoliaNativeLibraryException(string message) : base($"{message}\n" + - $"Library path is {Mpg123Instance.mpg123LibPath}") + $"Library path is {MpgNative.mpg123LibPath}") { } internal BasoliaNativeLibraryException(string message, Exception innerException) : base($"{message}\n" + - $"Library path is {Mpg123Instance.mpg123LibPath}", innerException) + $"Library path is {MpgNative.mpg123LibPath}", innerException) { } } } diff --git a/BassBoom.Native/Interop/Analysis/NativeMetadata.cs b/BassBoom.Native/Interop/Analysis/NativeMetadata.cs index fae904a..ba89e6c 100644 --- a/BassBoom.Native/Interop/Analysis/NativeMetadata.cs +++ b/BassBoom.Native/Interop/Analysis/NativeMetadata.cs @@ -150,137 +150,137 @@ internal static unsafe class NativeMetadata /// /// MPG123_EXPORT mpg123_string* mpg123_new_string(const char* val); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern mpg123_string* mpg123_new_string(string val); /// /// MPG123_EXPORT void mpg123_delete_string(mpg123_string* sb); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern void mpg123_delete_string(mpg123_string* sb); /// /// MPG123_EXPORT void mpg123_init_string(mpg123_string* sb); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern void mpg123_init_string(mpg123_string* sb); /// /// MPG123_EXPORT void mpg123_free_string(mpg123_string* sb); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern void mpg123_free_string(mpg123_string* sb); /// /// MPG123_EXPORT int mpg123_resize_string(mpg123_string* sb, size_t news); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_resize_string(mpg123_string* sb, int news); /// /// MPG123_EXPORT int mpg123_grow_string(mpg123_string* sb, size_t news); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_grow_string(mpg123_string* sb, int news); /// /// MPG123_EXPORT int mpg123_copy_string(mpg123_string* from, mpg123_string* to); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_copy_string(mpg123_string* from, mpg123_string* to); /// /// MPG123_EXPORT int mpg123_move_string(mpg123_string* from, mpg123_string* to); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_move_string(mpg123_string* from, mpg123_string* to); /// /// MPG123_EXPORT int mpg123_add_string(mpg123_string* sb, const char* stuff); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_add_string(mpg123_string* sb, string stuff); /// /// MPG123_EXPORT int mpg123_add_substring( mpg123_string *sb /// , const char *stuff, size_t from, size_t count ); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_add_substring(mpg123_string* sb, string stuff, int @from, int count); /// /// MPG123_EXPORT int mpg123_set_string(mpg123_string* sb, const char* stuff); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_set_string(mpg123_string* sb, string stuff); /// /// MPG123_EXPORT int mpg123_set_substring( mpg123_string *sb /// , const char *stuff, size_t from, size_t count ); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_set_substring(mpg123_string* sb, string stuff, int @from, int count); /// /// MPG123_EXPORT size_t mpg123_strlen(mpg123_string *sb, int utf8); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_strlen(mpg123_string* sb, int utf8); /// /// MPG123_EXPORT int mpg123_chomp_string(mpg123_string *sb); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_chomp_string(mpg123_string *sb); /// /// MPG123_EXPORT int mpg123_same_string(mpg123_string *a, mpg123_string *b); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_same_string(mpg123_string* a, mpg123_string* b); /// /// MPG123_EXPORT enum mpg123_text_encoding mpg123_enc_from_id3(unsigned char id3_enc_byte); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern mpg123_text_encoding mpg123_enc_from_id3(char id3_enc_byte); /// /// MPG123_EXPORT int mpg123_enc_from_id3_2(unsigned char id3_enc_byte); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_enc_from_id3_2(char id3_enc_byte); /// /// MPG123_EXPORT int mpg123_store_utf8(mpg123_string *sb, enum mpg123_text_encoding enc, const unsigned char *source, size_t source_size); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_store_utf8(mpg123_string* sb, mpg123_text_encoding enc, char* source, int source_size); /// /// MPG123_EXPORT int mpg123_store_utf8_2(mpg123_string *sb /// , int enc, const unsigned char *source, size_t source_size); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_store_utf8_2(mpg123_string* sb, int enc, char* source, int source_size); /// /// MPG123_EXPORT int mpg123_meta_check(mpg123_handle *mh); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_meta_check(mpg123_handle* mh); /// /// MPG123_EXPORT void mpg123_meta_free(mpg123_handle *mh); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern void mpg123_meta_free(mpg123_handle* mh); /// /// MPG123_EXPORT int mpg123_id3( mpg123_handle *mh /// , mpg123_id3v1 **v1, mpg123_id3v2 **v2 ); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_id3(mpg123_handle* mh, ref IntPtr v1, ref IntPtr v2); /// @@ -288,19 +288,19 @@ internal static unsafe class NativeMetadata /// , unsigned char **v1, size_t *v1_size /// , unsigned char **v2, size_t *v2_size ); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_id3_raw(mpg123_handle* mh, ref IntPtr v1, ref int v1_size, ref IntPtr v2, ref int v2_size); /// /// MPG123_EXPORT int mpg123_icy(mpg123_handle *mh, char **icy_meta); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_icy(mpg123_handle* mh, ref string icy_meta); /// /// MPG123_EXPORT char* mpg123_icy2utf8(const char* icy_text); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern string mpg123_icy2utf8(string icy_text); } } diff --git a/BassBoom.Native/Interop/Analysis/NativeParameters.cs b/BassBoom.Native/Interop/Analysis/NativeParameters.cs index c250329..7e9b953 100644 --- a/BassBoom.Native/Interop/Analysis/NativeParameters.cs +++ b/BassBoom.Native/Interop/Analysis/NativeParameters.cs @@ -34,79 +34,79 @@ internal static unsafe class NativeParameters /// MPG123_EXPORT mpg123_handle *mpg123_parnew( mpg123_pars *mp /// , const char* decoder, int *error ); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern mpg123_handle* mpg123_parnew(mpg123_pars* mp, string decoder, int* error); /// /// MPG123_EXPORT mpg123_pars *mpg123_new_pars(int *error); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern mpg123_pars *mpg123_new_pars(int *error); /// /// MPG123_EXPORT void mpg123_delete_pars(mpg123_pars* mp); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern void mpg123_delete_pars(mpg123_pars* mp); /// /// MPG123_EXPORT int mpg123_fmt_none(mpg123_pars *mp); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_fmt_none(mpg123_pars *mp); /// /// MPG123_EXPORT int mpg123_fmt_all(mpg123_pars *mp); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_fmt_all(mpg123_pars *mp); /// /// MPG123_EXPORT int mpg123_fmt(mpg123_pars *mp /// , long rate, int channels, int encodings); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_fmt(mpg123_pars* mp, long rate, int channels, int encodings); /// /// MPG123_EXPORT int mpg123_fmt2(mpg123_pars *mp /// , long rate, int channels, int encodings); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_fmt2(mpg123_pars* mp, long rate, int channels, int encodings); /// /// MPG123_EXPORT int mpg123_fmt_support(mpg123_pars *mp, long rate, int encoding); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_fmt_support(mpg123_pars *mp, long rate, int encoding); /// /// MPG123_EXPORT int mpg123_par( mpg123_pars *mp /// , enum mpg123_parms type, long value, double fvalue ); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_par(mpg123_pars* mp, mpg123_parms type, long @value, double fvalue); /// /// mpg123_par( mpg123_pars *mp /// , enum mpg123_parms type, long value, double fvalue ); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_par2(mpg123_pars* mp, int type, long @value, double fvalue); /// /// MPG123_EXPORT int mpg123_getpar( mpg123_pars *mp /// , enum mpg123_parms type, long *value, double *fvalue ); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_getpar(mpg123_pars* mp, mpg123_parms type, long* @value, double* fvalue); /// /// MPG123_EXPORT int mpg123_getpar2( mpg123_pars *mp /// , int type, long *value, double *fvalue ); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_getpar2(mpg123_pars* mp, int type, long* @value, double* fvalue); } } diff --git a/BassBoom.Native/Interop/Analysis/NativeStatus.cs b/BassBoom.Native/Interop/Analysis/NativeStatus.cs index fdfb9ca..74bc44c 100644 --- a/BassBoom.Native/Interop/Analysis/NativeStatus.cs +++ b/BassBoom.Native/Interop/Analysis/NativeStatus.cs @@ -135,105 +135,105 @@ internal static unsafe class NativeStatus /// /// MPG123_EXPORT int mpg123_info(mpg123_handle *mh, struct mpg123_frameinfo *mi); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_info(mpg123_handle* mh, ref mpg123_frameinfo mi); /// /// MPG123_EXPORT int mpg123_info2(mpg123_handle *mh, struct mpg123_frameinfo2 *mi); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_info2(mpg123_handle* mh, ref mpg123_frameinfo2 mi); /// /// MPG123_EXPORT int mpg123_info(mpg123_handle *mh, struct mpg123_frameinfo *mi); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi, EntryPoint = "mpg123_info")] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi, EntryPoint = "mpg123_info")] internal static extern int mpg123_info_win(mpg123_handle* mh, ref mpg123_frameinfo_win mi); /// /// MPG123_EXPORT int mpg123_info2(mpg123_handle *mh, struct mpg123_frameinfo2 *mi); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi, EntryPoint = "mpg123_info2")] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi, EntryPoint = "mpg123_info2")] internal static extern int mpg123_info2_win(mpg123_handle* mh, ref mpg123_frameinfo2_win mi); /// /// MPG123_EXPORT size_t mpg123_safe_buffer(void); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_safe_buffer(); /// /// MPG123_EXPORT int mpg123_scan(mpg123_handle *mh); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_scan(mpg123_handle* mh); /// /// MPG123_EXPORT off_t mpg123_framelength(mpg123_handle *mh); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_framelength(mpg123_handle* mh); /// /// MPG123_EXPORT off_t mpg123_length(mpg123_handle *mh); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_length(mpg123_handle* mh); /// /// MPG123_EXPORT int mpg123_set_filesize(mpg123_handle *mh, off_t size); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_set_filesize(mpg123_handle* mh, int size); /// /// MPG123_EXPORT int64_t mpg123_framelength64(mpg123_handle *mh); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern long mpg123_framelength64(mpg123_handle* mh); /// /// MPG123_EXPORT int64_t mpg123_length64(mpg123_handle *mh); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern long mpg123_length64(mpg123_handle* mh); /// /// MPG123_EXPORT int mpg123_set_filesize64(mpg123_handle *mh, int64_t size); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_set_filesize64(mpg123_handle* mh, long size); /// /// MPG123_EXPORT double mpg123_tpf(mpg123_handle *mh); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern double mpg123_tpf(mpg123_handle* mh); /// /// MPG123_EXPORT int mpg123_spf(mpg123_handle *mh); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_spf(mpg123_handle* mh); /// /// MPG123_EXPORT long mpg123_clip(mpg123_handle *mh); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern long mpg123_clip(mpg123_handle* mh); /// /// MPG123_EXPORT int mpg123_getstate( mpg123_handle *mh /// , enum mpg123_state key, long *val, double *fval ); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_getstate(mpg123_handle* mh, mpg123_state key, ref long val, ref double fval); /// /// MPG123_EXPORT int mpg123_getstate2( mpg123_handle *mh /// , int key, long *val, double *fval ); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_getstate2(mpg123_handle* mh, int key, ref long val, ref double fval); } } diff --git a/BassBoom.Native/Interop/Init/NativeDecoder.cs b/BassBoom.Native/Interop/Init/NativeDecoder.cs index 644ce8c..db38b60 100644 --- a/BassBoom.Native/Interop/Init/NativeDecoder.cs +++ b/BassBoom.Native/Interop/Init/NativeDecoder.cs @@ -30,25 +30,25 @@ internal static unsafe class NativeDecoder /// /// MPG123_EXPORT const char **mpg123_decoders(void); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern IntPtr mpg123_decoders(); /// /// MPG123_EXPORT const char **mpg123_supported_decoders(void); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern IntPtr mpg123_supported_decoders(); /// /// MPG123_EXPORT int mpg123_decoder(mpg123_handle *mh, const char* decoder_name); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_decoder(mpg123_handle* mh, string decoder_name); /// /// MPG123_EXPORT const char* mpg123_current_decoder(mpg123_handle *mh); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern IntPtr mpg123_current_decoder(mpg123_handle* mh); } } diff --git a/BassBoom.Native/Interop/Init/NativeError.cs b/BassBoom.Native/Interop/Init/NativeError.cs index ee81448..289393e 100644 --- a/BassBoom.Native/Interop/Init/NativeError.cs +++ b/BassBoom.Native/Interop/Init/NativeError.cs @@ -82,19 +82,19 @@ internal static unsafe class NativeError /// /// MPG123_EXPORT const char* mpg123_plain_strerror(int errcode); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern nint mpg123_plain_strerror(int errcode); /// /// MPG123_EXPORT const char* mpg123_strerror(mpg123_handle *mh); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern nint mpg123_strerror(mpg123_handle* mh); /// /// MPG123_EXPORT int mpg123_errcode(mpg123_handle *mh); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_errcode(mpg123_handle* mh); } } diff --git a/BassBoom.Native/Interop/Init/NativeInit.cs b/BassBoom.Native/Interop/Init/NativeInit.cs index 22a989b..f4c9947 100644 --- a/BassBoom.Native/Interop/Init/NativeInit.cs +++ b/BassBoom.Native/Interop/Init/NativeInit.cs @@ -118,71 +118,83 @@ internal static unsafe class NativeInit /// /// const char *mpg123_distversion(unsigned int *major, unsigned int *minor, unsigned int *patch) /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern IntPtr mpg123_distversion(ref uint major, ref uint minor, ref uint patch); /// /// unsigned int mpg123_libversion(unsigned int *patch); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern uint mpg123_libversion(ref uint patch); + /// + /// MPG123_EXPORT int mpg123_init (void) + /// + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] + internal static extern int mpg123_init(); + /// /// MPG123_EXPORT mpg123_handle* mpg123_new (const char* decoder, int* error) /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern mpg123_handle* mpg123_new([MarshalAs(UnmanagedType.LPStr)] string decoder, int* error); /// /// MPG123_EXPORT void mpg123_delete(mpg123_handle* mh) /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern void mpg123_delete(mpg123_handle* mh); /// /// MPG123_EXPORT void mpg123_free(void* ptr) /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern void mpg123_free(IntPtr ptr); /// /// MPG123_EXPORT int mpg123_param(mpg123_handle *mh /// , enum mpg123_parms type, long value, double fvalue); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_param(mpg123_handle* mh, mpg123_parms type, long value, double fvalue); /// /// MPG123_EXPORT int mpg123_param2(mpg123_handle *mh /// , int type, long value, double fvalue); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_param2(mpg123_handle* mh, int type, long value, double fvalue); /// /// MPG123_EXPORT int mpg123_getparam(mpg123_handle *mh /// , enum mpg123_parms type, long *value, double *fvalue); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_getparam(mpg123_handle* mh, mpg123_parms type, long* value, double* fvalue); /// /// MPG123_EXPORT int mpg123_getparam2(mpg123_handle *mh /// , int type, long *value, double *fvalue); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_getparam2(mpg123_handle* mh, int type, long* value, double* fvalue); /// /// MPG123_EXPORT int mpg123_feature(const enum mpg123_feature_set key); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_feature(mpg123_feature_set key); /// /// MPG123_EXPORT int mpg123_feature2(int key); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_feature2(int key); + + /// + /// int setenv(const char *name, const char *value, int overwrite); + /// + [DllImport(MpgNative.LibcName, CharSet = CharSet.Ansi)] + internal static extern int setenv(string name, string value, int overwrite); } } diff --git a/BassBoom.Native/Interop/LibraryTools.cs b/BassBoom.Native/Interop/LibraryTools.cs deleted file mode 100644 index f45ed12..0000000 --- a/BassBoom.Native/Interop/LibraryTools.cs +++ /dev/null @@ -1,109 +0,0 @@ -// -// BassBoom Copyright (C) 2023 Aptivi -// -// This file is part of BassBoom -// -// BassBoom is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// BassBoom is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY, without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . -// - -using BassBoom.Native.Interop.Init; -using BassBoom.Native.Interop.Output; -using BassBoom.Native.Runtime; -using System; -using System.Diagnostics; -using System.Runtime.InteropServices; - -namespace BassBoom.Native.Interop -{ - /// - /// General native library properties and functions - /// - internal static unsafe class LibraryTools - { - /// - /// Absolute path to the mpg123 library - /// - internal static string LibraryPath => - Mpg123Instance.mpg123LibPath; - - /// - /// Absolute path to the out123 library - /// - internal static string LibraryPathOut => - Mpg123Instance.out123LibPath; - - /// - /// MPG library version - /// - internal static Version MpgLibVersion - { - get - { - uint major = 0, minor = 0, patch = 0; - var versionHandle = NativeInit.mpg123_distversion(ref major, ref minor, ref patch); - string version = Marshal.PtrToStringAnsi(versionHandle); - Debug.WriteLine($"mpg123 version: {version}"); - return new((int)major, (int)minor, (int)patch, 0); - } - } - - /// - /// Output library version - /// - internal static Version OutLibVersion - { - get - { - uint major = 0, minor = 0, patch = 0; - var versionHandle = NativeOutputLib.out123_distversion(ref major, ref minor, ref patch); - string version = Marshal.PtrToStringAnsi(versionHandle); - Debug.WriteLine($"out123 version: {version}"); - return new((int)major, (int)minor, (int)patch, 0); - } - } - - /// - /// C library name (POSIX) - /// - internal const string LibcName = "libc"; - - /// - /// Library name to search for upon invoking P/Invoke - /// - internal const string LibraryName = "mpg123"; - - /// - /// Library name to search for upon invoking P/Invoke - /// - internal const string LibraryNameOut = "out123"; - - /// - /// MPG123_EXPORT int mpg123_init (void) - /// - [DllImport(LibraryName, CharSet = CharSet.Ansi)] - internal static extern int mpg123_init(); - - /// - /// int setenv(const char *name, const char *value, int overwrite); - /// - [DllImport(LibcName, CharSet = CharSet.Ansi)] - internal static extern int setenv(string name, string value, int overwrite); - - /// - /// int unsetenv(const char *name); - /// - [DllImport(LibcName, CharSet = CharSet.Ansi)] - internal static extern int unsetenv(string name); - } -} diff --git a/BassBoom.Native/Interop/LowLevel/NativeLowIo.cs b/BassBoom.Native/Interop/LowLevel/NativeLowIo.cs index e3fb798..6c17602 100644 --- a/BassBoom.Native/Interop/LowLevel/NativeLowIo.cs +++ b/BassBoom.Native/Interop/LowLevel/NativeLowIo.cs @@ -17,9 +17,9 @@ // along with this program. If not, see . // +using BassBoom.Native.Interop.Init; using System; using System.Runtime.InteropServices; -using BassBoom.Native.Interop.Init; namespace BassBoom.Native.Interop.LowLevel { @@ -53,13 +53,13 @@ internal static unsafe class NativeLowIo /// MPG123_EXPORT int mpg123_replace_buffer(mpg123_handle *mh /// , void *data, size_t size); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_replace_buffer(mpg123_handle* mh, IntPtr data, int size); /// /// MPG123_EXPORT size_t mpg123_outblock(mpg123_handle *mh); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_outblock(mpg123_handle* mh); /// @@ -68,7 +68,7 @@ internal static unsafe class NativeLowIo /// , off_t (*r_lseek)(int, off_t, int) /// ); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_replace_reader(mpg123_handle* mh, r_read r_read, r_lseek r_lseek); /// @@ -77,13 +77,13 @@ internal static unsafe class NativeLowIo /// , off_t (*r_lseek)(void *, off_t, int) /// , void (*cleanup)(void*) ); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_replace_reader_handle(mpg123_handle* mh, r_read2 r_read, r_lseek2 r_lseek, _cleanup cleanup); /// /// MPG123_EXPORT int mpg123_reader64( mpg123_handle *mh, int (*r_read) (void *, void *, size_t, size_t *), int64_t (*r_lseek)(void *, int64_t, int), void (*cleanup)(void*) ); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_reader64(mpg123_handle* mh, r_read3 r_read, r_lseek3 r_lseek, _cleanup cleanup); } } diff --git a/BassBoom.Native/Interop/Output/NativeOutputLib.cs b/BassBoom.Native/Interop/Output/NativeOutputLib.cs index 36adf42..0168438 100644 --- a/BassBoom.Native/Interop/Output/NativeOutputLib.cs +++ b/BassBoom.Native/Interop/Output/NativeOutputLib.cs @@ -85,138 +85,138 @@ internal static unsafe class NativeOutputLib /// /// MPG123_EXPORT const char *out123_distversion(unsigned int *major, unsigned int *minor, unsigned int *patch); /// - [DllImport(LibraryTools.LibraryNameOut, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryNameOut, CharSet = CharSet.Ansi)] internal static extern IntPtr out123_distversion(ref uint major, ref uint minor, ref uint patch); /// /// MPG123_EXPORT unsigned int out123_libversion(unsigned int *patch); /// - [DllImport(LibraryTools.LibraryNameOut, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryNameOut, CharSet = CharSet.Ansi)] internal static extern uint out123_libversion(ref uint patch); /// /// MPG123_EXPORT out123_handle *out123_new(void); /// - [DllImport(LibraryTools.LibraryNameOut, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryNameOut, CharSet = CharSet.Ansi)] internal static extern out123_handle* out123_new(); /// /// MPG123_EXPORT void out123_del(out123_handle *ao); /// - [DllImport(LibraryTools.LibraryNameOut, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryNameOut, CharSet = CharSet.Ansi)] internal static extern void out123_del(out123_handle* ao); /// /// MPG123_EXPORT void out123_free(void *ptr); /// - [DllImport(LibraryTools.LibraryNameOut, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryNameOut, CharSet = CharSet.Ansi)] internal static extern void out123_free(IntPtr ptr); /// /// MPG123_EXPORT const char* out123_strerror(out123_handle *ao); /// - [DllImport(LibraryTools.LibraryNameOut, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryNameOut, CharSet = CharSet.Ansi)] internal static extern nint out123_strerror(out123_handle* ao); /// /// MPG123_EXPORT int out123_errcode(out123_handle *ao); /// - [DllImport(LibraryTools.LibraryNameOut, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryNameOut, CharSet = CharSet.Ansi)] internal static extern int out123_errcode(out123_handle* ao); /// /// MPG123_EXPORT const char* out123_plain_strerror(int errcode); /// - [DllImport(LibraryTools.LibraryNameOut, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryNameOut, CharSet = CharSet.Ansi)] internal static extern nint out123_plain_strerror(int errcode); /// /// MPG123_EXPORT int out123_set_buffer(out123_handle *ao, size_t buffer_bytes); /// - [DllImport(LibraryTools.LibraryNameOut, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryNameOut, CharSet = CharSet.Ansi)] internal static extern int out123_set_buffer(out123_handle* ao, int buffer_bytes); /// /// MPG123_EXPORT int out123_param( out123_handle *ao, enum out123_parms code /// , long value, double fvalue, const char *svalue ); /// - [DllImport(LibraryTools.LibraryNameOut, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryNameOut, CharSet = CharSet.Ansi)] internal static extern int out123_param(out123_handle* ao, out123_parms code, long @value, double fvalue, string svalue); /// /// MPG123_EXPORT int out123_param2( out123_handle *ao, int code /// , long value, double fvalue, const char *svalue ); /// - [DllImport(LibraryTools.LibraryNameOut, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryNameOut, CharSet = CharSet.Ansi)] internal static extern int out123_param(out123_handle* ao, int code, long @value, double fvalue, string svalue); /// /// MPG123_EXPORT /// - [DllImport(LibraryTools.LibraryNameOut, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryNameOut, CharSet = CharSet.Ansi)] internal static extern int out123_getparam(out123_handle* ao, out123_parms code, long* ret_value, double* ret_fvalue, char* ret_svalue); /// /// MPG123_EXPORT int out123_getparam2( out123_handle *ao, int code /// , long *ret_value, double *ret_fvalue, char* *ret_svalue ); /// - [DllImport(LibraryTools.LibraryNameOut, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryNameOut, CharSet = CharSet.Ansi)] internal static extern int out123_getparam2(out123_handle* ao, int code, long* ret_value, double* ret_fvalue, char* ret_svalue); /// /// MPG123_EXPORT int out123_param_from(out123_handle *ao, out123_handle* from_ao); /// - [DllImport(LibraryTools.LibraryNameOut, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryNameOut, CharSet = CharSet.Ansi)] internal static extern int out123_param_from(out123_handle* ao, out123_handle* from_ao); /// /// MPG123_EXPORT int out123_drivers(out123_handle *ao, char ***names, char ***descr); /// - [DllImport(LibraryTools.LibraryNameOut, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryNameOut, CharSet = CharSet.Ansi)] internal static extern int out123_drivers(out123_handle* ao, ref nint names, ref nint descr); /// /// MPG123_EXPORT int out123_devices( out123_handle *ao, const char *driver /// , char ***names, char ***descr, char **active_driver ); /// - [DllImport(LibraryTools.LibraryNameOut, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryNameOut, CharSet = CharSet.Ansi)] internal static extern int out123_devices(out123_handle* ao, [MarshalAs(UnmanagedType.LPStr)] string driver, out nint names, out nint descr, ref nint active_driver); /// /// MPG123_EXPORT void out123_stringlists_free(char **name, char **descr, int count); /// - [DllImport(LibraryTools.LibraryNameOut, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryNameOut, CharSet = CharSet.Ansi)] internal static extern void out123_stringlists_free(char** name, char** descr, int count); /// /// MPG123_EXPORT int out123_open(out123_handle *ao, const char* driver, const char* device); /// - [DllImport(LibraryTools.LibraryNameOut, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryNameOut, CharSet = CharSet.Ansi)] internal static extern int out123_open(out123_handle* ao, string driver, string device); /// /// MPG123_EXPORT int out123_driver_info(out123_handle *ao, char **driver, char **device); /// - [DllImport(LibraryTools.LibraryNameOut, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryNameOut, CharSet = CharSet.Ansi)] internal static extern int out123_driver_info(out123_handle* ao, ref IntPtr driver, ref IntPtr device); /// /// MPG123_EXPORT void out123_close(out123_handle *ao); /// - [DllImport(LibraryTools.LibraryNameOut, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryNameOut, CharSet = CharSet.Ansi)] internal static extern void out123_close(out123_handle* ao); /// /// MPG123_EXPORT int out123_encodings(out123_handle *ao, long rate, int channels); /// - [DllImport(LibraryTools.LibraryNameOut, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryNameOut, CharSet = CharSet.Ansi)] internal static extern int out123_encodings(out123_handle* ao, long rate, int channels); /// /// MPG123_EXPORT int out123_encsize(int encoding); /// - [DllImport(LibraryTools.LibraryNameOut, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryNameOut, CharSet = CharSet.Ansi)] internal static extern int out123_encsize(int encoding); /// @@ -224,94 +224,94 @@ internal static extern int out123_devices(out123_handle* ao, /// , int minchannels, int maxchannels /// , struct mpg123_fmt **fmtlist ); /// - [DllImport(LibraryTools.LibraryNameOut, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryNameOut, CharSet = CharSet.Ansi)] internal static extern int out123_formats(out123_handle* ao, IntPtr rates, int ratecount, int minchannels, int maxchannels, ref IntPtr fmtlist); /// /// MPG123_EXPORT int out123_enc_list(int **enclist); /// - [DllImport(LibraryTools.LibraryNameOut, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryNameOut, CharSet = CharSet.Ansi)] internal static extern int out123_enc_list(int** enclist); /// /// MPG123_EXPORT int out123_enc_byname(const char *name); /// - [DllImport(LibraryTools.LibraryNameOut, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryNameOut, CharSet = CharSet.Ansi)] internal static extern int out123_enc_byname(string name); /// /// MPG123_EXPORT const char* out123_enc_name(int encoding); /// - [DllImport(LibraryTools.LibraryNameOut, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryNameOut, CharSet = CharSet.Ansi)] internal static extern string out123_enc_name(int encoding); /// /// MPG123_EXPORT const char* out123_enc_longname(int encoding); /// - [DllImport(LibraryTools.LibraryNameOut, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryNameOut, CharSet = CharSet.Ansi)] internal static extern string out123_enc_longname(int encoding); /// /// MPG123_EXPORT int out123_start( out123_handle *ao /// , long rate, int channels, int encoding ); /// - [DllImport(LibraryTools.LibraryNameOut, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryNameOut, CharSet = CharSet.Ansi)] internal static extern int out123_start(out123_handle* ao, long rate, int channels, int encoding); /// /// MPG123_EXPORT void out123_pause(out123_handle *ao); /// - [DllImport(LibraryTools.LibraryNameOut, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryNameOut, CharSet = CharSet.Ansi)] internal static extern void out123_pause(out123_handle* ao); /// /// MPG123_EXPORT void out123_continue(out123_handle *ao); /// - [DllImport(LibraryTools.LibraryNameOut, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryNameOut, CharSet = CharSet.Ansi)] internal static extern void out123_continue(out123_handle* ao); /// /// MPG123_EXPORT void out123_stop(out123_handle *ao); /// - [DllImport(LibraryTools.LibraryNameOut, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryNameOut, CharSet = CharSet.Ansi)] internal static extern void out123_stop(out123_handle *ao); /// /// MPG123_EXPORT size_t out123_play( out123_handle *ao /// , void *buffer, size_t bytes ); /// - [DllImport(LibraryTools.LibraryNameOut, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryNameOut, CharSet = CharSet.Ansi)] internal static extern int out123_play(out123_handle* ao, IntPtr buffer, int bytes); /// /// MPG123_EXPORT void out123_drop(out123_handle *ao); /// - [DllImport(LibraryTools.LibraryNameOut, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryNameOut, CharSet = CharSet.Ansi)] internal static extern void out123_drop(out123_handle* ao); /// /// MPG123_EXPORT void out123_drain(out123_handle *ao); /// - [DllImport(LibraryTools.LibraryNameOut, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] + [DllImport(MpgNative.LibraryNameOut, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] internal static extern void out123_drain(out123_handle* ao); /// /// MPG123_EXPORT void out123_ndrain(out123_handle *ao, size_t bytes); /// - [DllImport(LibraryTools.LibraryNameOut, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryNameOut, CharSet = CharSet.Ansi)] internal static extern void out123_ndrain(out123_handle* ao, int bytes); /// /// MPG123_EXPORT size_t out123_buffered(out123_handle *ao); /// - [DllImport(LibraryTools.LibraryNameOut, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryNameOut, CharSet = CharSet.Ansi)] internal static extern int out123_buffered(out123_handle* ao); /// /// MPG123_EXPORT int out123_getformat( out123_handle *ao /// , long *rate, int *channels, int *encoding, int *framesize ); /// - [DllImport(LibraryTools.LibraryNameOut, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryNameOut, CharSet = CharSet.Ansi)] internal static extern int out123_getformat(out123_handle* ao, long* rate, int* channels, int* encoding, out int framesize); } } diff --git a/BassBoom.Native/Interop/Play/NativeInput.cs b/BassBoom.Native/Interop/Play/NativeInput.cs index a540384..1af5ea3 100644 --- a/BassBoom.Native/Interop/Play/NativeInput.cs +++ b/BassBoom.Native/Interop/Play/NativeInput.cs @@ -17,9 +17,9 @@ // along with this program. If not, see . // +using BassBoom.Native.Interop.Init; using System; using System.Runtime.InteropServices; -using BassBoom.Native.Interop.Init; namespace BassBoom.Native.Interop.Play { @@ -32,51 +32,51 @@ internal static unsafe class NativeInput /// MPG123_EXPORT int mpg123_open_fixed(mpg123_handle *mh, const char *path /// , int channels, int encoding); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_open_fixed(mpg123_handle* mh, string path, int channels, int encoding); /// /// MPG123_EXPORT int mpg123_open(mpg123_handle *mh, const char *path); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_open(mpg123_handle* mh, string path); /// /// MPG123_EXPORT int mpg123_open_fd(mpg123_handle *mh, int fd); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_open_fd(mpg123_handle* mh, int fd); /// /// MPG123_EXPORT int mpg123_open_handle(mpg123_handle *mh, void *iohandle); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_open_handle(mpg123_handle* mh, IntPtr iohandle); /// /// MPG123_EXPORT int mpg123_open_feed(mpg123_handle *mh); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_open_feed(mpg123_handle* mh); /// /// MPG123_EXPORT int mpg123_close(mpg123_handle *mh); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_close(mpg123_handle* mh); /// /// MPG123_EXPORT int mpg123_read(mpg123_handle *mh /// , void *outmemory, size_t outmemsize, size_t *done); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_read(mpg123_handle* mh, IntPtr outmemory, int outmemsize, out int done); /// /// MPG123_EXPORT int mpg123_feed(mpg123_handle *mh /// , const unsigned char *in, size_t size); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_feed(mpg123_handle* mh, IntPtr @in, int size); /// @@ -84,60 +84,60 @@ internal static unsafe class NativeInput /// , const unsigned char *inmemory, size_t inmemsize /// , void *outmemory, size_t outmemsize, size_t *done); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_decode(mpg123_handle* mh, byte* inmemory, int inmemsize, IntPtr outmemory, int outmemsize, int* done); /// /// MPG123_EXPORT int mpg123_decode_frame(mpg123_handle *mh /// , off_t *num, unsigned char **audio, size_t *bytes); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_decode_frame(mpg123_handle* mh, ref IntPtr num, ref IntPtr audio, ref IntPtr bytes); /// /// MPG123_EXPORT int mpg123_framebyframe_decode(mpg123_handle *mh /// , off_t *num, unsigned char **audio, size_t *bytes); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_framebyframe_decode(mpg123_handle* mh, IntPtr num, string[] audio, int* bytes); /// /// MPG123_EXPORT int mpg123_decode_frame64(mpg123_handle *mh /// , int64_t *num, unsigned char **audio, size_t *bytes); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_decode_frame64(mpg123_handle *mh, long* num, string[] audio, int* bytes); /// /// MPG123_EXPORT int mpg123_framebyframe_decode64(mpg123_handle *mh /// , int64_t *num, unsigned char **audio, size_t *bytes); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_framebyframe_decode64(mpg123_handle* mh, long* num, string[] audio, int* bytes); /// /// MPG123_EXPORT int mpg123_framebyframe_next(mpg123_handle *mh); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_framebyframe_next(mpg123_handle* mh); /// /// MPG123_EXPORT int mpg123_framedata(mpg123_handle *mh /// , unsigned long *header, unsigned char **bodydata, size_t *bodybytes); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_framedata(mpg123_handle* mh, ulong* header, string[] bodydata, int* bodybytes); /// /// MPG123_EXPORT off_t mpg123_framepos(mpg123_handle *mh); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern IntPtr mpg123_framepos(mpg123_handle *mh); /// /// MPG123_EXPORT int64_t mpg123_framepos64(mpg123_handle *mh); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern long mpg123_framepos64(mpg123_handle* mh); } } diff --git a/BassBoom.Native/Interop/Play/NativeOutput.cs b/BassBoom.Native/Interop/Play/NativeOutput.cs index 970b912..ec854f3 100644 --- a/BassBoom.Native/Interop/Play/NativeOutput.cs +++ b/BassBoom.Native/Interop/Play/NativeOutput.cs @@ -17,8 +17,8 @@ // along with this program. If not, see . // -using System.Runtime.InteropServices; using BassBoom.Native.Interop.Init; +using System.Runtime.InteropServices; namespace BassBoom.Native.Interop.Play { @@ -36,66 +36,66 @@ internal static unsafe class NativeOutput /// /// MPG123_EXPORT void mpg123_rates(const long **list, size_t *number); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern void mpg123_rates(long[] list, int* number); /// /// MPG123_EXPORT void mpg123_encodings(const int **list, size_t *number); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern void mpg123_encodings(int[] list, int* number); /// /// MPG123_EXPORT int mpg123_encsize(int encoding); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_encsize(int encoding); /// /// MPG123_EXPORT int mpg123_format_none(mpg123_handle *mh); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_format_none(mpg123_handle* mh); /// /// MPG123_EXPORT int mpg123_format_all(mpg123_handle *mh); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_format_all(mpg123_handle* mh); /// /// MPG123_EXPORT int mpg123_format(mpg123_handle *mh /// , long rate, int channels, int encodings); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_format(mpg123_handle* mh, long rate, int channels, int encodings); /// /// MPG123_EXPORT int mpg123_format2(mpg123_handle *mh /// , long rate, int channels, int encodings); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_format2(mpg123_handle* mh, long rate, int channels, int encodings); /// /// MPG123_EXPORT int mpg123_format_support(mpg123_handle *mh /// , long rate, int encoding); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_format_support(mpg123_handle* mh, long rate, int encoding); /// /// MPG123_EXPORT int mpg123_getformat(mpg123_handle *mh /// , long *rate, int *channels, int *encoding); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_getformat(mpg123_handle* mh, out long rate, out int channels, out int encoding); /// /// MPG123_EXPORT int mpg123_getformat2(mpg123_handle *mh /// , long *rate, int *channels, int *encoding, int clear_flag); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_getformat2(mpg123_handle* mh, long* rate, int* channels, int* encoding, int clear_flag); } } diff --git a/BassBoom.Native/Interop/Play/NativePositioning.cs b/BassBoom.Native/Interop/Play/NativePositioning.cs index 58e34d8..75e0cb2 100644 --- a/BassBoom.Native/Interop/Play/NativePositioning.cs +++ b/BassBoom.Native/Interop/Play/NativePositioning.cs @@ -17,8 +17,8 @@ // along with this program. If not, see . // -using System.Runtime.InteropServices; using BassBoom.Native.Interop.Init; +using System.Runtime.InteropServices; namespace BassBoom.Native.Interop.Play { @@ -30,125 +30,125 @@ internal static unsafe class NativePositioning /// /// MPG123_EXPORT off_t mpg123_tell(mpg123_handle *mh); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_tell(mpg123_handle* mh); /// /// MPG123_EXPORT int64_t mpg123_tell64(mpg123_handle *mh); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern long mpg123_tell64(mpg123_handle* mh); /// /// MPG123_EXPORT off_t mpg123_tellframe(mpg123_handle *mh); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_tellframe(mpg123_handle* mh); /// /// MPG123_EXPORT int64_t mpg123_tellframe64(mpg123_handle *mh); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern long mpg123_tellframe64(mpg123_handle* mh); /// /// MPG123_EXPORT off_t mpg123_tell_stream(mpg123_handle *mh); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_tell_stream(mpg123_handle* mh); /// /// MPG123_EXPORT int64_t mpg123_tell_stream64(mpg123_handle *mh); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern long mpg123_tell_stream64(mpg123_handle* mh); /// /// MPG123_EXPORT off_t mpg123_seek( mpg123_handle *mh /// , off_t sampleoff, int whence ); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_seek(mpg123_handle* mh, int sampleoff, int whence); /// /// MPG123_EXPORT int64_t mpg123_seek64( mpg123_handle *mh /// , int64_t sampleoff, int whence ); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern long mpg123_seek64(mpg123_handle* mh, long sampleoff, int whence); /// /// MPG123_EXPORT off_t mpg123_feedseek( mpg123_handle *mh /// , off_t sampleoff, int whence, off_t *input_offset ); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_feedseek(mpg123_handle* mh, int sampleoff, int whence, int* input_offset); /// /// MPG123_EXPORT int64_t mpg123_feedseek64( mpg123_handle *mh /// , int64_t sampleoff, int whence, int64_t *input_offset ); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern long mpg123_feedseek64(mpg123_handle* mh, long sampleoff, int whence, long* input_offset); /// /// MPG123_EXPORT off_t mpg123_seek_frame( mpg123_handle *mh /// , off_t frameoff, int whence ); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_seek_frame(mpg123_handle* mh, int frameoff, int whence); /// /// MPG123_EXPORT int64_t mpg123_seek_frame64( mpg123_handle *mh /// , int64_t frameoff, int whence ); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern long mpg123_seek_frame64(mpg123_handle* mh, long frameoff, int whence); /// /// MPG123_EXPORT off_t mpg123_timeframe(mpg123_handle *mh, double sec); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_timeframe(mpg123_handle *mh, double sec); /// /// MPG123_EXPORT int mpg123_index( mpg123_handle *mh /// , off_t **offsets, off_t *step, size_t * fill); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_index(mpg123_handle* mh, int*[] offsets, int* step, int* fill); /// /// MPG123_EXPORT int64_t mpg123_timeframe64(mpg123_handle *mh, double sec); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern long mpg123_timeframe64(mpg123_handle* mh, double sec); /// /// MPG123_EXPORT int mpg123_index64( mpg123_handle *mh /// , int64_t **offsets, int64_t *step, size_t *fill ); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_index64(mpg123_handle* mh, long*[] offsets, long* step, int* fill); /// /// MPG123_EXPORT int mpg123_set_index( mpg123_handle *mh /// , off_t *offsets, off_t step, size_t fill ); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_set_index(mpg123_handle* mh, int* offsets, int step, int fill); /// /// MPG123_EXPORT int mpg123_set_index64( mpg123_handle *mh /// , int64_t *offsets, int64_t step, size_t fill ); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_set_index64(mpg123_handle* mh, long* offsets, long step, int fill); /// /// MPG123_EXPORT int mpg123_position( mpg123_handle *mh, off_t frame_offset, off_t buffered_bytes, off_t *current_frame, off_t *frames_left, double *current_seconds, double *seconds_left); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_position(mpg123_handle* mh, int frame_offset, int buffered_bytes, int* current_frame, int* frames_left, double* current_seconds, double* seconds_left); } } diff --git a/BassBoom.Native/Interop/Play/NativeVolume.cs b/BassBoom.Native/Interop/Play/NativeVolume.cs index b85fd3a..76ef424 100644 --- a/BassBoom.Native/Interop/Play/NativeVolume.cs +++ b/BassBoom.Native/Interop/Play/NativeVolume.cs @@ -17,8 +17,8 @@ // along with this program. If not, see . // -using System.Runtime.InteropServices; using BassBoom.Native.Interop.Init; +using System.Runtime.InteropServices; namespace BassBoom.Native.Interop.Play { @@ -38,71 +38,71 @@ internal static unsafe class NativeVolume /// MPG123_EXPORT int mpg123_eq( mpg123_handle *mh /// , enum mpg123_channels channel, int band, double val ); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_eq(mpg123_handle* mh, mpg123_channels channel, int band, double val); /// /// MPG123_EXPORT int mpg123_eq2( mpg123_handle *mh /// , int channel, int band, double val ); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_eq2(mpg123_handle* mh, int channel, int band, double val); /// /// MPG123_EXPORT int mpg123_eq_bands( mpg123_handle *mh /// , int channel, int a, int b, double factor ); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_eq_bands(mpg123_handle* mh, int channel, int a, int b, double factor); /// /// MPG123_EXPORT int mpg123_eq_change( mpg123_handle *mh /// , int channel, int a, int b, double db ); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_eq_change(mpg123_handle* mh, int channel, int a, int b, double db); /// /// MPG123_EXPORT double mpg123_geteq(mpg123_handle *mh /// , enum mpg123_channels channel, int band); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern double mpg123_geteq(mpg123_handle* mh, mpg123_channels channel, int band); /// /// MPG123_EXPORT double mpg123_geteq2(mpg123_handle *mh, int channel, int band); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern double mpg123_geteq2(mpg123_handle* mh, int channel, int band); /// /// MPG123_EXPORT int mpg123_reset_eq(mpg123_handle *mh); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_reset_eq(mpg123_handle* mh); /// /// MPG123_EXPORT int mpg123_volume(mpg123_handle *mh, double vol); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_volume(mpg123_handle* mh, double vol); /// /// MPG123_EXPORT int mpg123_volume_change(mpg123_handle *mh, double change); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_volume_change(mpg123_handle *mh, double change); /// /// MPG123_EXPORT int mpg123_volume_change_db(mpg123_handle *mh, double db); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_volume_change_db(mpg123_handle *mh, double db); /// /// MPG123_EXPORT int mpg123_getvolume(mpg123_handle *mh, double *base, double *really, double *rva_db); /// - [DllImport(LibraryTools.LibraryName, CharSet = CharSet.Ansi)] + [DllImport(MpgNative.LibraryName, CharSet = CharSet.Ansi)] internal static extern int mpg123_getvolume(mpg123_handle* mh, ref double @base, ref double really, ref double rva_db); } } diff --git a/BassBoom.Native/Runtime/Mpg123Instance.cs b/BassBoom.Native/MpgNative.cs similarity index 84% rename from BassBoom.Native/Runtime/Mpg123Instance.cs rename to BassBoom.Native/MpgNative.cs index f23b4a4..defd23a 100644 --- a/BassBoom.Native/Runtime/Mpg123Instance.cs +++ b/BassBoom.Native/MpgNative.cs @@ -18,7 +18,6 @@ // using BassBoom.Native.Exceptions; -using BassBoom.Native.Interop; using BassBoom.Native.Interop.Init; using BassBoom.Native.Interop.Output; using System; @@ -33,12 +32,12 @@ using NativeLand.Tools; #endif -namespace BassBoom.Native.Runtime +namespace BassBoom.Native { /// /// mpg123 instance class to enable Basolia to perform sound operations /// - internal unsafe class Mpg123Instance + internal static unsafe class MpgNative { internal static string mpg123LibPath = GetAppropriateMpg123LibraryPath(); internal static string out123LibPath = GetAppropriateOut123LibraryPath(); @@ -47,10 +46,51 @@ internal unsafe class Mpg123Instance internal static mpg123_handle* _mpg123Handle; internal static out123_handle* _out123Handle; + internal const string LibcName = "libc"; + internal const string LibraryName = "mpg123"; + internal const string LibraryNameOut = "out123"; + /// - /// Singleton of the mpg123 instance class + /// Absolute path to the mpg123 library /// - internal static Mpg123Instance Instance { get; } = new Mpg123Instance(); + internal static string LibraryPath => + mpg123LibPath; + + /// + /// Absolute path to the out123 library + /// + internal static string LibraryPathOut => + out123LibPath; + + /// + /// MPG library version + /// + internal static Version MpgLibVersion + { + get + { + uint major = 0, minor = 0, patch = 0; + var versionHandle = NativeInit.mpg123_distversion(ref major, ref minor, ref patch); + string version = Marshal.PtrToStringAnsi(versionHandle); + Debug.WriteLine($"mpg123 version: {version}"); + return new((int)major, (int)minor, (int)patch, 0); + } + } + + /// + /// Output library version + /// + internal static Version OutLibVersion + { + get + { + uint major = 0, minor = 0, patch = 0; + var versionHandle = NativeOutputLib.out123_distversion(ref major, ref minor, ref patch); + string version = Marshal.PtrToStringAnsi(versionHandle); + Debug.WriteLine($"out123 version: {version}"); + return new((int)major, (int)minor, (int)patch, 0); + } + } /// /// Initializes the mpg123 library @@ -148,7 +188,7 @@ internal static void InitializeLibrary(string libPath, string libPathOut, string Environment.SetEnvironmentVariable("MPG123_MODDIR", libPluginsPath); else { - int result = LibraryTools.setenv("MPG123_MODDIR", libPluginsPath, 1); + int result = NativeInit.setenv("MPG123_MODDIR", libPluginsPath, 1); if (result != 0) throw new BasoliaNativeLibraryException("Can't set environment variable MPG123_MODDIR"); } @@ -157,9 +197,9 @@ internal static void InitializeLibrary(string libPath, string libPathOut, string try { // mpg123 returns 0 on init. - _ = LibraryTools.mpg123_init(); + _ = NativeInit.mpg123_init(); var handle = NativeInit.mpg123_new(null, null); - Debug.WriteLine($"Verifying mpg123 version: {LibraryTools.MpgLibVersion}"); + Debug.WriteLine($"Verifying mpg123 version: {MpgLibVersion}"); _mpg123Handle = handle; } catch (Exception ex) @@ -172,7 +212,7 @@ internal static void InitializeLibrary(string libPath, string libPathOut, string try { var handle = NativeOutputLib.out123_new(); - Debug.WriteLine($"Verifying out123 version: {LibraryTools.OutLibVersion}"); + Debug.WriteLine($"Verifying out123 version: {OutLibVersion}"); _out123Handle = handle; } catch (Exception ex) @@ -185,10 +225,10 @@ internal static void InitializeLibrary(string libPath, string libPathOut, string #if NETCOREAPP private static nint ResolveLibrary(string libraryName, Assembly assembly, DllImportSearchPath? searchPath) { - IntPtr libHandle = IntPtr.Zero; - if (libraryName == LibraryTools.LibraryName) + nint libHandle = nint.Zero; + if (libraryName == LibraryName) libHandle = NativeLibrary.Load(mpg123LibPath); - else if (libraryName == LibraryTools.LibraryNameOut) + else if (libraryName == LibraryNameOut) libHandle = NativeLibrary.Load(out123LibPath); return libHandle; } @@ -243,8 +283,5 @@ internal static string GetAppropriateWinpthreadsLibraryPath(string root) return ""; return runtimesPath; } - - internal Mpg123Instance() - { } } }