Exemple #1
0
MtOutputLine* mt_output_line_new()
{
  MtOutputLine* line = mt_alloc_object(MtOutputLine);
  assert(line != NULL);

  line->length = 0;
  
  // Initialize all string arrays to be '\0'
  int string;
  for (string = 0; string < mt_conf.strings; ++string)
    memset(line->content[string], '\0', mt_conf.max_line_length);

  return line;
}
Exemple #2
0
MtNote* mt_note_new_muted(int string)
{
  MtNote* note = mt_alloc_object(MtNote);
  assert(note != NULL);

  note->type = MT_NOTE_MUTE;

  // String number error checking
  if ((string > MT_CONF.strings) || (string == 0))
    mt_error_emit(INVALID_STRING, string);

  note->string = string - 1;

  note->size = 1;

  return note;
}
Exemple #3
0
MtNote* mt_note_new_without_fret(int string)
{
  MtNote* note = mt_alloc_object(MtNote);
  assert(note != NULL);
  assert(string > 0);

  note->type = MT_NOTE_NONE;

  // String number error checking
  if ((string > MT_CONF.strings) || (string == 0))
    mt_error_emit(INVALID_STRING, string);

  note->string = string - 1;
  note->modifier = MT_MODIFIER_NONE;

  // This is a partial note, size is currently 0
  note->size = 0;

  return note;
}
Exemple #4
0
MtNote* mt_note_new(int string, int fret)
{
  MtNote* note = mt_alloc_object(MtNote);
  assert(note != NULL);
  assert(string > 0);
  assert(fret >= 0);

  note->type = MT_NOTE_NOTE;
  
  // String number error checking
  if ((string > MT_CONF.strings) || (string == 0))
    mt_error_emit(INVALID_STRING, string);

  note->string = string - 1;
  note->fret = fret;
  note->modifier = MT_MODIFIER_NONE;

  // Calculate the size (width) of the printed note
  note->size = digits(fret);

  return note;
}