本文整理汇总了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");
}
示例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;
}
示例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();
}
示例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();
}
示例5: initializePlayer
private void initializePlayer()
{
songPlayer = new Player();
songPlayer.CurrentSong = loadSongFromResources();
songPlayer.Play();
}
示例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();
//.........这里部分代码省略.........
示例7: Click
public void Click(Player p)
{
p.Play(_card);
}
示例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);
}