コード例 #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();
            }
        }
コード例 #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++;
            }
        }
コード例 #3
0
ファイル: EncodingJob.cs プロジェクト: rajeshwarn/Metastasis
 public void Initialize(GeneralConfiguration configuration, ReleaseConfiguration release, TrackConfiguration track)
 {
     Configuration = configuration;
     Release = release;
     Track = track;
 }
コード例 #4
0
ファイル: EncodingJob.cs プロジェクト: encratite/Metastasis
 public void Initialize(GeneralConfiguration configuration, ReleaseConfiguration release, TrackConfiguration track)
 {
     Configuration = configuration;
     Release       = release;
     Track         = track;
 }