示例#1
0
        public unsafe static bool BASS_WMA_EncodeSetTag(int handle, string tag, string value, BASSWMATag type)
        {
            if (handle == 0)
            {
                return(false);
            }
            if (tag == null && value == null)
            {
                return(BassWma.BASS_WMA_EncodeSetTag(handle, IntPtr.Zero, IntPtr.Zero, type));
            }
            if (tag == null)
            {
                tag = string.Empty;
            }
            else if (value == null)
            {
                value = string.Empty;
            }
            if (type == BASSWMATag.BASS_WMA_TAG_ANSI)
            {
                type = BASSWMATag.BASS_WMA_TAG_UNICODE;
            }
            if (type == BASSWMATag.BASS_WMA_TAG_UNICODE)
            {
                return(BassWma.BASS_WMA_EncodeSetTagUnicode(handle, tag, value, type));
            }
            UTF8Encoding utf8Encoding = new UTF8Encoding();

            byte[] bytes  = utf8Encoding.GetBytes(tag);
            byte[] bytes2 = utf8Encoding.GetBytes(value);
            bool   result;

            fixed(byte *ptr = bytes)
            {
                byte[] array = bytes2;
                byte * ptr2;

                if (bytes2 == null || array.Length == 0)
                {
                    ptr2 = null;
                }
                else
                {
                    ptr2 = (byte *)array[0];
                    //fixed (byte* ptr2 = &array[0]) { }
                }
                result = BassWma.BASS_WMA_EncodeSetTag(handle, (IntPtr)((void *)ptr), (IntPtr)((void *)ptr2), type);
                ptr2   = null;
            }

            return(result);
        }
示例#2
0
        public static bool BASS_WMA_EncodeSetTag(int handle, string tag, IntPtr value, int length)
        {
            if (handle == 0)
            {
                return(false);
            }
            if (tag == null && value == IntPtr.Zero)
            {
                return(BassWma.BASS_WMA_EncodeSetTag(handle, IntPtr.Zero, IntPtr.Zero, BASSWMATag.BASS_WMA_TAG_UNICODE));
            }
            if (tag == null)
            {
                tag = string.Empty;
            }
            BASSWMATag type = (BASSWMATag)(1 | Utils.MakeLong(256, length));

            return(BassWma.BASS_WMA_EncodeSetTagUnicode(handle, tag, value, type));
        }
示例#3
0
 public static bool BASS_WMA_EncodeSetTag(int handle, string tag, string value)
 {
     if (handle == 0)
     {
         return(false);
     }
     if (tag == null && value == null)
     {
         return(BassWma.BASS_WMA_EncodeSetTag(handle, IntPtr.Zero, IntPtr.Zero, BASSWMATag.BASS_WMA_TAG_UNICODE));
     }
     if (tag == null)
     {
         tag = string.Empty;
     }
     else if (value == null)
     {
         value = string.Empty;
     }
     return(BassWma.BASS_WMA_EncodeSetTagUnicode(handle, tag, value, BASSWMATag.BASS_WMA_TAG_UNICODE));
 }
示例#4
0
 public static string[] BASS_WMA_GetTagsArray(string file)
 {
     return(Utils.IntPtrToArrayNullTermUtf8(BassWma.BASS_WMA_GetTags(file)));
 }
示例#5
0
 public static IntPtr BASS_WMA_GetTags(string file)
 {
     return(BassWma.BASS_WMA_GetTags(file, BASSFlag.BASS_UNICODE));
 }
示例#6
0
 public static int BASS_WMA_StreamCreateURL(string url, long offset, long length, BASSFlag flags)
 {
     flags |= BASSFlag.BASS_UNICODE;
     return(BassWma.BASS_WMA_StreamCreateFileUnicode(false, url, offset, length, flags));
 }
示例#7
0
 public static int BASS_WMA_StreamCreateFileAuth(IntPtr memory, long offset, long length, BASSFlag flags, string user, string pass)
 {
     flags |= BASSFlag.BASS_UNICODE;
     return(BassWma.BASS_WMA_StreamCreateFileAuthMemory(true, memory, offset, length, flags, user, pass));
 }
示例#8
0
 public static int BASS_WMA_StreamCreateFileAuth(string file, long offset, long length, BASSFlag flags, string user, string pass)
 {
     flags |= BASSFlag.BASS_UNICODE;
     return(BassWma.BASS_WMA_StreamCreateFileAuthUnicode(false, file, offset, length, flags, user, pass));
 }
示例#9
0
 public static int BASS_WMA_StreamCreateIStreamAuth(IntPtr istream, long offset, long length, BASSFlag flags, string user, string pass)
 {
     flags |= BASSFlag.BASS_UNICODE;
     return(BassWma.BASS_WMA_StreamCreateFileAuthIStream(2, istream, offset, length, flags, user, pass));
 }
示例#10
0
 public static int BASS_WMA_StreamCreateFile(IntPtr memory, long offset, long length, BASSFlag flags)
 {
     return(BassWma.BASS_WMA_StreamCreateFileMemory(true, memory, offset, length, flags));
 }
示例#11
0
 public static int BASS_WMA_StreamCreateIStream(IntPtr istream, long offset, long length, BASSFlag flags)
 {
     return(BassWma.BASS_WMA_StreamCreateFileIStream(2, istream, offset, length, flags));
 }
示例#12
0
 public static int BASS_WMA_EncodeOpenPublishMulti(int freq, int chans, BASSWMAEncode flags, int[] bitrates, string url, string user, string pass)
 {
     flags |= BASSWMAEncode.BASS_UNICODE;
     return(BassWma.BASS_WMA_EncodeOpenPublishMultiUnicode(freq, chans, flags, bitrates, url, user, pass));
 }
示例#13
0
 public static int BASS_WMA_EncodeOpenFile(int freq, int chans, BASSWMAEncode flags, int bitrate, string file)
 {
     flags |= BASSWMAEncode.BASS_UNICODE;
     return(BassWma.BASS_WMA_EncodeOpenFileUnicode(freq, chans, flags, bitrate, file));
 }
示例#14
0
 public static int[] BASS_WMA_EncodeGetRates(int freq, int chans, BASSWMAEncode flags)
 {
     return(Utils.IntPtrToArrayNullTermInt32(BassWma.BASS_WMA_EncodeGetRatesPtr(freq, chans, flags)));
 }