コード例 #1
0
        internal void Deserialize(GMAudioOptionsModel audioOptionsModel)
        {
            Id = audioOptionsModel.id;

            foreach (var modelAudioGroup in audioOptionsModel.audioGroups)
            {
                var audioGroup = new GMAudioGroup();
                audioGroup.Deserialize(modelAudioGroup);
                AudioGroups.Add(audioGroup);
            }
        }
コード例 #2
0
ファイル: GMSound.cs プロジェクト: nkrapivin/YoYoProject
        internal override void Create(string name)
        {
            Name            = Project.Resources.GenerateValidName(name ?? "sound");
            CompressionKind = GMSoundCompression.Uncompressed;
            Volume          = 1.0f;
            PreLoad         = false;
            BitRate         = 128;
            SampleRate      = 44100;
            Type            = GMSoundType.Mono;
            BitDepth        = GMSoundBitDepth.SixteenBit;
            AudioGroup      = Project.Resources.Get <GMMainOptions>().Audio.DefaultAudioGroup;

            AddResourceToFolder("GMSound");
        }
コード例 #3
0
ファイル: GMSound.cs プロジェクト: nkrapivin/YoYoProject
        internal override void FinalizeDeserialization(ModelBase model)
        {
            var soundModel   = (GMSoundModel)model;
            var audiogrpGuid = soundModel.audioGroundGuid;

            if (audiogrpGuid == Guid.Empty)
            {
                AudioGroup = null;
            }
            else
            {
                AudioGroup = Project.Resources.Get <GMMainOptions>().Audio.AudioGroups.Find(g => g.Id == audiogrpGuid);
            }
        }
コード例 #4
0
        public GMAudioGroup CreateAudioGroup(string name)
        {
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }

            // TODO Validate name

            var audioGroup = new GMAudioGroup
            {
                Id   = Guid.NewGuid(),
                Name = name
            };

            AudioGroups.Add(audioGroup);

            return(audioGroup);
        }