当前位置: 首页>>代码示例>>C#>>正文


C# Audio.Stop方法代码示例

本文整理汇总了C#中Audio.Stop方法的典型用法代码示例。如果您正苦于以下问题:C# Audio.Stop方法的具体用法?C# Audio.Stop怎么用?C# Audio.Stop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Audio的用法示例。


在下文中一共展示了Audio.Stop方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: toFinal

 public void toFinal(Audio qMusic, Audio qFinal, int qNumber)
 {
     if (qMusic.Playing == true && qNumber > 5) qMusic.Stop();
     qFinal.Play();
     ansLabel.ForeColor = Color.Black;
     ansPic.Image = Form3.getPictureRes(ansLetter + "_final");
     ansIfLocked = true;
 }
开发者ID:Armandos95,项目名称:OldMillionaireApp,代码行数:8,代码来源:Answer.cs

示例2: toCorrect

 public void toCorrect(Audio qMusic, Audio qFinal, Audio qCorrect, Audio qWrong, int qNumber)
 {
     if (ansIfCorrect == true)
     {
         if (ansIfCorrect == ansIfLocked)
         {
             currentQuestion.ifAnsweredCorrectly = true;
             if (qNumber == 5) qMusic.Stop();
             if (qFinal.Playing == true) qFinal.Stop();
             qCorrect.Play();
             ansLabel.ForeColor = Color.Black;
             for (int i = 1; i <= 11; i++)
             {
                 if (i % 2 == 1)
                 {
                     ansPic.Image = Form3.getPictureRes(ansLetter + "_correct");
                     ansPic.Refresh();
                     Thread.Sleep(100);
                 }
                 else
                 {
                     ansPic.Image = Form3.getPictureRes(ansLetter + "_final");
                     ansPic.Refresh();
                     Thread.Sleep(100);
                 }
             }
             if (qMusic.Stopped && qNumber < 5) qMusic.Play();
         }
         else
         {
             qMusic.Stop();
             if (qFinal.Playing == true) qFinal.Stop();
             qWrong.Play();
             for (int i = 1; i <= 11; i++)
             {
                 if (i % 2 == 1)
                 {
                     ansPic.Image = Form3.getPictureRes(ansLetter + "_correct");
                     ansLabel.ForeColor = Color.Black;
                     ansPic.Refresh();
                     Thread.Sleep(250);
                 }
                 else
                 {
                     ansPic.Image = Form3.getPictureRes(ansLetter + "_normal");
                     ansLabel.ForeColor = Color.White;
                     ansPic.Refresh();
                     Thread.Sleep(250);
                 }
             }
         }
     }
 }
开发者ID:Armandos95,项目名称:OldMillionaireApp,代码行数:53,代码来源:Answer.cs

示例3: play

 private void play(Audio audio)
 {
     audio.Stop();
     audio.Play();
 }
开发者ID:pentlandfirth,项目名称:PongForKinect,代码行数:5,代码来源:Sounds.cs

