mirror of
https://github.com/badaix/snapcast.git
synced 2025-08-06 10:09:33 +02:00
rearranged code
This commit is contained in:
parent
505ead13bd
commit
33c9645eef
3 changed files with 13 additions and 14 deletions
|
@ -119,16 +119,16 @@ public class ClientInfo implements JsonSerialisable {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
public String getVisibleName() {
|
public String getVisibleName() {
|
||||||
if ((name != null) && !name.isEmpty())
|
if ((name != null) && !name.isEmpty())
|
||||||
return name;
|
return name;
|
||||||
return getHost();
|
return getHost();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setName(String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getLatency() {
|
public int getLatency() {
|
||||||
return latency;
|
return latency;
|
||||||
}
|
}
|
||||||
|
|
|
@ -167,6 +167,10 @@ public class Stream implements JsonSerialisable {
|
||||||
return query;
|
return query;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setQuery(HashMap<String, String> query) {
|
||||||
|
this.query = query;
|
||||||
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
if (query.containsKey("name"))
|
if (query.containsKey("name"))
|
||||||
return query.get("name");
|
return query.get("name");
|
||||||
|
@ -174,10 +178,6 @@ public class Stream implements JsonSerialisable {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setQuery(HashMap<String, String> query) {
|
|
||||||
this.query = query;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "Stream{" +
|
return "Stream{" +
|
||||||
|
|
|
@ -13,11 +13,8 @@ import java.net.InetAddress;
|
||||||
|
|
||||||
public class NsdHelper {
|
public class NsdHelper {
|
||||||
|
|
||||||
public interface NsdHelperListener {
|
|
||||||
void onResolved(NsdHelper nsdHelper, NsdServiceInfo serviceInfo);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static final String TAG = "NsdHelper";
|
private static final String TAG = "NsdHelper";
|
||||||
|
private static NsdHelper mInstance;
|
||||||
private String serviceName;
|
private String serviceName;
|
||||||
private String serviceType;
|
private String serviceType;
|
||||||
// private static final String NSD_SERVICE_TYPE = "_http._tcp.";
|
// private static final String NSD_SERVICE_TYPE = "_http._tcp.";
|
||||||
|
@ -28,8 +25,6 @@ public class NsdHelper {
|
||||||
private android.net.nsd.NsdManager.ResolveListener mResolveListener = null;
|
private android.net.nsd.NsdManager.ResolveListener mResolveListener = null;
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
private NsdHelperListener listener = null;
|
private NsdHelperListener listener = null;
|
||||||
private static NsdHelper mInstance;
|
|
||||||
|
|
||||||
private NsdHelper(Context context) {
|
private NsdHelper(Context context) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
}
|
}
|
||||||
|
@ -120,5 +115,9 @@ public class NsdHelper {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public interface NsdHelperListener {
|
||||||
|
void onResolved(NsdHelper nsdHelper, NsdServiceInfo serviceInfo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue