Skip to content

Commit

Permalink
Merge branch 'develop' into feature/bar_spacing
Browse files Browse the repository at this point in the history
* develop:
  Resolve conflict.
  Fix gregorio-project#905: Add linebreaks to gabc output.
  Update CHANGELOG for fixing gregorio-project#905.
  Fix gregorio-project#905: Add linebreaks to gabc output.
  • Loading branch information
rpspringuel committed Feb 14, 2016
2 parents 9759dea + 5686d3e commit 8e56e7c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ As of v3.0.0 this project adheres to [Semantic Versioning](http://semver.org/).
- Adjustments to the heuristic for ledger lines to include adjacent notes (see [#862](https://github.com/gregorio-project/gregorio/issues/862)).
- The stem length determination will use the ledger line below the note with the stem (see [#863](https://github.com/gregorio-project/gregorio/issues/863)).
- Made the oriscus orientation dependent on the note that follows. Using `1` will force the ascending oriscus and `0` will force the descending oriscus. The old behavior may be restored by setting the `oriscus-orientation` gabc header to `legacy`. See UPGRADE.md for details (for the change request, see [#774](https://github.com/gregorio-project/gregorio/issues/774) and [#898](https://github.com/gregorio-project/gregorio/issues/898)).
- Add new lines as needed to the gabc output. (see [#905](https://github.com/gregorio-project/gregorio/issues/905)).

### Added
- Controls for tuning horizontal episema vertical position. See GregorioRef for details (for the change request, see [#872](https://github.com/gregorio-project/gregorio/issues/872)).
Expand Down
26 changes: 19 additions & 7 deletions src/gabc/gabc-write.c
Original file line number Diff line number Diff line change
Expand Up @@ -980,9 +980,10 @@ static void gabc_write_gregorio_element(FILE *f, gregorio_element *element,
*
*/

static void gabc_write_gregorio_elements(FILE *f, gregorio_element *element,
static bool gabc_write_gregorio_elements(FILE *f, gregorio_element *element,
glyph_context *context)
{
bool linebreak_or_bar_in_element = false;
while (element) {
context->element = element;
gabc_write_gregorio_element(f, element, context);
Expand All @@ -993,8 +994,13 @@ static void gabc_write_gregorio_elements(FILE *f, gregorio_element *element,
&& element->next && element->next->type == GRE_ELEMENT) {
fprintf(f, "/");
}
if (element->type == GRE_END_OF_LINE || element->type == GRE_BAR)
{
linebreak_or_bar_in_element = true;
}
element = element->next;
}
return linebreak_or_bar_in_element;
}

/*
Expand All @@ -1006,6 +1012,7 @@ static void gabc_write_gregorio_elements(FILE *f, gregorio_element *element,
static void gabc_write_gregorio_syllable(FILE *f, gregorio_syllable *syllable,
glyph_context *context)
{
bool linebreak_or_bar_in_element;
gregorio_assert(syllable, gabc_write_gregorio_syllable,
"call with NULL argument", return);
if (syllable->no_linebreak_area == NLBA_BEGINNING) {
Expand Down Expand Up @@ -1038,14 +1045,19 @@ static void gabc_write_gregorio_syllable(FILE *f, gregorio_syllable *syllable,
}
fprintf(f, "(");
/* we write all the elements of the syllable. */
gabc_write_gregorio_elements(f, syllable->elements[0], context);
if (syllable->position == WORD_END
|| syllable->position == WORD_ONE_SYLLABLE
|| gregorio_is_only_special(syllable->elements[0]))
linebreak_or_bar_in_element = gabc_write_gregorio_elements(f, syllable->elements[0], context);
if (linebreak_or_bar_in_element)
{
fprintf(f, ") ");
fprintf(f, ")\n");
} else {
fprintf(f, ")");
if (syllable->position == WORD_END
|| syllable->position == WORD_ONE_SYLLABLE
|| gregorio_is_only_special(syllable->elements[0]))
{
fprintf(f, ") ");
} else {
fprintf(f, ")");
}
}
}

Expand Down

0 comments on commit 8e56e7c

Please sign in to comment.