------------------------------------------------------------------------
A poll associated with this post was created, to vote and see the
results, please visit http://forums.slimdevices.com/showthread.php?t=101145
------------------------------------------------------------------------
Question: What platform do you want to use LMS Remote on?
- Mac OS X
- Windows
- Linux
------------------------------------------------------------------------
Some bugs in the latest version:
- If I enter the IP address of my server and don't select player
immediately, the display just shows "Uncaugut node.js Error, TypeError:
Cannot call method "jsonRequest" of undefined at eval
(file:///Users/erland/Downloads/LMS%20Remove.app/Contents/Resources/app.nw/js/script.js:256:39).
It works if I'm fast enough to select player. It might be a good idea to
let it automatically select one of the player after connecting to a new
server.
- The <-> button seems to close the app if I click it when the app is
maximized, I assume this shouldn't happen ?
- The x button just turns the whole screen gray when clicked when the
app is in maximized mode
And some more improvement suggestions/ideas:
- Not sure if it's possible, but if it's possible to show the album
cover in the growl notification instead of the "note" icon, that would
be really great.
- I wonder if it would be preferred to show the artist name and maybe
also the album name below the track title in the artwork window,
currently if the track has a long title it's barely possible to see the
artist.
- It could be a good idea to provide a settings options from the tray
menu so one doesn't have to open the artwork window to reach the
settings dialog
- I wonder if it would make sense to offer it as a dashboard widget in
OSX. Not sure how people use the OSX dashbaord but this feels like
something that could fit there. Note, I'm not requesting this
functionality myself because I've not yet realized how/when/how I should
take advantage of the OSX dashboard.
- To make configuration easier, it should auto discover the LMS server,
this will make it do the right thing for 95% of all users and will avoid
the initial configuration completely. The Java code related to this from
my Squeeze Display Android app follows below in case it helps you how to
do it. Basically you need to do a UDP broadcast on port 3483 and then
the LMS server will respond with IP-address, port, name and version and
this should be enough information to configure it in LMS Remote app. You
still need the manual configuration for people using LMS Remote from a
remote location, but for most people using LMS Remote on the local
network automatic discovery should work.
- Maybe you could make it possible to launch LMS from LMS Remote app ?
This way I can use LMS Remote as my main controller and just launch LMS
from it to browse/search for new music to play.
- It's a bit confusing then the LMS Remote app launch in "Always on top"
the first time and the first thing it does is to ask you for
configuration of the server and it opens the server configuration behind
the LMS Remote app window. This isn't a big issue, especially if you
implement auto discovery, but I thought I'd mention it as it would
probably be preferred to launch it initially with "Always on top"
disabled and let the user choose if he/she wants to use it in Always on
top mode.
Code:
--------------------
package info.isaksson.squeezedisplay;
import android.util.Log;
import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.SocketTimeoutException;
public class ServerDiscoverer {
public static interface ServerManager {
void registerServer(Server server);
void discoveryFinished();
}
public static class Server {
private String ipAddress;
private int port;
private String name;
private String version;
public Server(String ipAddress, int port, String name, String version) {
this.ipAddress = ipAddress;
this.port = port;
this.name = name;
this.version = version;
}
public String getIpAddress() {
return ipAddress;
}
public int getPort() {
return port;
}
}
private static final int DISCOVERY_PORT = 3483;
private static final int TIMEOUT_MS = 5000;
private static final String DISCOVERY_PACKET = "eIPAD\0NAME\0JSON\0VERS\0";
private static Thread discoveryThread;
public static void start(final InetAddress broadcastAddress, final
ServerManager serverManager) throws IOException {
if (discoveryThread != null) {
try {
discoveryThread.join();
} catch (InterruptedException e) {
// If it's interrupted we handle it the same way as if it's finished
Log.d(ServerDiscoverer.class.getName(), "Interrupted discovery");
}
discoveryThread = null;
}
discoveryThread = new Thread(new Runnable() {
@Override
public void run() {
DatagramSocket socket = null;
try {
socket = sendDiscoveryRequest(broadcastAddress);
listenForResponses(socket, serverManager);
} catch (IOException e) {
Log.e(ServerDiscoverer.class.getName(), "Failure when discover servers", e);
} finally {
if (socket != null) {
socket.close();
}
discoveryThread = null;
}
}
});
discoveryThread.start();
}
private static DatagramSocket sendDiscoveryRequest(InetAddress
broadcastAddress) throws IOException {
DatagramSocket socket = new DatagramSocket(DISCOVERY_PORT);
socket.setBroadcast(true);
socket.setSoTimeout(TIMEOUT_MS);
DatagramPacket packet = new DatagramPacket(DISCOVERY_PACKET.getBytes(),
DISCOVERY_PACKET.length(), broadcastAddress, DISCOVERY_PORT);
socket.send(packet);
return socket;
}
private static void listenForResponses(DatagramSocket socket, ServerManager
serverManager) throws IOException {
byte[] buf = new byte[256];
try {
while (true) {
DatagramPacket packet = new DatagramPacket(buf, buf.length);
socket.receive(packet);
buf = packet.getData();
int i = 1;
int l;
String t;
String v;
if ((char) buf[0] == 'E') {
String ipAddress = packet.getAddress().getHostAddress();
String version = null;
String name = null;
int port = -1;
while (i < packet.getLength()) {
t = new String(buf, i, 4);
l = (int) buf[i + 4];
v = new String(buf, i + 5, l);
i = i + 5 + l;
if (t.equals("JSON")) {
try {
port = Integer.parseInt(v);
} catch (NumberFormatException e) {
e.printStackTrace();
}
} else if (t.equals("NAME")) {
name = v;
} else if (t.equals("VERS")) {
version = v;
}
}
if (port > 0) {
serverManager.registerServer(new Server(ipAddress, port, name, version));
}
}
}
} catch (SocketTimeoutException e) {
// No more servers, let's return to caller
serverManager.discoveryFinished();
}
}
}
--------------------
Erland Isaksson ('My homepage' (http://erland.isaksson.info))
(Developer of 'many plugins/applets (both free and commercial)'
(http://wiki.slimdevices.com/index.php/User:Erland).
If you like to encourage future presence on this forum and/or third
party plugin/applet development, 'consider purchasing some plugins'
(http://license.isaksson.info))
You may also want to try my Android apps 'Squeeze Display'
(https://play.google.com/store/apps/details?id=info.isaksson.squeezedisplay)
and 'RSS Photo Show'
(https://play.google.com/store/apps/details?id=info.isaksson.rssphotoshow)
*Interested in the future of music streaming ? 'ickStream - A world of
music at your fingertips'
(http://forums.slimdevices.com/showthread.php?98467-Pre-Announcement-ickStream&p=743516)*.
------------------------------------------------------------------------
erland's Profile: http://forums.slimdevices.com/member.php?userid=3124
View this thread: http://forums.slimdevices.com/showthread.php?t=101145
_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins