public void Setup()
        {
            SIL.Reporting.ErrorReport.IsOkToInteractWithUser = false;

            _tempAudioFile = MediaFileInfoTests.GetLongerTestAudioFile();
            _timeTier      = new TimeTier(_tempAudioFile);
            _timeTier.AddSegment(0f, 10f);
            _timeTier.AddSegment(10f, 20f);
            _timeTier.AddSegment(20f, 30f);

            _textTier = new TextTier(TextTier.ElanTranscriptionTierId);

            var annotationFile = new Mock <AnnotationComponentFile>();

            annotationFile.Setup(a => a.Tiers).Returns(new TierCollection {
                _timeTier, _textTier
            });

            _componentFile = new Mock <ComponentFile>();
            _componentFile.Setup(f => f.PathToAnnotatedFile).Returns(_tempAudioFile);
            _componentFile.Setup(f => f.GetAnnotationFile()).Returns(annotationFile.Object);

            CreateNewModel();
            Directory.CreateDirectory(_model.OralAnnotationsFolder);

            Assert.IsNotNull(_model.OrigWaveStream);
        }
Ejemplo n.º 2
0
        public void Setup()
        {
            _helper = new FLExTextExporter(null, "Homer", null, "en", "fr", "filename1", "filename2");

            var tempMediaPath = MediaFileInfoTests.GetLongerTestAudioFile();

            _tempFolder = new TemporaryFolder("TierCollectionTests");
            _mediaFile  = Path.Combine(_tempFolder.Path, "mediaFile.wav");
            File.Move(tempMediaPath, _mediaFile);
        }
        public void Setup()
        {
            _tempFolder        = new TemporaryFolder("ConvertMediaDlgViewModelTests");
            _testAudioFileName = MediaFileInfoTests.GetLongerTestAudioFile();
            var destFile = Path.Combine(_tempFolder.Path, "test.wav");

            File.Move(_testAudioFileName, destFile);
            _testAudioFileName = destFile;

            _model = new ConvertMediaDlgViewModel(_testAudioFileName,
                                                  ConvertMediaDlg.GetFactoryExtractToMp3AudioConversionName());
        }
Ejemplo n.º 4
0
        public void Setup()
        {
            var tempMediaPath = MediaFileInfoTests.GetLongerTestAudioFile();

            _tempFolder = new TemporaryFolder("TierCollectionTests");
            var mediaFile = Path.Combine(_tempFolder.Path, "mediaFile.wav");

            File.Move(tempMediaPath, mediaFile);

            _collection = new TierCollection(mediaFile);
            _collection.Clear();
            var timeTier = new TimeTier("timeTier", mediaFile);

            _collection.Add(timeTier);

            var transcriptionTier = new TextTier(TextTier.ElanTranscriptionTierId);

            _collection.Add(transcriptionTier);

            var translationTier = new TextTier(TextTier.ElanTranslationTierId);

            _collection.Add(translationTier);

            var otherTextTier = new TextTier("otherTextTier");

            _collection.Add(otherTextTier);

            timeTier.AddSegment(10f, 20f);
            timeTier.AddSegment(20f, 30f);
            timeTier.AddSegment(30f, 40f);

            transcriptionTier.AddSegment("trans1");
            transcriptionTier.AddSegment("trans2");
            transcriptionTier.AddSegment("trans3");

            translationTier.AddSegment("free1");
            translationTier.AddSegment("free2");
            translationTier.AddSegment(null);

            otherTextTier.AddSegment("other1");
            otherTextTier.AddSegment(null);
            otherTextTier.AddSegment(null);

            Assert.AreEqual(mediaFile, _collection.AnnotatedMediaFile);
            Assert.AreEqual(4, _collection.Count);
        }
Ejemplo n.º 5
0
        public void Setup()
        {
            var tempMediaPath = MediaFileInfoTests.GetLongerTestAudioFile();

            _tempFolder = new TemporaryFolder("TierCollectionTests");
            var mediaFile = Path.Combine(_tempFolder.Path, "mediaFile.wav");

            File.Move(tempMediaPath, mediaFile);
            _tier = new TimeTier("test tier", mediaFile);
            _tier.AddSegment(10f, 20f);
            _tier.AddSegment(20f, 30f);
            _tier.AddSegment(30f, 40f);

            Assert.AreEqual("test tier", _tier.Id);
            Assert.AreEqual(string.Empty, _tier.DisplayName);
            Assert.AreEqual(mediaFile, _tier.MediaFileName);
            Assert.AreEqual(Path.Combine(_tempFolder.Path, "mediaFile.wav_Annotations"), _tier.SegmentFileFolder);

            Assert.IsInstanceOf <AudioWaveFormColumn>(_tier.GridColumn);
        }
        public void Setup()
        {
            _tempAudioFile = MediaFileInfoTests.GetLongerTestAudioFile();
            var tier = new TimeTier(_tempAudioFile);

            tier.AddSegment(0f, 5f);
            tier.AddSegment(5f, 10f);
            tier.AddSegment(15f, 20f);
            tier.AddSegment(25f, 30f);

            var annotationFile = new Mock <AnnotationComponentFile>();

            annotationFile.Setup(a => a.Tiers).Returns(new TierCollection {
                tier
            });

            _componentFile = new Mock <ComponentFile>();
            _componentFile.Setup(f => f.PathToAnnotatedFile).Returns(_tempAudioFile);
            _componentFile.Setup(f => f.GetAnnotationFile()).Returns(annotationFile.Object);

            _model = OralAnnotationRecorderDlgViewModel.Create(_componentFile.Object, AudioRecordingType.Careful);
        }
Ejemplo n.º 7
0
 public void SetUp()
 {
     _testAudioFileName = MediaFileInfoTests.GetLongerTestAudioFile();
     _helper            = new AudioFileHelper(_testAudioFileName);
 }