Class: Cmus::Controller::Window
- Inherits:
-
Object
- Object
- Cmus::Controller::Window
- Defined in:
- lib/cmus/controller/window.rb
Instance Attribute Summary collapse
-
#controller ⇒ Object
readonly
Returns the value of attribute controller.
Instance Method Summary collapse
- #activate ⇒ Object
- #add(context = :playlist) ⇒ Object
- #bottom ⇒ Object
- #down ⇒ Object
-
#initialize(controller) ⇒ Window
constructor
A new instance of Window.
- #move(whence = :after) ⇒ Object
- #next ⇒ Object
- #page_down ⇒ Object
- #page_up ⇒ Object
- #refresh ⇒ Object
- #remove ⇒ Object
- #search(whence = :next) ⇒ Object
- #select_current ⇒ Object
- #toggle ⇒ Object
- #top ⇒ Object
- #up ⇒ Object
- #update ⇒ Object
- #update_cache ⇒ Object
- #view(name) ⇒ Object
Constructor Details
#initialize(controller) ⇒ Window
Returns a new instance of Window.
16 17 18 |
# File 'lib/cmus/controller/window.rb', line 16 def initialize (controller) @controller = controller end |
Instance Attribute Details
#controller ⇒ Object (readonly)
Returns the value of attribute controller.
14 15 16 |
# File 'lib/cmus/controller/window.rb', line 14 def controller @controller end |
Instance Method Details
#activate ⇒ Object
33 34 35 36 37 |
# File 'lib/cmus/controller/window.rb', line 33 def activate controller.send 'win-activate' self end |
#add(context = :playlist) ⇒ Object
39 40 41 42 43 44 |
# File 'lib/cmus/controller/window.rb', line 39 def add (context = :playlist) controller.send "win-add-#{context.to_s.downcase[0]}" controller.check_for_error self end |
#bottom ⇒ Object
46 47 48 49 50 |
# File 'lib/cmus/controller/window.rb', line 46 def bottom controller.send 'win-bottom' self end |
#down ⇒ Object
52 53 54 55 56 |
# File 'lib/cmus/controller/window.rb', line 52 def down controller.send 'win-down' self end |
#move(whence = :after) ⇒ Object
70 71 72 73 74 75 |
# File 'lib/cmus/controller/window.rb', line 70 def move (whence = :after) controller.send "win-mv-#{whence}" controller.check_for_error self end |
#next ⇒ Object
77 78 79 80 81 |
# File 'lib/cmus/controller/window.rb', line 77 def next controller.send 'win-next' self end |
#page_down ⇒ Object
89 90 91 92 93 |
# File 'lib/cmus/controller/window.rb', line 89 def page_down controller.send 'win-page-down' self end |
#page_up ⇒ Object
83 84 85 86 87 |
# File 'lib/cmus/controller/window.rb', line 83 def page_up controller.send 'win-page-up' self end |
#refresh ⇒ Object
27 28 29 30 31 |
# File 'lib/cmus/controller/window.rb', line 27 def refresh controller.send 'refresh' self end |
#remove ⇒ Object
95 96 97 98 99 |
# File 'lib/cmus/controller/window.rb', line 95 def remove controller.send 'win-remove' self end |
#search(whence = :next) ⇒ Object
125 126 127 128 129 130 |
# File 'lib/cmus/controller/window.rb', line 125 def search (whence = :next) controller.send "search-#{whence}" controller.check_for_error self end |
#select_current ⇒ Object
101 102 103 104 105 |
# File 'lib/cmus/controller/window.rb', line 101 def select_current controller.send 'win-sel-cur' self end |
#toggle ⇒ Object
107 108 109 110 111 |
# File 'lib/cmus/controller/window.rb', line 107 def toggle controller.send 'win-toggle' self end |
#top ⇒ Object
64 65 66 67 68 |
# File 'lib/cmus/controller/window.rb', line 64 def top controller.send 'win-top' self end |
#up ⇒ Object
58 59 60 61 62 |
# File 'lib/cmus/controller/window.rb', line 58 def up controller.send 'win-up' self end |
#update ⇒ Object
113 114 115 116 117 |
# File 'lib/cmus/controller/window.rb', line 113 def update controller.send 'win-update' self end |
#update_cache ⇒ Object
119 120 121 122 123 |
# File 'lib/cmus/controller/window.rb', line 119 def update_cache controller.send 'win-update-cache' self end |
#view(name) ⇒ Object
20 21 22 23 24 25 |
# File 'lib/cmus/controller/window.rb', line 20 def view (name) controller.send "view #{name}" controller.check_for_error self end |