libmpdclient-crystal
libmpdclient-crystal
C-Bindings for libmpdclient
to be used in Crystal projects
Installation
-
Ensure that you have
libmpdclient
installed on your system -
Add the dependency to your
shard.yml
:
dependencies:
libmpdclient:
github: TravonteD/libmpdclient-crystal
- Run
shards install
Usage
require "libmpdclient"
PORT = 6600 # Default port for mpd servers
TIMEOUT = 1000
connection = LibMpdClient.mpd_connection_new("localhost",
PORT, TIMEOUT)
exit 1 if connection.nil?
if LibMpdClient.mpd_connection_get_error(connection) != LibMpdClient::MpdError::MPD_ERROR_SUCCESS
p "#{LibMpdClient.mpd_connection_get_error_message(connection)}"
LibMpdClient.mpd_connection_free(connection)
exit 1
end
p "no errors"
Contributing
- Fork it (https://github.com/travonted/libmpdclient-crystal/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Contributors
- TravonteD - creator and maintainer
Repository
libmpdclient-crystal
Owner
Statistic
- 0
- 1
- 0
- 1
- 0
- over 2 years ago
- July 26, 2020
License
MIT License
Links
Synced at
Mon, 23 Dec 2024 01:55:30 GMT
Languages