mirror of
https://github.com/ZetaKebab/MpcNET.git
synced 2025-01-14 22:18:43 +00:00
Merge branch 'master' of https://github.com/glucaci/MpcNET
This commit is contained in:
commit
6cfbb61ca4
@ -9,6 +9,6 @@ before_install:
|
||||
script:
|
||||
- dotnet restore src
|
||||
- dotnet build src
|
||||
- dotnet test src/LibMpcTest/LibMpcTest.csproj
|
||||
- dotnet test src/MpcNET.Test/MpcNET.Test.csproj
|
||||
notifications:
|
||||
email:false
|
||||
|
21
README.md
21
README.md
@ -8,6 +8,27 @@ MpcNET
|
||||
|
||||
## Usage
|
||||
### Connection
|
||||
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();
|
||||
````
|
||||
### Send Command
|
||||
|
||||
## API Content
|
||||
|
Loading…
Reference in New Issue
Block a user