Google

"DTD/xhtml1-strict.dtd">
Class Xmms::Remote
In: xmms.c
Methods
Public Class methods
new(int argc, VALUE *argv, VALUE klass)

Create a new Xmms::Remote object.

Examples:

  # standard setup (one running copy of XMMS)
  remote = Xmms::Remote.new

  # bind to the third instance of XMMS (for you nutcases who run
  # multiple instances of XMMS)
  session = 2
  remote = Xmms::Remote.new session
connect(int argc, VALUE *argv, VALUE klass)

Create a new Xmms::Remote object.

Examples:

  # standard setup (one running copy of XMMS)
  remote = Xmms::Remote.new

  # bind to the third instance of XMMS (for you nutcases who run
  # multiple instances of XMMS)
  session = 2
  remote = Xmms::Remote.new session
Public Instance methods
initialize(int argc, VALUE *argv, VALUE self)

Xmms::Remote constructor.

This function is currently just a placeholder.

play(VALUE self)

Play current song.

Example:

  remote.play
pause(VALUE self)

Pause current song.

Example:

  remote.pause
stop(VALUE self)

Stop current song.

Example:

  remote.stop
eject(VALUE self)

XMMS eject button (toggle add file dialog).

Example:

  remote.eject
quit(VALUE self)

Quit XMMS.

Example:

  remote.quit
play_pause(VALUE self)

Toggle Play/Pause status.

Example:

  remote.play_pause
playing?(VALUE self)

Is XMMS playing?

Examples:

  puts 'playing' if remote.is_playing?
  puts 'playing' if remote.playing?
paused?(VALUE self)

Is XMMS paused?

Examples:

  puts 'paused' if remote.is_paused?
  puts 'paused' if remote.paused?
playlist(VALUE self)

Return the current playlist.

Example:

  remote.playlist.each { |i|
    title, file = i
    puts "'#{title}', #{file}"
  }
add(int argc, VALUE *argv, VALUE self)

Add one or more songs to the playlist.

Examples:

  # replace the current playlist with one song
  enqueue = false
  remote.add 'path/to/cool_song.mp3', enqueue

  # add several files to the current playlist
  files = %w{song01.mp3 song02.mp3 song03.mp3 song04.mp3 song05.mp3}
  remote.add *files
add_url(VALUE self, VALUE url)

Add a URL to the current playlist.

Examples:

  remote.add_url 'http://www.hhmecca.net/cool_song.mp3'
ins_url(VALUE self, VALUE url, VALUE pos)

Insert a URL into the current playlist.

Examples:

  # add a url after the 45th element in the playlist
  remote.ins_url 'http://www.hhmecca.net/cool_song.mp3', 45
delete(VALUE self, VALUE pos)

Delete the Nth element of the current playlist.

Examples:

  remote.delete 26  # delete the 26th playlist element
clear(VALUE self)

Clear the current playlist.

Examples:

  remote.clear
playlist_pos(VALUE self)

Get the current playlist position.

Examples:

  song_number = remote.position
  song_number = remote.get_pos
  song_number = remote.pos
set_playlist_pos(VALUE self, VALUE pos)

Set the current playlist position.

Examples:

  remote.pos = 45
  remote.position = 45
  remote.set_pos 45
get_playlist_file(int argc, VALUE *argv, VALUE self)

Get the file path of a song.

Examples:

  # get the path of the current song
  path = remote.file

  # get the path of song 23 in the playlist
  path = remote.file 23
get_playlist_title(int argc, VALUE *argv, VALUE self)

Get the title of a song.

Examples:

  # get the title of the current song
  path = remote.file

  # get the title of song 23 in the playlist
  path = remote.file 23
get_playlist_time(int argc, VALUE *argv, VALUE self)

Get the "playlist" time of a song.

Examples:

  # get the "playlist" time of the current song
  time = remote.playlist_time

  # get the "playlist" time of song 23 in the playlist
  time = remote.playlist_time 23
time(VALUE self)

Get the output time of the current song.

Examples:

  time = remote.time
  time = remote.output_time
jump_to_time(VALUE self, VALUE pos)

Jump to a specific time of the current song.

Examples:

  remote.jump 45   # jump 45 seconds into the current song
  remote.time = 45 # jump 45 seconds into the current song
time=(VALUE self, VALUE pos)

Jump to a specific time of the current song.

Examples:

  remote.jump 45   # jump 45 seconds into the current song
  remote.time = 45 # jump 45 seconds into the current song
playlist_prev(VALUE self)

Go to the previous song.

Example:

  remote.prev
playlist_next(VALUE self)

Go to the next song.

Example:

  remote.next
get_stereo_volume(VALUE self)

Get the stereo volume level.

Example:

  left, right = remote.get_stereo_volume
  left, right = remote.stereo_volume
get_main_volume(VALUE self)

Get the main volume level.

Example:

  vol = remote.volume
  vol = remote.main_volume
  vol = remote.get_main_volume
set_stereo_volume(VALUE self, VALUE l, VALUE r)

Set the stereo volume level.

Examples:

  remote.set_stereo_volume left, right

  stereo_volume = [10, 0]
  remote.set_stereo_volume *stereo_volume
set_main_volume(VALUE self, VALUE vol)

Set the main volume level.

Examples:

  remote.volume = 23
  remote.main_volume = 23
  remote.set_main_volume 23
get_balance(VALUE self)

Get the balance level.

Note: as of XMMS 1.2.6 xmms_remote_get_balance() does not appear to work correctly when XMMS is paused or stopped, so this function doesn't either.

