|
Canorus 0.0
|
creation, removal, configuration of music elements More...
#include <muselementfactory.h>
creation, removal, configuration of music elements
Copyright (c) 2006, Reinhard Katzmann, Canorus development team 2007, Matevž Jekovec, Canorus development team
All Rights Reserved. See AUTHORS for a complete list of authors.
Licensed under the GNU GENERAL PUBLIC LICENSE. See COPYING for details.
This class is used when creating a new music element, settings its values, but not having it placed inside the score (eg. music element still in the GUI, but user didn't clicked on the score to place it yet).
The factory contains the methods to set properties of all the available music elements ranging from playable elements to slurs and lyrics. The actual music element is created and added to the scene when one of the configure functions are called. These functions return True, if the element was successfully created or False otherwise.
This class should be typically used in the following order: 1) User selects a music element to place. CAMusElementFactory::setMusElementType() is called. 2) GUI for music element properties is updated according to the current factory values. 3) User sets music element properties he wants (eg. number of accidentals in key signature). CAMusElementFactory::setSomeMusicElementProperty( music element property value ) is called (eg. CAMusElementFactory::setKeySigNumberOfAccs(3) for A-Major/fis-minor). 4) User places the music element. CAMusElementFactory::configureSomeMusicElement() (eg. CAMusElementFactory::configureKeySignature(currentStaff, prevElement)). 5) If the configure function returns True, the GUI is refreshed and the note is drawn.
Changing the properties of already placed elements (eg. in edit mode) is done without using the factory.
| CAMusElementFactory::CAMusElementFactory | ( | ) |
Creates an empty, defeault music elements factory.
References _crescendoFinalVolume, _crescendoType, _diatonicKeyGender, _diatonicKeyNumberOfAccs, _dynamicText, _dynamicVolume, _eBarlineType, _eClef, _eNoteStemDirection, _eRestType, _eSlurType, _fbmAccs, _fbmAccsVisible, _fbmNumber, _fermataType, _fingeringFinger, _fingeringOriginal, _fmChordArea, _fmChordAreaMinor, _fmEllipse, _fmFunction, _fmFunctionMinor, _fmTonicDegree, _fmTonicDegreeMinor, _iClefOffset, _iNoteAccs, _iNoteExtraAccs, _instrument, _iPlayableDotted, _iTimeSigBeat, _iTimeSigBeats, _musElementType, _playableLength, _repeatMarkType, _repeatMarkVoltaNumber, _slurStyle, _tempoBeat, _tempoBpm, CACrescendo::Crescendo, CAFingering::First, CAPlayableLength::Half, CADiatonicKey::Major, mpoEmpty, mpoMusElement, CARest::Normal, CAFermata::NormalFermata, NULL, CAPlayableLength::Quarter, CABarline::Single, CASlur::SlurSolid, CANote::StemPreferred, CAFunctionMark::T, CASlur::TieType, CAClef::Treble, CAFunctionMark::Undefined, CAMusElement::Undefined, and CARepeatMark::Volta.
| CAMusElementFactory::~CAMusElementFactory | ( | ) |
Destroys the music elements factory.
References mpoEmpty, and removeMusElem().

|
inline |
References _iNoteAccs.
Referenced by CAMainWin::scoreViewKeyPress().

|
inline |
References _iNoteExtraAccs.
Referenced by CAMainWin::scoreViewKeyPress().

| void CAMusElementFactory::addPlayableDotted | ( | int | add, |
| CAPlayableLength | curLength | ||
| ) |
References _playableLength, CAPlayableLength::dotted(), CAPlayableLength::Eighth, CAPlayableLength::musicLength(), CAPlayableLength::setDotted(), CAPlayableLength::Sixteenth, CAPlayableLength::SixtyFourth, and CAPlayableLength::ThirtySecond.
Referenced by CAMainWin::scoreViewKeyPress().


|
inline |
References _articulationType.
Referenced by configureMark().

