Class: Ariblib::EventInformationTable::SelfWeeklyMultiEventSchedule
- Inherits:
-
Object
- Object
- Ariblib::EventInformationTable::SelfWeeklyMultiEventSchedule
- Defined in:
- lib/ariblib/EventInformationTable.rb
Instance Method Summary collapse
- #binary_insert(a, e) ⇒ Object
- #check(uid, tid, last_tid, seg_last, list) ⇒ Object
- #finish ⇒ Object
- #inc ⇒ Object
-
#initialize ⇒ SelfWeeklyMultiEventSchedule
constructor
A new instance of SelfWeeklyMultiEventSchedule.
- #refresh ⇒ Object
Constructor Details
#initialize ⇒ SelfWeeklyMultiEventSchedule
Returns a new instance of SelfWeeklyMultiEventSchedule.
11 12 13 |
# File 'lib/ariblib/EventInformationTable.rb', line 11 def initialize refresh end |
Instance Method Details
#binary_insert(a, e) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/ariblib/EventInformationTable.rb', line 29 def binary_insert(a,e) if a.size > 0 index = [*a.each_with_index].bsearch{|x, _| x[1] > e[1]}.last a.insert(index, e) if a[index][1]!=e[1] while a[@cur][2]==a[@cur+1][1] @cur+=1 end else a.insert(0, e) @cur=0 end end |
#check(uid, tid, last_tid, seg_last, list) ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/ariblib/EventInformationTable.rb', line 41 def check(uid,tid,last_tid,seg_last,list) if tid ==0x4e00 && list.size >0#自ストリーム現在地 unless @cur tmp=list[0][1] @cur=0 if @table.bsearch{|v|v[1]>=tmp} end elsif tid < 0x5000 #他ストリームnext elsif tid < 0x5200 #自ストリームtable 0x1ff -> 3f @end=list.last if @end==nil and tid==last_tid #and list.size >0 tmp=@table && @start[2] list.each do |v| next unless v[3][:title] @table << v end end end |
#finish ⇒ Object
20 21 |
# File 'lib/ariblib/EventInformationTable.rb', line 20 def finish end |
#inc ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/ariblib/EventInformationTable.rb', line 22 def inc while @cur < @table.size cur =@table[@cur ][2] nxt =@table[@cur+1][1] @cur+=1 if cur==nxt end end |
#refresh ⇒ Object
14 15 16 17 18 19 |
# File 'lib/ariblib/EventInformationTable.rb', line 14 def refresh @table=[] @start=nil @end=nil @cur=nil end |