andrewrk / mpd.js

Connect to a music player daemon server, send commands, emit events.
MIT License
89 stars 18 forks source link

added msg2json utility function #11

Closed sweetpi closed 10 years ago

andrewrk commented 10 years ago

2 things:

  1. How about this name instead? parseKeyValueMessage
  2. It should be a static method because it does not depend on the state of the MpdClient instance. e.g. at the top of the file MpdClient.parseKeyValueMessage = parseKeyValueMessage; and then define parseKeyValueMessage below.
sweetpi commented 10 years ago
  1. How about this name instead? parseKeyValueMessage

Sound good.

  1. It should not be a static method because it does not depend on the state of the MpdClient instance. e.g. at the top of the file MpdClient.parseKeyValueMessage = parseKeyValueMessage; and then define parseKeyValueMessage below.

Because it does not depend on the state of MpdClient it should be static, or am I wrong? It is static at the moment (not added to the prototype, but to the constructor function instead). But sure I can move it to the top like the cmd function.

andrewrk commented 10 years ago

Oops, my mistake. You did it static already. For some reason I thought it was using prototype. And then I accidentally typed "should not be static" instead of "should be static".

sweetpi commented 10 years ago

Like the new name and thanks for the cool module. Did the changes.

andrewrk commented 10 years ago

I published version 1.1.0 so you can use it.

P.S. check out Groove Basin, it supports the MPD protocol and does some things that MPD cannot do.

sweetpi commented 10 years ago

Thanks!

Really cool project. Definitively giving Groove Basin a try. I'm working on a pimatic plugin for controlling mpd, but maybe it will become a controller for Groove Basin in my setup :).

Btw: On what kind of server is the live demo running? Looking for a cheap node.js hosting solution for a pimatic demo.

andrewrk commented 10 years ago

Really cool project. Definitively giving Groove Basin a try. I'm working on a pimatic plugin for controlling mpd, but maybe it will become a controller for Groove Basin in my setup :).

Cool! Feel free to file any issues that come your way and I'll try to fix them.

Btw: On what kind of server is the live demo running? Looking for a cheap node.js hosting solution for a pimatic demo.

An EC2 micro instance, which costs 114 USD per year. (They charge per hour, but it's easier to understand a yearly cost in my opinion.)