コード例 #1
0
        public static IFrameStream OpenFile(string fileName, out AdvFileMetadataInfo fileMetadataInfo, out GeoLocationInfo geoLocation)
        {
            fileMetadataInfo = new AdvFileMetadataInfo();
            geoLocation      = new GeoLocationInfo();
            try
            {
                IFrameStream rv = new AstroDigitalVideoStreamV2(fileName, ref fileMetadataInfo, ref geoLocation);

                TangraContext.Current.RenderingEngine = fileMetadataInfo.Engine == "AAV" ? "AstroAnalogueVideo" : "AstroDigitalVideo";

                if (fileMetadataInfo.Engine == "AAV")
                {
                    UsageStats.Instance.ProcessedAavFiles++;
                }
                else
                {
                    UsageStats.Instance.ProcessedAdvFiles++;
                }
                UsageStats.Instance.Save();

                return(rv);
            }
            catch (ADVFormatException ex)
            {
                MessageBox.Show(ex.Message, "Error opening ADV/AAV file", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            return(null);
        }
コード例 #2
0
        public static IFrameStream OpenFile(string fileName, out AdvFileMetadataInfo fileMetadataInfo, out GeoLocationInfo geoLocation)
        {
            fileMetadataInfo = new AdvFileMetadataInfo();
            geoLocation      = new GeoLocationInfo();
            try
            {
                int version = TangraCore.ADV2GetFormatVersion(fileName);

                IFrameStream rv;
                if (version == 1)
                {
                    var adv1 = new AstroDigitalVideoStream(fileName, ref fileMetadataInfo, ref geoLocation);
                    if (adv1.IsStatusChannelOnly)
                    {
                        TangraContext.Current.CustomRenderer = new AavStatusChannelOnlyRenderer(adv1);
                        return(null);
                    }
                    rv = adv1;
                }
                else
                {
                    rv = AstroDigitalVideoStreamV2.OpenFile(fileName, out fileMetadataInfo, out geoLocation);
                }

                TangraContext.Current.RenderingEngine = fileMetadataInfo.Engine == "AAV" ? "AstroAnalogueVideo" : "AstroDigitalVideo";

                if (fileMetadataInfo.Engine == "AAV")
                {
                    UsageStats.Instance.ProcessedAavFiles++;
                }
                else
                {
                    UsageStats.Instance.ProcessedAdvFiles++;
                }
                UsageStats.Instance.Save();

                return(rv);
            }
            catch (ADVFormatException ex)
            {
                MessageBox.Show(ex.Message, "Error opening ADV/AAV file", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            return(null);
        }
コード例 #3
0
        public static IFrameStream OpenFile(string fileName, out AdvFileMetadataInfo fileMetadataInfo, out GeoLocationInfo geoLocation)
        {
            fileMetadataInfo = new AdvFileMetadataInfo();
            geoLocation = new GeoLocationInfo();
            try
            {
                IFrameStream rv = new AstroDigitalVideoStreamV2(fileName, ref fileMetadataInfo, ref geoLocation);

                TangraContext.Current.RenderingEngine = fileMetadataInfo.Engine == "AAV" ? "AstroAnalogueVideo" : "AstroDigitalVideo";

                if (fileMetadataInfo.Engine == "AAV")
                    UsageStats.Instance.ProcessedAavFiles++;
                else
                    UsageStats.Instance.ProcessedAdvFiles++;
                UsageStats.Instance.Save();

                return rv;
            }
            catch (ADVFormatException ex)
            {
                MessageBox.Show(ex.Message, "Error opening ADV/AAV file", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            return null;
        }