|
inline |
References _eBarlineType.
|
inline |
References _eClef.
|
inline |
References _iClefOffset.
|
inline |
| bool CAMusElementFactory::configureBarline | ( | CAStaff * | staff, |
| CAMusElement * | right | ||
| ) |
Configures a new barline with context and right before the right element.
References _eBarlineType, mpoMusElement, removeMusElem(), and CAStaff::voiceList().
Referenced by CAMainWin::insertMusElementAt().


| bool CAMusElementFactory::configureClef | ( | CAStaff * | staff, |
| CAMusElement * | right | ||
| ) |
Configures a new clef music element in context and right before the right element.
References _eClef, _iClefOffset, mpoMusElement, removeMusElem(), and CAStaff::voiceList().
Referenced by CAMainWin::insertMusElementAt().


| bool CAMusElementFactory::configureFiguredBassNumber | ( | CAFiguredBassMark * | fbm | ) |
Configures a new figured bass mark with timeStart and timeLength in context fbc.
References _fbmAccs, _fbmAccsVisible, _fbmNumber, CAFiguredBassMark::addNumber(), and mpoMusElement.
Referenced by CAMainWin::insertMusElementAt().


| bool CAMusElementFactory::configureFunctionMark | ( | CAFunctionMarkContext * | fmc, |
| int | timeStart, | ||
| int | timeLength | ||
| ) |
Configures a new function mark with timeStart and timeLength in context fmc.
References _diatonicKeyGender, _diatonicKeyNumberOfAccs, CAFunctionMarkContext::addFunctionMark(), CADiatonicKey::diatonicKeyToString(), fmChordArea(), fmFunction(), fmTonicDegree(), isFMChordAreaMinor(), isFMEllipse(), isFMFunctionMinor(), isFMTonicDegreeMinor(), and mpoMusElement.
Referenced by CAMainWin::insertMusElementAt().


| bool CAMusElementFactory::configureKeySignature | ( | CAStaff * | staff, |
| CAMusElement * | right | ||
| ) |
Configures a new key signature music element with iKeySignature accidentals, context and right before the right element.
References _diatonicKeyGender, _diatonicKeyNumberOfAccs, mpoMusElement, removeMusElem(), and CAStaff::voiceList().
Referenced by CAMainWin::insertMusElementAt().


| bool CAMusElementFactory::configureMark | ( | CAMusElement * | elt | ) |
Configures the new mark and adds it to the elt.
References CAMusElement::addMark(), CAMark::Articulation, articulationType(), CAMusElement::Barline, CAMark::BookMark, CAMark::Crescendo, crescendoFinalVolume(), crescendoType(), CAMark::Dynamic, dynamicText(), dynamicVolume(), CAMark::Fermata, fermataType(), CAMark::Fingering, fingeringFinger(), instrument(), CAMark::InstrumentChange, isFingeringOriginal(), CAMusElement::isPlayable(), CAMusElement::Mark, markType(), mpoMusElement, CAMusElement::musElementType(), CAMusElement::Note, CAMark::Pedal, CAMark::RehersalMark, CAMark::RepeatMark, repeatMarkType(), repeatMarkVoltaNumber(), CAMark::Ritardando, ritardandoType(), CAMark::Tempo, tempoBeat(), tempoBpm(), CAMark::Text, CAMusElement::timeLength(), CAMark::Undefined, and CARepeatMark::Volta.
Referenced by CAMainWin::insertMusElementAt().


| void CAMusElementFactory::configureMusElem | ( | CAMusElement & | roMusElement | ) |
| bool CAMusElementFactory::configureNote | ( | int | pitch, |
| CAVoice * | voice, | ||
| CAMusElement * | right, | ||
| bool | addToChord | ||
| ) |
Configures new note music element in the voice before element right. If addToChord is true and right is note, the element is added to the note instead of inserted.
References _eNoteStemDirection, _iNoteAccs, _playableLength, CASheet::contextList(), CAContext::FiguredBassContext, CAContext::FunctionMarkContext, CAVoice::insert(), CAVoice::lastNote(), CAVoice::lyricsContextList(), mpoMusElement, playableLength(), removeMusElem(), CAContext::sheet(), CAVoice::staff(), CAMusElement::timeLength(), CAMusElement::timeStart(), and CAPlayable::tuplet().
Referenced by CAMainWin::insertMusElementAt().


