private List <outputFormatBasic> getEventListsCurrent(DateTime eventTime, serviceFormat service) { List <outputFormatBasic> eventList = new List <outputFormatBasic>(); var list = from x in service.outList where x.eventtime.value <= eventTime && x.eventtime.value.AddMinutes(x.duration.value) > eventTime select x; foreach (outputFormatBasic p in list) { eventList.Add(p); break; } for (Int32 i = 0; i < service.children.Count; i++) { list = from x in service.children[i].outList where x.eventtime.value <= eventTime && x.eventtime.value.AddMinutes(x.duration.value) > eventTime select x; foreach (outputFormatBasic p in list) { eventList.Add(p); break; } } return(eventList); }
public byte[] getResultListByte(serviceFormat sf) { List <byte> result = new List <byte>(); setInfoLineToResult(this.paramList, ref result); if (sf.mostSimple == true) { return(result.ToArray()); } if (this.madara != null) { this.madara.makeList(); setInfoLineToResult(this.madara.paramList, ref result); } setInfoListToResult(this.videoInfo, ref result); setInfoListToResult(this.audioInfo, ref result); setInfoListToResult(this.genleInfo, ref result); this.copyControlMain.makeList(); setInfoLineToResult(this.copyControlMain.paramList, ref result); this.contentAvailability.makeList(); setInfoLineToResult(this.contentAvailability.paramList, ref result); // this.encoderInfo.makeList(); // setInfoLineToResult(this.encoderInfo.paramList, ref result); // this.ccj.makeList(); // setInfoLineToResult(this.ccj.paramList, ref result); setInfoListToResult(this.extDescriptorInfo, ref result); this.parental.makeList(); setInfoLineToResult(this.parental.paramList, ref result); return(result.ToArray()); }
private Int32 makeSeed(DateTime p, serviceFormat service) { Int32 ret = 0; Int32 p1 = 0; Int32.TryParse(p.ToString("yyyyMMdd"), out p1); ret = p1 + service.serviceId.value; return(ret); }
private string dispServiceListMadara(serviceFormat child) { string result = ""; result += " child" + child.madaraSeqNum.ToString(); result += "," + child.serviceName.ToString(); result += "," + child.serviceId.value.ToString(); result += "(exchanged channel No.:" + child.madaraToChNum.ToString() + ")" + "\r\n"; return(result); }
private void setMadara(serviceFormat service, Int32 counter, Int32 serviceNum, Int32 rawMax, Int32 index, outputFormatVideo video, Int32 point, ref bool parent) { outputFormatBasic target; // serviceNum:0 は service, それ以上は serviceNum.children に設定する必要がある。 if (serviceNum == 0) { target = service.outList[counter]; } else { //target = DeepCopyHelper.DeepCopy<outputFormatBasic>(service.children[serviceNum - 1].outList[counter]); //service.children[serviceNum - 1].outList[counter] = target; target = service.children[serviceNum - 1].outList[counter]; } target.videoInfo.Clear(); target.videoInfo.Add(video); if (point == -1) { target.madara.Clear(); return; } if (parent == true) { parent = false; // まず自分を追加 serviceFormat from = (serviceNum == 0) ? service : (service.children[serviceNum - 1]); target.madara.eventIdList.Add(from.outList[counter].eventid.ToOutput()); target.madara.serviceList.Add(from.serviceId.ToOutput()); // serviceNum これ以降の event から、自分を指している serviceId/eventIdを収集 for (Int32 i = (serviceNum + 1); i < rawMax; i++) { Int32 pointRef = this.table.getPointTo(service.madaraType, i, index); if (pointRef != -1) { target.madara.serviceList.Add(service.children[i - 1].serviceId.ToOutput()); target.madara.eventIdList.Add(service.children[i - 1].outList[counter].eventid.ToOutput()); } } } else { // 子。 if (point == 0) { target.madara.serviceList.Add(service.serviceId.ToOutput()); target.madara.eventIdList.Add(service.outList[counter].eventid.ToOutput()); } else { target.madara.serviceList.Add(service.children[point - 1].serviceId.ToOutput()); target.madara.eventIdList.Add(service.children[point - 1].outList[counter].eventid.ToOutput()); } } }
public void editToMadara(serviceFormat service) { epgEventTime current = new epgEventTime(DateTime.MinValue); List <outputFormatBasic> eventList; Int32 counter = 0; this.service = service; Int32 serviceTotalNum = 1 /* primary */ + service.children.Count(); while ((eventList = getNextEvent(service, current)).Count != 0) { // eventList には、各サービスの current 時刻以降で最も近いevent が並んでいる。 // このうち、「eventtime」が同じで「duration」も同じevent が並んでいたら、 // それを「まだら」にする。 if (eventList.Count == 1) { current = eventList[0].eventtime; continue; } // eventtimeのうち最小のイベントを抽出 DateTime thisCurrent = DateTime.MaxValue; outputFormatBasic target = null; foreach (outputFormatBasic x in eventList) { if (x.eventtime.value < thisCurrent) { target = x; thisCurrent = x.eventtime.value; } } current.value = thisCurrent; if (target == null) { continue; } // その eventtime と duration が同じeventをさがしてみる var list = from x in eventList where x.eventtime.value == target.eventtime.value && x.duration.value == target.duration.value select x; // そのeventtime の時間の eventlist全部も作る。 List <outputFormatBasic> alllist = this.getEventListsCurrent(current.value, service); if (list.Count() > 1) // まだらに出来るぞ! { this.setMadara(list.ToList <outputFormatBasic>(), alllist.ToList <outputFormatBasic>(), counter); } counter++; } }
public outputFormatBasic(int net, serviceFormat service, ExchangeLetter ex) { this.service = service; this.networkid = new epgNetowrkId(net); this.serviceid = new epgServiceId(service.serviceId.value); this.eventid = new epgEventId(1); this.eventtime = new epgEventTime(); this.duration = new epgDuration(0); this.title = new epgTitle("", ex); this.contents = new epgDescribe("", ex); this.payment = new epgPayment(0); this.exchangeLetter = ex; }
private void editToMadaraSeq(serviceFormat service, int counter) { Int32 lineMax = this.table.getLineNum(service.madaraType); Int32 rawMax = this.table.getServiceNum(service.madaraType); Int32 index = counter % lineMax; bool parentFlag = true; for (Int32 serviceNum = 0; serviceNum < rawMax; serviceNum++) { Int32 point = this.table.getPointTo(service.madaraType, serviceNum, index); outputFormatVideo video = new outputFormatVideo(this.table.getResolution(service.madaraType, service.madaraSeqNum, index)); this.setMadara(service, counter, serviceNum, rawMax, index, video, point, ref parentFlag); } }
/// <summary> /// service.outList, child[].outList の イベントについて /// サービス毎の startTime以降で最も「近い」イベントの epgEventTime を配列にして返す /// </summary> /// <param name="service"></param> /// <returns></returns> private List <outputFormatBasic> getNextEvent(serviceFormat service, epgEventTime startEvtTime) { List <outputFormatBasic> eventList = new List <outputFormatBasic>(); outputFormatBasic p; p = this.getEventListLater(service.outList, startEvtTime); if (p != null) { eventList.Add(p); } for (Int32 i = 0; i < service.children.Count; i++) { p = this.getEventListLater(service.children[i].outList, startEvtTime); if (p != null) { eventList.Add(p); } } return(eventList); }
public void editToMadara(serviceFormat service, int counter) { switch (service.madaraMethod) { case 1: // 1:順序通り繰り返し、 editToMadaraSeq(service, counter); break; case 2: // 2:ランダムのレア(頻度 1/10)、 break; case 3:// 3:ランダムのレア(頻度1/100)、 break; case 4: // 4:ランダムのレア(頻度1/200) break; default: // 0:ランダム、 editToMadaraRandom(service, counter); break; } }
private List <outputFormatExtList> makeAudioInfoList( ref serviceFormat service, ref int counter, ref Int32 soundKindCounter, ref Int32 soundNameCounter ) { /* * → Audio 以下を、Video同様、Indexの順番で適合させる。 * 1ES 1音声 * 1ES 2音声 * 2ES 1音声 + 1音声 * 2ES 2音声 + 1音声 * 2ES 1音声 + 2音声 * 2ES 2音声 + 2音声 * * component tag * ES1: 10, ES2: 11 * * * multilingul 2音声なら 1(両方のESとも) * maincomponent Main(ES1): 1 * quority : 1 * sample rate: 5 or 7 */ List <outputFormatExtList> audio = new List <outputFormatExtList>(); outputFormatAudio es1 = new outputFormatAudio(service.forceJlab035); // es1 = new outputFormatAudio(); outputFormatAudio es2 = null; es1.makeTestDataSound(1, ref counter, ref soundKindCounter, ref soundNameCounter, true, false); es2 = new outputFormatAudio(service.forceJlab035); es2.makeTestDataSound(2, ref counter, ref soundKindCounter, ref soundNameCounter, true, false); #if nouse switch (counter % 6) { case 0: es1.makeTestDataSound(1, ref counter, ref soundKindCounter, ref soundNameCounter, false, false); break; case 1: es1.makeTestDataSound(1, ref counter, ref soundKindCounter, ref soundNameCounter, false, true); break; case 2: es1.makeTestDataSound(1, ref counter, ref soundKindCounter, ref soundNameCounter, true, false); es2 = new outputFormatAudio(service.forceJlab035); es2.makeTestDataSound(2, ref counter, ref soundKindCounter, ref soundNameCounter, true, false); break; case 3: es1.makeTestDataSound(1, ref counter, ref soundKindCounter, ref soundNameCounter, true, true); es2 = new outputFormatAudio(service.forceJlab035); es2.makeTestDataSound(2, ref counter, ref soundKindCounter, ref soundNameCounter, true, false); break; case 4: es1.makeTestDataSound(1, ref counter, ref soundKindCounter, ref soundNameCounter, true, false); es2 = new outputFormatAudio(service.forceJlab035); es2.makeTestDataSound(2, ref counter, ref soundKindCounter, ref soundNameCounter, true, true); break; case 5: es1.makeTestDataSound(1, ref counter, ref soundKindCounter, ref soundNameCounter, true, true); es2 = new outputFormatAudio(service.forceJlab035); es2.makeTestDataSound(2, ref counter, ref soundKindCounter, ref soundNameCounter, true, true); break; default: break; } #endif audio.Add(es1); if (es2 != null) { audio.Add(es2); } return(audio); }
public Int32 getMyServiceNum(serviceFormat service) { return(this.table.getServiceNum(service.madaraType)); }
public string getMyResolution(serviceFormat service) { return(this.table.getResolution(service.madaraType, service.madaraSeqNum, 0)); }