Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kaworu/lua-mpd
Minimalist MPD client library using luasocket
https://github.com/kaworu/lua-mpd
lua luasocket mpd
Last synced: 4 months ago
JSON representation
Minimalist MPD client library using luasocket
- Host: GitHub
- URL: https://github.com/kaworu/lua-mpd
- Owner: kaworu
- License: mit
- Created: 2013-02-20T14:07:06.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2018-10-12T20:11:47.000Z (over 6 years ago)
- Last Synced: 2024-08-07T18:38:06.624Z (6 months ago)
- Topics: lua, luasocket, mpd
- Language: Lua
- Homepage:
- Size: 24.4 KB
- Stars: 13
- Watchers: 5
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MPD.lua
Minimalist MPD client library for Lua, using luasocket.
### Usage
```lua
mpd = require('mpd')
-- default values shown here:
server_settings = {
hostname = 'localhost',
port = 6600,
desc = 'localhost',
password = nil,
timeout = 1,
retry = 60
}mpc = mpd.new(server_settings)
-- here are all the functions currently avaiable
mpc:next()
mpc:previous()
mpc:stop()
mpc:volume_up(delta)
mpc:volume_down(delta)
mpc:toggle_random()
mpc:toggle_repeat()
mpc:toggle_play()
mpc:seek(delta)
mpc:protocol_version()-- But, you can always send any command mpd may accept with mpc:send().
-- Actually, the above methods are just wrappers for mpc:send(),
-- you can view all the available mpd commands here:
-- https://www.musicpd.org/doc/protocol/
-- For example, try:
mpc:send('outputs')
-- It should return a table with all information MPD
-- gives about it's outputs.
```### Installation
Either put `mpd.lua` in your `package.path` or install it with luarocks:
```sh
luarocks install mpd
```