Example:

  vol = remote.balance
set_balance(VALUE self, VALUE bal)

Set the balance level.

Note: as of XMMS 1.2.6 xmms_remote_set_balance() does not appear to work correctly when XMMS is paused or stopped, so this function doesn't either.

Example:

  remote.balance = 23
balance=(VALUE self, VALUE bal)

Set the balance level.

Note: as of XMMS 1.2.6 xmms_remote_set_balance() does not appear to work correctly when XMMS is paused or stopped, so this function doesn't either.

Example:

  remote.balance = 23
get_skin(VALUE self)

Get the current skin file.

Examples:

  skin = remote.get_skin
  skin = remote.skin
set_skin(VALUE self, VALUE skin)

Set the current skin file.

Examples:

  remote.set_skin 'path/to/cool_skin.zip'
  remote.skin = 'path/to/cool_skin.zip'
main_win_toggle(VALUE self, VALUE vis)

Set the visibility of the main window.

Examples:

  remote.set_main_toggle true
  remote.main_visible = true
  remote.main = true
pl_win_toggle(VALUE self, VALUE vis)

Set the visibility of the playlist window.

Examples:

  remote.set_playlist_toggle true
  remote.playlist_visible = true
  remote.pl_visible = true
  remote.pl = true
eq_win_toggle(VALUE self, VALUE vis)

Set the visibility of the equalizer window.

Examples:

  remote.set_equalizer_toggle true
  remote.equalizer_visible = true
  remote.eq_visible = true
  remote.eq = true
is_main_win?(VALUE self)

Get the visibility of the main window.

Examples:

  puts 'main window visible' if remote.main_visible?
  puts 'main window visible' if remote.main?
is_pl_win?(VALUE self)

Get the visibility of the playlist window.

Examples:

  puts 'playlist window visible' if remote.playlist_visible?
  puts 'playlist window visible' if remote.pl_visible?
  puts 'playlist window visible' if remote.playlist?
  puts 'playlist window visible' if remote.pl?
is_eq_win?(VALUE self)

Get the visibility of the equalizer window.

Examples:

  puts 'equalizer window visible' if remote.equalizer_visible?
  puts 'equalizer window visible' if remote.eq_visible?
  puts 'equalizer window visible' if remote.equalizer?
  puts 'equalizer window visible' if remote.eq?
show_prefs(VALUE self)

Show the preferences dialog.

Examples:

  remote.show_prefs
  remote.prefs
toggle_aot(VALUE self, VALUE aot)

Set the "always on top" flag.

Examples:

  remote.set_always_on_top true
  remote.always_on_top = true
  remote.aot = true
toggle_repeat(VALUE self)

Toggle the repeat flag.

Example:

  remote.toggle_repeat
is_repeat?(VALUE self)

Is the repeat flag set?

Examples:

  puts 'repeating' if remote.is_repeating?
  puts 'repeating' if remote.repeating?
  puts 'repeating' if remote.is_repeat?
  puts 'repeating' if remote.repeat?
toggle_shuffle(VALUE self)

Toggle the shuffle flag.

Example:

  remote.toggle_shuffle
is_shuffle?(VALUE self)

Is the shuffle flag set?

Examples:

  puts 'shuffling' if remote.is_shuffling?
  puts 'shuffling' if remote.shuffling?
  puts 'shuffling' if remote.is_shuffle?
  puts 'shuffling' if remote.shuffle?
get_eq(VALUE self)

Get the equalizer settings.

This method returns an array. The first element in the array is the preamp setting, and the second element in the array is an 10 element array of band settings. So the result would look something like this:

  [1.0, [0.0, -0.5, 0.9, 0.0, 0.0, 0.0, 0.2, 0.5, -0.1, 0.0]]

Examples:

  preamp, bands = remote.get_equalizer
  eq = remote.eq
set_eq(int argc, VALUE *argv, VALUE self)

Set the equalizer values.

This method takes either a preamp value and 10 band values, or a preamp value and an array of band values.

Examples:

  bands = [0.0, -0.5, 0.9, 0.0, 0.0, 0.0, 0.2, 0.5, -0.1, 0.0]
  remote.set_equalizer 0.0, bands

  remote.set_eq 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
get_eq_preamp(VALUE self)

Get the equalizer preamp value.

Examples:

  preamp = remote.get_preamp
  preamp = remote.preamp
set_eq_preamp(VALUE self, VALUE preamp)

Set the equalizer preamp value.

Examples:

  remote.set_preamp 0.5
  remote.preamp = 0.5
get_eq_band(VALUE self, VALUE band)

Get an equalizer band value.

Note that legal band indexes range from 0 to 9 instead of 1 to 10.

Examples:

  band = remote.get_band 2
  band = remote.band 8
set_eq_band(VALUE self, VALUE band, VALUE val)

Set an equalizer band value.

Note that legal band indexes range from 0 to 9 instead of 1 to 10.

Example:

  remote.set_band 2, 0.5
get_info(VALUE self)

Get various about the current song.

Returns an array of bitrate, frequency, and numchannels, respectively.

Examples:

  info = remote.info
  rate, freq, nch = remote.info
is_running?(VALUE self)

Is XMMS running?

Examples:

  puts 'xmms is running' if remote.is_running?
  puts 'xmms is running' if remote.running?
get_version(VALUE self)

Get the version of XMMS.

Note that this is separate from Xmms::Remote::VERSION, which is the version of Xmms-Ruby.

Examples:

  version = remote.version
  version = remote.get_version