using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using skyscraper5.Mpeg2;
using skyscraper5.Mpeg2.Psi;
using skyscraper5.Skyscraper.IO;
using skyscraper5.Skyscraper.Plugins;

namespace skyscraper5.Skyscraper.Scraper.StreamAutodetection.Contestants
{
	[SkyscraperPlugin]
	class TsdtContestant : Contestant, ITsdtEventHandler, IDisposable
    {
        public TsdtContestant(int pid) : base("TSDT", pid)
        {
            PacketProcessor = new PsiDecoder(pid, new TsdtParser(this));
        }

        public void NotifyOfCompliance(string compliance)
        {
            Score++;
        }

        public void NotifiyStationIdentification(string stationIdentification)
        {
            Score++;
        }

        public override void Dispose()
        {
            
        }

        public override void DeclareWinner(SkyscraperContext skyscraperContext, int pid, ProgramContext programContext)
        {
            skyscraperContext.DvbContext.RegisterPacketProcessor(pid, new PsiDecoder(pid, new TsdtParser(skyscraperContext)));
        }

        public override void Introduce(ProgramContext programContext)
        {
	        
        }
    }
}