| bool CAMusElementFactory::configureRest | ( | CAVoice * | voice, |
| CAMusElement * | right | ||
| ) |
Configures a new rest music element in voice voice before element right.
References _playableLength, CAVoice::insert(), CAVoice::lyricsContextList(), mpoMusElement, removeMusElem(), CALyricsContext::repositSyllables(), and restType().
Referenced by CAMainWin::insertMusElementAt(), and CAKeybdInput::midiInEventToScore().


Configures the new tie, slur or phrasing slur for the notes noteStart and noteEnd.
References mpoMusElement, CASlur::PhrasingSlurType, removeMusElem(), CANote::setPhrasingSlurEnd(), CANote::setPhrasingSlurStart(), CANote::setSlurEnd(), CANote::setSlurStart(), CASlur::setSlurStyle(), CANote::setTieEnd(), CANote::setTieStart(), CASlur::SlurPreferred, slurStyle(), slurType(), CASlur::SlurType, and CASlur::TieType.
Referenced by CAMainWin::insertMusElementAt(), and CAKeybdInput::midiInEventToScore().


| bool CAMusElementFactory::configureTimeSignature | ( | CAStaff * | staff, |
| CAMusElement * | right | ||
| ) |
Configures a new time signature music element with context and right before the right element.
References _iTimeSigBeat, _iTimeSigBeats, mpoMusElement, removeMusElem(), and CAStaff::voiceList().
Referenced by CAMainWin::insertMusElementAt().


| bool CAMusElementFactory::configureTuplet | ( | QList< CAPlayable * > | noteList | ) |
Configures a new tuplet containing the given noteList.
| CAMusElement * CAMusElementFactory::createMusElem | ( | ) |
|
inline |
References _crescendoFinalVolume.
Referenced by configureMark().

|
inline |
References _crescendoType.
Referenced by configureMark().

|
inline |
References _diatonicKeyGender.
Referenced by CAKeySignatureUI::updateKeySigToolBar().

|
inline |
References _diatonicKeyNumberOfAccs.
Referenced by CAKeySignatureUI::updateKeySigToolBar().

|
inline |
|
inline |
References _dynamicVolume.
Referenced by configureMark().

|
inline |
References mpoEmpty, and mpoMusElement.
Referenced by CAMainWin::insertMusElementAt().

|
inline |
References _fbmAccs.
|
inline |
References _fbmAccsVisible.
|
inline |
References _fbmNumber.
|
inline |
|
inline |
References _fingeringFinger.
Referenced by configureMark().

|
inline |
References _fmChordArea.
Referenced by configureFunctionMark().

|
inline |
References _fmFunction.
Referenced by configureFunctionMark().

|
inline |
References _fmTonicDegree.
Referenced by configureFunctionMark().

|
inline |
References _instrument.
Referenced by configureMark(), and setInstrument().

|
inline |
References _fingeringOriginal.
Referenced by configureMark().

|
inline |
References _fmChordAreaMinor.
Referenced by configureFunctionMark().

|
inline |
References _fmEllipse.
Referenced by configureFunctionMark().

|
inline |
References _fmFunctionMinor.
Referenced by configureFunctionMark().

|
inline |
References _fmTonicDegreeMinor.
Referenced by configureFunctionMark().

|
inline |
|
inline |
Reads the current music element and returns its pointer.
References mpoMusElement.
Referenced by CAKeybdInput::midiInEventToScore().

|
inline |
Returns the current music element type.
References _musElementType.
Referenced by CAMainWin::on_uiSlurType_toggled(), and CAMainWin::scoreViewMouseMove().

|
inline |
References _iNoteAccs.
|
inline |
References _iNoteExtraAccs.
Referenced by CAMainWin::scoreViewMouseMove().

|
inline |
References _eNoteStemDirection.
|
inline |
References _playableLength.
Referenced by configureNote(), CAKeybdInput::midiInEventToScore(), CAMainWin::scoreViewKeyPress(), and setPlayableLength().

