Beispiel #1
0
        private void SetTheme(Theme theme)
        {
            switch (theme)
            {
            case Theme.Autumn:
                _theme = Theme.Autumn;
                가을산책ToolStripMenuItem.CheckState = CheckState.Checked;
                비오는날ToolStripMenuItem.CheckState = CheckState.Unchecked;
                별헤는밤ToolStripMenuItem.CheckState = CheckState.Unchecked;
                테마ToolStripMenuItem.Text         = "테마 (가을 산책)";
                basicParticleSystem = new ParticleSystem(
                    /*cNum*/ 1, /*cRange*/ 0,
                    ParticleSystem.CreateFunction.TopRandom,
                    Particle.Type.leaf, Color.White,
                    /*pSize*/ 1f, /*pLife*/ 128);

                StopPlaying(0);
                StopPlaying(1);
                StopPlaying(2);
                StopPlaying(3);
                StopPlaying(4);
                particleSystems = new List <ParticleSystem>();

                // TODO
                outDevice.Send(new ChannelMessage(ChannelCommand.ProgramChange, 0, 32));       // 사운드이펙트(고블린) -> 분위기를 만드는 역할
                outDevice.Send(new ChannelMessage(ChannelCommand.ProgramChange, 1, 24));       // 어쿠스틱 기타(나일론) -> 주 멜로디
                outDevice.Send(new ChannelMessage(ChannelCommand.ProgramChange, 2, 123));      // 새 지저귀는 소리 -> 효과음
                break;

            case Theme.Rain:
                _theme = Theme.Rain;
                가을산책ToolStripMenuItem.CheckState = CheckState.Unchecked;
                비오는날ToolStripMenuItem.CheckState = CheckState.Checked;
                별헤는밤ToolStripMenuItem.CheckState = CheckState.Unchecked;
                테마ToolStripMenuItem.Text         = "테마 (비 오는 날)";
                basicParticleSystem = new ParticleSystem(
                    /*cNum*/ 1, /*cRange*/ 0,
                    ParticleSystem.CreateFunction.TopRandom,
                    Particle.Type.rain, Color.White,
                    /*pSize*/ 0.2f, /*pLife*/ 32);

                StopPlaying(0);
                StopPlaying(1);
                StopPlaying(2);
                StopPlaying(3);
                StopPlaying(4);
                particleSystems = new List <ParticleSystem>();

                outDevice.Send(new ChannelMessage(ChannelCommand.ProgramChange, 0, 101)); // 사운드이펙트(고블린) -> 분위기를 만드는 역할
                outDevice.Send(new ChannelMessage(ChannelCommand.ProgramChange, 1, 12));  // 마림바 -> 주 멜로디
                outDevice.Send(new ChannelMessage(ChannelCommand.ProgramChange, 2, 126)); // 박수 소리 -> 빗소리
                outDevice.Send(new ChannelMessage(ChannelCommand.ProgramChange, 3, 126)); // 박수 소리 -> 빗소리
                outDevice.Send(new ChannelMessage(ChannelCommand.ProgramChange, 4, 126)); // 박수 소리 -> 빗소리

                frameNumber = 0;                                                          // UpdateFrame()에서 기본 빗소리를 재생하도록 함
                Score score = new Score();
                Note  note  = new Note(45, 1, 0, 0, 4);
                score.PlayANoteForever(outDevice, note, (int)Math.Round(48 * volumeD));         // 기본 빗소리 (사라지지 않아야 함)
                break;

            case Theme.Star:
                _theme = Theme.Star;
                가을산책ToolStripMenuItem.CheckState = CheckState.Unchecked;
                비오는날ToolStripMenuItem.CheckState = CheckState.Unchecked;
                별헤는밤ToolStripMenuItem.CheckState = CheckState.Checked;
                테마ToolStripMenuItem.Text         = "테마 (별 헤는 밤)";
                basicParticleSystem = new ParticleSystem(
                    /*cNum*/ 1, /*cRange*/ 0,
                    ParticleSystem.CreateFunction.Random,
                    Particle.Type.star, Color.Black,
                    /*pSize*/ 1f, /*pLife*/ 64);

                StopPlaying(0);
                StopPlaying(1);
                StopPlaying(2);
                StopPlaying(3);
                StopPlaying(4);
                particleSystems = new List <ParticleSystem>();

                outDevice.Send(new ChannelMessage(ChannelCommand.ProgramChange, 0, 49));        // 현악 합주 2 -> 분위기를 만드는 역할
                outDevice.Send(new ChannelMessage(ChannelCommand.ProgramChange, 1, 11));        // 비브라폰 -> 주 멜로디

                break;
            }

            Opacity = opacity / 100D;
            trackBarMenuItem1.Value    = opacity / 5;
            trackBarMenuItem2.Value    = volume / 5;
            불투명도ToolStripMenuItem.Text = "불투명도 (" + opacity + "%)";
            음량ToolStripMenuItem.Text   = "음량 (" + volume + "%)";
            chord = new Chord(theme);
        }