Ejemplo n.º 1
0
 public void Init(TickStatistics stats, Core core)
 {
     mStats = stats;
     mCore = core;
     if (mActive)
         mCore.Tick += mTickListener;
 }
 private void AddStatisticsl(TickStatistics statistics, string name)
 {
     if (mStatistics.ContainsKey(name)) {
         mStatistics.Add(name + mUsedNames[name], statistics);
         mUsedNames[name]++;
     } else {
         mStatistics.Add(name, statistics);
         mUsedNames.Add(name, 1);
     }
 }
Ejemplo n.º 3
0
        public Step(FlythroughState state, XmlNode node, Text subtitlesText, int subtitleTimeoutS, IMediaPlayer player)
        {
            if (node.Attributes["St››ep"] == null && !int.TryParse(node.Attributes["Step"].Value, out mStep))
                throw new ArgumentException("Unable to load slideshow step. A valid 'Step' attribute must be supplied.");

            #if DEBUG
            if (sStatistics == null) {
                sStatistics = new TickStatistics();
                StatisticsCollection.AddStatistics(sStatistics, "Flythrough Steps");
            }
            #endif

            mPlayer = player;
            mManager = state.Manager;
            mStep = GetInt(node, -1, "Step");
            if (mStep == -1)
                throw new ArgumentException("Unable to load step ID. A valid Step attribute is expected.");

            XmlAttribute voiceoverAttribute = node.Attributes["Voiceover"];
            if (voiceoverAttribute != null && File.Exists(Path.GetFullPath(voiceoverAttribute.Value))) {
                if (mPlayer != null)
                    mVoiceoverFile = Path.GetFullPath(voiceoverAttribute.Value);
                else
                    Logger.Warn("Unable to load voiceover for flythrough step. No MediaPlayer supplied.");
            }

            mSubtitlesText = subtitlesText;

            XmlNode newFontNode = node.SelectSingleNode("child::SubtitlesFont");
            if (newFontNode != null)
                mNewSubtitlesFont = state.Manager.MakeText(newFontNode);

            if (mSubtitlesText != null) {
                mTickListener = new Action(mCoordinator_Tick);
                mSubtitleTimeoutS = subtitleTimeoutS;
                XmlNode subtitlesNode = node.SelectSingleNode("child::Subtitles");
                if (subtitlesNode != null) {
                    foreach (XmlNode child in subtitlesNode.ChildNodes) {
                        if (child is XmlElement) {
                            double time = child.Attributes["Time"] != null ? double.Parse(child.Attributes["Time"].Value) : 0;
                            mSubtitles.Add(time, child.InnerText.Trim('\n', ' ', Environment.NewLine[0]).Replace("  ", ""));
                        }
                    }
                }
            }

            foreach (var featureNode in GetChildrenOfChild(node, "Features")) {
                IFeature feature = mManager.GetFeature(featureNode, "flythrough step " + (mStep + 1), null);
                if (feature != null) {
                    mFeatures.Add(feature);
                    state.AddFeature(feature);
                    feature.Active = false;
                }
            }
        }
Ejemplo n.º 4
0
 private void AddStatisticsl(TickStatistics statistics, string name)
 {
     if (mStatistics.ContainsKey(name))
     {
         mStatistics.Add(name + mUsedNames[name], statistics);
         mUsedNames[name]++;
     }
     else
     {
         mStatistics.Add(name, statistics);
         mUsedNames.Add(name, 1);
     }
 }
Ejemplo n.º 5
0
 public static void AddStatistics(TickStatistics statistics, string name)
 {
     sCol.AddStatisticsl(statistics, name);
 }
Ejemplo n.º 6
0
 public StatisticsForm(Core core, TickStatistics stats)
     : this()
 {
     statisticsPanel.Init(stats, core);
 }
Ejemplo n.º 7
0
 public StatisticsPanel(TickStatistics stats, Core core)
     : this()
 {
     Init(stats, core);
 }
 public static void AddStatistics(TickStatistics statistics, string name)
 {
     sCol.AddStatisticsl(statistics, name);
 }
        private void StateActivated(State state)
        {
            if (mCurrentStats != null)
                mCurrentStats.End();

            mCurrentStats = mStatistics[state.Name];
            mCurrentStats.Begin();
        }