Пример #1
0
        internal void Reconstruct(sound_cache_file_gestalt_group gestalt,
                                  sound_gestalt_permutations_block gestalt_perm)
        {
            int index = gestalt_perm.Name.Value;

            if (index != -1)
            {
                this.Name.Handle = gestalt.ImportNames[index].ImportName.Handle;
            }

            // TODO: do the tools actually "encode" these values or just cast them?
            this.SkipFraction.Value = (float)gestalt_perm.EncodedSkipFraction.Value;
            this.Gain.Value         = (float)gestalt_perm.EncodedGain.Value;

            this.SamplesSize = gestalt_perm.SampleSize.Value;

            //RawInfo = PermutationInfoIndex?
            // TODO: do the tools multiply this by a constant (ie, 30) or leave it the same?
            this.LanguageNeutralMilliseconds.Value = gestalt_perm.LanguageNeutralTime.Value;

            index = gestalt_perm.FirstChunk.Value;
            if (index != -1)
            {
                int count = gestalt_perm.ChunkCount.Value;

                for (int x = 0; x < count; x++)
                {
                    this.Chunks.AddElement(gestalt.Chunks[index + x].Clone(this.Chunks)
                                           as sound_permutation_chunk_block);
                }
            }
        }
Пример #2
0
        internal void Reconstruct(sound_cache_file_gestalt_group gestalt,
                                  sound_gestalt_pitch_ranges_block gestalt_pr)
        {
            int index = gestalt_pr.Name.Value;

            if (index != -1)
            {
                this.Name.Handle = gestalt.ImportNames[index].ImportName.Handle;
            }

            index = gestalt_pr.Parameters.Value;
            if (index != -1)
            {
                Reconstruct(gestalt.PitchRangeParameters[index]);
            }

            //? = EncodedPermutationData
            //? = FirstRuntimePermutationFlagIndex

            index = gestalt_pr.FirstPermutation.Value;
            if (index != -1)
            {
                int count = gestalt_pr.PermutationCount.Value;
                for (int x = 0; x < count; x++)
                {
                    sound_permutations_block perm;
                    this.Permutations.Add(out perm);

                    perm.Reconstruct(gestalt, gestalt.Permutations[index + x]);
                }
            }
        }
Пример #3
0
		internal void Reconstruct(sound_cache_file_gestalt_group gestalt,
			sound_gestalt_permutations_block gestalt_perm)
		{
			int index = gestalt_perm.Name.Value;
			if (index != -1)
				this.Name.Handle = gestalt.ImportNames[index].ImportName.Handle;

			// TODO: do the tools actually "encode" these values or just cast them?
			this.SkipFraction.Value = (float)gestalt_perm.EncodedSkipFraction.Value;
			this.Gain.Value = (float)gestalt_perm.EncodedGain.Value;

			this.SamplesSize = gestalt_perm.SampleSize.Value;

			//RawInfo = PermutationInfoIndex?
			// TODO: do the tools multiply this by a constant (ie, 30) or leave it the same?
			this.LanguageNeutralMilliseconds.Value = gestalt_perm.LanguageNeutralTime.Value;

			index = gestalt_perm.FirstChunk.Value;
			if (index != -1)
			{
				int count = gestalt_perm.ChunkCount.Value;

				for (int x = 0; x < count; x++)
					this.Chunks.AddElement(gestalt.Chunks[index+x].Clone(this.Chunks)
						as sound_permutation_chunk_block);
			}
		}
