Esempio n. 1
0
        public void Run(ReleaseConfiguration release)
        {
            _Jobs = new ConcurrentQueue <EncodingJob>();
            CreateJobs <LameEncodingJob>(release);
            CreateJobs <FlacEncodingJob>(release);
            var threads = new List <Thread>();

            for (int i = 0; i < Environment.ProcessorCount; i++)
            {
                var thread = new Thread(Worker);
                thread.Start();
            }
            foreach (var thread in threads)
            {
                thread.Join();
            }
        }
Esempio n. 2
0
        private void CreateJobs <JobType>(ReleaseConfiguration release)
            where JobType : EncodingJob, new()
        {
            int trackNumber = 1;

            foreach (var track in release.Tracks)
            {
                var job = new JobType();
                if (!track.Number.HasValue)
                {
                    track.Number = trackNumber;
                }
                job.Initialize(_Configuration, release, track);
                _Jobs.Enqueue(job);
                trackNumber++;
            }
        }
Esempio n. 3
0
 public void Initialize(GeneralConfiguration configuration, ReleaseConfiguration release, TrackConfiguration track)
 {
     Configuration = configuration;
     Release = release;
     Track = track;
 }
Esempio n. 4
0
 public void Initialize(GeneralConfiguration configuration, ReleaseConfiguration release, TrackConfiguration track)
 {
     Configuration = configuration;
     Release       = release;
     Track         = track;
 }