/// <summary>
 /// Handles note off events.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The <see cref="NoteEventArgs"/> instance containing the event data.</param>
 private void NoteOffHandler(object sender, NoteEventArgs e)
 {
     if (e.Pitch != null)
     {
         _midiOutAdapter.SendNoteOff(e.Pitch.Value, Get7bitMidiRange(e.Velocity));
     }
 }
示例#2
0
        void notebook_NoteAdded(object sender, NoteEventArgs e)
        {
            if (AllNoteControls.Any(c => c.Note == e.Note))
            {
                return;
            }
            var ctrlNote = new ucNote()
            {
                Note     = e.Note,
                WordWrap = WordWrap
            };

            foreach (var otherCtrlNote in AllNoteControls)
            {
                if (otherCtrlNote.Note.CreatedDate > ctrlNote.Note.CreatedDate)
                {
                    pnlNotes.Children.Insert(pnlNotes.Children.IndexOf(otherCtrlNote), ctrlNote);
                    break;
                }
            }
            if (!pnlNotes.Children.Contains(ctrlNote))
            {
                pnlNotes.Children.Add(ctrlNote);
            }
            //pnlNotes.UpdateLayout();
            scrollNotes.UpdateLayout();
            scrollNotes.ScrollToVerticalOffset(ctrlNote.TranslatePoint(new Point(0, 0), pnlNotes).Y);
        }
示例#3
0
        void notebook_NoteRemoved(object sender, NoteEventArgs e)
        {
            var ctrlNote = pnlNotes.Children.OfType <ucNote>().FirstOrDefault(c => c.Note == e.Note);

            if (ctrlNote != null)
            {
                pnlNotes.Children.Remove(ctrlNote);
            }
        }
示例#4
0
        /// <summary>
        /// Add note to current track
        /// </summary>
        private ToDoNote OnAddedNote(object sender, NoteEventArgs e)
        {
            var note = e.Note;

            note.SampleRef = _currentSample;
            DataBaseContext.Notes.InsertOnSubmit(note);
            DataBaseContext.SubmitChanges();
            CurrentSample.Notes.Add(note);
            return(note);
        }
示例#5
0
        /// <summary>
        /// Add note to current track
        /// </summary>
        private ToDoNote OnDeletedNote(object sender, NoteEventArgs e)
        {
            var note = e.Note;

            CurrentSample.Notes.Remove(note);
            DataBaseContext.Notes.DeleteOnSubmit(note);
            DataBaseContext.SubmitChanges();
            //// Restore references
            _currentSample.TrackRef = DataBaseContext.Tracks.First(x => x.Id == _currentSample.TrackId);
            return(null);
        }
        /// <summary>
        /// Handles the Click event of the NoteEditor control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        protected void note_SaveButtonClick(object sender, NoteEventArgs e)
        {
            _noteId = e.NoteId;
            LaunchWorkflow();

            if (GetAttributeValue("StartNewSearch").AsBoolean())
            {
                Response.Redirect(Request.Path);
            }
            else
            {
                ShowPersonInfo();
                ShowNotes();
            }
        }
示例#7
0
 protected void OnNoteModified(NoteEventArgs e)
 {
     try
     {
         if (this.NoteModified == null)
         {
             return;
         }
         this.NoteModified((object)this, e);
     }
     catch (Exception ex)
     {
         LabyrinthData.Log((object)ex);
     }
 }
 void OnDestroyedNote(object sender, NoteEventArgs e)
 {
     if (e.WasHit)
     {
         multiplier            += 0.1f;
         score                 += Mathf.FloorToInt(multiplier * 100);
         scoreDisplay.text      = score.ToString();
         multiplierDisplay.text = multiplier.ToString();
     }
     else
     {
         multiplier             = 1f;
         scoreDisplay.text      = score.ToString();
         multiplierDisplay.text = multiplier.ToString();
     }
     spawnedNotes.Remove(e.Sender);
     Destroy(e.Sender);
 }
 private void OnNoteParsed(object sender, NoteEventArgs e)
 {
     noteWindow.AddNote(e.Note);
     if (e.Note.IsFirstNote)
     {
         if (handlePolyphony)
         {
             handlePolyphony = false;
         }
     }
     else
     {
         handlePolyphony = !e.Note.IsHarmonicNote;
     }
     if (noteWindow.SecondPreviousNote != null)
     {
         Save(false);
     }
 }
 /// <summary>
 /// Handles the SaveButtonClick event of the noteEditor control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="NoteEventArgs"/> instance containing the event data.</param>
 private void noteEditor_SaveButtonClick(object sender, NoteEventArgs e)
 {
     noteEditor.Visible      = false;
     noteEditor.ShowEditMode = false;
 }
示例#11
0
 public void OnNotePressed(object sender, NoteEventArgs e)
 {
     Print($"Note pressed: value = {e.Note.Value}  onVelocity = {e.Note.OnVelocity}");
 }
示例#12
0
 void OnNotePickup(object sender, NoteEventArgs args)
 {
     NoteUI.gameObject.SetActive(true);
 }
示例#13
0
 /// <summary>
 /// Raises the NoteOffEvent.
 /// </summary>
 /// <param name="eventArgs">The <see cref="NoteEventArgs"/> instance containing the event data.</param>
 protected virtual void OnNoteOffEvent(NoteEventArgs eventArgs)
 {
     NoteOff(this, eventArgs);
     PlayingPitch = null;
 }
示例#14
0
 /// <summary>
 /// Raises the NoteOnEvent.
 /// </summary>
 /// <param name="eventArgs">The <see cref="NoteEventArgs"/> instance containing the event data.</param>
 protected virtual void OnNoteOnEvent(NoteEventArgs eventArgs)
 {
     NoteOn(this, eventArgs);
     PlayingPitch = eventArgs.Pitch;
 }
 public void OnNotePickup(object sender, NoteEventArgs args)
 {
     text.GetComponent <Text>().text = args.description;
 }
示例#16
0
 public void OnDestroyObject(NoteEventArgs args)
 {
     NoteDestoyed?.Invoke(this, args);
 }
示例#17
0
 public void OnNoteReleased(object sender, NoteEventArgs e)
 {
     Print($"Note released: value = {e.Note.Value}  offVelocity = {e.Note.OffVelocity}");
 }
示例#18
0
 public void OnNoteParsed(object sender, NoteEventArgs e)
 {
     Print($"Note parsed: value = {e.Note.Value}  duration = {e.Note.Duration}  onVelocity = {e.Note.OnVelocity}  offVelocity = {e.Note.OffVelocity}");
 }
示例#19
0
 public void NotePressedFromUI(NoteEventArgs noteEventArgs)
 {
     OnNoteOn?.Invoke(this, noteEventArgs);
 }
示例#20
0
 public void NoteReleasedFromUI(NoteEventArgs noteEventArgs)
 {
     OnNoteOff?.Invoke(this, noteEventArgs);
 }
 private void NoteChangedHandler(object sender, NoteEventArgs e)
 {
     OnTimetableDocumentChanged();
 }
示例#22
0
 private void NoteOn(NoteEventArgs noteEventArgs)
 {
     _pressedNotes.Add(noteEventArgs.NoteAbsolute);
     OnNoteOn?.Invoke(this, noteEventArgs);
 }
示例#23
0
 private void NoteOff(NoteEventArgs noteEventArgs)
 {
     _pressedNotes.Remove(noteEventArgs.NoteAbsolute);
     OnNoteOff?.Invoke(this, noteEventArgs);
 }