Example #1
0
        public static CREATESOUNDEXINFO CreateFromInternal(ref CREATESOUNDEXINFO_INTERNAL exinfoInt)
        {
            CREATESOUNDEXINFO exinfo = new CREATESOUNDEXINFO();
            exinfo.cbsize = Marshal.SizeOf(typeof(CREATESOUNDEXINFO_INTERNAL));
            
            exinfo.fileoffset            = exinfoInt.fileoffset;
            exinfo.numchannels           = exinfoInt.numchannels;
            exinfo.defaultfrequency      = exinfoInt.defaultfrequency;
            exinfo.format                = exinfoInt.format;
            exinfo.decodebuffersize      = exinfoInt.decodebuffersize;
            exinfo.initialsubsound       = exinfoInt.initialsubsound;
            exinfo.numsubsounds          = exinfoInt.numsubsounds;
            exinfo.inclusionlist         = exinfoInt.inclusionlist;
            exinfo.inclusionlistnum      = exinfoInt.inclusionlistnum;
            exinfo.pcmreadcallback       = exinfoInt.pcmreadcallback != IntPtr.Zero ? Marshal.GetDelegateForFunctionPointer(exinfoInt.pcmreadcallback, typeof(SOUND_PCMREADCALLBACK)) as SOUND_PCMREADCALLBACK : null;
            exinfo.pcmsetposcallback     = exinfoInt.pcmsetposcallback != IntPtr.Zero ? Marshal.GetDelegateForFunctionPointer(exinfoInt.pcmsetposcallback, typeof(SOUND_PCMSETPOSCALLBACK)) as SOUND_PCMSETPOSCALLBACK : null;
            exinfo.nonblockcallback      = exinfoInt.nonblockcallback != IntPtr.Zero ? Marshal.GetDelegateForFunctionPointer(exinfoInt.nonblockcallback, typeof(SOUND_NONBLOCKCALLBACK)) as SOUND_NONBLOCKCALLBACK : null;
            exinfo.dlsname               = exinfoInt.dlsname;
            exinfo.encryptionkey         = exinfoInt.encryptionkey;
            exinfo.maxpolyphony          = exinfoInt.maxpolyphony;
            exinfo.userdata              = exinfoInt.userdata;
            exinfo.suggestedsoundtype    = exinfoInt.suggestedsoundtype;
            exinfo.fileuseropen          = exinfoInt.fileuseropen != IntPtr.Zero ? Marshal.GetDelegateForFunctionPointer(exinfoInt.fileuseropen, typeof(FILE_OPENCALLBACK)) as FILE_OPENCALLBACK : null;
            exinfo.fileuserclose         = exinfoInt.fileuserclose != IntPtr.Zero ? Marshal.GetDelegateForFunctionPointer(exinfoInt.fileuserclose, typeof(FILE_CLOSECALLBACK)) as FILE_CLOSECALLBACK : null;
            exinfo.fileuserread          = exinfoInt.fileuserread != IntPtr.Zero ? Marshal.GetDelegateForFunctionPointer(exinfoInt.fileuserread, typeof(FILE_READCALLBACK)) as FILE_READCALLBACK : null;
            exinfo.fileuserseek          = exinfoInt.fileuserseek != IntPtr.Zero ? Marshal.GetDelegateForFunctionPointer(exinfoInt.fileuserseek, typeof(FILE_SEEKCALLBACK)) as FILE_SEEKCALLBACK : null;
            exinfo.fileuserasyncread     = exinfoInt.fileuserasyncread != IntPtr.Zero ? Marshal.GetDelegateForFunctionPointer(exinfoInt.fileuserasyncread, typeof(FILE_ASYNCREADCALLBACK)) as FILE_ASYNCREADCALLBACK : null;
            exinfo.fileuserasynccancel   = exinfoInt.fileuserasynccancel != IntPtr.Zero ? Marshal.GetDelegateForFunctionPointer(exinfoInt.fileuserasynccancel, typeof(FILE_ASYNCCANCELCALLBACK)) as FILE_ASYNCCANCELCALLBACK : null;
            exinfo.fileuserdata          = exinfoInt.fileuserdata;
            exinfo.filebuffersize        = exinfoInt.filebuffersize;
            exinfo.channelorder          = exinfoInt.channelorder;
            exinfo.channelmask           = exinfoInt.channelmask;
            exinfo.initialsoundgroup     = exinfoInt.initialsoundgroup;
            exinfo.initialseekposition   = exinfoInt.initialseekposition;
            exinfo.initialseekpostype    = exinfoInt.initialseekpostype;
            exinfo.ignoresetfilesystem   = exinfoInt.ignoresetfilesystem;
            exinfo.audioqueuepolicy      = exinfoInt.audioqueuepolicy;
            exinfo.minmidigranularity    = exinfoInt.minmidigranularity;
            exinfo.nonblockthreadid      = exinfoInt.nonblockthreadid;
            exinfo.fsbguid               = exinfoInt.fsbguid;

            return exinfo;
        }
