当前位置: 首页>>代码示例>>C#>>正文


C# FMOD.TAG类代码示例

本文整理汇总了C#中FMOD.TAG的典型用法代码示例。如果您正苦于以下问题:C# TAG类的具体用法?C# TAG怎么用?C# TAG使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


TAG类属于FMOD命名空间,在下文中一共展示了TAG类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Tag

        public Tag(TAG tag)
            : this()
        {
            Name = tag.name;
            Type = (TagType)tag.type;
            DataType = (TagDataType)tag.datatype;
            Updated = tag.updated;

            Data = new byte[tag.datalen];
            Marshal.Copy(tag.data, Data, 0, (int)tag.datalen);
        }
开发者ID:HakanL,项目名称:SupersonicSound,代码行数:11,代码来源:Tag.cs

示例2: FMOD_Sound_GetTag

 private static extern RESULT FMOD_Sound_GetTag(IntPtr sound, string name, int index, ref TAG tag);
开发者ID:huming2207,项目名称:ghgame,代码行数:1,代码来源:fmod.cs

示例3: getTag

 public RESULT getTag(string name, int index, ref TAG tag)
 {
     return FMOD_Sound_GetTag(soundraw, name, index, ref tag);
 }
开发者ID:huming2207,项目名称:ghgame,代码行数:4,代码来源:fmod.cs

示例4: FMOD_Sound_GetTag

 public RESULT getTag                  (string name, int index, out TAG tag)
 {
     return FMOD_Sound_GetTag(rawPtr, name, index, out tag);
 }
开发者ID:Cocotus,项目名称:simple-music-player,代码行数:4,代码来源:fmod.cs

示例5: getTag

 public RESULT getTag(string name, int index, ref TAG tag)
 {
     IntPtr ptr    = Marshal.AllocCoTaskMem(Marshal.SizeOf(tag));
     RESULT result = FMOD_Sound_GetTag(soundraw, name, index, ptr);
     if(result == RESULT.OK)
     {
         tag = (TAG)Marshal.PtrToStructure(ptr, typeof(TAG));
     }
     return result;
 }
开发者ID:ufosky-server,项目名称:MultiversePlatform,代码行数:10,代码来源:fmod.cs

示例6: GetSoundName

        private string GetSoundName(Sound sound)
        {
            //original implementation did not return all characters
            //StringBuilder name = new StringBuilder(0x100);
            //sound.getName(name, name.Capacity);

            //begin custom implementation
            string name = "";
            var tagCount = 0;
            var tagsUpdated = 0;
            sound.getNumTags(ref tagCount, ref tagsUpdated);
            TAG tag = new TAG();
            for (var i = 0; i < tagCount; i++) {
                sound.getTag(null, i, ref tag);
                if (tag.name == "TIT2") {
                    name = Marshal.PtrToStringAnsi(tag.data);
                    break;
                }
            }
            return name;
        }
开发者ID:jmcadams,项目名称:vplus,代码行数:21,代码来源:SoundChannel.cs

示例7: Update

        private void Update(object sender)
        {
            if (sound == null) return;

            invoke(new SoundDelegate(() =>
            {
                try
                {
                    FMODExec(system.update());

                    TAG tag = new TAG();
                    int numTags = 0;
                    int numTagsUpdated = 0;

                    var res = sound.getNumTags(ref numTags, ref numTagsUpdated);

                    if (res == RESULT.OK && numTagsUpdated > 0)
                    {
                        for (int i=0; i < numTags; i++)
                        {
                            if (sound.getTag(null, i, ref tag) != RESULT.OK)
                            {
                                continue;
                            }

                            if (tag.type == TAGTYPE.FMOD && tag.name == "Sample Rate Change")
                            {
                                float newfreq = (float)Marshal.PtrToStructure(tag.data, typeof(float));
                                Logger.DebugLog("New stream frequency: " + newfreq.ToString("F" + 0));
                                channel.setFrequency(newfreq);
                            }

                            if (tag.datatype != TAGDATATYPE.STRING) continue;

                            // Tell listeners about the Stream tag.  This can be
                            // displayed to the user.
                            if (OnStreamInfo != null)
                                OnStreamInfo(this, new StreamInfoArgs(tag.name.ToLower(), Marshal.PtrToStringAnsi(tag.data)));
                        }
                    }
                }
                catch (Exception ex)
                {
                    Logger.DebugLog("Error getting stream tags: " + ex.Message);
                }
            }));
        }
