コード例 #1
0
            private void FillTreeItems(AudioProfilerView.AudioProfilerTreeViewItem parentNode, int depth, int parentId, List <AudioProfilerInfoWrapper> items)
            {
                int capacity = 0;

                using (List <AudioProfilerInfoWrapper> .Enumerator enumerator = items.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        AudioProfilerInfoWrapper current = enumerator.Current;
                        if (parentId == (!current.addToRoot ? current.info.parentId : 0))
                        {
                            ++capacity;
                        }
                    }
                }
                if (capacity <= 0)
                {
                    return;
                }
                parentNode.children = new List <TreeViewItem>(capacity);
                using (List <AudioProfilerInfoWrapper> .Enumerator enumerator = items.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        AudioProfilerInfoWrapper current = enumerator.Current;
                        if (parentId == (!current.addToRoot ? current.info.parentId : 0))
                        {
                            AudioProfilerView.AudioProfilerTreeViewItem parentNode1 = new AudioProfilerView.AudioProfilerTreeViewItem(current.info.uniqueId, !current.addToRoot ? depth : 1, (TreeViewItem)parentNode, current.objectName, current);
                            parentNode.children.Add((TreeViewItem)parentNode1);
                            this.FillTreeItems(parentNode1, depth + 1, current.info.uniqueId, items);
                        }
                    }
                }
            }
コード例 #2
0
 public AudioProfilerTreeViewItem(int id, int depth, TreeViewItem parent, string displayName, AudioProfilerInfoWrapper info) : base(id, depth, parent, displayName)
 {
     this.info = info;
 }
コード例 #3
0
        public static string GetColumnString(AudioProfilerInfoWrapper info, AudioProfilerInfoHelper.ColumnIndices index)
        {
            bool flag  = (info.info.flags & 1) != 0;
            bool flag2 = (info.info.flags & 64) != 0;

            switch (index)
            {
            case AudioProfilerInfoHelper.ColumnIndices.ObjectName:
                return(info.objectName);

            case AudioProfilerInfoHelper.ColumnIndices.AssetName:
                return(info.assetName);

            case AudioProfilerInfoHelper.ColumnIndices.Volume:
                return(AudioProfilerInfoHelper.FormatDb(info.info.volume));

            case AudioProfilerInfoHelper.ColumnIndices.Audibility:
                return((!flag2) ? AudioProfilerInfoHelper.FormatDb(info.info.audibility) : string.Empty);

            case AudioProfilerInfoHelper.ColumnIndices.PlayCount:
                return((!flag2) ? info.info.playCount.ToString() : string.Empty);

            case AudioProfilerInfoHelper.ColumnIndices.Is3D:
                return((!flag2) ? ((!flag) ? "NO" : (((info.info.flags & 2) == 0) ? "YES" : "Spatial")) : string.Empty);

            case AudioProfilerInfoHelper.ColumnIndices.IsPaused:
                return((!flag2) ? (((info.info.flags & 4) == 0) ? "NO" : "YES") : string.Empty);

            case AudioProfilerInfoHelper.ColumnIndices.IsMuted:
                return((!flag2) ? (((info.info.flags & 8) == 0) ? "NO" : "YES") : string.Empty);

            case AudioProfilerInfoHelper.ColumnIndices.IsVirtual:
                return((!flag2) ? (((info.info.flags & 16) == 0) ? "NO" : "YES") : string.Empty);

            case AudioProfilerInfoHelper.ColumnIndices.IsOneShot:
                return((!flag2) ? (((info.info.flags & 32) == 0) ? "NO" : "YES") : string.Empty);

            case AudioProfilerInfoHelper.ColumnIndices.IsLooped:
                return((!flag2) ? (((info.info.flags & 512) == 0) ? "NO" : "YES") : string.Empty);

            case AudioProfilerInfoHelper.ColumnIndices.DistanceToListener:
                return((!flag2) ? (flag ? ((info.info.distanceToListener < 1000f) ? string.Format("{0:0.00} m", info.info.distanceToListener) : string.Format("{0:0.00} km", info.info.distanceToListener * 0.001f)) : "N/A") : string.Empty);

            case AudioProfilerInfoHelper.ColumnIndices.MinDist:
                return((!flag2) ? (flag ? ((info.info.minDist < 1000f) ? string.Format("{0:0.00} m", info.info.minDist) : string.Format("{0:0.00} km", info.info.minDist * 0.001f)) : "N/A") : string.Empty);

            case AudioProfilerInfoHelper.ColumnIndices.MaxDist:
                return((!flag2) ? (flag ? ((info.info.maxDist < 1000f) ? string.Format("{0:0.00} m", info.info.maxDist) : string.Format("{0:0.00} km", info.info.maxDist * 0.001f)) : "N/A") : string.Empty);

            case AudioProfilerInfoHelper.ColumnIndices.Time:
                return((!flag2) ? string.Format("{0:0.00} s", info.info.time) : string.Empty);

            case AudioProfilerInfoHelper.ColumnIndices.Duration:
                return((!flag2) ? string.Format("{0:0.00} s", info.info.duration) : string.Empty);

            case AudioProfilerInfoHelper.ColumnIndices.Frequency:
                return((!flag2) ? ((info.info.frequency < 1000f) ? string.Format("{0:0.00} Hz", info.info.frequency) : string.Format("{0:0.00} kHz", info.info.frequency * 0.001f)) : string.Format("{0:0.00} x", info.info.frequency));

            case AudioProfilerInfoHelper.ColumnIndices.IsStream:
                return((!flag2) ? (((info.info.flags & 128) == 0) ? "NO" : "YES") : string.Empty);

            case AudioProfilerInfoHelper.ColumnIndices.IsCompressed:
                return((!flag2) ? (((info.info.flags & 256) == 0) ? "NO" : "YES") : string.Empty);

            case AudioProfilerInfoHelper.ColumnIndices.IsNonBlocking:
                return((!flag2) ? (((info.info.flags & 8192) == 0) ? "NO" : "YES") : string.Empty);

            case AudioProfilerInfoHelper.ColumnIndices.IsOpenUser:
                return((!flag2) ? (((info.info.flags & 4096) == 0) ? "NO" : "YES") : string.Empty);

            case AudioProfilerInfoHelper.ColumnIndices.IsOpenMemory:
                return((!flag2) ? (((info.info.flags & 1024) == 0) ? "NO" : "YES") : string.Empty);

            case AudioProfilerInfoHelper.ColumnIndices.IsOpenMemoryPoint:
                return((!flag2) ? (((info.info.flags & 2048) == 0) ? "NO" : "YES") : string.Empty);

            default:
                return("Unknown");
            }
        }
