예제 #1
0
        /// <summary>
        /// duration を、候補の中から「乱数」で選ぶ。
        /// 乱数を使いはするが、「底」を日毎+自分のサービス番号と決めて使い、日が変わる時に再度「底」を宣言する。
        /// </summary>
        /// <returns></returns>
        private List <outputFormatBasic> getDataTimePattern1()
        {
            List <outputFormatBasic> result = new List <outputFormatBasic>();
            Int32  counter          = 0;
            Int32  soundNameCounter = 0;
            Int32  soundKindCounter = 0;
            Int32  genleBig         = 0;
            Int32  genleSmall       = 0;
            string line             = "";
            bool   keepTableFlag    = true;

            Int32[] durationItems    = this.service.madaraDurations;
            Int32   seed             = 0;
            Int32   dayNum           = -1;
            Random  rnd              = null;
            Int32   copyControlValue = 0;

            for (DateTime current = today; current < this.lastDay;)  // 指定した日付「まで」作る
            {
                if (dayNum != current.Day)
                {
                    seed   = makeSeed(this.today, this.service);
                    dayNum = current.Day;
                    rnd    = new Random(seed);
                }
                Int32             duration = durationItems[rnd.Next(durationItems.Count())];
                outputFormatBasic ou       = new outputFormatBasic(
                    service.networkId.value,
                    service,
                    exchangeLetter);
                ou.eventtime      = new epgEventTime(current);
                ou.eventid.value  = ou.eventid.setEventIdFromDate(ou.eventtime.value);
                ou.duration.value = duration;
                //                ou.contents.set("Contents:" + current.ToLongDateString() + "," + current.ToLongTimeString());
                // ou.videoInfo = makeVideoInfoList(ref counter, this.service.madaraResolution); // HDで
                ou.videoInfo = makeVideoInfoList(ref counter, this.service.DefaultVideoComponentType.value);
                ou.audioInfo = makeAudioInfoList(ref ou.service, ref counter, ref soundKindCounter, ref soundNameCounter);

                line          = "";
                keepTableFlag = makeContentsWithAllKanji(ref kanji, ref ou, ref line);
                ou.contents.set(line);
                ou.title.set(makeTitleWithAllKanji(ref kanji));   // "title" + current.ToShortTimeString() , ou.duration.value);
                if (keepTableFlag == false)
                {
                    kanji.setFirst();
                }

                copyControlData cp = new copyControlData(copyControlValue);
                copyControlValue++;
                if (cp.copyControl != null && cp.contents != null)
                {
                    ou.copyControlMain     = cp.copyControl;
                    ou.contentAvailability = cp.contents;
                }

                outputFormatGenle ougenle = new outputFormatGenle();
                ougenle.getGenleNext(ref genleBig, ref genleSmall);
                ougenle.genleBig.value   = genleBig;
                ougenle.genleSmall.value = genleSmall;
                ou.genleInfo.Add(ougenle);
                ou.service = service;

                outputFormatEncoderInfo enc = new outputFormatEncoderInfo();
                enc.rate.value = 6000; // 6Mbps
                ou.encoderInfo = enc;

                result.Add(ou);
                current = current.AddMinutes(duration);
                counter++;
            }
            return(result);
        }
예제 #2
0
        public override int CompareTo(object obj)
        {
            outputFormatEncoderInfo p = (obj as outputFormatEncoderInfo);

            return(this.rate.CompareTo(p.rate));
        }