Giter Site home page Giter Site logo

dart_mpd's Introduction

#dart_mpd

A MPD wrapper for Dart.

What does it do?

dart_mpd is a wrapper for MPD. It just makes it easy for someone to start up mpd and control it. Instead of having to deal with the protocol yourself, you can let dart_mpd handle it.

How to use it

Just import the package, create an MPDController object, and start using it.

import "dart:async";
import "dart:io";
import "package:mpd/mpd.dart";

void main() {
  // Create the object.
  MPDController controller = new MPDController();

  // Start MPD.
  controller.startMPD()
  .then((Process process) {
    // Start asking MPD for things.
    
    // Clear the current playlist.
    controller.clear();
    
    // Add the song with an ID of 0. You can also use `add` to add a file path.
    controller.addID(0);
    
    // Start playing.
    controller.play();

    // Wait so we can listen to the first 10 seconds of the first song.
    new Timer(new Duration(seconds: 10), () {
      // Add a song with an ID of 1.
      controller.addID(1);
      
      // Play the next song.
      controller.next();      
    });
  });
}

More examples can be found here.

Documentation

Every method has doc comments, but if you want/need more information, go to MPD's documentation page.

Contributing

If you would like to contribute, feel free to fork it and send me a pull request. Everything is pretty well documented.

dart_mpd's People

Contributors

mpeterson2 avatar leadpogrommer avatar

Stargazers

 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.