public void PopulateLocalProcesses(List <MultiboxProcess> processes) { PerformerLayout.Controls.Clear(); List <BmpLocalPerformer> performers = new List <BmpLocalPerformer>(); int track = 0; foreach (MultiboxProcess mp in processes) { BmpLocalPerformer perf = new BmpLocalPerformer(mp); perf.onUpdate += delegate(object o, EventArgs e) { this.Invoke(t => t.UpdatePerformer(perf)); }; if (mp.hostProcess == true) { perf.hostProcess = true; performers.Insert(0, perf); } else { performers.Add(perf); } track++; } for (int i = 0; i < performers.Count; i++) { BmpLocalPerformer perf = performers[i]; perf.TrackNum = i; PerformerLayout.Controls.Add(perf); } BmpLocalOrchestra_Resize(this, EventArgs.Empty); }
public void PopulateLocalProcesses(List <MultiboxProcess> processes) { PerformerPanel.Controls.Clear(); List <BmpLocalPerformer> performers = new List <BmpLocalPerformer>(); int track = 0; foreach (MultiboxProcess mp in processes) { BmpLocalPerformer perf = new BmpLocalPerformer(mp); perf.Dock = DockStyle.Top; if (mp.hostProcess == true) { perf.hostProcess = true; performers.Insert(0, perf); } else { performers.Add(perf); } track++; } for (int i = 0; i < performers.Count; i++) { BmpLocalPerformer perf = performers[i]; perf.TrackNum = i + 1; PerformerPanel.Controls.Add(perf); } }
private void muteAll_Click(object sender, EventArgs e) { foreach (Control ctl in PerformerLayout.Controls) { BmpLocalPerformer performer = (ctl as BmpLocalPerformer); if (performer != null && performer.PerformerEnabled) { performer.ToggleMute(); } } }
private void closeInstruments_Click(object sender, EventArgs e) { foreach (Control ctl in PerformerLayout.Controls) { BmpLocalPerformer performer = (ctl as BmpLocalPerformer); if (performer != null && performer.PerformerEnabled) { performer.CloseInstrument(); } } }
public void PerformersInvoke(Action <BmpLocalPerformer> action) { foreach (Control ctl in PerformerPanel.Controls) { BmpLocalPerformer performer = (ctl as BmpLocalPerformer); if (performer != null) { action.Invoke(performer); } } }
public void PerformerStop() { foreach (Control ctl in PerformerPanel.Controls) { BmpLocalPerformer performer = (ctl as BmpLocalPerformer); if (performer != null) { performer.Stop(); } } }
public void PerformerProgress(int prog) { foreach (Control ctl in PerformerPanel.Controls) { BmpLocalPerformer performer = (ctl as BmpLocalPerformer); if (performer != null) { performer.SetProgress(prog); } } }
public void PerformerPlay(bool play) { foreach (Control ctl in PerformerPanel.Controls) { BmpLocalPerformer performer = (ctl as BmpLocalPerformer); if (performer != null) { performer.Play(play); } } }
private void testC_Click(object sender, EventArgs e) { foreach (Control ctl in PerformerLayout.Controls) { BmpLocalPerformer performer = (ctl as BmpLocalPerformer); if (performer != null && performer.PerformerEnabled) { performer.NoteKey("C"); } } }
public void UpdatePerformer(BmpLocalPerformer performer) { if (sequencerRef == null) { return; } if (performer != null) { performer.Update(sequencerRef); } }
public BmpLocalPerformer FindPerformer(string name) { foreach (Control ctl in PerformerLayout.Controls) { BmpLocalPerformer performer = (ctl as BmpLocalPerformer); if (performer != null && performer.PerformerName == name) { return(performer); } } return(null); }
private void testC_Click(object sender, EventArgs e) { //StartSyncWorker(); foreach (Control ctl in PerformerPanel.Controls) { BmpLocalPerformer performer = (ctl as BmpLocalPerformer); if (performer != null && performer.PerformerEnabled) { performer.NoteKey("C"); } } }
public void UpdatePerformers() { if (sequencerRef == null) { return; } foreach (Control ctl in PerformerLayout.Controls) { BmpLocalPerformer performer = (ctl as BmpLocalPerformer); if (performer != null) { this.UpdatePerformer(performer); } } }
public void UpdatePerformers(BmpSequencer seq) { if (seq == null) { return; } foreach (Control ctl in PerformerPanel.Controls) { BmpLocalPerformer performer = (ctl as BmpLocalPerformer); if (performer != null) { performer.Sequencer = seq; } } }
public void ProcessOnNote(NoteEvent note) { foreach (Control ctl in PerformerLayout.Controls) { BmpLocalPerformer performer = (ctl as BmpLocalPerformer); if (performer != null && performer.UiEnabled && performer.PerformerEnabled) { if (note.trackNum == performer.TrackNum) { int po = SequencerReference.GetTrackPreferredOctaveShift(note.track); note.note = NoteHelper.ApplyOctaveShift(note.origNote, performer.OctaveNum + po); performer.ProcessOnNote(note); } } } }
private void ensembleCheck_Click(object sender, EventArgs e) { Timer openTimer = new Timer { Interval = 500 }; openTimer.Elapsed += delegate(object o, ElapsedEventArgs ev) { openTimer.Stop(); openTimer = null; foreach (Control ctl in PerformerLayout.Controls) { BmpLocalPerformer performer = (ctl as BmpLocalPerformer); if (performer != null && performer.PerformerEnabled && !performer.hostProcess) { performer.EnsembleAccept(); } } }; openTimer.Start(); }
public void UpdateMemory() { if (Sharlayan.MemoryHandler.Instance.IsAttached) { if (Sharlayan.Reader.CanGetActors() && Sharlayan.Reader.CanGetPerformance()) { List <string> performerNames = GetPerformerNames(); int pid = -1; PerformanceResult perfs = Sharlayan.Reader.GetPerformance(); ActorResult ares = Sharlayan.Reader.GetActors(); if (ares != null) { foreach (ActorItem actor in ares.CurrentPCs.Values.ToList()) { if (performerNames.Contains(actor.Name)) { uint perfId = actor.PerformanceID / 2; if (perfId >= 0 && perfId < 99 && perfs.Performances.ContainsKey(perfId)) { PerformanceItem item = perfs.Performances[perfId]; BmpLocalPerformer perf = this.FindPerformer(actor.Name); if (perf != null) { perf.PerformanceUp = item.IsReady(); perf.performanceId = perfId; perf.actorId = actor.ID; } } } } } } } }
private void StartSyncWorker() { BackgroundWorker syncWorker = new BackgroundWorker(); syncWorker.WorkerSupportsCancellation = true; syncWorker.DoWork += SyncWorker_DoWork; syncWorker.RunWorkerCompleted += SyncWorker_RunWorkerCompleted; this.UpdateMemory(); List <uint> actorIds = new List <uint>(); foreach (Control ctl in PerformerPanel.Controls) { BmpLocalPerformer performer = (ctl as BmpLocalPerformer); if (performer != null && performer.PerformerEnabled && performer.PerformanceUp) { actorIds.Add(performer.actorId); } } syncWorker.RunWorkerAsync(actorIds); onMemoryCheck.Invoke(this, true); }