Class: DVRB::Tivo

Inherits:
Base
  • Object
show all
Defined in:
lib/dvrb/tivo.rb

Constant Summary collapse

PORT =
31339

Instance Attribute Summary collapse

Attributes inherited from Base

#host, #port

Instance Method Summary collapse

Constructor Details

#initialize(host) ⇒ Tivo

Returns a new instance of Tivo.



7
8
9
# File 'lib/dvrb/tivo.rb', line 7

def initialize(host)
  @host = host
end

Instance Attribute Details

#tivoObject

TiVo specific functions



67
68
69
# File 'lib/dvrb/tivo.rb', line 67

def tivo
  @tivo
end

Instance Method Details

#channel(num) ⇒ Object

Changes the channel



46
47
48
# File 'lib/dvrb/tivo.rb', line 46

def channel(num)
  num.to_s.split("").each { |n| number(n) }
end

#channel_downObject

Channel down



32
33
34
# File 'lib/dvrb/tivo.rb', line 32

def channel_down
  remote "CHANNELDOWN"
end

#channel_upObject

Channel up



27
28
29
# File 'lib/dvrb/tivo.rb', line 27

def channel_up
  remote "CHANNELUP"
end

#downObject



54
55
56
# File 'lib/dvrb/tivo.rb', line 54

def down
  remote "DOWN"
end

#leftObject



58
59
60
# File 'lib/dvrb/tivo.rb', line 58

def left
  remote "LEFT"
end

#live_tvObject



79
80
81
# File 'lib/dvrb/tivo.rb', line 79

def live_tv
  remote "LIVETV"
end

#now_showingObject



83
84
85
# File 'lib/dvrb/tivo.rb', line 83

def now_showing
  remote "NOWSHOWING"
end

#number(num) ⇒ Object

Input a number



41
42
43
# File 'lib/dvrb/tivo.rb', line 41

def number(num)
  remote "NUM#{num}"
end

#pauseObject

Pause



17
18
19
# File 'lib/dvrb/tivo.rb', line 17

def pause
  remote "PAUSE"
end

#playObject

Play



12
13
14
# File 'lib/dvrb/tivo.rb', line 12

def play
  remote "PLAY"
end

#recordObject

Starts recording the current channel



22
23
24
# File 'lib/dvrb/tivo.rb', line 22

def record
  remote "RECORD", "SELECT"
end

#rightObject



62
63
64
# File 'lib/dvrb/tivo.rb', line 62

def right
  remote "RIGHT"
end

#selectObject



36
37
38
# File 'lib/dvrb/tivo.rb', line 36

def select
  remote "SELECT"
end

#thumbs_downObject



75
76
77
# File 'lib/dvrb/tivo.rb', line 75

def thumbs_down
  remote "THUMBSDOWN"
end

#thumbs_upObject



71
72
73
# File 'lib/dvrb/tivo.rb', line 71

def thumbs_up
  remote "THUMBSUP"
end

#upObject



50
51
52
# File 'lib/dvrb/tivo.rb', line 50

def up
  remote "UP"
end