Class: LastFM::AudioOutput::ITunes
- Inherits:
-
Object
- Object
- LastFM::AudioOutput::ITunes
- Defined in:
- lib/lastfm.rb
Instance Method Summary collapse
-
#initialize(stream_url) ⇒ ITunes
constructor
A new instance of ITunes.
- #play ⇒ Object
- #quit ⇒ Object
- #skip ⇒ Object
- #start ⇒ Object
- #stop ⇒ Object
- #volume ⇒ Object
- #volume=(value) ⇒ Object
Constructor Details
#initialize(stream_url) ⇒ ITunes
Returns a new instance of ITunes.
358 359 360 361 |
# File 'lib/lastfm.rb', line 358 def initialize(stream_url) @itunes = OSX::SBApplication.applicationWithBundleIdentifier("com.apple.iTunes") @stream_url = stream_url end |
Instance Method Details
#play ⇒ Object
367 368 369 |
# File 'lib/lastfm.rb', line 367 def play skip end |
#quit ⇒ Object
363 364 365 |
# File 'lib/lastfm.rb', line 363 def quit @itunes.stop end |
#skip ⇒ Object
373 374 375 376 377 378 |
# File 'lib/lastfm.rb', line 373 def skip # simply restart the stream fork do %x{open -g -a iTunes.app #{@stream_url} &} end end |
#start ⇒ Object
379 380 381 382 383 |
# File 'lib/lastfm.rb', line 379 def start fork do %x{open -g -a iTunes.app #{@stream_url} &} end end |
#stop ⇒ Object
370 371 372 |
# File 'lib/lastfm.rb', line 370 def stop @itunes.stop end |
#volume ⇒ Object
384 385 386 |
# File 'lib/lastfm.rb', line 384 def volume @itunes.soundVolume end |
#volume=(value) ⇒ Object
387 388 389 |
# File 'lib/lastfm.rb', line 387 def volume=(value) @itunes.soundVolume = value end |