| void CAMusElementFactory::removeMusElem | ( | bool | bReallyRemove = false | ) |
Removes the current music element. Destroys the music element, if bReallyRemove is true (default is false).
References mpoEmpty, and mpoMusElement.
Referenced by configureBarline(), configureClef(), configureKeySignature(), configureNote(), configureRest(), configureSlur(), configureTimeSignature(), and ~CAMusElementFactory().

|
inline |
References _repeatMarkType.
Referenced by configureMark().

|
inline |
References _repeatMarkVoltaNumber.
Referenced by configureMark().

|
inline |
|
inline |
References _ritardandoType.
Referenced by configureMark().

|
inline |
References _articulationType.
Referenced by CAMainWin::on_uiArticulationType_toggled().

|
inline |
References _eBarlineType.
Referenced by CAMainWin::on_uiBarlineType_toggled().

|
inline |
References _eClef.
Referenced by CAMainWin::on_uiClefType_toggled().

|
inline |
References _iClefOffset.
Referenced by CAMainWin::on_uiClefOffset_valueChanged().

|
inline |
References _crescendoFinalVolume.
|
inline |
References _crescendoType.
Referenced by CAMainWin::on_uiMarkType_toggled().

|
inline |
References _diatonicKeyGender.
Referenced by CAKeySignatureCtl::on_uiKeySig_activated().

|
inline |
References _diatonicKeyNumberOfAccs.
Referenced by CAKeySignatureCtl::on_uiKeySig_activated().

|
inline |
References _dynamicText.
Referenced by CAMainWin::on_uiDynamicCustomText_returnPressed(), and CAMainWin::on_uiDynamicText_toggled().

|
inline |
References _dynamicVolume.
Referenced by CAMainWin::on_uiDynamicVolume_valueChanged().

|
inline |
References _fbmAccs.
Referenced by CAMainWin::on_uiFBMAccs_toggled().

|
inline |
References _fbmAccsVisible.
Referenced by CAMainWin::on_uiFBMAccs_toggled().

|
inline |
References _fbmNumber.
Referenced by CAMainWin::on_uiFBMNumber_toggled().

|
inline |
References _fermataType.
Referenced by CAMainWin::on_uiFermataType_toggled().

|
inline |
References _fingeringFinger.
Referenced by CAMainWin::on_uiFinger_toggled().

|
inline |
References _fingeringOriginal.
Referenced by CAMainWin::on_uiFingeringOriginal_toggled().

|
inline |
References _fmChordArea.
Referenced by CAMainWin::on_uiFMChordArea_toggled().

|
inline |
References _fmChordAreaMinor.
Referenced by CAMainWin::on_uiFMChordArea_toggled().

|
inline |
References _fmEllipse.
Referenced by CAMainWin::on_uiFMEllipse_toggled().

|
inline |
References _fmFunction.
Referenced by CAMainWin::on_uiFMFunction_toggled().

|
inline |
References _fmFunctionMinor.
Referenced by CAMainWin::on_uiFMFunction_toggled().

|
inline |
References _fmTonicDegree.
Referenced by CAMainWin::on_uiFMTonicDegree_toggled().

|
inline |
References _fmTonicDegreeMinor.
Referenced by CAMainWin::on_uiFMTonicDegree_toggled().

|
inline |
References _instrument, and instrument().
Referenced by CAMainWin::on_uiInstrumentChange_activated().


|
inline |
References _markType.
Referenced by CAMainWin::on_uiArticulationType_toggled(), and CAMainWin::on_uiMarkType_toggled().

|
inline |
References mpoMusElement.
Referenced by CAMainWin::insertMusElementAt().

|
inline |
Sets the new current music element type eMEType, does not create a new element of this type!
References _musElementType.
Referenced by CAMainWin::on_uiArticulationType_toggled(), CAMainWin::on_uiBarlineType_toggled(), CAMainWin::on_uiClefType_toggled(), CAMainWin::on_uiContextType_toggled(), CAMainWin::on_uiInsertFBM_toggled(), CAMainWin::on_uiInsertFM_toggled(), CAKeySignatureCtl::on_uiInsertKeySig_toggled(), CAMainWin::on_uiInsertPlayable_toggled(), CAMainWin::on_uiMarkType_toggled(), CAMainWin::on_uiSlurType_toggled(), CAMainWin::on_uiTimeSigType_toggled(), CAMainWin::scoreViewMousePress(), and CAMainWin::setMode().

