Пример #1
0
        public CueTrack(CueSheet Father, int tracknumber, string datatype)
        {
            _Father = Father;
            m_TrackNumber = (uint)tracknumber;

            switch (datatype.Trim().ToUpper())
            {
                case "AUDIO":
                    m_TrackDataType = DataType.AUDIO;
                    break;
                case "CDG":
                    m_TrackDataType = DataType.CDG;
                    break;
                case "MODE1/2048":
                    m_TrackDataType = DataType.MODE1_2048;
                    break;
                case "MODE1/2352":
                    m_TrackDataType = DataType.MODE1_2352;
                    break;
                case "MODE2/2336":
                    m_TrackDataType = DataType.MODE2_2336;
                    break;
                case "MODE2/2352":
                    m_TrackDataType = DataType.MODE2_2352;
                    break;
                case "CDI/2336":
                    m_TrackDataType = DataType.CDI_2336;
                    break;
                case "CDI/2352":
                    m_TrackDataType = DataType.CDI_2352;
                    break;
                default:
                    m_TrackDataType = DataType.AUDIO;
                    break;
            }

            m_TrackFlags = new Flags[0];
            m_Songwriter = "";
            m_Title = "";
            m_ISRC = null;
            m_Performer = "";
            m_Indices = new Index[0];
            m_Garbage = new string[0];
            m_Comments = new string[0];
            m_PreGap = new Index(-1, 0, 0, 0);
            m_PostGap = new Index(-1, 0, 0, 0);
            m_DataFile = new AudioFile();
            _Path = "";
            _Duration = new TimeSpan();
        }
Пример #2
0
        public CueTrack(CueSheet Father, int tracknumber, DataType datatype)
        {
            _Father = Father;

            m_TrackNumber = (uint)tracknumber;
            m_TrackDataType = datatype;

            m_TrackFlags = new Flags[0];
            m_Songwriter = "";
            m_Title = "";
            m_ISRC = null;
            m_Performer = "";
            m_Indices = new Index[0];
            m_Garbage = new string[0];
            m_Comments = new string[0];
            m_PreGap = new Index(-1, 0, 0, 0);
            m_PostGap = new Index(-1, 0, 0, 0);
            m_DataFile = new AudioFile();
            _Path = "";
            _Duration = new TimeSpan();
        }
Пример #3
0
        public void Test()
        {

            using (IMusicSession ms = MusicSessionImpl.GetSession(_SK.Builder))
            {
                Assert.That(ms.AllAlbums.Count, Is.EqualTo(0));
                Assert.That(ms.AllGenres.Count, Is.EqualTo(0));
                Assert.That(ms.AllArtists.Count, Is.EqualTo(0));

                IMusicImporter imi = ms.GetDBImporter();
                Assert.That(imi, Is.Not.Null);
                imi.Load();
                Assert.That(ms.AllAlbums.Count, Is.EqualTo(0));
                Assert.That(ms.AllGenres.Count, Is.EqualTo(25));
                Assert.That(ms.AllArtists.Count, Is.EqualTo(0));

                //World_Saxophone_Quartet-Steppin_With

                _SK.Settings.RarFileManagement.RarZipFileAfterSuccessfullExtract = CompleteFileBehaviour.Delete;
                string rarpath = Path.Combine(DirectoryIn, "a.rar");
                Assert.That(File.Exists(rarpath), Is.True);

                IFilesImporterBuilder imi2 = ms.GetImporterBuilder(MusicImportType.Compressed) as IFilesImporterBuilder;
                Assert.That(imi2, Is.Not.Null);
                imi2.Files = new string[] { rarpath };
                Assert.That(imi2.IsValid, Is.True);
                imi = imi2.BuildImporter(); 

                ImportExportError error=null;
                WPFSynchroneousImportProgess ip = new WPFSynchroneousImportProgess((e) => { error = e; }, null);
            
                //imi.Error += (o, e) => error = e;
                imi.Load(ip);
                if (error != null)
                {
                    Console.WriteLine(error);
                    if (error is NotEnougthSpace)
                    {
                        Assert.Ignore("Not Enougth Disk space.  Omitting.");
                    }
                    else
                    {
                        Assert.That(false);
                    }
                }

                Assert.That(File.Exists(rarpath), Is.False);
                Assert.That(ms.AllAlbums.Count, Is.EqualTo(1));

                CueSheet cs = new CueSheet(Path.Combine(DirectoryIn, "a.cue"));

                AssertAlbum(ms.AllAlbums[0], cs, AlbumDescriptorCompareMode.AlbumandTrackMD);
                AssertAlbum(ms.AllAlbums[0], Albums[0][0], AlbumDescriptorCompareMode.AlbumandTrackMD);

            }
        }