public static void pausePlay() { var app = new iTunesApp(); app.PlayPause(); app = null; }
public static void PlayPause() { iTunesApp app = new iTunesApp(); app.PlayPause(); app = null; }
public bool?TogglePlayPause() { if (!IsActive) { return(null); } _app.PlayPause(); return(IsPlaying); }
static void Main(string[] args) { Process[] pname = Process.GetProcessesByName("iTunes"); if (pname.Length == 0 || args.Length == 0) //iTunes process not found OR no arguments passed { Environment.Exit(1); } var app = new iTunesApp(); switch (args[0].ToLower()) { case "playpause": app.PlayPause(); break; case "next": app.NextTrack(); break; case "prev": app.PreviousTrack(); break; case "stop": app.Stop(); break; case "volup": app.SoundVolume = Math.Min(100, app.SoundVolume + 5); break; case "voldown": app.SoundVolume = Math.Max(0, app.SoundVolume - 5); break; } Environment.Exit(0); }
public static void Main(string[] args) { if (args.Length == 0) return; var itunes = new iTunesApp(); if (itunes.PlayerState == ITPlayerState.ITPlayerStatePlaying || args[0] == "playpause") { var track = itunes.CurrentTrack; switch (args[0]) { case "1": case "2": case "3": case "4": case "5": var oldrating = track.Rating; var rating = Int32.Parse(args[0]) * 20; if (oldrating != rating) { track.Rating = rating; ShowTrackInfo(track); } break; case "info": ShowTrackInfo(track); break; case "playpause": itunes.PlayPause(); break; case "next": itunes.NextTrack(); ShowTrackInfo(itunes.CurrentTrack); break; case "prev": itunes.BackTrack(); var prevID = itunes.CurrentTrack.TrackDatabaseID; var currentID = track.TrackDatabaseID; if (prevID != currentID) ShowTrackInfo(itunes.CurrentTrack); break; } } }
/// <summary> /// This function is the callback used to execute the command when the menu item is clicked. /// See the constructor to see how the menu item is associated with this function using /// OleMenuCommandService service and MenuCommand class. /// </summary> /// <param name="sender">Event sender.</param> /// <param name="e">Event args.</param> private void PlayButtonCallback(object sender, EventArgs e) { iTunes.PlayPause(); }
private void Form1_KeyDown(object sender, KeyEventArgs e) { switch (e.KeyCode) { case Keys.Right: if (e.Control) { iTunes.PlayerPosition += 30; FlashLabel(this.lblFwd30s); } else { iTunes.PlayerPosition += 5; FlashLabel(this.lblFwd5s); } break; case Keys.Left: if (e.Control) { iTunes.PlayerPosition -= 30; FlashLabel(this.lblRwd30s); } else { iTunes.PlayerPosition -= 5; FlashLabel(this.lblRwd5s); } break; case Keys.Up: if (e.Control) { iTunes.SoundVolume = iTunes.SoundVolume + 4; FlashLabel(this.lblVolUp); } else { iTunes.PreviousTrack(); FlashLabel(this.lblPrevTrk); } break; case Keys.Down: if (e.Control) { iTunes.SoundVolume = iTunes.SoundVolume - 4; FlashLabel(this.lblVolDown); } else { iTunes.NextTrack(); FlashLabel(this.lblNextTrk); } break; case Keys.Space: iTunes.PlayPause(); FlashLabel(this.lblPlayPause); break; case Keys.I: WindowsShell.ActivateWindow("iTunes"); SwitchActiveState(); FlashLabel(this.lblActivateItunes); break; case Keys.U: iTunes.UpdatePodcastFeeds(); FlashLabel(this.lblUpdatePodcasts); break; case Keys.S: FlashLabel(this.lblSyncIPods); SyncAlliPods(); break; } }
public static void PlayPause() { iTunesApp app = new iTunesApp(); app.PlayPause(); app = null; }
public static void pausePlay() { var app = new iTunesApp(); app.PlayPause(); app = null; }