1
0
mirror of https://github.com/ZetaKebab/MpcNET.git synced 2024-09-16 05:30:09 +00:00
MpcNET/README.md

32 lines
926 B
Markdown
Raw Normal View History

2021-10-03 15:53:58 +00:00
<img src="Sources/MpcNET/icon.png" width="128">
2017-04-12 09:29:41 +00:00
MpcNET
2016-11-30 13:53:37 +00:00
===========
2021-10-03 15:53:58 +00:00
Pure .NET Client Library for [**Music Player Daemon**](https://www.musicpd.org/) Servers.
2017-04-11 14:59:19 +00:00
## Usage
### Connection
2017-04-12 10:41:58 +00:00
To create a client for MPD, you must first create a `IPEndPoint` for the Server with the right IP and Port.
````C#
var mpdEndpoint = new IPEndPoint(IPAddress.Loopback, 6600);
````
Then create a Client and Connect to MPD.
````C#
var client = new Mpc(mpdEndpoint);
var connected = await client.ConnectAsync();
````
The `ConnectAsync()` method is returning a bool to indicate if the connection was successfully. However, this can be queried directly on the Client also:
````C#
var isConnected = client.IsConnected;
````
and for MPD version, additional property is available:
````C#
var mpdVersion = client.Version
````
To disconnect the Client use the follow method:
````C#
await client.DisconnectAsync();
````
2017-04-11 14:59:19 +00:00
### Send Command
2021-10-03 15:53:58 +00:00
## API Content