Пример #1
0
        public static Version BASS_Encode_GetVersion(int fieldcount)
        {
            if (fieldcount < 1)
            {
                fieldcount = 1;
            }
            if (fieldcount > 4)
            {
                fieldcount = 4;
            }
            int     num    = BassEnc.BASS_Encode_GetVersion();
            Version result = new Version(2, 4);

            switch (fieldcount)
            {
            case 1:
                result = new Version(num >> 24 & 255, 0);
                break;

            case 2:
                result = new Version(num >> 24 & 255, num >> 16 & 255);
                break;

            case 3:
                result = new Version(num >> 24 & 255, num >> 16 & 255, num >> 8 & 255);
                break;

            case 4:
                result = new Version(num >> 24 & 255, num >> 16 & 255, num >> 8 & 255, num & 255);
                break;
            }
            return(result);
        }
Пример #2
0
        public unsafe static bool BASS_Encode_GetACMFormat(int handle, ref ACMFORMAT codec, string title, BASSACMFormat flags)
        {
            int num = BassEnc.BASS_Encode_GetACMFormatUnicode(0, IntPtr.Zero, 0, null, BASSACMFormat.BASS_ACM_NONE);

            byte[] array  = new byte[(num > codec.FormatLength) ? num : codec.FormatLength];
            bool   result = false;

            byte[] array2 = new byte[Marshal.SizeOf(codec) + (int)codec.waveformatex.cbSize];
            int    num2   = Marshal.SizeOf(codec);
            IntPtr intPtr = Marshal.AllocHGlobal(num2);

            Marshal.StructureToPtr(codec, intPtr, false);
            Marshal.Copy(intPtr, array2, 0, num2);
            Marshal.FreeHGlobal(intPtr);
            for (int i = 0; i < codec.extension.Length; i++)
            {
                array2[18 + i] = codec.extension[i];
            }
            Array.Copy(array2, array, num2);
            fixed(byte *ptr = array)
            {
                if (BassEnc.BASS_Encode_GetACMFormat(handle, (IntPtr)((void *)ptr), num, title, flags) > 0)
                {
                    codec  = new ACMFORMAT((IntPtr)((void *)ptr));
                    result = true;
                }
            }

            return(result);
        }
Пример #3
0
 public static bool BASS_Encode_CastSendMeta(int handle, BASSEncodeMetaDataType type, string xml)
 {
     if (string.IsNullOrEmpty(xml))
     {
         return(false);
     }
     byte[] bytes = Encoding.UTF8.GetBytes(xml);
     return(BassEnc.BASS_Encode_CastSendMeta(handle, type, bytes, bytes.Length));
 }
Пример #4
0
        public ACMFORMAT()
        {
            int num = BassEnc.BASS_Encode_GetACMFormat(0, IntPtr.Zero, 0, null, BASSACMFormat.BASS_ACM_NONE);

            this.waveformatex        = new WAVEFORMATEX();
            this.waveformatex.cbSize = (short)(num - 18);
            if (this.waveformatex.cbSize >= 0)
            {
                this.extension = new byte[(int)this.waveformatex.cbSize];
            }
        }
Пример #5
0
        public unsafe static ACMFORMAT BASS_Encode_GetACMFormatSuggest(int handle, BASSACMFormat flags, WAVEFormatTag format)
        {
            ACMFORMAT result = null;
            int       num    = BassEnc.BASS_Encode_GetACMFormatUnicode(0, IntPtr.Zero, 0, null, BASSACMFormat.BASS_ACM_NONE);

            fixed(byte *ptr = new byte[num])
            {
                if (BassEnc.BASS_Encode_GetACMFormat(handle, (IntPtr)((void *)ptr), num, null, (BASSACMFormat)Utils.MakeLong((int)flags, (int)format)) > 0)
                {
                    result = new ACMFORMAT((IntPtr)((void *)ptr));
                }
            }

            return(result);
        }
Пример #6
0
 public static string BASS_Encode_CastGetStats(int handle, BASSEncodeStats type, string pass)
 {
     if (string.IsNullOrEmpty(pass))
     {
         IntPtr intPtr = BassEnc.BASS_Encode_CastGetStatsPtr(handle, type, IntPtr.Zero);
         if (intPtr != IntPtr.Zero)
         {
             return(Utils.IntPtrAsStringAnsi(intPtr));
         }
         return(null);
     }
     else
     {
         IntPtr intPtr2 = BassEnc.BASS_Encode_CastGetStatsPtr(handle, type, pass);
         if (intPtr2 != IntPtr.Zero)
         {
             return(Utils.IntPtrAsStringAnsi(intPtr2));
         }
         return(null);
     }
 }
Пример #7
0
 public static int BASS_Encode_StartUser(int handle, string filename, BASSEncode flags, ENCODERPROC proc, IntPtr user)
 {
     flags |= BASSEncode.BASS_UNICODE;
     return(BassEnc.BASS_Encode_StartUserUnicode(handle, filename, flags, proc, user));
 }
Пример #8
0
 public static int BASS_Encode_Start(int handle, string cmdline, BASSEncode flags, ENCODEPROC proc, IntPtr user, int limit)
 {
     flags |= BASSEncode.BASS_UNICODE;
     return(BassEnc.BASS_Encode_StartUnicode(handle, cmdline, flags, proc, user, limit));
 }
Пример #9
0
 public static bool BASS_Encode_CastSendMeta(int handle, BASSEncodeMetaDataType type, byte[] buffer)
 {
     return(BassEnc.BASS_Encode_CastSendMeta(handle, type, buffer, buffer.Length));
 }
Пример #10
0
 public static int BASS_Encode_StartACMFile(int handle, ACMFORMAT form, BASSEncode flags, string filename)
 {
     flags |= BASSEncode.BASS_UNICODE;
     return(BassEnc.BASS_Encode_StartACMFileUnicode(handle, form, flags, filename));
 }
Пример #11
0
        public static int BASS_Encode_GetACMFormat(int handle, IntPtr form, int fromlen, string title, BASSACMFormat flags)
        {
            flags |= BASSACMFormat.BASS_UNICODE;

            return(BassEnc.BASS_Encode_GetACMFormatUnicode(handle, form, fromlen, title, flags));
        }