Example #1
0
File: Project.cs Project: y0ti/JSIL
        public bool SetProperty(string propertyName, string value, string[] source, ref int line)
        {
            if (Parser.TokeniseLine(source[line], out propertyName, out value))
            {
                switch (propertyName)
                {
                case "Signature":
                    m_signature = value;
                    break;

                case "Version":
                    m_version = Parser.ParseInt(value, line);
                    break;

                case "Content Version":
                    m_contentVersion = Parser.ParseInt(value, line);
                    break;

                case "Release":
                    m_release = value;
                    break;

                case "Options":
                    m_options = new Options();
                    m_options.Parse(source, ref line, this);
                    break;

                case "Global Settings":
                    m_globalSettings = new GlobalSettings();
                    m_globalSettings.Parse(source, ref line, this);
                    break;

                case "Wave Bank":
                    WaveBank waveBank = new WaveBank();
                    waveBank.Parse(source, ref line, this);
                    m_waveBanks.Add(waveBank);
                    break;

                case "Sound Bank":
                    SoundBank soundBank = new SoundBank();
                    soundBank.Parse(source, ref line, this);
                    m_soundBanks.Add(soundBank);
                    break;

                case "Workspace":
                    Workspace workspace = new Workspace();
                    workspace.Parse(source, ref line, this);
                    m_workspaces.Add(workspace);
                    break;

                default:
                    return(false);
                }
            }

            return(true);
        }
Example #2
0
		public bool SetProperty( string propertyName, string value, string[] source, ref int line )
		{
			if ( Parser.TokeniseLine( source[line], out propertyName, out value ) )
			{
				switch ( propertyName )
				{
					case "Signature":
						m_signature = value;
						break;

					case "Version":
						m_version = Parser.ParseInt( value, line );
						break;

					case "Content Version":
						m_contentVersion = Parser.ParseInt( value, line );
						break;

					case "Release":
						m_release = value;
						break;

					case "Options":
						m_options = new Options();
						m_options.Parse( source, ref line, this );
						break;

					case "Global Settings":
						m_globalSettings = new GlobalSettings();
						m_globalSettings.Parse( source, ref line, this );
						break;

					case "Wave Bank":
						WaveBank waveBank = new WaveBank();
						waveBank.Parse( source, ref line, this );
						m_waveBanks.Add( waveBank );
						break;

					case "Sound Bank":
						SoundBank soundBank = new SoundBank();
						soundBank.Parse( source, ref line, this );
						m_soundBanks.Add( soundBank );
						break;

					case "Workspace":
						Workspace workspace = new Workspace();
						workspace.Parse( source, ref line, this );
						m_workspaces.Add( workspace );
						break;

					default:
						return false;
				}
			}

			return true;
		}
Example #3
0
        public Sound FindSound(SoundBank soundBank)
        {
            foreach (Sound sound in soundBank.m_sounds)
            {
                if (sound.m_name == m_name)
                {
                    return(sound);
                }
            }

            // Not found by name, which suggests index is likely to fail too (so why
            // the XAP file format insists on providing both, I don't understand)
            if (m_index >= 0)
            {
                return(soundBank.m_sounds[m_index]);
            }

            return(null);
        }
Example #4
0
		public Sound FindSound( SoundBank soundBank )
		{
			foreach ( Sound sound in soundBank.m_sounds )
			{
				if ( sound.m_name == m_name )
				{
					return sound;
				}
			}

			// Not found by name, which suggests index is likely to fail too (so why
			// the XAP file format insists on providing both, I don't understand)
			if ( m_index >= 0 )
			{
				return soundBank.m_sounds[m_index];
			}

			return null;
		}