Beispiel #1
0
 void updatePrograms(ChannelData channel)
 {
     if (activeChannel != channel)
     {
         return;
     }
     string programString = "";
     foreach (ProgramData programData in channel.programs)
     {
         programString += programData.startTime.ToString("H:mm") +
             "-" + programData.endTime.ToString("H:mm") + ": " +
             programData.name + Environment.NewLine;
     }
     programInfo.Text = programString;
 }
Beispiel #2
0
 void fetchPrograms(string programData, ChannelData channel)
 {
     channel.programs.Clear();
     channel.programs.AddRange(ProgramData.parse(JsonMapper.ToObject(programData)["programs"]));
     updatePrograms(channel);
 }
Beispiel #3
0
 void showPrograms(ChannelData channel)
 {
     activeChannel = channel;
     channelName.Text = channel.name;
     updatePrograms(channel);
     if (channel.programs.Count < 5 && DateTime.Now.Subtract(channel.lastUpdatedPrograms).TotalSeconds > minUpdateDelay)
     {
         channel.lastUpdatedPrograms = DateTime.Now;
         programInfo.Text += "Ladataan ohjelmatietoja...";
         WebFetcher.fetchPage(programInfoUrl + "channel=" + Uri.EscapeUriString(channel.name), delegate(string result)
         {
             fetchPrograms(result, channel);
         });
     }
 }
Beispiel #4
0
 private String constructArguments(ChannelData channel)
 {
     StringBuilder sb = new StringBuilder();
     if (!runningOnLinux)
         sb.Append(vlcArgs + " ");
     if (Properties.Settings.Default.useDeinterlacing)
         sb.Append("--vout-filter=deinterlace --deinterlace-mode=" + Properties.Settings.Default.deinterlacingMode.ToLower() + " ");
     sb.Append(useMulticast ? channel.multicast : channel.unicast);
     return sb.ToString();
 }