Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upComponent:Ruby bindings
Examples
For an example on how to write a client in ruby you can have a look at the euphoria client. If you're new to ruby then you might want to have a look at Why's Poignant Guide to Ruby or Programming Ruby - The Pragmatic Programmer's Guide before you get your hands dirty.
rdoc
rdoc generated documentation can be found at http://people.xmms2.org/~tilman/ruby-api-docs-0.7/.
Basics
Connecting
require 'xmmsclient'
xmms = nil
begin
xmms = Xmms::Client.new('client_name').connect(ENV['XMMS_PATH'])
rescue Xmms::Client::ClientError
$stderr.puts 'Failed to connect to XMMS2 daemon.'
end
Specifics
- xmms is an object of Xmms::Client class (see Connecting section above).
- res is a return value.
Broadcasts
Broadcast is a message that XMMS2 will send to client when something changed. Playback status, new items in playlists, etc.
Sample usage:
xmms.broadcast_quit.notifier do |res|
# This will not execute immediately.
# Only when you application receive broadcast_quit broadcast.
puts 'Server was shutdown.'
false
end
Keep in mind that you need to return true or false inside a notifier block. true means you want to receive events of this type in the future. While false means you will not receive events of this type anymore. Ruby will use last calculated value as a result if you don't explicitly specify it which may result in weird error messages.
For information about specific broadcasts see Ruby_bindings/Broadcasts.
Signals
TODO: write something
Other queries
Methods in this sections are useful when you want actively query XMMS2 for something (reading song metadata by it's id, etc.).
For information about specific queries see Ruby_bindings/Other queries.
Content is available under GNU Free Documentation License 1.2 unless otherwise noted.
Pages 594
- Home
- About
- About People
- Album Covers
- Automatic Manual Page Generation
- Build system requirements
- ChangeLog Format
- CLI Generated Commands
- Client capabilities and intercommunication
- Client for writing tags to files
- Client Ideas
- Client:Abraca
- Client:AlbumThing
- Client:Azrael
- Client:Azucar
- Client:Bash tab completion for the CLI
- Client:bbkeysxmms2
- Client:bbxmms2menu
- Client:Bemused
- Client:Blastwave
- Client:bluegroove
- Client:bnxc
- Client:Camio
- Client:ccx2
- Client:Chalyx
- Client:Cluck
- Client:Cocopapa
- Client:Crystalxmms
- Client:Dabra
- Client:daixmms2client
- Client:daixmms2skin
- Client:dxmms2
- Client:EkoXMMS2
- Client:Eloquence
- Client:eq
- Client:Esperanza
- Client:Esperanza Git Usage
- Client:Esperanza Roadmap
- Client:Esperanza Windows Build Instructions
- Client:Etude
- Client:Euphoria
- Client:exmms2
- Client:Flexmms2
- Client:FluxboxKeys
- Client:fvwm2xmms
- Client:GIMME
- Client:gkrellxmms2
- Client:GNOME Do
- Client:GnomeDeskBar
- Client:gntxmms2
- Client:gx2ctl
- Client:gx2osd
- Client:gxmms2
- Client:Harald
- Client:Insanity
- Client:Insanity Playlist refactoring
- Client:ixmms2
- Client:j. xmms(2)viewer
- Client:JukX
- Client:juxtapose
- Client:Konfetka
- Client:kuechenstation
- Client:lagn
- Client:Listen
- Client:LWXC
- Client:lxmms2
- Client:LXMusic
- Client:medialib ui
- Client:Muxic
- Client:notify xmms2
- Client:nxmms2
- Client:nyello
- Client:nymp
- Client:Octopus
- Client:Oritide
- Client:perlamp
- Client:Promoe
- Client:radiobar
- Client:Remuco
- Client:RXmms2
- Client:SAXm2s
- Client:SeaSerpent
- Client:SeMMiX
- Client:shelfelf
- Client:Shellac
- Client:Shhh
- Client:sisy
- Client:snett
- Client:Sonus
- Client:Sopran
- Client:Spring
- Client:TurboX2
- Client:vimmp
- Client:vimxmms2
- Client:Wiixm
- Client:Wmxmms2
- Client:x2c
- Client:x2cp
- Client:X4X
- Client:XMMbaSh2
- Client:Xmms Weighted Shuffle
- Client:XMMS2 AMP
- Client:xmms2 blue
- Client:xmms2 cdinfo
- Client:XMMS2 CLI client
- Client:xmms2 jump
- Client:xmms2 mpris bridge
- Client:xmms2 notify
- Client:xmms2 OpenboxMenu
- Client:xmms2 OpenboxMenu(python3)
- Client:xmms2 osd
- Client:xmms2 pidgin
- Client:XMMS2 Scrobbler
- Client:xmms2 shell
- Client:xmms2 web
- Client:XMMS2 Webterface
- Client:xmms2 xaw
- Client:xmms2 xchat
- Client:XMMS2 xml rpc
- Client:XMMS2Curse
- Client:xmms2curses
- Client:xmms2hotkey
- Client:xmms2joystick
- Client:XMMS2Musica
- Client:xmms2play
- Client:xmms2Plugin
- Client:xmms2swi
- Client:XMMS2tray
- Client:XMMS2www
- Client:XmmsDeskbar
- Client:xmmsfs
- Clientlist
- Clients
- Collaborative Playlist Management
- Collections
- Collections 2.0
- Collections 2.0 TODO
- Collections Concept
- Collections Design
- Collections Python
- Collections usage with cli
- Component:ALSA
- Component:cdda
- Component:coreaudio
- Component:Cpp bindings
- Component:cue
- Component:curl
- Component:daap
- Component:Diskwriter
- Component:Distributed Objects
- Component:equalizer
- Component:ESD
- Component:faad
- Component:file
- Component:FLAC
- Component:fluidsynth
- Component:FTP
- Component:gme
- Component:GnomeVFS
- Component:html
- Component:HTTP
- Component:ices
- Component:Jack
- Component:Java bindings
- Component:Libao
- Component:m3u
- Component:mac
- Component:mad
- Component:Medialib
- Component:mid1
- Component:MMS
- Component:modplug
- Component:Mono bindings
- Component:mpg123
- Component:musepack
- Component:normalize
- Component:OSS
- Component:Output
- Component:Playlist
- Component:pls
- Component:Ruby bindings
- Component:Ruby bindings Broadcasts
- Component:Ruby bindings Other queries
- Component:samba
- Component:sid
- Component:speex
- Component:Sun
- Component:TCP Socket
- Component:Twisted bindings
- Component:UNIX Socket
- Component:Visualization
- Component:vorbis
- Component:wave
- Component:WaveOut
- Component:wma
- Concerns after Log table removal
- Configuration file
- Contact Us
- Container format support
- Contribs
- Daniel's proposal
- Design of XMMS2
- Design of XMMS2 pre DrEvil
- Developer Corner
- Developer Ideas
- Distributed Art
- Distributed Build Testing
- Dj DiezelSun project
- Download XMMS2
- Emacs C style
- Emacs Client
- ET
- External Projects Qt on N800
- FAQ
- Features
- Features from other Players
- Files
- Finances
- FreeBSD
- Gapless Playback
- Gapless Support
- General information
- General Notify support
- Generated IPC
- Generated IPC Format
- Generic properties policy
- Genipc
- Getting Started
- GSoC:2006
- GSoC:2006 Proposed projects
- GSoC:2006 Student requirements
- GSoC:2007
- GSoC:2007 Generated IPC
- GSoC:2007 Generated IPC Autogen
- GSoC:2007 Generated IPC Milestones
- GSoC:2007 Generated IPC Notes
- GSoC:2007 Generated IPC Server
- GSoC:2007 Mentor Application
- GSoC:2007 Mentors
- GSoC:2007 Proposed projects
- GSoC:2007 Service Clients
- GSoC:2007 Service Clients Design
- GSoC:2007 Service Clients Details
- GSoC:2007 Service Clients Ideas
- GSoC:2007 Service Clients Progress
- GSoC:2007 Service Clients Schedule
- GSoC:2007 Service Clients scm
- GSoC:2007 Service Clients Tutorial
- GSoC:2007 Student Application
- GSoC:2007 Testing Framework
- GSoC:2007 Visualization
- GSoC:2007 Visualization Details
- GSoC:2007 Visualization Progress
- GSoC:2007 Visualization Schedule
- GSoC:2008
- GSoC:2008 Cloud Stream
- GSoC:2008 Collections 2.0
- GSoC:2008 Collections 2.0 Operator list
- GSoC:2008 Collections 2.0 Query API proposal
- GSoC:2008 Collections 2.0 Querying concept
- GSoC:2008 Collections 2.0 Source preference
- GSoC:2008 Collections 2.0 Todo list
- GSoC:2008 GenIPC
- GSoC:2008 GenIPC Milestones
- GSoC:2008 Mentor Application
- GSoC:2008 New medialib backend
- GSoC:2008 nycli
- GSoC:2008 nycli Roadmap
- GSoC:2008 Proposed projects
- GSoC:2008 Service Clients and Language Bindings
- GSoC:2008 Service Clients and Language Bindings Details
- GSoC:2008 Service Clients and Language Bindings Milestones
- GSoC:2008 Student Application
- GSoC:2009
- GSoC:2009 Mentor Application
- GSoC:2009 Proposed projects
- GSoC:2009 Student Application
- GSoC:2010
- GSoC:2010 Mentor Application
- GSoC:2010 Proposed projects
- GSoC:2010 Student Application
- GSoC:2011
- GSoC:2011 Mentor Application
- GSoC:2011 Proposed projects
- GSoC:2011 Proposed projects Smarter Playlists
- GSoC:2011 Student Application
- Help Wanted
- Help:Contents
- Help:Editing
- Henrik's proposal
- Hierarchical playlists
- History
- History Ancient
- History Prehistory
- Hotkeys Example
- Hotspot based metadata
- Install instructions
- Intro Clips
- IRC Meeting
- IRC Meeting 2006 11 20 Agenda
- IRC Meeting 2006 11 20 Minutes
- IRC Meeting 2006 11 27 Agenda
- IRC Meeting 2006 11 27 Minutes
- IRC Meeting 2006 12 04 Agenda
- IRC Meeting 2006 12 04 Minutes
- IRC Meeting 2006 12 18 Agenda
- IRC Meeting 2007 01 08 Agenda
- IRC Meeting 2007 01 08 Minutes
- IRC Meeting 2007 01 22 Agenda
- IRC Meeting 2007 01 22 Minutes
- IRC Meeting 2007 01 29 Agenda
- IRC Meeting 2007 01 29 Minutes
- IRC Meeting 2008 03 29 Agenda
- IRC Meeting 2008 03 29 Minutes
- IRC Meeting 2008 04 05 Agenda
- IRC Meeting 2008 04 05 Minutes
- IRC Meeting 2008 04 12 Agenda
- IRC Meeting 2008 04 27 Agenda
- IRC Meeting 2008 05 04 Agenda
- IRC Meeting 2008 05 18 Agenda
- IRC Meeting 2008 12 07 Agenda
- IRC Meeting 2008 12 07 Minutes
- IRC Meeting Archive
- IRC Quotes 2005
- IRC Quotes 2006
- IRC Quotes 2007
- IRC Quotes 2008
- IRC Quotes 2009
- Linux
- List of features required for proper sub tune support
- Logo
- Logo Competition
- Logo old stuff
- Manifesto for a Better Music Player
- MDNS
- Media formats
- Media Player Interfaces
- Media Player Interfaces API Comparison
- Media Player Interfaces Chalyx API Comparison
- Medialib Plugins
- Medialib querier
- Medialib queries
- Mediatags
- Metadata profiles
- MIDI client
- MIDI playback
- MigrateToNyCLI
- Mobile platforms
- MPRIS
- MPRIS Metadata
- Music Sharing
- NetBSD
- NeurosOSD
- New korving CLI
- New medialib backend
- News
- News Archive
- NextGenOutput
- Notes from developing an xform plugin
- Old install instructions
- OpenBSD
- OS X
- Other Projects
- Packager Policy
- Playlist Plugins as Client
- Playlist refactor
- Plugins
- Problems with current IPC
- Project Status
- Proposed Graphic Competition
- Queue Playlist
- Random songs support
- README
- Release Checklist
- Release:DR1
- Release:DR1.1
- Release:DR2
- Release:DR2.1
- Release:DR2.2
- Release:DrAlban
- Release:DrBombay
- Release:DrCox
- Release:DrDolittle
- Release:DrEvil
- Release:DrFeelgood
- Release:DrGonzo
- Release:DrHouse
- Release:DrJekyll
- Release:DrKosmos
- Release:DrLecter
- Release:DrMattDestruction
- Release:DrNo
- Release:DrO o
- Release:DrParnassus
- Reporting bugs
- Request for pull mailbot
- Roadmap
- S4
- S4:Summary
- Samba
- Screenshots
- Sitemap
- Smart playlists
- SoC:AirTunes
- SoC:Collections
- SoC:DAAP
- SoC:TurboX2
- SoC:XMMS2Testing
- Software Mixer
- Solaris
- Submitting code
- Summer of Code 2011 Service Clients
- Support for clients to write to the medialib
- Tags
- Talk:About
- Talk:About XMMS2
- Talk:Album Covers
- Talk:Bash tab completion for the CLI
- Talk:Client:Blastwave
- Talk:Client:Euphoria
- Talk:Client:gxmms2
- Talk:Client:Listen
- Talk:Client:Promoe
- Talk:Client:Shellac
- Talk:Client:xmms2 pidgin
- Talk:Client:XMMS2Musica
- Talk:Collaborative Playlist Management
- Talk:Collections
- Talk:Collections Concept
- Talk:Collections Python
- Talk:Component:Medialib
- Talk:Daniel's proposal
- Talk:Developer Corner
- Talk:Distributed Art
- Talk:Download XMMS2
- Talk:FAQ
- Talk:Generated IPC
- Talk:Generic properties policy
- Talk:GSoC:2006
- Talk:Henrik's proposal
- Talk:Install instructions
- Talk:IRC Meeting
- Talk:Logo old stuff
- Talk:Media Player Interfaces
- Talk:Mediatags
- Talk:Music Sharing
- Talk:New korving CLI
- Talk:New medialib backend
- Talk:Playlist Plugins as Client
- Talk:Playlist refactor
- Talk:Problems with current IPC
- Talk:Project Status
- Talk:Release:DR2
- Talk:Roadmap
- Talk:Summer of Code 2007 Generated IPC
- Talk:Summer of Code 2007 Service Clients Details
- Talk:Summer of Code 2011 Service Clients
- Talk:Support for clients to write to the medialib
- Talk:Transports
- Talk:Using the application
- Talk:Versioning
- Talk:What XMMS2 isn't
- Talk:Wiki Refactoring
- Talk:Windows Mingw
- Talk:XMMS2 as a DJ station
- Talk:XMMS2 Clients
- Talk:XMMS2 vs MPD
- Technical note that describes the Remote Audio Access Protocol (RAOP) used in AirTunes
- Technical note to describe the Remote Audio Access Protocol (RAOP) as used in Apple iTunes to stream music to the Airport Express (ApEx).
- Testing
- The Medialib
- Transform Plugins
- Transforms
- Transports
- Understanding xmms2d output
- User talk:Antonio22
- User talk:Arlo James Barnes
- User talk:Janiak
- User talk:Nwily
- User talk:Puzzles
- User:201.0.68.218
- User:2ck
- User:AJ Ashton (aj.ashton@gmail.com)
- User:Alexander Botero Lowry
- User:Anders Waldenborg
- User:Anders Waldenborg SandBox IRCMeetingStatus
- User:Arachnist
- User:Arlo James Barnes
- User:Arpith
- User:Banlu Kemiyatorn
- User:Ben
- User:Ben:Wishlish
- User:Björn Lindström
- User:Ccr
- User:Chris Morgan
- User:Christopher Rosell
- User:Coledot
- User:Crazy
- User:Daniel Pearson
- User:Daniel Svensson
- User:Dcs3jah
- User:Eleusis Sandbox
- User:Eleusis Sandbox Clientlist
- User:Eleusis Sandbox Graphviz
- User:Eleusis Sandbox Wiki Mindmap
- User:Georg Schild & Franz Endstrasser
- User:Hackmiker
- User:Hashar
- User:Hasseeb
- User:Ion bidon
- User:Jhuss
- User:Johannes Heimansberg
- User:John O'Meara
- User:Juho Vähä Herttua
- User:Kristian Benoit
- User:Lite
- User:Malvineous
- User:Matti Hämäläinen
- User:Michael Lindgren
- User:Nesciens
- User:Nesciens Sandbox Collections Concept
- User:Nesciens Sandbox On playlist updates
- User:Nollidj
- User:Paul Hinds
- User:Pete
- User:Puzzles
- User:Puzzles GSoC 2007
- User:Puzzles Sandbox Download
- User:Puzzles Sandbox Front Page
- User:Ralf Engels
- User:Sham Chukoury
- User:Shlomif
- User:Simoncion
- User:Sivoais
- User:Skim
- User:Sébastien Cevey
- User:Tcoppi
- User:Tenno Seremel
- User:Thomas Nilsson
- User:Tilman Sauerbeck
- User:Tilmus Sauvalds
- User:Tim Sylvester
- User:Tkillian
- User:Tobias Rundström
- User:TobiasRundström Sandbox
- User:Vasco
- User:VxJasonxV
- User:VxJasonxV Sandbox Install instructions
- User:VxJasonxV Sandbox Template:RSS
- User:VxJasonxV Sandbox Template:RSSHeadlines
- User:Xkr47
- User:Ypnos
- User:Ypnos Clients
- User:Zeegeek
- Users
- Using Git
- Using ICES Output
- Using the application
- Versioning
- Visualization
- VMWare virtual appliance
- Waf Cross Compile for Neuros OSD
- Waf Crosscompile
- WAF modifications
- Waf problems
- What XMMS2 isn't
- Why does XMMS2 use so much CPU
- Wiki Refactoring
- Wikitodo
- Windows
- Windows Directory Structure
- Windows Mingw
- Windows Puzzles Merge Notes
- Writing XMMS2 Clients
- Writing XMMS2 Plugins
- XDG coverart sharing
- Xmms1
- XMMS2 as a DJ station
- XMMS2 Coding Style
- XMMS2 Development Process
- XMMS2 in the press
- XMMS2 IPC Protocol
- XMMS2 Mac OS X Notes
- XMMS2 talk:Community Portal
- XMMS2 Vision
- XMMS2 vs GStreamer
- XMMS2 vs MPD
- XMMS2:Copyrights
- XMMS2:General disclaimer
- XMMS2:Privacy policy
- XMMS2:Wikipolicy
- XMMS2Con2010
- XMMS2Forge
- XMMSCU
- Community
- Development