Ejemplo n.º 1
0
        public void ReadXml(XmlReader xmlReader)
        {
            xmlReader.ReadStartElement();

            while (xmlReader.NodeType == XmlNodeType.Element)
            {
                switch (xmlReader.Name)
                {
                case "Enabled":
                    enabled = XmlHelper.ParseBoolean(xmlReader.ReadElementContentAsString());
                    break;

                case "Frames":
                    fadingFrames = xmlReader.ReadElementContentAsInt();
                    break;

                case "UseDefault":
                    useDefault = XmlHelper.ParseBoolean(xmlReader.ReadElementContentAsString());
                    break;

                case "AlwaysVisible":
                    alwaysVisible = XmlHelper.ParseBoolean(xmlReader.ReadElementContentAsString());
                    break;

                default:
                    string unparsed = xmlReader.ReadOuterXml();
                    log.DebugFormat("Unparsed content in KVA XML: {0}", unparsed);
                    break;
                }
            }

            xmlReader.ReadEndElement();

            fadingFrames = Math.Max(fadingFrames, 1);
        }
Ejemplo n.º 2
0
        public void ReadXML(XmlReader reader)
        {
            reader.ReadStartElement();

            while (reader.NodeType == XmlNodeType.Element)
            {
                switch (reader.Name)
                {
                case "Culture":
                    uiCultureName = reader.ReadElementContentAsString();
                    break;

                case "ExplorerVisible":
                    explorerVisible = XmlHelper.ParseBoolean(reader.ReadElementContentAsString());
                    break;

                case "ExplorerSplitterDistance":
                    explorerSplitterDistance = reader.ReadElementContentAsInt();
                    break;

                case "PreferencesPage":
                    preferencePage = reader.ReadElementContentAsInt();
                    break;

                default:
                    reader.ReadOuterXml();
                    break;
                }
            }

            reader.ReadEndElement();
        }
Ejemplo n.º 3
0
        public void Readxml(XmlReader reader)
        {
            reader.ReadStartElement();

            while (reader.NodeType == XmlNodeType.Element)
            {
                switch (reader.Name)
                {
                case "CameraName":
                    CameraName = reader.ReadElementContentAsString();
                    break;

                case "Autostream":
                    Autostream = XmlHelper.ParseBoolean(reader.ReadElementContentAsString());
                    break;

                case "Delay":
                    float delay;
                    bool  read = float.TryParse(reader.ReadElementContentAsString(), NumberStyles.Any, CultureInfo.InvariantCulture, out delay);
                    if (read)
                    {
                        this.Delay = delay;
                    }
                    break;

                default:
                    reader.ReadOuterXml();
                    break;
                }
            }

            reader.ReadEndElement();
        }
Ejemplo n.º 4
0
        public void ReadXML(XmlReader reader)
        {
            reader.ReadStartElement();

            while (reader.NodeType == XmlNodeType.Element)
            {
                switch (reader.Name)
                {
                case "CapturePathConfiguration":
                    capturePathConfiguration.ReadXml(reader);
                    break;

                case "DisplaySynchronizationFramerate":
                    string str = reader.ReadElementContentAsString();
                    displaySynchronizationFramerate = double.Parse(str, CultureInfo.InvariantCulture);
                    break;

                case "CaptureRecordingMode":
                    recordingMode = (CaptureRecordingMode)Enum.Parse(typeof(CaptureRecordingMode), reader.ReadElementContentAsString());
                    break;

                case "SaveUncompressedVideo":
                    saveUncompressedVideo = XmlHelper.ParseBoolean(reader.ReadElementContentAsString());
                    break;

                case "VerboseStats":
                    verboseStats = XmlHelper.ParseBoolean(reader.ReadElementContentAsString());
                    break;

                case "MemoryBuffer":
                    memoryBuffer = reader.ReadElementContentAsInt();
                    break;

                case "Cameras":
                    ParseCameras(reader);
                    break;

                case "DelayCompositeConfiguration":
                    delayCompositeConfiguration.ReadXml(reader);
                    break;

                case "PhotofinishConfiguration":
                    photofinishConfiguration.ReadXml(reader);
                    break;

                default:
                    reader.ReadOuterXml();
                    break;
                }
            }

            reader.ReadEndElement();
        }