|
inline |
References _iNoteAccs.
Referenced by CAMainWin::scoreViewMouseMove().

|
inline |
References _iNoteExtraAccs.
Referenced by CAMainWin::insertMusElementAt().

|
inline |
References _eNoteStemDirection.
Referenced by CAMainWin::on_uiNoteStemDirection_toggled().

|
inline |
References _playableLength, and playableLength().
Referenced by CAMainWin::on_uiPlayableLength_toggled().


|
inline |
References _repeatMarkType.
Referenced by CAMainWin::on_uiRepeatMarkType_toggled().

|
inline |
References _repeatMarkVoltaNumber.
Referenced by CAMainWin::on_uiRepeatMarkType_toggled().

|
inline |
References _eRestType.
Referenced by CAMainWin::on_uiHiddenRest_toggled().

|
inline |
References _ritardandoType.
Referenced by CAMainWin::on_uiMarkType_toggled().

|
inline |
References _slurStyle.
|
inline |
References _eSlurType.
Referenced by CAMainWin::on_uiSlurType_toggled().

|
inline |
References _tempoBeat.
Referenced by CAMainWin::on_uiTempoBeat_toggled().

|
inline |
References _tempoBpm, and tempoBpm().
Referenced by CAMainWin::on_uiTempoBpm_returnPressed().


|
inline |
References _iTimeSigBeat.
Referenced by CAMainWin::on_uiTimeSigBeat_valueChanged(), and CAMainWin::on_uiTimeSigType_toggled().

|
inline |
References _iTimeSigBeats.
Referenced by CAMainWin::on_uiTimeSigBeats_valueChanged(), and CAMainWin::on_uiTimeSigType_toggled().

|
inline |
References _tupletActualNumber.
Referenced by CAMainWin::on_uiTupletActualNumber_valueChanged().

|
inline |
References _tupletNumber.
Referenced by CAMainWin::on_uiTupletNumber_valueChanged().

|
inline |
|
inline |
References _eSlurType.
Referenced by configureSlur(), and CAMainWin::insertMusElementAt().

|
inline |
References _iNoteAccs.
Referenced by CAMainWin::scoreViewKeyPress().

|
inline |
References _iNoteExtraAccs.
Referenced by CAMainWin::scoreViewKeyPress().

|
inline |
|
inline |
References _tempoBpm.
Referenced by configureMark(), and setTempoBpm().

