#include <SegmentRetrospective.h>
Digest segments of the previous main program
NextMain/NextMacro-type: Retrospective of the previous main choice, primary choices only REF https://github.com/xjmusic/xjmusic/issues/242
Continue-type: Retrospective of all segments in this main program REF https://github.com/xjmusic/xjmusic/issues/242
◆ ~SegmentRetrospective()
virtual XJ::SegmentRetrospective::~SegmentRetrospective |
( |
| ) |
|
|
virtualdefault |
◆ SegmentRetrospective()
SegmentRetrospective::SegmentRetrospective |
( |
SegmentEntityStore * |
entityStore, |
|
|
int |
segmentId, |
|
|
bool |
autoload = true |
|
) |
| |
|
explicit |
Constructor from entity store and segment id Compute the retrospective
NOTE: the segment retrospective is empty for segments of type Initial, NextMain, and NextMacro– Only Continue-type segments have a retrospective
Begin by getting the previous segment Only can build retrospective if there is at least one previous segment The previous segment is the first one cached here. We may cache even further back segments below if found
- Parameters
-
entityStore | for retrospective |
segmentId | from which to create retrospective |
autoload | whether to autoload the retrospective |
- Exceptions
-
◆ getArrangement()
Get the arrangement for the given pick
- Parameters
-
pick | for which to get arrangement |
- Returns
- arrangement @ on failure to retrieve
◆ getChoice()
Get the choice for the given arrangement
- Parameters
-
arrangement | for which to get choice |
- Returns
- choice @ on failure to retrieve
◆ getChoices()
std::set< const SegmentChoice * > SegmentRetrospective::getChoices |
( |
| ) |
const |
|
virtual |
◆ getInstrumentType()
Get the instrument type for a given pick
- Parameters
-
pick | for which to get instrument type |
- Returns
- instrument type of pick
◆ getPicks()
Get the picks of any previous segments which selected the same main sequence
Artist writing detail program expects 'X' note value to result in random part creation from available Voicings https://github.com/xjmusic/xjmusic/issues/251
- Returns
- map of all previous segment meme constellations (as keys) to a collection of choices made
◆ getPreviousArrangementsForInstrument()
Get the previous arrangements for the given instrument id
- Parameters
-
instrumentId | for which to get arrangements |
- Returns
- segment choice arrangements
◆ getPreviousChoiceOfType() [1/3]
Get the choice of a given type
- Parameters
-
segment | for which to get choice |
programType | of choice to get |
- Returns
- choice of given type
◆ getPreviousChoiceOfType() [2/3]
Get the previous-segment choices of a given instrument type
- Parameters
-
instrumentType | for which to get previous-segment choices |
- Returns
- choices
◆ getPreviousChoiceOfType() [3/3]
Get the previous-segment choice of a given type
- Parameters
-
programType | of choice to get |
- Returns
- choice of given type
◆ getPreviousChoicesForInstrument()
std::set< const SegmentChoice * > SegmentRetrospective::getPreviousChoicesForInstrument |
( |
const UUID & |
instrumentId | ) |
const |
|
virtual |
Get the previous segment choices for the given instrument (although there should only be one previous segment choice for each instrument)
- Parameters
-
instrumentId | for which to get choice |
- Returns
- previous segment choice
◆ getPreviousChoicesOfMode()
Get the previous-segment choices of a given instrument mode
- Parameters
-
instrumentMode | for which to get previous-segment choices |
- Returns
- choices
◆ getPreviousChoicesOfTypeMode()
Get the previous-segment choices of a given instrument type and mode
- Parameters
-
instrumentType | for which to get previous-segment choices |
instrumentMode | for which to get previous-segment choices |
- Returns
- choices
◆ getPreviousMeta()
std::optional< const SegmentMeta * > SegmentRetrospective::getPreviousMeta |
( |
const std::string & |
key | ) |
const |
|
virtual |
◆ getPreviousPicksForInstrument()
Get the previous picks for the given instrument id
- Parameters
-
instrumentId | for which to get picks |
- Returns
- segment choice picks
◆ getPreviousSegment()
std::optional< const Segment * > SegmentRetrospective::getPreviousSegment |
( |
| ) |
const |
|
virtual |
Get the segment immediately previous to the current segment
- Returns
- previous segment
◆ getSegmentChords()
std::vector< const SegmentChord * > SegmentRetrospective::getSegmentChords |
( |
int |
segmentId | ) |
const |
|
virtual |
Get all segment chords for the given segment id, ordered by position
- Parameters
-
segmentId | for which to get chords |
- Returns
- chords
◆ getSegments()
std::vector< const Segment * > SegmentRetrospective::getSegments |
( |
| ) |
const |
|
virtual |
- Returns
- all cached segments, ordered by id
Always starts with the segment at current offset minus one, includes that segment and all others with the same main program, which covers both whether this retrospective is looking back on the current main program (Continue segment), or the previous one (NextMain/NextMacro segments)
The documentation for this class was generated from the following files: