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


C# Player.Play方法代码示例

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


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

示例1: CanInstantiateProxyFromInterface

		public void CanInstantiateProxyFromInterface()
		{
			var pi = new Player();
			var impl = pi.Play<TestInterface>();

			Assert.That(impl, Is.Not.Null);

			//impl.AskAndAnswer("Question");
		}
开发者ID:yonglehou,项目名称:Betamax.Net,代码行数:9,代码来源:PlaybackImplementationProxy.cs

示例2: ReactToAttack

 public override bool ReactToAttack(GameModel gameModel, Player targetPlayer)
 {
     CardModel choice = targetPlayer.Chooser.ChooseZeroOrOneCard(Chooser.CardChoiceType.PlayCaravanGuard, "You may play Caravan Guard", Chooser.ChoiceSource.FromHand, new CardModel[] { this });
     if (choice != null)
     {
         this.playedOutOfTurn = targetPlayer;
         targetPlayer.Play(choice, false, true);
     }
     return false;
 }
开发者ID:alanjg,项目名称:MajorDomo,代码行数:10,代码来源:CaravanGuard.cs

示例3: DoSomething

        public void DoSomething()
        {
            Player player = new Player();
            player.Play();
            (player as IPlayable).Pause();
            (player as IPlayable).Stop();

            player.Record();
            (player as IRecordable).Pause();
            (player as IRecordable).Stop();
            Console.ReadKey();
        }
开发者ID:SyrnikovEK,项目名称:csharp,代码行数:12,代码来源:Task2.cs

示例4: MainWindow

        public MainWindow()
        {
            InitializeComponent();

            library = new Library();
            playlist = new LibraryPlaylist(library);
            player = new Player<Track>(playlist, new AudioControl<Track>(rt => rt.FilePath));
            player.StatusChanged += player_StatusChanged;

            Settings s;

            try
            {
                s = Settings.LoadSettings("Settings.xml");
            }
            catch (FileNotFoundException e)
            {
                s = new Settings();
            }

            foreach (var path in s.Mediapaths)
            {
                scanner = new ScannerBackgroundWorker(
                new AudioScanner(new MediaParser(), path));

                scanner.FileParsed += scanner_FileParsed;
                scanner.RunAync();
            }

            icon = new TaskbarIcon();
            icon.Icon = Properties.Resources.headset;

            var ctal = ModifierKeys.Control | ModifierKeys.Alt;

            hotkeys = new Hotkeys.HotKeyManager(this);
            hotkeys.AddHotKey(Key.J, ctal, () => { this.Show(); textbox.Focus(); textbox.Text = ""; });
            hotkeys.AddHotKey(Key.Q, ctal, () => this.Close());
            hotkeys.AddHotKey(Key.Insert, ctal, () => player.Play());
            hotkeys.AddHotKey(Key.Home, ctal, () => player.Pause());
            hotkeys.AddHotKey(Key.End, ctal, () => player.Stop());
            hotkeys.AddHotKey(Key.PageUp, ctal, () => playlist.MovePrevious());
            hotkeys.AddHotKey(Key.PageDown, ctal, () => playlist.MoveNext());
            hotkeys.AddHotKey(Key.Right, ctal, () => player.Seek(PlayerSeekOrigin.CurrentForwards, 5000));
            hotkeys.AddHotKey(Key.Left, ctal, () => player.Seek(PlayerSeekOrigin.CurrentBackwards, 5000));

            textbox.Focus();
        }
开发者ID:stufkan,项目名称:SimpleAudio,代码行数:47,代码来源:MainWindow.xaml.cs

示例5: initializePlayer

 private void initializePlayer()
 {
     songPlayer = new Player();
     songPlayer.CurrentSong = loadSongFromResources();
     songPlayer.Play();
 }
开发者ID:AugustoRuiz,项目名称:WYZTracker,代码行数:6,代码来源:About.cs

