Exemplo n.º 1
0
        private static int CompareStationNames(LineupConfig lineupConfig, string left, string right)
        {
            SDStation leftStation  = lineupConfig.GetStationByID(left);
            SDStation rightStation = lineupConfig.GetStationByID(right);

            return(leftStation.name.CompareTo(rightStation.name));
        }
Exemplo n.º 2
0
        private static int CompareStationCallsigns(LineupConfig lineupConfig, string left, string right)
        {
            SDStation leftStation  = lineupConfig.GetStationByID(left);
            SDStation rightStation = lineupConfig.GetStationByID(right);

            return(leftStation.callsign.CompareTo(rightStation.callsign));
        }
Exemplo n.º 3
0
            internal MXFService(SDStation sdStation)
            {
                string stationId = sdStation.stationID;

                id       = StationCache.instance.GetServiceIdByStationId(stationId);
                uid      = "!Service!GSD" + stationId;
                name     = sdStation.name;
                callSign = sdStation.callsign;
                if (!string.IsNullOrEmpty(sdStation.affiliate))
                {
                    affiliate = StationCache.instance.AddAffiliateAndGetId(sdStation.affiliate);
                }
                else
                {
                    affiliate = StationCache.instance.AddAffiliateAndGetId("Cablecast");
                }
                if (sdStation.logo != null)
                {
                    logoImage = ImageCache.instance.FindOrCreateMXFImageId(sdStation.logo.URL);
                }
            }
Exemplo n.º 4
0
        private void ChannelSettingsDataGridView_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex < 0 || e.RowIndex >= stationIDs_.Count())
            {
                return;
            }
            ChannelSettingsColumn column = GetColumnByIndex(e.ColumnIndex);
            string    stationID          = stationIDs_[e.RowIndex];
            SDStation station            = channelSettingsLineup.GetStationByID(stationID);

            switch (column)
            {
            case ChannelSettingsColumn.Download:
                channelSettingsLineup.SetExcludedFromDownload(stationID, !channelSettingsLineup.ExcludedFromDownload(stationID));
                ChannelSettingsDataGridView.InvalidateRow(e.RowIndex);
                break;

            case ChannelSettingsColumn.IncludeInGuide:
                channelSettingsLineup.SetExcludedFromGuide(stationID, !channelSettingsLineup.ExcludedFromGuide(stationID));
                ChannelSettingsDataGridView.InvalidateRow(e.RowIndex);
                break;
            }
        }
Exemplo n.º 5
0
 internal StationInfo(SDStation station)
 {
     sdStation_ = station;
 }
Exemplo n.º 6
0
 internal MXFService(SDStation sdStation)
 {
     string stationId = sdStation.stationID;
     id = StationCache.instance.GetServiceIdByStationId(stationId);
     uid = "!Service!GSD" + stationId;
     name = sdStation.name;
     callSign = sdStation.callsign;
     if (!string.IsNullOrEmpty(sdStation.affiliate))
     {
         affiliate = StationCache.instance.AddAffiliateAndGetId(sdStation.affiliate);
     }
     else affiliate = StationCache.instance.AddAffiliateAndGetId("Cablecast");
     if (sdStation.logo != null)
     {
         logoImage = ImageCache.instance.FindOrCreateMXFImageId(sdStation.logo.URL);
     }
 }
Exemplo n.º 7
0
 internal MXFChannel(ChannelNumberConfig channelNumberConfig, SDStation station)
 {
     channelNumberConfig_ = channelNumberConfig;
     station_             = station;
 }
Exemplo n.º 8
0
 internal StationInfo(SDStation station)
 {
     sdStation_ = station;
 }
Exemplo n.º 9
0
        private void ChannelSettingsDataGridView_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e)
        {
            if (e.RowIndex >= stationIDs_.Count())
            {
                return;
            }
            ChannelSettingsColumn column = GetColumnByIndex(e.ColumnIndex);
            string    stationID          = stationIDs_[e.RowIndex];
            SDStation station            = channelSettingsLineup.GetStationByID(stationID);

            switch (column)
            {
            case ChannelSettingsColumn.Callsign:
                e.Value = station.callsign;
                break;

            case ChannelSettingsColumn.DefaultGuideChannels:
                var defaultChannelNumbers = channelSettingsLineup.defaultStationChannelNumbers[stationID];
                e.Value = string.Join("\n", defaultChannelNumbers);
                break;

            case ChannelSettingsColumn.DefaultPhysicalChannels:
                var defaultPhysicalChannels = channelSettingsLineup.defaultStationTuningParams[stationID];
                e.Value = string.Join("\n", defaultPhysicalChannels);
                break;

            case ChannelSettingsColumn.Download:
                e.Value = !channelSettingsLineup.ExcludedFromDownload(stationID);
                break;

            case ChannelSettingsColumn.EffectiveGuideChannels:
                var effectiveChannelNumbers = channelSettingsLineup.EffectiveStationChannelNumbers(stationID);
                e.Value = string.Join("\n", effectiveChannelNumbers);
                break;

            case ChannelSettingsColumn.EffectivePhysicalChannels:
                var effectivePhysicalChannels = channelSettingsLineup.EffectivePhysicalChannelNumbers(stationID);
                e.Value = string.Join("\n", effectivePhysicalChannels);
                break;

            case ChannelSettingsColumn.IncludeInGuide:
                e.Value = !channelSettingsLineup.ExcludedFromGuide(stationID);
                break;

            case ChannelSettingsColumn.Logo:
                string url   = station.logo?.URL;
                Image  image = null;
                if (url != null)
                {
                    image = Misc.LoadImageFromURL(url);
                }
                e.Value = (image != null) ? image : new Bitmap(1, 1);
                break;

            case ChannelSettingsColumn.PhysicalChannelOverride:
            case ChannelSettingsColumn.GuideChannelOverride:
                e.Value = "Override";
                break;

            case ChannelSettingsColumn.StationID:
                e.Value = stationID;
                break;

            case ChannelSettingsColumn.StationName:
                e.Value = station.name;
                break;
            }
        }