Ejemplo n.º 1
0
        public void OpenFlacFileAndCreateMultiplePadding()
        {
            int    paddingCount = 0;
            string origFile     = @"Data\testfile4.flac";
            string newFile      = @"Data\testfile4_temp.flac";

            FileHelper.GetNewFile(origFile, newFile);

            try
            {
                using (FlacFile flac = new FlacFile(newFile))
                {
                    if (flac.Padding != null)
                    {
                        paddingCount = 1;
                    }

                    Padding newPadding = new Padding()
                    {
                        EmptyBitCount = 8
                    };
                    flac.Metadata.Add(newPadding);
                    newPadding = new Padding()
                    {
                        EmptyBitCount = 8
                    };
                    flac.Metadata.Add(newPadding);

                    paddingCount += 2;

                    flac.Save();
                }
                using (FlacFile flac = new FlacFile(newFile))
                {
                    Assert.AreEqual <int>(paddingCount, flac.GetAllPadding().Count());
                }
            }
            finally
            {
                if (File.Exists(newFile))
                {
                    File.Delete(newFile);
                }
            }
        }
Ejemplo n.º 2
0
        public void OpenFlacFileAndCreateMultiplePadding()
        {
            int paddingCount = 0;
            string origFile = @"Data\testfile4.flac";
            string newFile = @"Data\testfile4_temp.flac";

            FileHelper.GetNewFile(origFile, newFile);

            try
            {
                using (FlacFile flac = new FlacFile(newFile))
                {
                    if (flac.Padding != null)
                    {
                        paddingCount = 1;
                    }

                    Padding newPadding = new Padding() { EmptyBitCount = 8 };
                    flac.Metadata.Add(newPadding);
                     newPadding = new Padding() { EmptyBitCount = 8 };
                    flac.Metadata.Add(newPadding);

                    paddingCount += 2;

                    flac.Save();
                }
                using (FlacFile flac = new FlacFile(newFile))
                {
                    Assert.AreEqual<int>(paddingCount, flac.GetAllPadding().Count());
                }
            }
            finally
            {
                if (File.Exists(newFile))
                {
                    File.Delete(newFile);
                }
            }
        }