Main Page | Modules | Class Hierarchy | Class List | File List | Class Members | Related Pages

NoteContainer Class Reference
[Core Musical Objects]

#include <NoteContainer.h>

List of all members.

Public Member Functions

void sort ()
SortedNotes getSortedNotes ()
int count ()
void append (NoteMusic *)
void print ()
void setLocalNumerator (int)
void setCommonNumerator (CommonNumerator *)
QPtrList< VoiceMCgetVoices ()
NoteMusicgetNextVoiceNote (NoteMusic *, QPtrList< NoteMusic > *noteList)
QString toString ()
int getLastDivision ()
bool isUpperVoice (NoteMusic *, NoteMusic *)
int getIdVoice (NoteMusic *)
VoiceMCgetVoice (int i)


Detailed Description

This class is a fontal function to access the notes.

Warning:
Do not use find to find a reference but use contains Ref (Always) or else you are based on the start time of the notes


Member Function Documentation

int NoteContainer::getIdVoice NoteMusic n  ) 
 

Returns:
the voice id of a note

int NoteContainer::getLastDivision  ) 
 

This function maybe optimized

Returns:
the last division slices in all the notes.

NoteMusic * NoteContainer::getNextVoiceNote NoteMusic pnote,
QPtrList< NoteMusic > *  noteList
 

To let us know what is the next note in the voice we implement the function getNextVoiceNote(NoteMusic * pnote) in the sorted notes object.

It return the note that has a start time equal to pnote->getLStart()+pnote->getLDuration(). If several note correspond to this constraint we choose the one that has the same staff and we set the remainingVoice note to the one that we do not return

If the voice is unspecified (-1) then every note that has the same virtual voice became eligible.

Please note that a note in a chord is never part of a voice, the only note in the voice is the one that this note is chorded to.

Returns:
the next note in sorted note in the same voice

if there are several notes corresponding to the criteria then we return the fisrt note that has the same staff than the parameter note there will also be a voice criteria in the future to take in account

SortedNotes NoteContainer::getSortedNotes  ) 
 

It is important that no other method let the not be accessed so the common numerator adjustement can be done

Returns:
the sorted notes

VoiceMC * NoteContainer::getVoice int  id  ) 
 

Parameters:
the id of the voice
Returns:
the voice of id i, 0 if the voice of id id does not exist

QPtrList< VoiceMC > NoteContainer::getVoices  ) 
 

This method build the voices.

It has the following algorithm. If the 1025 in the implementation seems to you a mystery look at the VoiceMC class and you will understand, if still not look in the stems.txt specs if still not... Who cares...

The modified variable is usefull not to compute every time the voices.

bool NoteContainer::isUpperVoice NoteMusic nm1,
NoteMusic nm2
 

Returns:
true if a the note is in an upper voice than note2 this is useful to resolve collision of rest. Maybe more... The concept of upper voice is linked to the potential pitch
See also:
VoiceMC
Parameters:
note1 
note2 

void NoteContainer::print  ) 
 

for debbuging purpose

Deprecated:
use toString() instead

void NoteContainer::setCommonNumerator CommonNumerator cn  ) 
 

This sets the common numerator (Universal time to parts

void NoteContainer::setLocalNumerator int  i  ) 
 

This set the local numerator

void NoteContainer::sort  ) 
 

sort the notes only if modified

QString NoteContainer::toString  ) 
 

Returns:
the string representation of the vector


The documentation for this class was generated from the following files:
Generated on Tue Jun 1 21:13:34 2004 for Alternate Take by doxygen 1.3.6