|
inline |
References _iTimeSigBeat.
|
inline |
References _iTimeSigBeats.
|
inline |
References _tupletActualNumber.
|
inline |
References _tupletNumber.
|
private |
Referenced by articulationType(), and setArticulationType().
|
private |
Referenced by CAMusElementFactory(), crescendoFinalVolume(), and setCrescendoFinalVolume().
|
private |
Referenced by CAMusElementFactory(), crescendoType(), and setCrescendoType().
|
private |
Referenced by CAMusElementFactory(), configureFunctionMark(), configureKeySignature(), diatonicKeyGender(), and setDiatonicKeyGender().
|
private |
|
private |
Referenced by CAMusElementFactory(), dynamicText(), and setDynamicText().
|
private |
Referenced by CAMusElementFactory(), dynamicVolume(), and setDynamicVolume().
|
private |
Referenced by barlineType(), CAMusElementFactory(), configureBarline(), and setBarlineType().
|
private |
Type of the clef to be inserted.
Referenced by CAMusElementFactory(), clef(), configureClef(), and setClef().
|
private |
Referenced by CAMusElementFactory(), configureNote(), noteStemDirection(), and setNoteStemDirection().
|
private |
Referenced by CAMusElementFactory(), restType(), and setRestType().
|
private |
Referenced by CAMusElementFactory(), setSlurType(), and slurType().
|
private |
Referenced by CAMusElementFactory(), configureFiguredBassNumber(), fbmAccs(), and setFBMAccs().
|
private |
Referenced by CAMusElementFactory(), configureFiguredBassNumber(), fbmAccsVisible(), and setFBMAccsVisible().
|
private |
Referenced by CAMusElementFactory(), configureFiguredBassNumber(), fbmNumber(), and setFBMNumber().
|
private |
Referenced by CAMusElementFactory(), fermataType(), and setFermataType().
|
private |
Referenced by CAMusElementFactory(), fingeringFinger(), and setFingeringFinger().
|
private |
Referenced by CAMusElementFactory(), isFingeringOriginal(), and setFingeringOriginal().
|
private |
Referenced by CAMusElementFactory(), fmChordArea(), and setFMChordArea().
|
private |
Referenced by CAMusElementFactory(), isFMChordAreaMinor(), and setFMChordAreaMinor().
|
private |
Referenced by CAMusElementFactory(), isFMEllipse(), and setFMEllipse().
|
private |
Referenced by CAMusElementFactory(), fmFunction(), and setFMFunction().
|
private |
Referenced by CAMusElementFactory(), isFMFunctionMinor(), and setFMFunctionMinor().
|
private |
Referenced by CAMusElementFactory(), fmTonicDegree(), and setFMTonicDegree().
|
private |
Referenced by CAMusElementFactory(), isFMTonicDegreeMinor(), and setFMTonicDegreeMinor().
|
private |
Referenced by CAMusElementFactory(), clefOffset(), configureClef(), and setClefOffset().
|
private |
Note accidentals at specific coordinates updated regularily when in insert mode.
Referenced by addNoteAccs(), CAMusElementFactory(), configureNote(), noteAccs(), setNoteAccs(), and subNoteAccs().
|
private |
Extra note accidentals for new notes which user adds/removes with +/- keys.
Referenced by addNoteExtraAccs(), CAMusElementFactory(), noteExtraAccs(), setNoteExtraAccs(), and subNoteExtraAccs().
|
private |
Referenced by CAMusElementFactory(), instrument(), and setInstrument().
|
private |
Number of dots to be inserted for the note/rest.
Referenced by CAMusElementFactory().
|
private |
Time signature beat to be inserted.
Referenced by CAMusElementFactory(), configureTimeSignature(), setTimeSigBeat(), and timeSigBeat().
|
private |
Time signature number of beats to be inserted.
Referenced by CAMusElementFactory(), configureTimeSignature(), setTimeSigBeats(), and timeSigBeats().
|
private |
Referenced by markType(), and setMarkType().
|
private |
Referenced by CAMusElementFactory(), musElementType(), and setMusElementType().
|
private |
Referenced by addPlayableDotted(), CAMusElementFactory(), configureNote(), configureRest(), playableLength(), and setPlayableLength().
|
private |
Referenced by CAMusElementFactory(), repeatMarkType(), and setRepeatMarkType().
|
private |
Referenced by CAMusElementFactory(), repeatMarkVoltaNumber(), and setRepeatMarkVoltaNumber().
|
private |
Referenced by ritardandoType(), and setRitardandoType().
|
private |
Referenced by CAMusElementFactory(), setSlurStyle(), and slurStyle().
|
private |
Referenced by CAMusElementFactory(), setTempoBeat(), and tempoBeat().
|
private |
Referenced by CAMusElementFactory(), setTempoBpm(), and tempoBpm().
|
private |
Referenced by setTupletActualNumber(), and tupletActualNumber().
|
private |
Referenced by setTupletNumber(), and tupletNumber().
|
private |
Referenced by CAMusElementFactory(), emptyMusElem(), removeMusElem(), and ~CAMusElementFactory().
|
private |
Newly created music element itself.
Referenced by CAMusElementFactory(), cloneMusElem(), configureBarline(), configureClef(), configureFiguredBassNumber(), configureFunctionMark(), configureKeySignature(), configureMark(), configureNote(), configureRest(), configureSlur(), configureTimeSignature(), emptyMusElem(), musElement(), removeMusElem(), and setMusElement().