Пример #1
0
        public static void loadPatch()
        {
            if (loader == null)
            {
                loader = IsLinux() ? (IDllLoader) new LinuxDllLoader() : (IDllLoader) new WindowsDllLoader();
            }
            SDllHandle = loader.LoadLibrary("libpdcsharp." + (IsLinux() ? "so" : "dll"));
            LibPD.ReInit();

            LibPD.OpenAudio(2, 3, 44100);
            SPatch = LibPD.OpenPatch(@"../../test_csharp.pd");
            LibPD.ComputeAudio(true);
        }
Пример #2
0
        public static void loadPatch()
        {
            if (loader == null)
            {
                loader = IsLinux() ? (IDllLoader)new LinuxDllLoader() : (IDllLoader)new WindowsDllLoader();
            }
            SDllHandle = loader.LoadLibrary("libpdcsharp." + (IsLinux() ? "so" : "dll"));
            LibPD.ReInit();

            LibPD.OpenAudio(2, 3, 44100);
            SPatch = LibPD.OpenPatch(@"../../test_csharp.pd");
            LibPD.ComputeAudio(true);
        }
Пример #3
0
 static Usbmuxd()
 {
     if (Platform.IsMac)
     {
         loader = new PosixDllLoader();
     }
     else if (Platform.IsWindows)
     {
         loader = new WindowsDllLoader();
     }
     else
     {
         throw new NotSupportedException("Platform not supported");
     }
 }
Пример #4
0
        static Usbmuxd()
        {
            switch (Environment.OSVersion.Platform)
            {
            case PlatformID.Unix:
            case PlatformID.MacOSX:
                ourLoader = new PosixDllLoader();
                break;

            case PlatformID.Win32NT:
                ourLoader = new WindowsDllLoader();
                break;

            default:
                throw new NotSupportedException("Platform not supported");
            }
        }
        /// <summary>
        /// Internal constructor. Used by <see cref="NativeDllsLoader"/>.
        /// </summary>
        internal NativeDll(void *handle, string file, IDllLoader dllLoader)
        {
            if (handle == null)
            {
                throw new ArgumentNullException("handle");
            }
            if (dllLoader == null)
            {
                throw new ArgumentNullException("dllLoader");
            }
            if (string.IsNullOrEmpty(file))
            {
                throw new ArgumentNullException("file");
            }
            if (!System.IO.File.Exists(file))
            {
                throw new ArgumentOutOfRangeException("file");
            }

            Handle    = handle;
            File      = file;
            DllLoader = dllLoader;
        }