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