コード例 #4
0
 public AudioProfilerTreeViewItem(int id, int depth, TreeViewItem parent, string displayName, AudioProfilerInfoWrapper info)
   : base(id, depth, parent, displayName)
 {
   this.info = info;
 }
コード例 #5
0
        public static string GetColumnString(AudioProfilerInfoWrapper info, ColumnIndices index)
        {
            bool flag  = (info.info.flags & 1) != 0;
            bool flag2 = (info.info.flags & 0x40) != 0;

            switch (index)
            {
            case ColumnIndices.ObjectName:
                return(info.objectName);

            case ColumnIndices.AssetName:
                return(info.assetName);

            case ColumnIndices.Volume:
                return(FormatDb(info.info.volume));

            case ColumnIndices.Audibility:
                return(!flag2 ? FormatDb(info.info.audibility) : string.Empty);

            case ColumnIndices.PlayCount:
                return(!flag2 ? info.info.playCount.ToString() : string.Empty);

            case ColumnIndices.Is3D:
                return(!flag2 ? (!flag ? "NO" : "YES") : string.Empty);

            case ColumnIndices.IsPaused:
                return(!flag2 ? (((info.info.flags & 4) == 0) ? "NO" : "YES") : string.Empty);

            case ColumnIndices.IsMuted:
                return(!flag2 ? (((info.info.flags & 8) == 0) ? "NO" : "YES") : string.Empty);

            case ColumnIndices.IsVirtual:
                return(!flag2 ? (((info.info.flags & 0x10) == 0) ? "NO" : "YES") : string.Empty);

            case ColumnIndices.IsOneShot:
                return(!flag2 ? (((info.info.flags & 0x20) == 0) ? "NO" : "YES") : string.Empty);

            case ColumnIndices.IsLooped:
                return(!flag2 ? (((info.info.flags & 0x200) == 0) ? "NO" : "YES") : string.Empty);

            case ColumnIndices.DistanceToListener:
                return(!flag2 ? (flag ? ((info.info.distanceToListener < 1000f) ? string.Format("{0:0.00} m", info.info.distanceToListener) : string.Format("{0:0.00} km", info.info.distanceToListener * 0.001f)) : "N/A") : string.Empty);

            case ColumnIndices.MinDist:
                return(!flag2 ? (flag ? ((info.info.minDist < 1000f) ? string.Format("{0:0.00} m", info.info.minDist) : string.Format("{0:0.00} km", info.info.minDist * 0.001f)) : "N/A") : string.Empty);

            case ColumnIndices.MaxDist:
                return(!flag2 ? (flag ? ((info.info.maxDist < 1000f) ? string.Format("{0:0.00} m", info.info.maxDist) : string.Format("{0:0.00} km", info.info.maxDist * 0.001f)) : "N/A") : string.Empty);

            case ColumnIndices.Time:
                return(!flag2 ? string.Format("{0:0.00} s", info.info.time) : string.Empty);

            case ColumnIndices.Duration:
                return(!flag2 ? string.Format("{0:0.00} s", info.info.duration) : string.Empty);

            case ColumnIndices.Frequency:
                return(!flag2 ? ((info.info.frequency < 1000f) ? string.Format("{0:0.00} Hz", info.info.frequency) : string.Format("{0:0.00} kHz", info.info.frequency * 0.001f)) : string.Format("{0:0.00} x", info.info.frequency));

            case ColumnIndices.IsStream:
                return(!flag2 ? (((info.info.flags & 0x80) == 0) ? "NO" : "YES") : string.Empty);

            case ColumnIndices.IsCompressed:
                return(!flag2 ? (((info.info.flags & 0x100) == 0) ? "NO" : "YES") : string.Empty);

            case ColumnIndices.IsNonBlocking:
                return(!flag2 ? (((info.info.flags & 0x2000) == 0) ? "NO" : "YES") : string.Empty);

            case ColumnIndices.IsOpenUser:
                return(!flag2 ? (((info.info.flags & 0x1000) == 0) ? "NO" : "YES") : string.Empty);

            case ColumnIndices.IsOpenMemory:
                return(!flag2 ? (((info.info.flags & 0x400) == 0) ? "NO" : "YES") : string.Empty);

            case ColumnIndices.IsOpenMemoryPoint:
                return(!flag2 ? (((info.info.flags & 0x800) == 0) ? "NO" : "YES") : string.Empty);
            }
            return("Unknown");
        }
