private bool HandleNotificationIconMouseWheel(bool upOrDown) { switch (TrayIcon?.GUID.ToString()) { case NotificationArea.VOLUME_GUID: VolumeChanger.ChangeVolume(WindowHelper.FindWindowsTray(IntPtr.Zero), upOrDown); return(true); default: return(false); } }
private void Awake() { if (instance != null) { VolumeChanger.SetOldVol(instance.volRecord); } if (instance != null && instance != this) { Destroy(this.gameObject); return; } else { instance = this; } DontDestroyOnLoad(this.gameObject); }
/// <summary> /// 매 tick마다 호출되어 playingScores에 들어있는 악보들을 재생해주는 helper 메서드입니다. /// </summary> /// <param name="syn">신디사이저</param> /// <param name="velocityChange">연주 세기를 변화시키기 위해 음 세기에 곱해질 값</param> public static void PlayPerTick(Synth syn, VolumeChanger velocityChanger) { void playingScoresPlay(object[] args) { Dictionary <string, List <ScoreWithPosition> > playingScores_ = args[0] as Dictionary <string, List <ScoreWithPosition> >; Synth syn_ = args[1] as Synth; VolumeChanger velocityChanger_ = args[2] as VolumeChanger; foreach (KeyValuePair <string, List <ScoreWithPosition> > pair in playingScores_) { List <ScoreWithPosition> deadScores = new List <ScoreWithPosition>(); foreach (ScoreWithPosition p in pair.Value) { long measure = p.position / 64; int position = (int)(p.position % 64); //Console.WriteLine("Current position: " + p.position); //p.score.Print(); p.score.PlayEnumerable(syn, measure, position, -1, velocityChanger_(pair.Key) * p.velocityChange); if (p.position + 1 <= p.score.length) { p.position++; } else { deadScores.Add(p); //Console.WriteLine("End of score - length: " + p.score.length); } //Console.WriteLine(); } pair.Value.RemoveAll(x => deadScores.Contains(x)); //Console.WriteLine(pair.Key + " group: " + pair.Value.Count + " / " + playingScores[pair.Key].Count); } //Console.WriteLine("\n"); } Util.TaskQueue.Add("playingScores", playingScoresPlay, playingScores, syn, velocityChanger); }
/// <summary> /// Handles RPCs to adjust system volume /// </summary> private void HandleVolumeRPC() { VolumeChanger volumeChanger = new VolumeChanger(); switch (GetNextLine()) { case "Mute": volumeChanger.Mute(); break; case "VolumeDown": volumeChanger.VolumeDown(); break; case "VolumeUp": volumeChanger.VolomeUp(); break; default: Response = $"Method could not be found"; break; } }
void Update() { volRecord = VolumeChanger.GetOldVol(); }
// Use this for initialization void Start() { singleKey = GameObject.Find("SingleKey").GetComponent <VolumeChanger>(); sizeScale = singleKey.volumeForce; }
private void Awake() { _volumeChanger = GetComponent <VolumeChanger>(); }