MainForm.cs
author StephaneLenclud
Sat, 16 May 2015 01:31:32 +0200
changeset 5 29ccfbf98e54
parent 4 8372aa8d6292
child 7 bf908f6c7758
permissions -rw-r--r--
Group support and multiple package import.
StephaneLenclud@0
     1
using System;
StephaneLenclud@0
     2
using System.Collections.Generic;
StephaneLenclud@0
     3
using System.ComponentModel;
StephaneLenclud@0
     4
using System.Data;
StephaneLenclud@0
     5
using System.Drawing;
StephaneLenclud@0
     6
using System.Linq;
StephaneLenclud@0
     7
using System.Text;
StephaneLenclud@0
     8
using System.Threading.Tasks;
StephaneLenclud@0
     9
using System.Windows.Forms;
StephaneLenclud@0
    10
using CsQuery;
StephaneLenclud@0
    11
using System.Diagnostics;
StephaneLenclud@0
    12
using System.Net;
StephaneLenclud@0
    13
StephaneLenclud@0
    14
StephaneLenclud@0
    15
StephaneLenclud@0
    16
namespace SatChanGen
StephaneLenclud@0
    17
{
StephaneLenclud@0
    18
    public partial class MainForm : Form
StephaneLenclud@0
    19
    {
StephaneLenclud@0
    20
        public MainForm()
StephaneLenclud@0
    21
        {
StephaneLenclud@0
    22
            InitializeComponent();
StephaneLenclud@0
    23
        }
StephaneLenclud@0
    24
StephaneLenclud@0
    25
        private void buttonGenerate_Click(object sender, EventArgs e)
StephaneLenclud@0
    26
        {
StephaneLenclud@5
    27
            List<Channel> channels = new List<Channel>();
StephaneLenclud@5
    28
            channels.AddRange(KingOfSat.Parse(channels, "http://en.kingofsat.net/pack-skygermany.php", "19.2°E"));
StephaneLenclud@5
    29
            channels.AddRange(KingOfSat.Parse(channels, "http://en.kingofsat.net/pack-hdplus.php", "19.2°E"));
StephaneLenclud@5
    30
            channels.AddRange(KingOfSat.Parse(channels, "http://en.kingofsat.net/pack-arddigital.php", "19.2°E"));
StephaneLenclud@5
    31
            channels.AddRange(KingOfSat.Parse(channels, "http://en.kingofsat.net/pack-zdfvision.php", "19.2°E"));
StephaneLenclud@5
    32
            channels.AddRange(KingOfSat.Parse(channels, "http://en.kingofsat.net/pack-tntsat.php", "19.2°E"));
StephaneLenclud@5
    33
        
StephaneLenclud@5
    34
            //Discard non HD channels we don't need
StephaneLenclud@5
    35
            channels = KingOfSat.CleanChannelList(channels);
StephaneLenclud@4
    36
StephaneLenclud@5
    37
            //Declare tuner cards so that we don't need to create mapping manually after import
StephaneLenclud@5
    38
            List<string> tuners = new List<string>(){"3","4"};
StephaneLenclud@4
    39
StephaneLenclud@5
    40
            //Export to XML for MediaPortal to import
StephaneLenclud@5
    41
            MediaPortal.Export(channels, tuners, "channels.xml", false);
StephaneLenclud@0
    42
        }
StephaneLenclud@0
    43
    }
StephaneLenclud@0
    44
}