Example #2
0
 private static extern RESULT FMOD5_System_CreateStream           (IntPtr system, byte[] name_or_data, MODE mode, ref CREATESOUNDEXINFO_INTERNAL exinfo, out IntPtr sound);
Example #3
0
        public IntPtr                      fsbguid;                /* [r/w] Optional. Specify 0 to ignore. Allows you to provide the GUID lookup for cached FSB header info. Once loaded the GUID will be written back to the pointer. This is to avoid seeking and reading the FSB header. */

        public static CREATESOUNDEXINFO_INTERNAL CreateFromExternal(ref CREATESOUNDEXINFO exinfoExt)
        {
            CREATESOUNDEXINFO_INTERNAL exinfoInt = new CREATESOUNDEXINFO_INTERNAL();
            exinfoInt.cbsize = Marshal.SizeOf(typeof(CREATESOUNDEXINFO_INTERNAL));
            exinfoInt.fileoffset            = exinfoExt.fileoffset;
            exinfoInt.numchannels           = exinfoExt.numchannels;
            exinfoInt.defaultfrequency      = exinfoExt.defaultfrequency;
            exinfoInt.format                = exinfoExt.format;
            exinfoInt.decodebuffersize      = exinfoExt.decodebuffersize;
            exinfoInt.initialsubsound       = exinfoExt.initialsubsound;
            exinfoInt.numsubsounds          = exinfoExt.numsubsounds;
            exinfoInt.inclusionlist         = exinfoExt.inclusionlist;
            exinfoInt.inclusionlistnum      = exinfoExt.inclusionlistnum;
            exinfoInt.pcmreadcallback       = exinfoExt.pcmreadcallback != null ? Marshal.GetFunctionPointerForDelegate(exinfoExt.pcmreadcallback) : IntPtr.Zero;
            exinfoInt.pcmsetposcallback     = exinfoExt.pcmsetposcallback != null ? Marshal.GetFunctionPointerForDelegate(exinfoExt.pcmsetposcallback) : IntPtr.Zero;
            exinfoInt.nonblockcallback      = exinfoExt.nonblockcallback != null ? Marshal.GetFunctionPointerForDelegate(exinfoExt.nonblockcallback) : IntPtr.Zero;
            exinfoInt.dlsname               = exinfoExt.dlsname;
            exinfoInt.encryptionkey         = exinfoExt.encryptionkey;
            exinfoInt.maxpolyphony          = exinfoExt.maxpolyphony;
            exinfoInt.userdata              = exinfoExt.userdata;
            exinfoInt.suggestedsoundtype    = exinfoExt.suggestedsoundtype;
            exinfoInt.fileuseropen          = exinfoExt.fileuseropen != null ? Marshal.GetFunctionPointerForDelegate(exinfoExt.fileuseropen) : IntPtr.Zero;
            exinfoInt.fileuserclose         = exinfoExt.fileuserclose != null ? Marshal.GetFunctionPointerForDelegate(exinfoExt.fileuserclose) : IntPtr.Zero;
            exinfoInt.fileuserread          = exinfoExt.fileuserread != null ? Marshal.GetFunctionPointerForDelegate(exinfoExt.fileuserread) : IntPtr.Zero;
            exinfoInt.fileuserseek          = exinfoExt.fileuserseek != null ? Marshal.GetFunctionPointerForDelegate(exinfoExt.fileuserseek) : IntPtr.Zero;
            exinfoInt.fileuserasyncread     = exinfoExt.fileuserasyncread != null ? Marshal.GetFunctionPointerForDelegate(exinfoExt.fileuserasyncread) : IntPtr.Zero;
            exinfoInt.fileuserasynccancel   = exinfoExt.fileuserasynccancel != null ? Marshal.GetFunctionPointerForDelegate(exinfoExt.fileuserasynccancel) : IntPtr.Zero;
            exinfoInt.fileuserdata          = exinfoExt.fileuserdata;
            exinfoInt.filebuffersize        = exinfoExt.filebuffersize;
            exinfoInt.channelorder          = exinfoExt.channelorder;
            exinfoInt.channelmask           = exinfoExt.channelmask;
            exinfoInt.initialsoundgroup     = exinfoExt.initialsoundgroup;
            exinfoInt.initialseekposition   = exinfoExt.initialseekposition;
            exinfoInt.initialseekpostype    = exinfoExt.initialseekpostype;
            exinfoInt.ignoresetfilesystem   = exinfoExt.ignoresetfilesystem;
            exinfoInt.audioqueuepolicy      = exinfoExt.audioqueuepolicy;
            exinfoInt.minmidigranularity    = exinfoExt.minmidigranularity;
            exinfoInt.nonblockthreadid      = exinfoExt.nonblockthreadid;
            exinfoInt.fsbguid               = exinfoExt.fsbguid;

            return exinfoInt;
        }