예제 #1
0
        public void CanCreate()
        {
            var channel = new PhysicalChannel(Guid.Empty)
            {
                Name         = "Test",
                SamplingRate = 100,
            };

            Assert.AreEqual("Test", channel.Name);
            Assert.AreEqual(100, channel.SamplingRate);
        }
예제 #2
0
 public void OnCarrierDefinition(AtscTransmissionMedium transmissionMedium, byte index, int carrierFrequency)
 {
     if (transmissionMedium != AtscTransmissionMedium.Cable)
     {
         return;
     }
     if (carrierFrequency > 1750)
     {
         // Convert from centre frequency to the analog video carrier frequency.
         // This is a BDA convention.
         PhysicalChannel channel = new PhysicalChannel();
         channel.Frequency          = carrierFrequency - 1750;
         channel.Channel            = ATSCChannel.GetPhysicalChannelFromFrequency(carrierFrequency);
         _carrierFrequencies[index] = channel;
     }
 }
예제 #3
0
파일: TVChannel.cs 프로젝트: ewin66/media
 /// <summary>
 /// Returns a string representing this channel.
 /// </summary>
 /// <remarks>
 /// If both <see cref="P:MajorChannel"/> and <see cref="P:MinorChannel"/> are defined, it will return a string in the form "X.X".
 /// If only <see cref="P:MajorChannel"/> is defined, the string will simply be "X".
 /// If <see cref="P:MajorChannel"/> and <see cref="P:PhysicalChannel"/> are the same, and <see cref="P:MinorChannel"/> is 0 or -1, ti will return the physical channel in the format "X".
 /// If only the <see cref="P:PhysicalChannel"/> is defined, then that will be shown, in the form "X".
 /// If nothing else, the <see cref="P:PhysicalChannel"/>, <see cref="P:MajorChannel"/>, and <see cref="P:MinorChannel"/> will all be listed, in the format "X X X".
 /// </remarks>
 public override string ToString()
 {
     if ((MajorChannel > -1) && (MinorChannel > -1))
     {
         return(MajorChannel.ToString() + "." + MinorChannel.ToString());
     }
     else if ((PhysicalChannel < 0) && (MajorChannel > -1))
     {
         return(MajorChannel.ToString());
     }
     else if ((PhysicalChannel == MajorChannel) && (MinorChannel <= 0))
     {
         return(PhysicalChannel.ToString());
     }
     else if ((MajorChannel < 0) && (PhysicalChannel > -1))
     {
         return(PhysicalChannel.ToString());
     }
     else
     {
         return(PhysicalChannel.ToString() + " " + MajorChannel.ToString() + "." + MinorChannel.ToString());
     }
 }
예제 #4
0
파일: TVChannel.cs 프로젝트: ewin66/media
 /// <summary>
 /// Returns a string with all of the parameters shown
 /// </summary>
 /// <remarks>Shown in the format "<see cref="P:PhysicalChannel"/> <see cref="P:MajorChannel"/> <see cref="P:MinorChannel"/> <see cref="P:CarrierFrequency"/> <see cref="P:Callsign"/>"</remarks>
 public string ToDebugString()
 {
     return(PhysicalChannel.ToString() + " " + MajorChannel.ToString() + "." + MinorChannel.ToString() + " " + CarrierFrequency.ToString() + " " + Callsign);
 }
예제 #5
0
 public void OnCarrierDefinition(AtscTransmissionMedium transmissionMedium, byte index, int carrierFrequency)
 {
   if (transmissionMedium != AtscTransmissionMedium.Cable)
   {
     return;
   }
   if (carrierFrequency > 1750)
   {
     // Convert from centre frequency to the analog video carrier frequency.
     // This is a BDA convention.
     PhysicalChannel channel = new PhysicalChannel();
     channel.Frequency = carrierFrequency - 1750;
     channel.Channel = ATSCChannel.GetPhysicalChannelFromFrequency(carrierFrequency);
     _carrierFrequencies[index] = channel;
   }
 }
예제 #6
0
 public override int GetHashCode()
 {
     return(PhysicalChannel.GetHashCode());
 }