开发者ID:Booser,项目名称:radegast,代码行数:47,代码来源:Stream.cs

示例8: getTag

 public RESULT getTag(string name, int index, out TAG tag)
 {
     return Sound.FMOD5_Sound_GetTag(this.rawPtr, name, index, out tag);
 }
开发者ID:GameDiffs,项目名称:TheForest,代码行数:4,代码来源:Sound.cs

示例9: CheckTags

        private void CheckTags(object sender)
        {
            if (sound == null) return;

            invoke(new SoundDelegate(() =>
            {
                try
                {
                    TAG tag = new TAG();
                    while (sound.getTag(null, -1, ref tag) == RESULT.OK)
                    {
                        if (tag.datatype != TAGDATATYPE.STRING) continue;

                        // Tell listeners about the Stream tag.  This can be
                        // displayed to the user.
                        if (OnStreamInfo != null)
                            OnStreamInfo(this, new StreamInfoArgs(tag.name.ToLower(), Marshal.PtrToStringAnsi(tag.data)));
                    }
                }
                catch (Exception ex)
                {
                    Logger.DebugLog("Error getting stream tags: " + ex.Message);
                }
            }));
        }
开发者ID:mixixi,项目名称:radegast,代码行数:25,代码来源:Stream.cs

示例10: GetProgress

        public string GetProgress()
        {
            if (sound == null) return null;

            RESULT result;
            uint ms = 0;
            uint lenms = 0;
            bool playing = false;
            bool paused = false;

            if (channel != null)
            {
                result = channel.isPlaying(ref playing);
                if ((result != RESULT.OK) && (result != RESULT.ERR_INVALID_HANDLE))
                    ERRCHECK(result);

                result = channel.getPaused(ref paused);
                if ((result != RESULT.OK) && (result != RESULT.ERR_INVALID_HANDLE))
                    ERRCHECK(result);

                result = channel.getPosition(ref ms, TIMEUNIT.MS);
                if ((result != RESULT.OK) && (result != RESULT.ERR_INVALID_HANDLE))
                    ERRCHECK(result);

                result = sound.getLength(ref lenms, TIMEUNIT.MS);
                if ((result != RESULT.OK) && (result != RESULT.ERR_INVALID_HANDLE))
                    ERRCHECK(result);
            }

            if (system != null)
                system.update();

            var duration = TimeSpan.FromMilliseconds(lenms);
            var position = TimeSpan.FromMilliseconds(ms);

            var songName = new StringBuilder(64);
            sound.getName(songName, songName.Capacity);

            int numTags = 0;
            int blah = 0;
            sound.getNumTags(ref numTags, ref blah);
            var tags = new StringBuilder();
            for (var i = 0; i < numTags; i++)
            {
                TAG tag = new TAG();
                sound.getTag(null, i, ref tag);
                tags.AppendFormat("{0} => {1}", tag.name, tag.data).AppendLine();
            }

            var status = string.Format(
                @"{0:mm\:ss} / {1:mm\:ss}
            {2}
            {3}
            {4}
            ",
                position,
                duration,
                paused ? "Paused " : playing ? "Playing" : "Stopped",
                songName,
                tags
            );
            return status;
        }
开发者ID:olivierdagenais,项目名称:sharp-notes,代码行数:63,代码来源:Player.cs


注:本文中的FMOD.TAG类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。