Ejemplo n.º 5
0
        public void ReadXML(XmlReader reader)
        {
            reader.ReadStartElement();

            while (reader.NodeType == XmlNodeType.Element)
            {
                switch (reader.Name)
                {
                case "Culture":
                    uiCultureName = reader.ReadElementContentAsString();
                    break;

                case "ExplorerVisible":
                    explorerVisible = XmlHelper.ParseBoolean(reader.ReadElementContentAsString());
                    break;

                case "ExplorerSplitterDistance":
                    explorerSplitterDistance = reader.ReadElementContentAsInt();
                    break;

                case "WindowState":
                    windowState = (FormWindowState)Enum.Parse(typeof(FormWindowState), reader.ReadElementContentAsString());
                    break;

                case "WindowRectangle":
                    windowRectangle = XmlHelper.ParseRectangle(reader.ReadElementContentAsString());
                    break;

                case "Workspace":
                    workspace.ReadXML(reader);
                    break;

                case "AllowMultipleInstances":
                    allowMultipleInstances = XmlHelper.ParseBoolean(reader.ReadElementContentAsString());
                    break;

                case "InstancesOwnPreferences":
                    instancesOwnPreferences = XmlHelper.ParseBoolean(reader.ReadElementContentAsString());
                    break;

                case "PreferencesPage":
                    preferencePage = reader.ReadElementContentAsInt();
                    break;

                default:
                    reader.ReadOuterXml();
                    break;
                }
            }

            reader.ReadEndElement();
        }
        public void ReadXml(XmlReader r)
        {
            r.ReadStartElement();

            while (r.NodeType == XmlNodeType.Element)
            {
                switch (r.Name)
                {
                case "EnableAudioTrigger":
                    EnableAudioTrigger = XmlHelper.ParseBoolean(r.ReadElementContentAsString());
                    break;

                case "AudioInputDevice":
                    AudioInputDevice = r.ReadElementContentAsString();
                    break;

                case "AudioTriggerThreshold":
                    string strAudioTreshold = r.ReadElementContentAsString();
                    AudioTriggerThreshold = float.Parse(strAudioTreshold, CultureInfo.InvariantCulture);
                    break;

                case "AudioQuietPeriod":
                    string strAudioQuietPeriod = r.ReadElementContentAsString();
                    AudioQuietPeriod = float.Parse(strAudioQuietPeriod, CultureInfo.InvariantCulture);
                    break;

                case "RecordingSeconds":
                    string strRecordingSeconds = r.ReadElementContentAsString();
                    RecordingSeconds = float.Parse(strRecordingSeconds, CultureInfo.InvariantCulture);
                    break;

                case "IgnoreOverwriteWarning":
                    IgnoreOverwrite = XmlHelper.ParseBoolean(r.ReadElementContentAsString());
                    break;

                default:
                    string outerXml = r.ReadOuterXml();
                    log.DebugFormat("Unparsed content in XML: {0}", outerXml);
                    break;
                }
            }

            r.ReadEndElement();
        }
Ejemplo n.º 7
0
        public void ReadXML(XmlReader reader)
        {
            reader.ReadStartElement();

            while (reader.NodeType == XmlNodeType.Element)
            {
                switch (reader.Name)
                {
                case "CapturePathConfiguration":
                    capturePathConfiguration.ReadXml(reader);
                    break;

                case "UseCameraSignalSynchronization":
                    useCameraSignalSynchronization = XmlHelper.ParseBoolean(reader.ReadElementContentAsString());
                    break;

                case "DisplaySynchronizationFramerate":
                    string str = reader.ReadElementContentAsString();
                    displaySynchronizationFramerate = double.Parse(str, CultureInfo.InvariantCulture);
                    break;

                case "MemoryBuffer":
                    memoryBuffer = reader.ReadElementContentAsInt();
                    break;

                case "Cameras":
                    ParseCameras(reader);
                    break;

                case "DelayCompositeConfiguration":
                    delayCompositeConfiguration.ReadXml(reader);
                    break;

                default:
                    reader.ReadOuterXml();
                    break;
                }
            }

            reader.ReadEndElement();
        }
