예제 #1
0
 public void LoadVorbisBuffer(OggStreamBuffer ovb, LoopCommentExtension loop)
 {
     loop_start  = loop.Start * 4;
     loop_length = loop.Length * 4;
     loop_end    = loop.End * 4;
     total       = loop.Total;
 }
예제 #2
0
        public LoopCommentExtension(OggStreamBuffer owner)
        {
            total = owner.GetTotalPcm (-1);
            foreach (var cmt in owner.GetComment(-1).Comments)
            {
                var comment = cmt.Replace(" ", ""); // trim spaces
                if (comment.StartsWith("LOOPSTART="))
                    loop_start = int.Parse(comment.Substring("LOOPSTART=".Length));
                if (comment.StartsWith("LOOPLENGTH="))
                    loop_length = int.Parse(comment.Substring("LOOPLENGTH=".Length));
            }

            if (loop_start > 0 && loop_length > 0)
                loop_end = (loop_start + loop_length);
        }
예제 #3
0
        public LoopCommentExtension(OggStreamBuffer owner)
        {
            total = owner.GetTotalPcm(-1);
            foreach (var cmt in owner.GetComment(-1).Comments)
            {
                var comment = cmt.Replace(" ", ""); // trim spaces
                if (comment.StartsWith("LOOPSTART="))
                {
                    loop_start = int.Parse(comment.Substring("LOOPSTART=".Length));
                }
                if (comment.StartsWith("LOOPLENGTH="))
                {
                    loop_length = int.Parse(comment.Substring("LOOPLENGTH=".Length));
                }
            }

            if (loop_start > 0 && loop_length > 0)
            {
                loop_end = (loop_start + loop_length);
            }
        }
예제 #4
0
        public void SelectFile(string file)
        {
            var hist = GetPlayHistory();

            if (!hist.Contains(file))
            {
                var ifs = IsolatedStorageFile.GetUserStoreForApplication();
                using (var sw = new StreamWriter(ifs.OpenFile("history.txt", FileMode.Create))) {
                    sw.WriteLine(file);
                    foreach (var h in hist.Take(Math.Min(9, hist.Length)))
                    {
                        sw.WriteLine(h);
                    }
                }
            }

            Stream input = File.OpenRead(file);

            vorbis_buffer = new OggStreamBuffer(input);
            loop          = new LoopCommentExtension(vorbis_buffer);
            InitializeVorbisBuffer();
        }
예제 #5
0
 public void LoadVorbisBuffer(OggStreamBuffer ovb, LoopCommentExtension loop)
 {
     loop_start = loop.Start * 4;
     loop_length = loop.Length * 4;
     loop_end = loop.End * 4;
     total = loop.Total;
 }
예제 #6
0
        public void SelectFile(string file)
        {
            var hist = GetPlayHistory ();
            if (!hist.Contains (file)) {
                var ifs = IsolatedStorageFile.GetUserStoreForApplication ();
                using (var sw = new StreamWriter (ifs.OpenFile ("history.txt", FileMode.Create))) {
                    sw.WriteLine(file);
                    foreach (var h in hist.Take (Math.Min (9, hist.Length)))
                        sw.WriteLine (h);
                }
            }

            Stream input = File.OpenRead (file);
            vorbis_buffer = new OggStreamBuffer (input);
            loop = new LoopCommentExtension (vorbis_buffer);
            InitializeVorbisBuffer ();
        }