Ejemplo n.º 1
0
        public static D_Note noteFromToken(String token, int current_scope_octave, D_Note previous_note)
        {
            NoteLevel noteLevel            = noteLevelDictionary[token[0]];
            int       length_in_sixteenths = 16 / StringUtil.getNumberFromString(token);

            if (token.Contains('.'))
            {
                length_in_sixteenths = (int)((double)length_in_sixteenths * 1.5);
            }

            if (noteLevel == NoteLevel.rest)
            {
                return(D_NoteFactory.create_rest(length_in_sixteenths));
            }
            else
            {
                NoteAlteration alteration = getNoteNoteAlteration(token);

                int octave = getNoteOctave(token, current_scope_octave);

                D_Note new_note = D_NoteFactory.create_note(noteLevel, alteration, octave, length_in_sixteenths);
                if (previous_note != null)
                {
                    setRelativeOctave(new_note, previous_note);
                }
                return(new_note);
            }
        }
Ejemplo n.º 2
0
 public static D_Note create_note(NoteLevel level, NoteAlteration alteration, int octave, int beats)
 {
     return(new D_Note(
                level,
                beats,
                octave,
                alteration,
                false
                ));
 }
Ejemplo n.º 3
0
 public D_Note(NoteLevel level, int length, NoteTie note_tie = NoteTie.none, int octave = 1,
               NoteAlteration alteration = NoteAlteration.none, bool is_rest            = false)
 {
     this.level           = level;
     this.length          = length;
     this.octave          = octave;
     this.alteration      = alteration;
     this.is_rest         = is_rest;
     this.length_modifier = has_length_modifier(length);
     this.note_tie        = note_tie;
 }
 public List<PatientNote> GetViewNotes(Guid patientId, string keyword, NoteLevel? level)
 {
     var notes =
         Repository.Query<PatientNote>()
             .Where(x => x.Patient.Id == patientId && (string.IsNullOrEmpty(keyword) ||
                                                       x.CreatedBy.Name.Contains(keyword) ||
                                                       x.Detail.Contains(keyword)
                 ));
     if (level.HasValue)
     {
         notes = notes.Where(x => x.Level == level.Value);
     }
     return notes.ToList();
 }
Ejemplo n.º 5
0
 static String getNoteLevel(NoteLevel level)
 {
     return(note_levels[level]);
 }
 public JsonResult GetViewNotes(Guid patientId, string keyword, NoteLevel? level)
 {
     var model = _patientService.GetViewNotes(patientId, keyword, level).Select(ToJsonModel);
     return Json(model, JsonRequestBehavior.AllowGet);
 }