Ejemplo n.º 1
0
        public Soundtrack(psai.ProtoBuf_PsaiCoreSoundtrack pbSoundtrack) : this()
        {
            for (int i = 0; i < pbSoundtrack.themes.Count; i++)
            {
                psai.ProtoBuf_Theme pbTheme = pbSoundtrack.themes[i];
                Theme tempTheme             = new Theme(pbTheme);
                m_themes[tempTheme.id] = tempTheme;
            }

            for (int i = 0; i < pbSoundtrack.snippets.Count; i++)
            {
                psai.ProtoBuf_Snippet pbSnippet = pbSoundtrack.snippets[i];
                Segment tempSnippet             = new Segment(pbSnippet);

                m_snippets[tempSnippet.Id] = tempSnippet;

                Theme tmpTheme = m_themes[tempSnippet.ThemeId];
                if (tmpTheme != null)
                {
                    tmpTheme.m_segments.Add(tempSnippet);
                }
                else
                {
                    #if !(PSAI_NOLOG)
                    {
                        if (LogLevel.errors <= Logger.Instance.LogLevel)
                        {
                            string s = "INTERNAL ERROR! could not find Theme for Theme id " + tempSnippet.ThemeId + " of snippet" + tempSnippet.Id;
                            Logger.Instance.Log(s, LogLevel.errors);
                        }
                    }
                    #endif
                }
            }
        }
Ejemplo n.º 2
0
        internal Theme(psai.ProtoBuf_Theme pbTheme) : this()
        {
            this.id = pbTheme.id;
            this.intensityAfterRest     = pbTheme.intensityAfterRest;
            this.musicDurationAfterRest = pbTheme.musicPhaseSecondsAfterRest;
            this.musicDurationGeneral   = pbTheme.musicPhaseSecondsGeneral;
            this.Name           = pbTheme.name;
            this.priority       = pbTheme.priority;
            this.restSecondsMin = pbTheme.restSecondsMin;
            this.restSecondsMax = pbTheme.restSecondsMax;
            this.themeType      = (ThemeType)(pbTheme.themeType);

            this.weightings.intensityVsVariety   = pbTheme.weightingIntensityVsVariety;
            this.weightings.lowPlaycountVsRandom = pbTheme.weightingPlaycountVsRandom;
            this.weightings.switchGroups         = pbTheme.weightingSwitchGroups;
        }
Ejemplo n.º 3
0
 internal psai.ProtoBuf_Theme CreateProtoBufTheme()
 {
     psai.ProtoBuf_Theme pbTheme = new psai.ProtoBuf_Theme();
     pbTheme.id = id;
     pbTheme.name = Name;
     pbTheme.themeType = (int)(this.themeType);
     pbTheme.intensityAfterRest = this.intensityAfterRest;
     pbTheme.musicPhaseSecondsGeneral = this.musicDurationGeneral;
     pbTheme.musicPhaseSecondsAfterRest = this.musicDurationAfterRest;
     pbTheme.restSecondsMin = this.restSecondsMin;
     pbTheme.restSecondsMax = this.restSecondsMax;
     return pbTheme;
 }