From 8f82f87eec5703d5c1a0447271f7815952ad8293 Mon Sep 17 00:00:00 2001 From: lado Date: Wed, 26 Oct 2011 14:53:46 +0200 Subject: audio added --- .../src/de/bjusystems/vdrmanager/data/Channel.java | 29 +++++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/data/Channel.java b/vdrmanager/src/de/bjusystems/vdrmanager/data/Channel.java index eeda768..9cc8396 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/data/Channel.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/data/Channel.java @@ -1,23 +1,37 @@ package de.bjusystems.vdrmanager.data; + +import de.bjusystems.vdrmanager.StringUtils; +import de.bjusystems.vdrmanager.app.C; + import android.os.Parcel; import android.os.Parcelable; public class Channel implements Parcelable { - private final int number; - private final String name; - private final String provider; + String id; + private int number; + private String name; + private String provider; + private String rawAudio; + + public String getRawAudio() { + return rawAudio; + } public Channel(final String channelData) { - String[] words = channelData.split(":"); + String[] words = StringUtils.splitPreserveAllTokens(channelData, C.DATA_SEPARATOR); this.number = Integer.valueOf(words[0].substring(1)); if (words.length > 2) { this.name = words[1]; this.provider = words[2]; + this.id = words[3]; + this.rawAudio = words[4]; } else { this.name = words[1]; + this.id = "-1"; this.provider = "Unknown"; + this.rawAudio = ""; } } @@ -25,12 +39,16 @@ public class Channel implements Parcelable { this.number = 0; this.name = "Unknown"; this.provider = "Unknown"; + this.id = "Uknwon"; + this.rawAudio = ""; } public Channel(Parcel in) { this.number = in.readInt(); this.name = in.readString(); this.provider = in.readString(); + this.id = in.readString(); + this.rawAudio = in.readString(); } public boolean isGroupSeparator() { @@ -68,6 +86,9 @@ public class Channel implements Parcelable { dest.writeInt(number); dest.writeString(name); dest.writeString(provider); + dest.writeString(id); + dest.writeString(rawAudio); + } public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { -- cgit v1.2.3