Ejemplo n.º 8
0
        public void ReadXml(XmlReader reader)
        {
            reader.ReadStartElement();

            while (reader.NodeType == XmlNodeType.Element)
            {
                switch (reader.Name)
                {
                case "FullPath":
                    FullPath = reader.ReadElementContentAsString();
                    break;

                case "Autoplay":
                    Autoplay = XmlHelper.ParseBoolean(reader.ReadElementContentAsString());
                    break;

                case "SpeedPercentage":
                    float speed;
                    bool  read = float.TryParse(reader.ReadElementContentAsString(), NumberStyles.Any, CultureInfo.InvariantCulture, out speed);
                    if (read)
                    {
                        this.SpeedPercentage = speed;
                    }
                    break;

                case "Stretch":
                    Stretch = XmlHelper.ParseBoolean(reader.ReadElementContentAsString());
                    break;

                case "IsReplayWatcher":
                    IsReplayWatcher = XmlHelper.ParseBoolean(reader.ReadElementContentAsString());
                    break;

                default:
                    reader.ReadOuterXml();
                    break;
                }
            }

            reader.ReadEndElement();
        }
Ejemplo n.º 9
0
        public void ReadXml(XmlReader _xmlReader)
        {
            _xmlReader.ReadStartElement();

            while (_xmlReader.NodeType == XmlNodeType.Element)
            {
                switch (_xmlReader.Name)
                {
                case "Enabled":
                    m_bEnabled = XmlHelper.ParseBoolean(_xmlReader.ReadElementContentAsString());
                    break;

                case "Frames":
                    m_iFadingFrames = _xmlReader.ReadElementContentAsInt();
                    break;

                case "UseDefault":
                    m_bUseDefault = XmlHelper.ParseBoolean(_xmlReader.ReadElementContentAsString());
                    break;

                case "AlwaysVisible":
                    m_bAlwaysVisible = XmlHelper.ParseBoolean(_xmlReader.ReadElementContentAsString());
                    break;

                default:
                    string unparsed = _xmlReader.ReadOuterXml();
                    log.DebugFormat("Unparsed content in KVA XML: {0}", unparsed);
                    break;
                }
            }

            _xmlReader.ReadEndElement();

            // Sanity check.
            if (m_iFadingFrames < 1)
            {
                m_iFadingFrames = 1;
            }
        }
Ejemplo n.º 10
0
        public void ReadXml(XmlReader r)
        {
            r.ReadStartElement();

            while (r.NodeType == XmlNodeType.Element)
            {
                switch (r.Name)
                {
                case "ThresholdHeight":
                    ThresholdHeight = int.Parse(r.ReadElementContentAsString(), CultureInfo.InvariantCulture);
                    break;

                case "ConsolidationHeight":
                    ConsolidationHeight = int.Parse(r.ReadElementContentAsString(), CultureInfo.InvariantCulture);
                    break;

                case "OutputHeight":
                    OutputHeight = int.Parse(r.ReadElementContentAsString(), CultureInfo.InvariantCulture);
                    break;

                case "Waterfall":
                    Waterfall = XmlHelper.ParseBoolean(r.ReadElementContentAsString());
                    break;

                case "WaterfallFlushHeight":
                    WaterfallFlushHeight = int.Parse(r.ReadElementContentAsString(), CultureInfo.InvariantCulture);
                    break;

                default:
                    string outerXml = r.ReadOuterXml();
                    log.DebugFormat("Unparsed content in XML: {0}", outerXml);
                    break;
                }
            }

            r.ReadEndElement();
        }
        public ScreenDescriptionPlayback(XmlReader reader) : this()
        {
            reader.ReadStartElement();

            while (reader.NodeType == XmlNodeType.Element)
            {
                switch (reader.Name)
                {
                case "FullPath":
                    FullPath = reader.ReadElementContentAsString();
                    break;

                case "Autoplay":
                    Autoplay = XmlHelper.ParseBoolean(reader.ReadElementContentAsString());
                    break;

                case "SpeedPercentage":
                    SpeedPercentage = reader.ReadElementContentAsDouble();
                    break;

                case "Stretch":
                    Stretch = XmlHelper.ParseBoolean(reader.ReadElementContentAsString());
                    break;

                case "IsReplayWatcher":
                    IsReplayWatcher = XmlHelper.ParseBoolean(reader.ReadElementContentAsString());
                    break;

                default:
                    reader.ReadOuterXml();
                    break;
                }
            }

            reader.ReadEndElement();
        }
