private List <outputFormatBasic> getDataNormal() { List <outputFormatBasic> result = new List <outputFormatBasic>(); Int32 duration = 15; Int32 counter = 0; Int32 soundNameCounter = 0; Int32 soundKindCounter = 0; Int32 genleBig = 0; Int32 genleSmall = 0; string line = ""; bool keepTableFlag = true; for (DateTime current = today; current < this.lastDay; current = current.AddMinutes(duration)) // 指定した日付「まで」作る { counter++; 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); // HDで ou.audioInfo = makeAudioInfoList(ref 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(); } 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; result.Add(ou); } return(result); }
public override List <outputFormatBasic> getData() { List <outputFormatBasic> result = new List <outputFormatBasic>(); Int32 index = 0; Int32.TryParse(this.service.uri, out index); if (index > data.Count) { index = data.Count - 1; } serviceData conf = this.data.First(); // 特殊 1日当たり96event、9:30AM-17:30で5分間隔。 // StartTime は、this.today の 日付のみ借りて 9:30AM強制 // これを this.daycount日分繰り返す for (Int32 days = 0; days < 24 /* this.daycount */; days++) { DateTime startTime = new DateTime(today.Year, today.Month, today.Day, conf.startTime.Hour, conf.startTime.Minute, 0).AddDays(days); int counterEncodeRate = 0; for (Int32 eventCount = 0; eventCount < 96; eventCount++) { outputFormatBasic ou = new outputFormatBasic( service.networkId.value, service, null); ou.eventtime = new epgEventTime(startTime); ou.eventid.value = ou.eventid.setEventIdFromDate(ou.eventtime.value); ou.duration = new epgDuration(conf.duration); ou.videoInfo = new List <outputFormatExtList>(); outputFormatVideo p = new outputFormatVideo(); // p.componentType = new epgVideoComponentType(0xb3); p.componentType = new epgVideoComponentType(service.DefaultVideoComponentType.value); p.videoType = new epgVideoType("HD映像"); ou.videoInfo.Add(p); ou.audioInfo = new List <outputFormatExtList>(); ou.audioInfo.Add(new outputFormatAudio(ou.service.forceJlab035)); ou.title.value = conf.title; ou.contents.set(conf.desc.Trim()); if (conf.addEncRateText == true) { ou.encoderInfo = new outputFormatEncoderInfo(); Int32 rate = conf.rate[counterEncodeRate % conf.rate.Length]; ou.encoderInfo.rate.value = rate; ou.title.value += " " + ((Int32)(rate / 1000)).ToString() + "Mbps"; } else { ou.encoderInfo.clear(); } ou.genleInfo = new List <outputFormatExtList>(); outputFormatGenle genle = new outputFormatGenle(); genle.genleBig = new epgGenleBig(0x02); // 情報/ワイドショー genle.genleSmall = new epgGenleSmall(0x04); // ショッピング・通販 ou.genleInfo.Add(genle); ou.extDescriptorInfo = new List <outputFormatExtList>(); foreach (TagData tag in conf.tags) { outputFormatExtDescription exDesc = new outputFormatExtDescription(); exDesc.makeExtDescription(tag.name, tag.desc); ou.extDescriptorInfo.Add(exDesc); } counterEncodeRate++; startTime = startTime.AddMinutes(conf.duration); result.Add(ou); } } return(result); }
/// <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); }