Пример #4
0
        void Reconstruct(sound_cache_file_gestalt_group gestalt, cache_file_sound_group snd)
        {
            int index;

            this.Flags.Value       = snd.Flags.Value;
            this.Class.Value       = snd.SoundClass.Value;
            this.SampleRate.Value  = snd.SampleRate.Value;
            this.Encoding.Value    = snd.Encoding.Value;
            this.Compression.Value = snd.Compression.Value;

            index = snd.PlaybackIndex.Value;
            if (index != -1)
            {
                this.Playback.Value = gestalt.Playbacks[index].Playback.Value.Clone(this)
                                      as sound_playback_parameters_struct;
            }

            index = snd.ScaleIndex.Value;
            if (index != -1)
            {
                this.Scale.Value = gestalt.Scales[index].Scale.Value.Clone(this)
                                   as sound_scale_modifiers_struct;
            }

            index = snd.PromotionIndex.Value;
            if (index != -1)
            {
                this.Promotion.Value = gestalt.Promotions[index].Promotion.Value.Clone(this)
                                       as sound_promotion_parameters_struct;
            }

            index = snd.FirstPitchRangeIndex.Value;
            int count = snd.PitchRangeIndex.Value;

            if (index != -1)
            {
                this.PitchRanges.Resize(count);

                for (int x = 0; x < count; x++)
                {
                    this.PitchRanges[x].Reconstruct(gestalt,
                                                    gestalt.PitchRanges[index + x]);
                }
            }

            index = snd.CustomPlaybackIndex.Value;
            if (index != -1)
            {
                sound_platform_sound_playback_block param;
                this.PlatformParameters.Add(out param);

                param.PlaybackDefinition.Value = gestalt.CustomPlaybacks[index].PlaybackDefinition.Value.Clone(this)
                                                 as simple_platform_sound_playback_struct;
            }

            index = snd.ExtraInfoIndex.Value;
            if (index != -1)
            {
                ExtraInfo.AddElement(gestalt.ExtraInfos[index].Clone(this)
                                     as sound_extra_info_block);
            }

            //snd.MaximumPlayTime.Value?
        }
Пример #5
0
		void Reconstruct(sound_cache_file_gestalt_group gestalt, cache_file_sound_group snd)
		{
			int index;

			this.Flags.Value = snd.Flags.Value;
			this.Class.Value = snd.SoundClass.Value;
			this.SampleRate.Value = snd.SampleRate.Value;
			this.Encoding.Value = snd.Encoding.Value;
			this.Compression.Value = snd.Compression.Value;

			index = snd.PlaybackIndex.Value;
			if(index != -1)
				this.Playback.Value = gestalt.Playbacks[index].Playback.Value.Clone(this) 
					as sound_playback_parameters_struct;

			index = snd.ScaleIndex.Value;
			if (index != -1)
				this.Scale.Value = gestalt.Scales[index].Scale.Value.Clone(this) 
					as sound_scale_modifiers_struct;

			index = snd.PromotionIndex.Value;
			if (index != -1)
				this.Promotion.Value = gestalt.Promotions[index].Promotion.Value.Clone(this)
					as sound_promotion_parameters_struct;

			index = snd.FirstPitchRangeIndex.Value;
			int count = snd.PitchRangeIndex.Value;
			if (index != -1)
			{
				this.PitchRanges.Resize(count);

				for (int x = 0; x < count; x++)
					this.PitchRanges[x].Reconstruct(gestalt,
						gestalt.PitchRanges[index + x]);
			}

			index = snd.CustomPlaybackIndex.Value;
			if (index != -1)
			{
				sound_platform_sound_playback_block param;
				this.PlatformParameters.Add(out param);

				param.PlaybackDefinition.Value = gestalt.CustomPlaybacks[index].PlaybackDefinition.Value.Clone(this)
					as simple_platform_sound_playback_struct;
			}

			index = snd.ExtraInfoIndex.Value;
			if (index != -1)
				ExtraInfo.AddElement(gestalt.ExtraInfos[index].Clone(this) 
					as sound_extra_info_block);

			//snd.MaximumPlayTime.Value?
		}
Пример #6
0
		internal void Reconstruct(sound_cache_file_gestalt_group gestalt,
			sound_gestalt_pitch_ranges_block gestalt_pr)
		{
			int index = gestalt_pr.Name.Value;
			if (index != -1)
				this.Name.Handle = gestalt.ImportNames[index].ImportName.Handle;

			index = gestalt_pr.Parameters.Value;
			if (index != -1)
				Reconstruct(gestalt.PitchRangeParameters[index]);

			//? = EncodedPermutationData
			//? = FirstRuntimePermutationFlagIndex

			index = gestalt_pr.FirstPermutation.Value;
			if (index != -1)
			{
				int count = gestalt_pr.PermutationCount.Value;
				for(int x = 0; x < count; x++)
				{
					sound_permutations_block perm;
					this.Permutations.Add(out perm);

					perm.Reconstruct(gestalt, gestalt.Permutations[index+x]);
				}
			}
		}