Ejemplo n.º 12
0
        public void ReadXML(XmlReader reader)
        {
            reader.ReadStartElement();

            while (reader.NodeType == XmlNodeType.Element)
            {
                switch (reader.Name)
                {
                case "TimecodeFormat":
                    timecodeFormat = (TimecodeFormat)Enum.Parse(typeof(TimecodeFormat), reader.ReadElementContentAsString());
                    break;

                case "SpeedUnit":
                    speedUnit = (SpeedUnit)Enum.Parse(typeof(SpeedUnit), reader.ReadElementContentAsString());
                    break;

                case "AccelerationUnit":
                    accelerationUnit = (AccelerationUnit)Enum.Parse(typeof(AccelerationUnit), reader.ReadElementContentAsString());
                    break;

                case "AngleUnit":
                    angleUnit = (AngleUnit)Enum.Parse(typeof(AngleUnit), reader.ReadElementContentAsString());
                    break;

                case "AngularVelocityUnit":
                    angularVelocityUnit = (AngularVelocityUnit)Enum.Parse(typeof(AngularVelocityUnit), reader.ReadElementContentAsString());
                    break;

                case "AngularAccelerationUnit":
                    angularAccelerationUnit = (AngularAccelerationUnit)Enum.Parse(typeof(AngularAccelerationUnit), reader.ReadElementContentAsString());
                    break;

                case "CustomLengthUnit":
                    customLengthUnit = reader.ReadElementContentAsString();
                    break;

                case "CustomLengthAbbreviation":
                    customLengthAbbreviation = reader.ReadElementContentAsString();
                    break;

                case "AspectRatio":
                    aspectRatio = (ImageAspectRatio)Enum.Parse(typeof(ImageAspectRatio), reader.ReadElementContentAsString());
                    break;

                case "DeinterlaceByDefault":
                    deinterlaceByDefault = XmlHelper.ParseBoolean(reader.ReadElementContentAsString());
                    break;

                case "InteractiveFrameTracker":
                    interactiveFrameTracker = XmlHelper.ParseBoolean(reader.ReadElementContentAsString());
                    break;

                case "WorkingZoneSeconds":
                    workingZoneSeconds = reader.ReadElementContentAsInt();
                    break;

                case "WorkingZoneMemory":
                    workingZoneMemory = reader.ReadElementContentAsInt();
                    break;

                case "SyncLockSpeed":
                    syncLockSpeed = XmlHelper.ParseBoolean(reader.ReadElementContentAsString());
                    break;

                case "ImageFormat":
                    imageFormat = (KinoveaImageFormat)Enum.Parse(typeof(KinoveaImageFormat), reader.ReadElementContentAsString());
                    break;

                case "VideoFormat":
                    videoFormat = (KinoveaVideoFormat)Enum.Parse(typeof(KinoveaVideoFormat), reader.ReadElementContentAsString());
                    break;

                case "InfoFading":
                    defaultFading.ReadXml(reader);
                    break;

                case "MaxFading":
                    maxFading = reader.ReadElementContentAsInt();
                    break;

                case "DrawOnPlay":
                    drawOnPlay = XmlHelper.ParseBoolean(reader.ReadElementContentAsString());
                    break;

                case "RecentColors":
                    ParseRecentColors(reader);
                    break;

                case "MaxRecentColors":
                    maxRecentColors = reader.ReadElementContentAsInt();
                    break;

                case "TrackingProfile":
                    trackingProfile.ReadXml(reader);
                    break;

                case "EnableFiltering":
                    enableFiltering = XmlHelper.ParseBoolean(reader.ReadElementContentAsString());
                    break;

                case "EnableCustomToolsDebugMode":
                    enableCustomToolsDebugMode = XmlHelper.ParseBoolean(reader.ReadElementContentAsString());
                    break;

                default:
                    reader.ReadOuterXml();
                    break;
                }
            }

            reader.ReadEndElement();
        }
