コード例 #1
0
        private Dictionary <int, List <SampleMeta> > getActivitiesToLaunch()
        {
            var pos2activites = new Dictionary <int, List <SampleMeta> >();

            string[] assetsIWant;

            try
            {
                assetsIWant = this.Assets.List("samples");

                int pos            = -1;
                int lastCategoryId = -1;
                foreach (var asset in assetsIWant)
                {
                    if (!asset.Contains("_"))
                    {
                        continue;
                    }

                    SampleMeta sampleMeta = new SampleMeta(asset);
                    if (sampleMeta.CategoryId != lastCategoryId)
                    {
                        pos++;
                        if (!pos2activites.ContainsKey(pos))
                        {
                            pos2activites.Add(pos, new List <SampleMeta>());
                        }
                    }
                    pos2activites[pos].Add(sampleMeta);
                    lastCategoryId = sampleMeta.CategoryId;
                }

                return(pos2activites);
            } catch (Exception ex)
            {
                Log.Error("WIKITUDE_EXAMPLE", ex.ToString());
                return(null);
            }
        }
コード例 #2
0
ファイル: PopAtom.cs プロジェクト: unitycoder/PopCodecs
        static List <SampleMeta> GetSampleMetas(TAtom Atom, byte[] FileData)
        {
            var Metas    = new List <SampleMeta>();
            var AtomData = Atom.AtomData;

            //	https://developer.apple.com/library/content/documentation/QuickTime/QTFF/QTFFChap2/qtff2.html
            //var Version = AtomData[8];
            /*var Flags = */ Get24(AtomData[9], AtomData[10], AtomData[11]);
            var EntryCount = Get32(AtomData[12], AtomData[13], AtomData[14], AtomData[15]);

            var MetaSize = 3 * 4;

            for (int i = 16; i < AtomData.Length; i += MetaSize)
            {
                var Meta = new SampleMeta(AtomData, i);
                Metas.Add(Meta);
            }
            if (Metas.Count() != EntryCount)
            {
                Debug.LogWarning("Expected " + EntryCount + " sample metas, got " + Metas.Count());
            }

            return(Metas);
        }
コード例 #3
0
        private Dictionary<int, List<SampleMeta>> getActivitiesToLaunch()
        {
            var pos2activites = new Dictionary<int, List<SampleMeta>>();

            string[] assetsIWant;

            try
            {
                assetsIWant = this.Assets.List("samples");

                int pos = -1;
                int lastCategoryId = -1;
                foreach (var asset in assetsIWant)
                {
                    if (asset.Split('_').Length != 4)
                        continue;

                    SampleMeta sampleMeta = new SampleMeta(asset);
                    if (sampleMeta.CategoryId!=lastCategoryId)
                    {
                        pos++;
                        if (!pos2activites.ContainsKey(pos))
                            pos2activites.Add(pos, new List<SampleMeta>());
                    }
                    pos2activites[pos].Add(sampleMeta);
                    lastCategoryId = sampleMeta.CategoryId;
                }

                return pos2activites;

            } catch (Exception ex)
            {
                Log.Error ("WIKITUDE_EXAMPLE", ex.ToString());
                return null;
            }
        }