示例6: GaGa

        /// <summary>
        /// GaGa implementation.
        /// </summary>
        /// <param name="settingsFilepath">
        /// Path to the settings file to use.
        /// </param>
        /// <param name="streamsFilepath">
        /// Path to the streams file to use.
        /// </param>
        public GaGa(String settingsFilepath, String streamsFilepath)
        {
            // gui components:
            container = new Container();
            toolStripRenderer = new ToolStripAeroRenderer();

            notifyIcon = new NotifyIcon(container);
            notifyIcon.ContextMenuStrip = new ContextMenuStrip();
            notifyIcon.ContextMenuStrip.Renderer = toolStripRenderer;
            notifyIcon.Visible = true;

            // settings:
            this.settingsFilepath = settingsFilepath;
            settings = SettingsLoad();

            // streams:
            this.streamsFilepath = streamsFilepath;
            streamsFileLoader = new StreamsFileLoader(streamsFilepath);

            // player:
            player = new Player(notifyIcon);

            // constant menu items:
            dynamicMenuMarker = new ToolStripMenuItem();
            dynamicMenuMarker.Visible = false;

            errorOpenItem = new ToolStripMenuItem();
            errorOpenItem.Text = "Error opening streams file (click for details)";

            errorReadItem = new ToolStripMenuItem();
            errorReadItem.Text = "Error reading streams file (click for details)";

            editItem = new ToolStripMenuItem();
            editItem.Text = "&Edit streams file";

            exitItem = new ToolStripMenuItem();
            exitItem.Text = "E&xit";

            // audio submenu:
            audioMenuItem = new ToolStripMenuItem();
            audioMenuItem.Text = "Audio";

            balanceTrackBar = new ToolStripLabeledTrackBar();
            balanceTrackBar.Label.Text = "Balance";
            balanceTrackBar.TrackBar.Minimum = -10;
            balanceTrackBar.TrackBar.Maximum = 10;

            volumeTrackBar = new ToolStripLabeledTrackBar();
            volumeTrackBar.Label.Text = "Volume";
            volumeTrackBar.TrackBar.Minimum = 0;
            volumeTrackBar.TrackBar.Maximum = 20;

            // adjust the backcolor to the renderer:
            Color back = toolStripRenderer.ColorTable.ToolStripDropDownBackground;

            balanceTrackBar.BackColor = back;
            balanceTrackBar.Label.BackColor = back;
            balanceTrackBar.TrackBar.BackColor = back;
            volumeTrackBar.BackColor = back;
            volumeTrackBar.Label.BackColor = back;
            volumeTrackBar.TrackBar.BackColor = back;

            audioMenuItem.DropDownItems.Add(balanceTrackBar);
            audioMenuItem.DropDownItems.Add(volumeTrackBar);

            // options submenu:
            optionsMenuItem = new ToolStripMenuItem();
            optionsMenuItem.Text = "Options";

            optionsEnableAutoPlayItem = new ToolStripMenuItem();
            optionsEnableAutoPlayItem.Text = "Enable auto play on startup";

            optionsEnableMultimediaKeysItem = new ToolStripMenuItem();
            optionsEnableMultimediaKeysItem.Text = "Enable multimedia keys";

            optionsMenuItem.DropDownItems.Add(optionsEnableAutoPlayItem);
            optionsMenuItem.DropDownItems.Add(optionsEnableMultimediaKeysItem);

            // add multimedia keys:
            KeyboardHook.Hooker.Add("Toggle Play", Keys.MediaPlayPause);
            KeyboardHook.Hooker.Add("Stop", Keys.MediaStop);
            KeyboardHook.Hooker.Add("Toggle Mute", Keys.VolumeMute);
            KeyboardHook.Hooker.Add("Volume Up", Keys.VolumeUp);
            KeyboardHook.Hooker.Add("Volume Down", Keys.VolumeDown);

            // apply settings before wiring events:
            balanceTrackBar.TrackBar.Value = settings.LastBalanceTrackBarValue;
            volumeTrackBar.TrackBar.Value = settings.LastVolumeTrackBarValue;

            BalanceUpdate();
            VolumeUpdate();
//.........这里部分代码省略.........
开发者ID:asaveliev,项目名称:GaGa,代码行数:101,代码来源:GaGa.cs

示例7: Click

 public void Click(Player p)
 {
     p.Play(_card);
 }
开发者ID:bobrathgeber,项目名称:Dominion,代码行数:4,代码来源:HandButton.cs

示例8: button2_Click

 private void button2_Click(object sender, EventArgs e)
 {
     Player pl = new Player();
     st = new FileStream(tempVoicePath, FileMode.Open, FileAccess.ReadWrite);
     pl.Play(st);
 }
开发者ID:Tobias-Schneider,项目名称:DiversityMobile,代码行数:6,代码来源:Form1.cs


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