示例4: Run

        public void Run()
        {
            form = new Form();
            // �E�B���h�E�T�C�Y�•ς̕����ǂ��ˁH
            form.Icon = MafiaLoader.DefaultLoader.GetIcon("mafia.ico");
            form.Text = Mafia.TITLE;

            stages = new Stage[numStages];
            for (int i = 0; i < numStages; i++)
            {
                if (i < Mafia.NUM_STAGES)
                {
                    stages[i] = MafiaLoader.DefaultLoader.GetStage("stage" + i + ".stg");
                }
                else
                {
                    stages[i] = MafiaLoader.DefaultLoader.GetStage(stagePath[i - Mafia.NUM_STAGES]);
                }
            }
            if (stagePath.Length == 0)
            {
                currentStageIndex = 0;
            }
            else
            {
                currentStageIndex = Mafia.NUM_STAGES;
            }

            title = new TitleScene();
            select = new SelectScene(stages, 0);

            state = TITLE_SCENE;

            video = new MafiaVideo(form, MessageBox.Show("�t���X�N���[���ŋN�����܂����H", "�m�F", MessageBoxButtons.YesNo) == DialogResult.Yes);
            sound = new MafiaSound(form);
            input = new MafiaInput(form);

            try
            {
                bgm = new Audio(Application.StartupPath + "\\" + Mafia.RESOURCE_NAME + "\\mafia.mp3");
                bgm.Ending += new EventHandler(bgm_Ending);
            }
            catch
            {
            }

            form.Show();

            timer = new FpsTimer(Mafia.FPS, false);

            while (CheckState())
            {
                if (input.ShouldToggleFullscreen())
                {
                    video.ToggleFullscreen();
                }
                switch (state)
                {
                    case TITLE_SCENE:
                        // �C�F���h�E�Anull���ǂ����`�F�b�N���Ȃ���Ȃ��Ƃ͉�����
                        if (bgm != null && bgm.Playing)
                        {
                            bgm.Stop();
                        }
                        switch (title.Tick(input.GetCurrentTitleInput()))
                        {
                            case TitleScene.NONE:
                                if (timer.ShouldRender() && video.CheckDrawable())
                                {
                                    video.Begin();
                                    video.DrawTitleScene(title);
                                    video.DrawFps(timer.GetCurrentFps());
                                    video.End();
                                    video.Present();
                                }
                                break;
                            case TitleScene.START_GAME:
                                select.CurrentStage = currentStageIndex;
                                state = SELECT_SCENE_TITLE;
                                break;
                            case TitleScene.EXIT:
                                form.Close();
                                break;
                        }
                        break;
                    case SELECT_SCENE_TITLE:
                        {
                            title.Tick(TitleInput.Empty);
                            int result = select.Tick(input.GetCurrentSelectInput());
                            switch (result)
                            {
                                case SelectScene.NONE:
                                    if (timer.ShouldRender() && video.CheckDrawable())
                                    {
                                        video.Begin();
                                        video.DrawTitleScene(title);
                                        video.DrawSelectScene(select);
                                        video.DrawFps(timer.GetCurrentFps());
                                        video.End();
                                        video.Present();
//.........这里部分代码省略.........
开发者ID:sinshu,项目名称:mafia,代码行数:101,代码来源:MafiaApplication.cs

示例5: button4_Click

        private void button4_Click(object sender, EventArgs e)
        {
            Audio music = new Audio("resources\\track.wma", true);

            music.Play();
            System.Threading.Thread.Sleep(5000);
            music.Stop();
        }
开发者ID:HwangBae,项目名称:hoo-eye-relaxant,代码行数:8,代码来源:MainForm.cs

示例6: useLF2

 private void useLF2(ref bool ifLF, Audio musicLF, Audio soundLF, string st1, string st2, string st3,
     System.Windows.Forms.Button buttonLF)
 {
     if (!ifLF)
     {
         ifLF = true;
         currentQuestion.stopAllMusic();
         musicLF.Play();
         pictureActiveLF.Visible = true;
         pictureActiveLF.Image = getPictureRes(st1);
         pictureActiveLF.BringToFront();
         pictureLF2.Image = getPictureRes(st2);
     }
     else
     {
         musicLF.Stop();
         soundLF.Play();
         pictureActiveLF.Visible = false;
         pictureLF2.Image = getPictureRes(st3);
         Thread.Sleep(1500);
         currentQuestion.qMusic.Play();
         buttonLF.Enabled = false;
     }
 }
开发者ID:Armandos95,项目名称:OldMillionaireApp,代码行数:24,代码来源:Form3.cs

示例7: toBlankDD

 public void toBlankDD(Audio qFinal, Audio DD2)
 {
     toBlank();
     qFinal.Stop();
     DD2.Play();
 }
开发者ID:Armandos95,项目名称:OldMillionaireApp,代码行数:6,代码来源:Answer.cs


注:本文中的Audio.Stop方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。