public static void NextSong() { iTunesApp app = new iTunesApp(); app.NextTrack(); app = null; }
public static void nextTrack() { var app = new iTunesApp(); app.NextTrack(); app = null; }
public void Next() { try { _itunesApp.NextTrack(); } catch (COMException) { } }
public Track SkipTrack() { if (!IsActive) { return(null); } _app.NextTrack(); return(new Track(_app.CurrentTrack)); }
public static void nextTrackkeys() { if (!Config.Item("enablekeysctrl").GetValue <bool>()) { return; } var app = new iTunesApp(); app.NextTrack(); app = null; }
static void Main(string[] args) { iTunesApp iTunesInstance = new iTunesApp(); if (args.Length == 0) { return; } switch(args[0].ToLower()) { case "next": iTunesInstance.NextTrack(); break; case "prev": iTunesInstance.PreviousTrack(); break; case "play": iTunesInstance.Play(); break; case "pause": iTunesInstance.Pause(); break; case "current_track_artist": Console.WriteLine(iTunesInstance.CurrentTrack.Artist); break; case "current_track_name": Console.WriteLine(iTunesInstance.CurrentTrack.Name); break; case "state": Console.WriteLine(iTunesInstance.PlayerState.ToString()); break; default: break; } }
void doNextTrack() { if (iTunesControl == null) { return; } // Jump to next track try { iTunesControl.NextTrack(); } catch (COMException ex) { iTunesError(ex, "Could not jump to next track in iTunes."); } }
public MediaState NextTrack() { iTunesApp iTunes = null; try { iTunes = new iTunesApp(); iTunes.NextTrack(); return GetMediaState(); } catch (Exception ex) { LogUtility.LogException(ex); throw; } finally { // Marshall.ReleaseComObject? } }
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; } } }
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 nextTrackkeys() { if (!Config.Item("enablekeysctrl").GetValue<bool>()) { return; } var app = new iTunesApp(); app.NextTrack(); app = null; }
private void initRecognizer() { mRecognizerRule = new SpeechLib.SpInProcRecoContext(); bool hit = false; foreach (SpObjectToken recoPerson in mRecognizerRule.Recognizer.GetRecognizers()) { if (recoPerson.GetAttribute("Language") == "411") { mRecognizerRule.Recognizer.Recognizer = recoPerson; hit = true; break; } } if (!hit) { MessageBox.Show("日本語認識が利用できません"); Application.Exit(); } mRecognizerRule.Recognizer.AudioInput = createMicrofon(); if (mRecognizerRule.Recognizer.AudioInput == null) { MessageBox.Show("マイク初期化エラー"); Application.Exit(); } mRecognizerRule.Hypothesis += delegate(int streamNumber, object streamPosition, SpeechLib.ISpeechRecoResult result) { string strText = result.PhraseInfo.GetText(); textBox1.Text = strText; }; mRecognizerRule.Recognition += delegate(int streamNumber, object streamPosition, SpeechLib.SpeechRecognitionType srt, SpeechLib.ISpeechRecoResult isrr) { SpeechEngineConfidence confidence = isrr.PhraseInfo.Rule.Confidence; switch (confidence) { case SpeechEngineConfidence.SECHighConfidence: label3.Text = "Confidence is High"; break; case SpeechEngineConfidence.SECNormalConfidence: label3.Text = "Confidence is Normal"; break; case SpeechEngineConfidence.SECLowConfidence: label3.Text = "Confidence is Low"; textBox2.Text = "信頼性が低すぎます"; return; } string strText = isrr.PhraseInfo.GetText(); //isrr.PhraseInfo. label4.Text = isrr.RecoContext.Voice.Volume.ToString(); if (strText == "えんいー") { Application.Exit(); } if (itunes != null) { switch (strText) { case "あいちゅーんず.つぎのきょく": case "あいちゅーんず.つぎ": itunes.NextTrack(); break; case "あいちゅーんず.まえのきょく": case "あいちゅーんず.まえ": itunes.PreviousTrack(); break; case "あいちゅーんず.いちじていし": itunes.Pause(); break; case "あいちゅーんず.ていし": itunes.Stop(); break; case "あいちゅーんず.さいせい": itunes.Play(); break; case "あいちゅーんず.しね": itunes.Quit(); unhockiTunes(); break; case "あいちゅーんず.しずかに": itunes.SoundVolume = 50; break; case "あいちゅーんず.おおきく": itunes.SoundVolume = 100; break; case "あいちゅーんず.らんだむ": itunes.CurrentPlaylist.Shuffle = !itunes.CurrentPlaylist.Shuffle; break; } } else { if (strText == "あいちゅーんず.おきろ") { initiTunes(); } } textBox2.Text = strText; }; mRecognizerRule.StartStream += delegate(int streamNumber, object streamPosition) { textBox1.Text = textBox2.Text = ""; }; mRecognizerRule.FalseRecognition += delegate(int streamNumber, object streamPosition, SpeechLib.ISpeechRecoResult isrr) { textBox1.Text = textBox2.Text = label3.Text = "--Error!--"; }; mRecognizerGrammarRule = mRecognizerRule.CreateGrammar(); mRecognizerGrammarRule.Reset(); mRecognizerGrammarRuleGrammarRule = mRecognizerGrammarRule.Rules.Add("TopLevelRule", SpeechRuleAttributes.SRATopLevel | SpeechRuleAttributes.SRADynamic); mRecognizerGrammarRuleGrammarRule.InitialState.AddWordTransition(null, "あいちゅーんず.おきろ"); mRecognizerGrammarRuleGrammarRule.InitialState.AddWordTransition(null, "あいちゅーんず.つぎのきょく"); mRecognizerGrammarRuleGrammarRule.InitialState.AddWordTransition(null, "あいちゅーんず.まえのきょく"); mRecognizerGrammarRuleGrammarRule.InitialState.AddWordTransition(null, "あいちゅーんず.つぎ"); mRecognizerGrammarRuleGrammarRule.InitialState.AddWordTransition(null, "あいちゅーんず.まえ"); mRecognizerGrammarRuleGrammarRule.InitialState.AddWordTransition(null, "あいちゅーんず.いちじていし"); mRecognizerGrammarRuleGrammarRule.InitialState.AddWordTransition(null, "あいちゅーんず.ていし"); mRecognizerGrammarRuleGrammarRule.InitialState.AddWordTransition(null, "あいちゅーんず.さいせい"); mRecognizerGrammarRuleGrammarRule.InitialState.AddWordTransition(null, "あいちゅーんず.しね"); mRecognizerGrammarRuleGrammarRule.InitialState.AddWordTransition(null, "あいちゅーんず.しずかに"); mRecognizerGrammarRuleGrammarRule.InitialState.AddWordTransition(null, "あいちゅーんず.おおきく"); mRecognizerGrammarRuleGrammarRule.InitialState.AddWordTransition(null, "あいちゅーんず.らんだむ"); // mRecognizerGrammarRuleGrammarRule.InitialState.AddWordTransition(null, "えんいー"); mRecognizerGrammarRule.Rules.Commit(); mRecognizerGrammarRule.CmdSetRuleState("TopLevelRule", SpeechRuleState.SGDSActive); }
public void NextSong() { itunes.NextTrack(); }
private void bNextSong_Click(object sender, EventArgs e) { iTunes.NextTrack(); }
private void NextButtonCallback(object sender, EventArgs e) { iTunes.NextTrack(); }
private void myVoice_SpeechRecognized(object sender, SpeechRecognizedEventArgs e) { string input = e.Result.Text; Console.WriteLine(input); switch (input.ToUpper()) { case ("HOW IS THE WEATHER"): case ("WEATHER"): case ("HOWS THE WEATHER"): case ("HOW'S THE WEATHER"): getWeather(); break; case ("TOMORROWS FORECAST"): case ("TOMORROWS WEATHER"): case ("HOWS TOMORROWS WEATHER"): case ("HOW IS TOMORROWS WEATHER"): case ("WHATS TOMORROW LIKE"): case ("WHATS IT LIKE TOMORROW"): case ("FORECAST"): getForecast(); break; case ("MAIL"): case ("EMAIL"): case ("EMAILS"): case ("OPEN MAIL"): case ("OPEN EMAIL"): case ("OUTLOOK"): case ("SHOW MAIL"): case ("SHOW EMAIL"): case ("SHOW EMAILS"): openMail(); break; case ("SEND MAIL"): case ("SEND EMAIL"): case ("SEND EMAILS"): case ("SEND AN EMAIL"): case ("SEND MESSAGE"): sendMail(); break; case ("READ MAIL"): case ("READ EMAIL"): case ("READ EMAILS"): readMail(); break; case ("SEARCH"): case ("SEARCH FOR"): case ("FIND"): search(); break; //Works with no appointments - Haven't checked when appointment is present case ("CALENDER"): case ("CHECK CALENDER"): case ("APPOINTMENTS"): case ("TASKS"): Console.WriteLine("Calender"); checkCalender(); break; case ("GOOGLE"): googleSearch(); break; case ("SHOW TIME"): case ("TIME"): case ("CURRENT TIME"): case ("TELL TIME"): case ("SAY TIME"): currentTime(); break; case ("SHOW DAY"): case ("DAY"): case ("CURRENT DAY"): case ("TELL DAY"): case ("SAY DAY"): case ("SHOW DATE"): case ("DATE"): case ("CURRENT DATE"): case ("TELL DATE"): case ("SAY DATE"): currentDate(); break; case ("HELLO"): case ("HEY JARVIS"): case ("HEY"): case ("SUP"): case ("GOOD MORNING"): case ("GOOD AFTERNOON"): case ("GOOD EVENING"): helloResponse(); break; case ("PLAY"): case ("PLAY ITUNES"): case ("PLAY SONG"): app = new iTunesApp(); app.Play(); break; case ("PAUSE"): case ("PAUSE ITUNES"): case ("PAUSE SONG"): app = new iTunesApp(); app.Pause(); break; case ("NEXT"): case ("NEXT SONG"): app = new iTunesApp(); app.NextTrack(); app.Play(); break; case ("PREVIOUS"): case ("PREVIOUS SONG"): case ("LAST SONG"): app = new iTunesApp(); app.PreviousTrack(); app.Play(); break; case ("SHUFFLE"): case ("SHUFFLE ITUNES"): app = new iTunesApp(); app.CurrentPlaylist.Shuffle = true; app.Play(); break; case ("TURN DOWN VOLUME"): case ("TURN DOWN ITUNES"): case ("TURN DOWN SONG VOLUME"): case ("TURN DOWN THE VOLUME"): case ("TURN DOWN THE SONG VOLUME"): case ("TURN DOWN"): case ("VOLUME DOWN"): turnDownItunes(); break; case ("TURN UP VOLUME"): case ("TURN UP ITUNES"): case ("TURN UP SONG VOLUME"): case ("TURN UP THE VOLUME"): case ("TURN UP THE SONG VOLUME"): case ("TURN UP"): case ("VOLUME UP"): turnUpItunes(); break; case ("LEAGUE OF LEGENDS"): case ("LOL"): case ("LEAGUE"): Process.Start(@"C:\Riot Games\League of Legends\lol.launcher.exe"); break; case ("LOLESPORTS"): case ("LOL ESPORTS"): case ("WATCH LEAGUE"): Process.Start("http://euw.lolesports.com/"); Thread loadLeague = new Thread(new ThreadStart(() => speak.loading())); loadLeague.IsBackground = true; loadLeague.Start(); break; case ("JARVIS QUIET"): case ("JARVIS SH"): case ("JARVIS VOLUME DOWN"): jarvisVolume(true); break; case ("JARVIS LOUD"): case ("I CANT HEAR YOU"): case ("I CANT HEAR YOU JARVIS"): case ("JARVIS VOLUME UP"): jarvisVolume(false); break; case ("JARVIS MUTE"): case ("MUTE"): jarvisMute(true); break; case ("JARVIS SPEAK"): case ("UNDO MUTE"): jarvisMute(false); break; case ("STOP LISTENING"): stopListening(); break; case ("EXIT CHROME"): case ("CLOSE CHROME"): exitChromeWindows(); break; case ("OPEN CHROME"): openChromeWindow(); break; case ("ALL PROCESSES"): case ("SHOW PROCESSES"): showProcesses(); break; case ("CLOSE MAIL"): case ("EXIT MAIL"): case ("CLOSE OUTLOOK"): case ("EXIT OUTLOOK"): closeEmail(); break; case ("CLOSE ITUNES"): case ("EXIT ITUNES"): endProcess("itunes"); break; case ("MOVIES"): loadMovies(); break; case ("MINIMIZE"): case ("JARVIS SMALL"): minimize(); break; case ("JARVIS COME BACK"): case ("JARVIS NORMAL"): case ("NORMAL"): normalSize(); break; case ("QUIT"): case ("Q"): case ("STOP"): case ("END"): endProgram(this); break; default: noCommand(); break; } }