Esempio n. 1
0
        public void StartJob(VlcJob job)
        {
            logger.Debug("Call to start job. Input file: {0} Output file: {1}", job.InputFile.FullName, job.OutputFile.FullName);
            job.QuitAfer = true; //fairly important if we're tracking it
            var vlcArguments = job.GetVlcArguments();

            job.State = VlcJob.JobState.Started;
            var instance = Starter.Start(vlcArguments, VlcExePath);

            job.Instance       = instance;
            instance.OnExited += OnVlcInstanceExited;
            JobBag.Add(job);
        }
Esempio n. 2
0
        public void EnsureTheLiveStatusIsNotUpdatedWhenStateIsNotStarted(VlcJob.JobState state)
        {
            var audioConfig = MockRepository.GenerateMock<IAudioConfiguration>();

            var portAllocator = MockRepository.GenerateMock<IPortAllocator>();
            portAllocator.Expect(x => x.NewPort()).Return(89);

            var statusSource = MockRepository.GenerateStub<IVlcStatusSource>();
            statusSource.Expect(x => x.GetXml()).Return("Foo");

            var statusParser = MockRepository.GenerateMock<IStatusParser>();
            statusParser.Expect(x => x.Position).Return(67);

            var job = new VlcAudioJob(audioConfig, portAllocator, statusParser, statusSource, new TimeSouce(), MockRepository.GenerateMock<ILogger>())
            {
                State = state,
            };

            job.UpdateProgress();
            statusSource.AssertWasNotCalled(x => x.GetXml());
            statusParser.AssertWasNotCalled(x => x.Parse());
        }
Esempio n. 3
0
        public void StartJob(VlcJob job)
        {
            logger.Debug("Call to start job. Input file: {0} Output file: {1}", job.InputFile.FullName, job.OutputFile.FullName);
            job.QuitAfer = true; //fairly important if we're tracking it
            var vlcArguments = job.GetVlcArguments();

            job.State = VlcJob.JobState.Started;
            var instance = Starter.Start(vlcArguments, VlcExePath);
            job.Instance = instance;
            instance.OnExited += OnVlcInstanceExited;
            JobBag.Add(job);
        }