コード例 #6
0
        public static string GetColumnString(AudioProfilerInfoWrapper info, AudioProfilerInfoHelper.ColumnIndices index)
        {
            bool flag1 = (info.info.flags & 1) != 0;
            bool flag2 = (info.info.flags & 64) != 0;

            switch (index)
            {
            case AudioProfilerInfoHelper.ColumnIndices.ObjectName:
                return(info.objectName);

            case AudioProfilerInfoHelper.ColumnIndices.AssetName:
                return(info.assetName);

            case AudioProfilerInfoHelper.ColumnIndices.Volume:
                return(AudioProfilerInfoHelper.FormatDb(info.info.volume));

            case AudioProfilerInfoHelper.ColumnIndices.Audibility:
                if (flag2)
                {
                    return(string.Empty);
                }
                return(AudioProfilerInfoHelper.FormatDb(info.info.audibility));

            case AudioProfilerInfoHelper.ColumnIndices.PlayCount:
                if (flag2)
                {
                    return(string.Empty);
                }
                return(info.info.playCount.ToString());

            case AudioProfilerInfoHelper.ColumnIndices.Is3D:
                if (flag2)
                {
                    return(string.Empty);
                }
                if (!flag1)
                {
                    return("NO");
                }
                return((info.info.flags & 2) != 0 ? "Spatial" : "YES");

            case AudioProfilerInfoHelper.ColumnIndices.IsPaused:
                if (flag2)
                {
                    return(string.Empty);
                }
                return((info.info.flags & 4) != 0 ? "YES" : "NO");

            case AudioProfilerInfoHelper.ColumnIndices.IsMuted:
                if (flag2)
                {
                    return(string.Empty);
                }
                return((info.info.flags & 8) != 0 ? "YES" : "NO");

            case AudioProfilerInfoHelper.ColumnIndices.IsVirtual:
                if (flag2)
                {
                    return(string.Empty);
                }
                return((info.info.flags & 16) != 0 ? "YES" : "NO");

            case AudioProfilerInfoHelper.ColumnIndices.IsOneShot:
                if (flag2)
                {
                    return(string.Empty);
                }
                return((info.info.flags & 32) != 0 ? "YES" : "NO");

            case AudioProfilerInfoHelper.ColumnIndices.IsLooped:
                if (flag2)
                {
                    return(string.Empty);
                }
                return((info.info.flags & 512) != 0 ? "YES" : "NO");

            case AudioProfilerInfoHelper.ColumnIndices.DistanceToListener:
                if (flag2)
                {
                    return(string.Empty);
                }
                if (!flag1)
                {
                    return("N/A");
                }
                if ((double)info.info.distanceToListener >= 1000.0)
                {
                    return(string.Format("{0:0.00} km", (object)(float)((double)info.info.distanceToListener * (1.0 / 1000.0))));
                }
                return(string.Format("{0:0.00} m", (object)info.info.distanceToListener));

            case AudioProfilerInfoHelper.ColumnIndices.MinDist:
                if (flag2)
                {
                    return(string.Empty);
                }
                if (!flag1)
                {
                    return("N/A");
                }
                if ((double)info.info.minDist >= 1000.0)
                {
                    return(string.Format("{0:0.00} km", (object)(float)((double)info.info.minDist * (1.0 / 1000.0))));
                }
                return(string.Format("{0:0.00} m", (object)info.info.minDist));

            case AudioProfilerInfoHelper.ColumnIndices.MaxDist:
                if (flag2)
                {
                    return(string.Empty);
                }
                if (!flag1)
                {
                    return("N/A");
                }
                if ((double)info.info.maxDist >= 1000.0)
                {
                    return(string.Format("{0:0.00} km", (object)(float)((double)info.info.maxDist * (1.0 / 1000.0))));
                }
                return(string.Format("{0:0.00} m", (object)info.info.maxDist));

            case AudioProfilerInfoHelper.ColumnIndices.Time:
                if (flag2)
                {
                    return(string.Empty);
                }
                return(string.Format("{0:0.00} s", (object)info.info.time));

            case AudioProfilerInfoHelper.ColumnIndices.Duration:
                if (flag2)
                {
                    return(string.Empty);
                }
                return(string.Format("{0:0.00} s", (object)info.info.duration));

            case AudioProfilerInfoHelper.ColumnIndices.Frequency:
                if (flag2)
                {
                    return(string.Format("{0:0.00} x", (object)info.info.frequency));
                }
                if ((double)info.info.frequency >= 1000.0)
                {
                    return(string.Format("{0:0.00} kHz", (object)(float)((double)info.info.frequency * (1.0 / 1000.0))));
                }
                return(string.Format("{0:0.00} Hz", (object)info.info.frequency));

            case AudioProfilerInfoHelper.ColumnIndices.IsStream:
                if (flag2)
                {
                    return(string.Empty);
                }
                return((info.info.flags & 128) != 0 ? "YES" : "NO");

            case AudioProfilerInfoHelper.ColumnIndices.IsCompressed:
                if (flag2)
                {
                    return(string.Empty);
                }
                return((info.info.flags & 256) != 0 ? "YES" : "NO");

            case AudioProfilerInfoHelper.ColumnIndices.IsNonBlocking:
                if (flag2)
                {
                    return(string.Empty);
                }
                return((info.info.flags & 8192) != 0 ? "YES" : "NO");

            case AudioProfilerInfoHelper.ColumnIndices.IsOpenUser:
                if (flag2)
                {
                    return(string.Empty);
                }
                return((info.info.flags & 4096) != 0 ? "YES" : "NO");

            case AudioProfilerInfoHelper.ColumnIndices.IsOpenMemory:
                if (flag2)
                {
                    return(string.Empty);
                }
                return((info.info.flags & 1024) != 0 ? "YES" : "NO");

            case AudioProfilerInfoHelper.ColumnIndices.IsOpenMemoryPoint:
                if (flag2)
                {
                    return(string.Empty);
                }
                return((info.info.flags & 2048) != 0 ? "YES" : "NO");

            default:
                return("Unknown");
            }
        }