Ejemplo n.º 13
0
        public static CameraBlurb FromXML(XmlReader reader)
        {
            reader.ReadStartElement();
            string    cameraType       = "";
            string    identifier       = "";
            string    alias            = "";
            Bitmap    icon             = null;
            Rectangle displayRectangle = Rectangle.Empty;
            string    aspectRatio      = "Auto";
            string    rotation         = "Rotate0";
            bool      mirror           = false;
            string    specific         = "";

            while (reader.NodeType == XmlNodeType.Element)
            {
                switch (reader.Name)
                {
                case "CameraType":
                    cameraType = reader.ReadElementContentAsString();
                    break;

                case "Identifier":
                    identifier = reader.ReadElementContentAsString();
                    break;

                case "Alias":
                    alias = reader.ReadElementContentAsString();
                    break;

                case "Icon":
                    icon = XmlHelper.ParseImageFromBase64(reader.ReadElementContentAsString());
                    break;

                case "DisplayRectangle":
                    displayRectangle = XmlHelper.ParseRectangle(reader.ReadElementContentAsString());
                    break;

                case "AspectRatio":
                    aspectRatio = reader.ReadElementContentAsString();
                    break;

                case "Rotation":
                    rotation = reader.ReadElementContentAsString();
                    break;

                case "Mirror":
                    mirror = XmlHelper.ParseBoolean(reader.ReadElementContentAsString());
                    break;

                case "Specific":
                    specific = reader.ReadInnerXml();
                    break;

                default:
                    reader.ReadOuterXml();
                    break;
                }
            }

            reader.ReadEndElement();

            return(new CameraBlurb(cameraType, identifier, alias, icon, displayRectangle, aspectRatio, rotation, mirror, specific));
        }
Ejemplo n.º 14
0
        public void ReadXml(XmlReader r)
        {
            r.ReadStartElement();

            while (r.NodeType == XmlNodeType.Element)
            {
                switch (r.Name)
                {
                case "SimilarityThreshold":
                    SimilarityThreshold = double.Parse(r.ReadElementContentAsString(), CultureInfo.InvariantCulture);
                    break;

                case "TemplateUpdateThreshold":
                    TemplateUpdateThreshold = double.Parse(r.ReadElementContentAsString(), CultureInfo.InvariantCulture);
                    break;

                case "SearchWindow":
                    if (r.MoveToAttribute("unit"))
                    {
                        SearchWindowUnit = (TrackerParameterUnit)Enum.Parse(typeof(TrackerParameterUnit), r.ReadContentAsString());
                    }

                    r.ReadStartElement();
                    SearchWindow = XmlHelper.ParseSize(r.ReadContentAsString());
                    r.ReadEndElement();
                    break;

                case "BlockWindow":
                    if (r.MoveToAttribute("unit"))
                    {
                        BlockWindowUnit = (TrackerParameterUnit)Enum.Parse(typeof(TrackerParameterUnit), r.ReadContentAsString());
                    }

                    r.ReadStartElement();
                    BlockWindow = XmlHelper.ParseSize(r.ReadContentAsString());
                    r.ReadEndElement();
                    break;

                case "RefinementNeighborhood":
                    RefinementNeighborhood = int.Parse(r.ReadElementContentAsString(), CultureInfo.InvariantCulture);
                    break;

                case "ResetOnMove":
                    ResetOnMove = XmlHelper.ParseBoolean(r.ReadElementContentAsString());
                    break;

                default:
                    string outerXml = r.ReadOuterXml();
                    log.DebugFormat("Unparsed content in XML: {0}", outerXml);
                    break;
                }
            }

            r.ReadEndElement();

            SimilarityThreshold     = Math.Min(1.0, SimilarityThreshold);
            TemplateUpdateThreshold = Math.Min(1.0, TemplateUpdateThreshold);

            if (BlockWindow.Width >= SearchWindow.Width || BlockWindow.Height >= SearchWindow.Height)
            {
                BlockWindow = new Size(SearchWindow.Width / 2, SearchWindow.Height / 2);
            }
        }