private string GetChannelPlayList(MediaStream remoteControl, Configuration config, int transcoderId, int channelId)
        {
            StringBuilder builder = new StringBuilder();
            foreach (Channel channel in remoteControl.GetChannels()) {
                // show all channels, except when channelId is given
                if (channelId != 0 && channel.IdChannel != channelId)
                    continue;

                foreach (Transcoder transcoder in remoteControl.GetTranscoders()) {
                    // show all transcoders, except when transcoderId is given
                    if (transcoderId != 0 && transcoder.Id != transcoderId)
                        continue;
                    string name = channel.Name + (transcoderId == 0 ? " (" + transcoder.Name + ")" : "");
                    string streamurl = remoteControl.GetTranscodedTvStreamUrl(channel.IdChannel, config.Username, config.Password, transcoder.Id);
                    WriteEntry(builder, name, streamurl);
                }
            }

            return builder.ToString();
        }
        private void SetupStreamTable(MediaStream remoteControl, Configuration config)
        {
            // header row
            TableHeaderRow hrow = new TableHeaderRow();
            TableHeaderCell cell = new TableHeaderCell();
            cell.Text = "Channel";
            hrow.Cells.Add(cell);
            foreach (Transcoder transcoder in remoteControl.GetTranscoders()) {
                TableHeaderCell tcell = new TableHeaderCell();
                tcell.Text = transcoder.Name.Replace(",", ",<br />");
                hrow.Cells.Add(tcell);
            }
            StreamTable.Rows.Add(hrow);

            // link to the playlist
            TableRow prow = new TableRow();
            prow.Cells.Add(new TableCell());
            foreach (Transcoder transcoder in remoteControl.GetTranscoders()) {
                TableCell pcell = new TableCell();
                HyperLink link = new HyperLink();
                link.NavigateUrl = "Playlist.aspx?transcoder=" + transcoder.Id.ToString();
                link.Text = "Playlist";
                pcell.Controls.Add(link);
                prow.Cells.Add(pcell);
            }
            StreamTable.Rows.Add(prow);

            foreach (Channel channel in remoteControl.GetChannels()) {
                // channel name header cell
                TableRow row = new TableRow();
                TableCell title = new TableCell();
                title.Text = channel.DisplayName;
                row.Cells.Add(title);

                // all transcoders
                foreach (Transcoder transcoder in remoteControl.GetTranscoders()) {
                    TableCell item = new TableCell();
                    item.Text = createCellContents(remoteControl.GetTranscodedTvStreamUrl(channel.IdChannel, config.Username, config.Password, transcoder.Id), "channel", channel.IdChannel.ToString(), transcoder);
                    row.Cells.Add(item);
                }
                StreamTable.Rows.Add(row);
            }
        }