Canorus  0.7
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Signals | Public Member Functions | Private Slots | Private Member Functions | Private Attributes | Static Private Attributes
CAScoreViewPort Class Reference

#include <scoreviewport.h>

Inheritance diagram for CAScoreViewPort:
Inheritance graph
[legend]

List of all members.

Public Types

enum  CAScrollBarVisibility { ScrollBarAlwaysVisible, ScrollBarAlwaysHidden, ScrollBarShowIfNeeded }

Signals

void CATripleClickEvent (QMouseEvent *e, QPoint p)
void CADoubleClickEvent (QMouseEvent *e, QPoint p)
void CAMousePressEvent (QMouseEvent *e, QPoint p)
void CAMouseReleaseEvent (QMouseEvent *e, QPoint p)
void CAMouseMoveEvent (QMouseEvent *e, QPoint p)
void CAWheelEvent (QWheelEvent *e, QPoint p)
void CAKeyPressEvent (QKeyEvent *e)
void selectionChanged ()

Public Member Functions

 CAScoreViewPort (QWidget *parent=0)
 CAScoreViewPort (CASheet *sheet, QWidget *parent=0)
virtual ~CAScoreViewPort ()
CAScoreViewPortclone ()
CAScoreViewPortclone (QWidget *parent)
CASheetsheet ()
void setSheet (CASheet *sheet)
void addMElement (CADrawableMusElement *elt, bool select=false)
void addCElement (CADrawableContext *elt, bool select=false)
CAMusElementremoveMElement (double x, double y)
void importElements (CAKDTree< CADrawableMusElement * > *drawableMList, CAKDTree< CADrawableContext * > *drawableCList)
void importMElements (CAKDTree< CADrawableMusElement * > *elts)
void importCElements (CAKDTree< CADrawableContext * > *elts)
QList< CADrawableMusElement * > & selection ()
QList< CAMusElement * > musElementSelection ()
QList< CADrawableMusElement * > musElementsAt (double x, double y)
CADrawableContextselectCElement (double x, double y)
CADrawableMusElementselectMElement (CAMusElement *elt)
CADrawableContextselectContext (CAContext *context)
QPoint lastMousePressCoords ()
void setLastMousePressCoordsAfter (const QList< CAMusElement * > list)
CADrawableContextcurrentContext ()
void setCurrentContext (CADrawableContext *c)
void selectAll ()
void selectAllCurBar ()
void selectAllCurContext ()
void invertSelection ()
void clearSelection ()
bool removeFromSelection (CADrawableMusElement *elt)
void addToSelection (CADrawableMusElement *elt, bool triggerSignal=true)
void addToSelection (const QList< CADrawableMusElement * > list, bool selectableOnly=true)
CADrawableMusElementaddToSelection (CAMusElement *elt)
void addToSelection (const QList< CAMusElement * > elts)
CADrawableMusElementselectNextMusElement (bool append=false)
CADrawableMusElementselectPrevMusElement (bool append=false)
CADrawableMusElementselectUpMusElement ()
CADrawableMusElementselectDownMusElement ()
const QList< QRect > & selectionRegionList () const
void addSelectionRegion (QRect r)
void removeSelectionRegion (QRect r)
void clearSelectionRegionList ()
CADrawable::CADirection resizeDirection ()
CADrawableMusElementfindMElement (CAMusElement *)
CADrawableContextfindCElement (CAContext *)
QList< CADrawableContext * > findContextsInRegion (QRect &reg)
CADrawableMusElementnearestLeftElement (double x, double y, CADrawableContext *context=0)
CADrawableMusElementnearestLeftElement (double x, double y, CAVoice *voice)
CADrawableMusElementnearestRightElement (double x, double y, CADrawableContext *context=0)
CADrawableMusElementnearestRightElement (double x, double y, CAVoice *voice)
int coordsToTime (double x)
double timeToCoords (int time)
double timeToCoordsSimpleVersion (int time)
CADrawableContextnearestUpContext (double x, double y)
CADrawableContextnearestDownContext (double x, double y)
int calculateTime (double x, double y)
CAContextcontextCollision (double x, double y)
void setManualScroll (bool scroll)
bool manualScroll ()
void checkScrollBars ()
CAScrollBarVisibility isScrollBarVisible ()
void setScrollBarVisible (CAScrollBarVisibility status)
void rebuild ()
const int drawableWidth ()
const int drawableHeight ()
void setWorldX (int x, bool animate=false, bool force=false)
void setWorldY (int y, bool animate=false, bool force=false)
void setWorldWidth (int w, bool force=false)
void setWorldHeight (int h, bool force=false)
const int worldX ()
const int worldY ()
const int worldWidth ()
const int worldHeight ()
const QRect worldCoords ()
const float zoom ()
void setWorldCoords (const QRect r, bool animate=false, bool force=false)
void setWorldCoords (double x, double y, double w, double h, bool animate=false, bool force=false)
void setCenterCoords (double x, double y, bool animate=false, bool force=false)
void setZoom (float z, double x=0, double y=0, bool animate=false, bool force=false)
void setZoom (float z, QPoint p, bool animate=false, bool force=false)
void zoomToSelection (bool animate=false, bool force=false)
void zoomToWidth (bool animate=false, bool force=false)
void zoomToHeight (bool animate=false, bool force=false)
void zoomToFit (bool animate=false, bool force=false)
void setBorder (const QPen pen)
void unsetBorder ()
QPen border ()
QColor backgroundColor ()
void setBackgroundColor (const QColor c)
QColor foregroundColor ()
void setForegroundColor (const QColor c)
QColor selectionColor ()
void setSelectionColor (const QColor c)
QColor selectionAreaColor ()
void setSelectionAreaColor (const QColor c)
QColor selectedContextColor ()
void setSelectedContextColor (const QColor c)
QColor hiddenElementsColor ()
void setHiddenElementsColor (const QColor c)
QColor disabledElementsColor ()
void setDisabledElementsColor (const QColor c)
bool playing ()
void setPlaying (bool playing)
void setRepaintArea (QRect *area)
void clearRepaintArea ()
CAVoiceselectedVoice ()
void setSelectedVoice (CAVoice *selectedVoice)
bool shadowNoteVisible ()
void setShadowNoteVisible (bool visible)
bool drawShadowNoteAccs ()
void setDrawShadowNoteAccs (bool draw)
int shadowNoteAccs ()
void setShadowNoteAccs (int accs)
void setShadowNoteLength (CAPlayableLength)
CATextEditcreateTextEdit (CADrawableMusElement *elt)
CATextEdittextEdit ()
void removeTextEdit ()
bool textEditVisible ()
bool noteNameVisible ()
void setNoteNameVisible (bool v)
QString noteName ()
void setNoteName (QString n)
void updateHelpers ()

Private Slots

void mousePressEvent (QMouseEvent *e)
void mouseMoveEvent (QMouseEvent *e)
void mouseReleaseEvent (QMouseEvent *e)
void wheelEvent (QWheelEvent *e)
void keyPressEvent (QKeyEvent *e)
void HScrollBarEvent (int val)
void VScrollBarEvent (int val)
void resizeEvent (QResizeEvent *e)
void paintEvent (QPaintEvent *p)
void leaveEvent (QEvent *e)
void enterEvent (QEvent *e)
void on_animationTimer_timeout ()
void on_clickTimer_timeout ()

Private Member Functions

void initScoreViewPort (CASheet *s)
void clearMElements ()
void clearCElements ()
bool isSelected (CADrawableMusElement *elt)
template<typename T >
int getMaxXExtended (CAKDTree< T > &v)
template<typename T >
int getMaxYExtended (CAKDTree< T > &v)
void setLastMousePressCoords (QPoint p)
bool shadowNoteVisibleOnLeave ()
void setShadowNoteVisibleOnLeave (bool v)
void setTextEdit (CATextEdit *e)
QRect textEditGeometry ()
void setTextEditGeometry (const QRect r)
void setTextEditVisible (bool v)
void setResizeDirection (CADrawable::CADirection r)
void drawSelectionRegion (QPainter *p, CADrawSettings s)
void startAnimationTimer ()

Private Attributes

QGridLayout * _layout
QWidget_canvas
QScrollBar * _hScrollBar
QScrollBar * _vScrollBar
CAKDTree< CADrawableMusElement * > _drawableMList
CAKDTree< CADrawableContext * > _drawableCList
CASheet_sheet
QList< CADrawableMusElement * > _selection
CADrawableContext_currentContext
double _worldX
double _worldY
double _worldW
double _worldH
QPoint _lastMousePressCoords
float _zoom
CAVoice_selectedVoice
bool _shadowNoteVisible
bool _shadowNoteVisibleOnLeave
int _shadowNoteAccs
bool _drawShadowNoteAccs
QList< CANote * > _shadowNote
QList< CADrawableNote * > _shadowDrawableNote
CATextEdit_textEdit
QRect _textEditGeometry
bool _textEditVisible
CADrawable::CADirection _resizeDirection
QList< QRect > _selectionRegionList
bool _drawBorder
QRect * _repaintArea
QPen _borderPen
QColor _backgroundColor
QColor _foregroundColor
QColor _selectionColor
QColor _selectionAreaColor
QColor _selectedContextColor
QColor _disabledElementsColor
QColor _hiddenElementsColor
bool _noteNameVisible
QString _noteName
QTimer * _animationTimer
int _animationStep
double _targetWorldX
double _targetWorldY
double _targetWorldW
double _targetWorldH
float _targetZoom
CAScrollBarVisibility _scrollBarVisible
bool _allowManualScroll
double _oldWorldX
double _oldWorldY
double _oldWorldW
double _oldWorldH
bool _playing
QTimer * _clickTimer
int _numberOfClicks
double _xCursor
double _yCursor
bool _holdRepaint
bool _checkScrollBarsDeadLock
bool _hScrollBarDeadLock
bool _vScrollBarDeadLock

Static Private Attributes

static const int RIGHT_EXTRA_SPACE = 100
static const int BOTTOM_EXTRA_SPACE = 30
static const int ANIMATION_STEPS = 7

Detailed Description

Widget for rendering the score.

This class represents the widget capable of rendering the score. It is usually used as a central widget in the main window, but might be used for example, in a list of possible harmonization or improvization solutions, score layout window and more as an independent widget or only as a drawable content on a button.

Score viewport consists of a virtual workspace full of drawable elements which represent the abstract music elements or contexts. Every drawable element has its absolute X, Y, Width and Height geometry properties. Score viewport also shows usually a small part of the whole workspace (depending on scroll bars values and a zoom level). When drawable elements are drawn, their CADrawable::draw() methods are called with the viewports X and Y coordinates, zoom level, pen color and other properties needed to correctly draw an element to the score viewport's canvas.

Note that this widget is only capable of correctly rendering the drawable elements. No Control part of the MVC model is implemented here. The viewport logic is implemented outside of this class (usually main window). Score viewport only provides various signals to communicate with outer world. However, this class provides various modes (eg. drawing the shadow notes when inserting music elements, coloring only one voice, hiding certain staffs, animating the scroll etc.) the controller might use.

This widget also provides horizontal and vertical scrollbars (see _hScrollBar and _vScrollBar).


Member Enumeration Documentation

Different behaviour of the scroll bars:

  • ScrollBarAlwaysVisible - scrollbars are always visible, no matter if the whole scene can be rendered on canvas or not
  • ScrollBarAlwaysHidden - scrollbars are always hidden, no matter if the whole scene can be rendered on canvas or not
  • ScrollBarShowIfNeeded - scrollbars are visible, if they are needed (the current viewport area is too small to render the whole scene), otherwise hidden. This is default behaviour.
Enumerator:
ScrollBarAlwaysVisible 
ScrollBarAlwaysHidden 
ScrollBarShowIfNeeded 

Constructor & Destructor Documentation

References initScoreViewPort().

Referenced by clone().

Here is the call graph for this function:

Here is the caller graph for this function:

CAScoreViewPort::CAScoreViewPort ( CASheet sheet,
QWidget parent = 0 
)

References initScoreViewPort().

Here is the call graph for this function:


Member Function Documentation

void CAScoreViewPort::addCElement ( CADrawableContext elt,
bool  select = false 
)

Adds a drawable music element elt to the score viewport and selects it, if select is true.

References _drawableCList, _shadowDrawableNote, _shadowNote, CAKDTree< T >::addElement(), CADrawableContext::context(), CADrawableContext::drawableContextType(), CADrawableContext::DrawableStaff, and setCurrentContext().

Referenced by importCElements(), importElements(), and CAEngraver::reposit().

Here is the call graph for this function:

Here is the caller graph for this function:

void CAScoreViewPort::addMElement ( CADrawableMusElement elt,
bool  select = false 
)

Adds a drawable music element elt to the score viewport and selects it, if select is true.

References _drawableMList, _selection, CAKDTree< T >::addElement(), CADrawableContext::addMElement(), addToSelection(), CADrawableMusElement::drawableContext(), and selectionChanged().

Referenced by importElements(), importMElements(), CAEngraver::placeMarks(), and CAEngraver::reposit().

Here is the call graph for this function:

Here is the caller graph for this function:

void CAScoreViewPort::addSelectionRegion ( QRect  r) [inline]

References _selectionRegionList.

Referenced by CAMainWin::scoreViewPortMouseMove(), and CASettingsDialog::setupPages().

Here is the caller graph for this function:

void CAScoreViewPort::addToSelection ( CADrawableMusElement elt,
bool  triggerSignal = true 
)
void CAScoreViewPort::addToSelection ( const QList< CADrawableMusElement * >  list,
bool  selectableOnly = true 
)

Adds the given list of drawable music elements list to the current selection.

References addToSelection(), and selectionChanged().

Here is the call graph for this function:

Adds the drawable music element of the given abstract music element elt to the selection. Returns a pointer to its drawable element or 0, if the music element is not part of this score viewport.

References _drawableMList, _selection, addToSelection(), CAKDTree< T >::at(), selectionChanged(), and CAKDTree< T >::size().

Here is the call graph for this function:

Adds the given list of abstract music elements to the selection.

References _drawableMList, addToSelection(), CAKDTree< T >::at(), CADrawable::isSelectable(), selectionChanged(), and CAKDTree< T >::size().

Here is the call graph for this function:

QColor CAScoreViewPort::backgroundColor ( ) [inline]

References _backgroundColor.

Referenced by initScoreViewPort().

Here is the caller graph for this function:

QPen CAScoreViewPort::border ( ) [inline]

References _borderPen.

void CAScoreViewPort::CADoubleClickEvent ( QMouseEvent *  e,
QPoint  p 
) [signal]

Referenced by mousePressEvent().

Here is the caller graph for this function:

void CAScoreViewPort::CAKeyPressEvent ( QKeyEvent *  e) [signal]

This signal is emitted when keyPressEvent() is called. Parent class is usually connected to this event. It adds another two arguments to the wheelEvent() function - pointer to this score viewport. This is useful when a parent class wants to know which class the signal was emmitted by.

Parameters:
eWheel event which gets processed.
vPointer to this viewport (the viewport which emmitted the signal).

Referenced by keyPressEvent().

Here is the caller graph for this function:

int CAScoreViewPort::calculateTime ( double  x,
double  y 
)

Calculates the logical time at the given coordinates x and y.

References _drawableMList, CAKDTree< T >::findNearestLeft(), CAKDTree< T >::findNearestRight(), CADrawableMusElement::musElement(), CAMusElement::timeLength(), and CAMusElement::timeStart().

Here is the call graph for this function:

void CAScoreViewPort::CAMouseMoveEvent ( QMouseEvent *  e,
QPoint  p 
) [signal]

This signal is emitted when mouseMoveEvent() is called. Parent class is usually connected to this event. It adds another two arguments to the mouseMoveEvent() function - pointer to this viewport and coordinates in world coordinates where user used the mouse. This is useful when a parent class wants to know which class the signal was emmitted by.

Parameters:
eMouse event which gets processed.
pCoordinates of the mouse cursor in absolute world values.
vPointer to this viewport (the viewport which emmitted the signal).

Referenced by mouseMoveEvent().

Here is the caller graph for this function:

void CAScoreViewPort::CAMousePressEvent ( QMouseEvent *  e,
QPoint  p 
) [signal]

This signal is emitted when mousePressEvent() is called. Parent class is usually connected to this event. It adds another two arguments to the mousePressEvent() function - pointer to this viewport and coordinates in world coordinates where user used the mouse. This is useful when a parent class wants to know which class the signal was emmitted by.

Parameters:
eMouse event which gets processed.
pCoordinates of the mouse cursor in absolute world values.
vPointer to this viewport (the viewport which emmitted the signal).

Referenced by mousePressEvent().

Here is the caller graph for this function:

void CAScoreViewPort::CAMouseReleaseEvent ( QMouseEvent *  e,
QPoint  p 
) [signal]

This signal is emitted when mouseReleaseEvent() is called. Parent class is usually connected to this event. It adds another two arguments to the mouseReleaseEvent() function - pointer to this score viewport and coordinates in world coordinates where user used the mouse. This is useful when a parent class wants to know which class the signal was emmitted by.

Parameters:
eMouse event which gets processed.
pCoordinates of the mouse cursor in absolute world values.
vPointer to this viewport (the viewport which emmitted the signal).

Referenced by mouseReleaseEvent().

Here is the caller graph for this function:

void CAScoreViewPort::CATripleClickEvent ( QMouseEvent *  e,
QPoint  p 
) [signal]

Referenced by mousePressEvent().

Here is the caller graph for this function:

void CAScoreViewPort::CAWheelEvent ( QWheelEvent *  e,
QPoint  p 
) [signal]

This signal is emitted when wheelEvent() is called. Parent class is usually connected to this event. It adds another two arguments to the wheelEvent() function - pointer to this score viewport and coordinates in world coordinates where user used the mouse. This is useful when a parent class wants to know which class the signal was emmitted by.

Parameters:
eWheel event which gets processed.
pCoordinates of the mouse cursor in absolute world values.
vPointer to this viewport (the viewport which emmitted the signal).

Referenced by wheelEvent().

Here is the caller graph for this function:

Checks whether the scrollbars are needed (the whole scene is not rendered) or not. Scrollbars get shown or hidden here. Repaint is done automatically, if needed.

References _checkScrollBarsDeadLock, _drawableCList, _drawableMList, _holdRepaint, _hScrollBar, _vScrollBar, _zoom, drawableHeight(), drawableWidth(), getMaxXExtended(), getMaxYExtended(), isScrollBarVisible(), ScrollBarShowIfNeeded, setWorldHeight(), setWorldWidth(), worldHeight(), and worldWidth().

Referenced by rebuild(), setCenterCoords(), setScrollBarVisible(), setWorldCoords(), setWorldHeight(), setWorldWidth(), setWorldX(), setWorldY(), and setZoom().

Here is the call graph for this function:

Here is the caller graph for this function:

void CAScoreViewPort::clearCElements ( ) [inline, private]

References _drawableCList, and CAKDTree< T >::clear().

Here is the call graph for this function:

void CAScoreViewPort::clearMElements ( ) [inline, private]

References _drawableMList, and CAKDTree< T >::clear().

Here is the call graph for this function:

Disables and deletes the area to be repainted.

See also:
setRepaintArea()

References _repaintArea.

Returns a pointer to the new cloned viewport with the same parent. This function is usually called when a user creates a new docked view.

Implements CAViewPort.

References _drawableCList, _drawableMList, _sheet, CAScoreViewPort(), and importElements().

Referenced by importElements().

Here is the call graph for this function:

Here is the caller graph for this function:

CAScoreViewPort * CAScoreViewPort::clone ( QWidget parent) [virtual]

Returns a pointer to the new cloned viewport with the parent parent. This function is usually called when a user creates a new undocked view.

Implements CAViewPort.

References _drawableCList, _drawableMList, _sheet, CAScoreViewPort(), and importElements().

Here is the call graph for this function:

CAContext * CAScoreViewPort::contextCollision ( double  x,
double  y 
)

If the given coordinates hit any of the contexts, returns that context.

References _drawableCList, and CAKDTree< T >::findInRange().

Here is the call graph for this function:

int CAScoreViewPort::coordsToTime ( double  x)

Returns Canorus time for the given X coordinate x.

Returns 0, if no contexts are present.

References _drawableMList, CAKDTree< T >::addElement(), CAKDTree< T >::list(), CADrawableMusElement::musElement(), nearestLeftElement(), nearestRightElement(), selection(), CAMusElement::timeEnd(), CAMusElement::timeStart(), and CADrawable::xPos().

Referenced by CAMainWin::scoreViewPortMouseMove(), and selectAllCurBar().

Here is the call graph for this function:

Here is the caller graph for this function:

References _disabledElementsColor.

Referenced by initScoreViewPort(), and paintEvent().

Here is the caller graph for this function:

References _canvas.

Referenced by checkScrollBars(), on_animationTimer_timeout(), paintEvent(), resizeEvent(), setWorldCoords(), setWorldHeight(), and setZoom().

Here is the caller graph for this function:

References _canvas.

Referenced by checkScrollBars(), on_animationTimer_timeout(), paintEvent(), resizeEvent(), setWorldCoords(), setWorldWidth(), and setZoom().

Here is the caller graph for this function:

void CAScoreViewPort::drawSelectionRegion ( QPainter *  p,
CADrawSettings  s 
) [private]

References CADrawSettings::color, CADrawSettings::h, CADrawSettings::w, CADrawSettings::x, and CADrawSettings::y.

Referenced by paintEvent().

Here is the caller graph for this function:

References _drawShadowNoteAccs.

void CAScoreViewPort::enterEvent ( QEvent *  e) [private, slot]

Finds the drawable instance of the given abstract context.

See also:
findMElement()

References _drawableCList, CAKDTree< T >::at(), and CAKDTree< T >::size().

Referenced by CASettingsDialog::setupPages().

Here is the call graph for this function:

Here is the caller graph for this function:

Returns a list of drawable contexts the current score viewport includes between the vertical coordinates y1 and y2. The context is in a list already if only part of the context is touched by the region. That is the first returned context's top border is smaller than y1 and the last returned context's bottom border is larger than x2.

References _drawableCList, and CAKDTree< T >::findInRange().

Referenced by CAMainWin::scoreViewPortMouseMove(), and CAMainWin::scoreViewPortMouseRelease().

Here is the call graph for this function:

Here is the caller graph for this function:

Finds the drawable instance of the given abstract music element.

See also:
findCElement()

References _drawableMList, CAKDTree< T >::at(), and CAKDTree< T >::size().

Referenced by createTextEdit(), and CAEngraver::reposit().

Here is the call graph for this function:

Here is the caller graph for this function:

QColor CAScoreViewPort::foregroundColor ( ) [inline]

References _foregroundColor.

Referenced by initScoreViewPort(), and paintEvent().

Here is the caller graph for this function:

template<typename T >
int CAScoreViewPort::getMaxXExtended ( CAKDTree< T > &  v) [private]

Returns the maximum X of the viewable World a little bigger to make insertion at the end easy.

References CAKDTree< T >::getMaxX(), and RIGHT_EXTRA_SPACE.

Referenced by checkScrollBars(), setWorldWidth(), setWorldX(), and zoomToWidth().

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename T >
int CAScoreViewPort::getMaxYExtended ( CAKDTree< T > &  v) [private]

Returns the maximum Y of the viewable World a little bigger to make insertion at the end easy.

References BOTTOM_EXTRA_SPACE, and CAKDTree< T >::getMaxY().

Referenced by checkScrollBars(), setWorldHeight(), setWorldY(), and zoomToHeight().

Here is the call graph for this function:

Here is the caller graph for this function:

References _hiddenElementsColor.

Referenced by initScoreViewPort(), and paintEvent().

Here is the caller graph for this function:

void CAScoreViewPort::HScrollBarEvent ( int  val) [private, slot]

Processes the Horizontal scroll bar event. This method is called when the horizontal scrollbar changes its value, let it be internally or due to user interaction.

References _allowManualScroll, _hScrollBarDeadLock, and setWorldX().

Referenced by initScoreViewPort().

Here is the call graph for this function:

Here is the caller graph for this function:

References addCElement(), CAKDTree< T >::at(), CADrawableContext::clone(), and CAKDTree< T >::size().

Here is the call graph for this function:

void CAScoreViewPort::importElements ( CAKDTree< CADrawableMusElement * > *  drawableMList,
CAKDTree< CADrawableContext * > *  drawableCList 
)

References _drawableCList, addCElement(), addMElement(), CAKDTree< T >::at(), clone(), CAKDTree< T >::list(), and CAKDTree< T >::size().

Referenced by clone().

Here is the call graph for this function:

Here is the caller graph for this function:

References addMElement(), CAKDTree< T >::at(), CADrawableMusElement::clone(), and CAKDTree< T >::size().

Here is the call graph for this function:

Inverts the current selection.

References _drawableMList, addToSelection(), CAKDTree< T >::at(), clearSelection(), selection(), selectionChanged(), and CAKDTree< T >::size().

Here is the call graph for this function:

References _scrollBarVisible.

Referenced by checkScrollBars().

Here is the caller graph for this function:

bool CAScoreViewPort::isSelected ( CADrawableMusElement elt) [inline, private]

References _selection.

void CAScoreViewPort::keyPressEvent ( QKeyEvent *  e) [private, slot]

Processes the keyPressEvent(). A new signal is emitted: CAKeyPressEvent(), which usually gets processed by the parent class then.

References CAKeyPressEvent().

Here is the call graph for this function:

void CAScoreViewPort::leaveEvent ( QEvent *  e) [private, slot]
bool CAScoreViewPort::manualScroll ( ) [inline]

References _allowManualScroll.

void CAScoreViewPort::mouseMoveEvent ( QMouseEvent *  e) [private, slot]

Processes the mouseMoveEvent(). A new signal is emitted: CAMouseMoveEvent(), which usually gets processed by the parent class then.

References _worldX, _worldY, _xCursor, _yCursor, _zoom, CAMouseMoveEvent(), and selection().

Here is the call graph for this function:

void CAScoreViewPort::mousePressEvent ( QMouseEvent *  e) [private, slot]

Processes the mousePressEvent(). A new signal is emitted: CAMousePressEvent(), which usually gets processed by the parent class then.

Reimplemented from CAViewPort.

References _clickTimer, _numberOfClicks, _worldX, _worldY, _zoom, CADrawable::Bottom, CADoubleClickEvent(), CAMousePressEvent(), CATripleClickEvent(), lastMousePressCoords(), CADrawable::Left, CADrawable::Right, selection(), setLastMousePressCoords(), setResizeDirection(), and CADrawable::Top.

Here is the call graph for this function:

void CAScoreViewPort::mouseReleaseEvent ( QMouseEvent *  e) [private, slot]

Processes the mouseReleaseEvent(). A new signal is emitted: CAMouseReleaseEvent(), which usually gets processed by the parent class then.

References _worldX, _worldY, _zoom, CAMouseReleaseEvent(), setResizeDirection(), and CADrawable::Undefined.

Here is the call graph for this function:

QList< CADrawableMusElement * > CAScoreViewPort::musElementsAt ( double  x,
double  y 
)

Returns a list of pointers to the drawable music elements at the given coordinates.

Multiple elements can exist at the same coordinates.

If there is a currently selected voice, only elements belonging to this voice are selected.

References _drawableMList, CAKDTree< T >::findInRange(), and selectedVoice().

Referenced by CAMainWin::insertMusElementAt(), and CAMainWin::scoreViewPortMousePress().

Here is the call graph for this function:

Here is the caller graph for this function:

Returns a list of currently selected music elements. Does the same as selection(), but doesn't return their Drawable instances.

References _selection.

Referenced by CAPlugin::callAction(), and rebuild().

Here is the caller graph for this function:

    Returns a pointer to the nearest upper drawable context from the given coordinates.
Todo:
Also look at X coordinate

References _drawableCList, and CAKDTree< T >::findNearestDown().

Here is the call graph for this function:

CADrawableMusElement * CAScoreViewPort::nearestLeftElement ( double  x,
double  y,
CADrawableContext context = 0 
)

Returns a pointer to the nearest drawable music element left of the current coordinates with the largest startTime. Drawable elements left borders are taken into account. If context is non-zero, returns the nearest element in the given context only.

References _drawableMList, and CAKDTree< T >::findNearestLeft().

Referenced by coordsToTime(), and CAMainWin::insertMusElementAt().

Here is the call graph for this function:

Here is the caller graph for this function:

CADrawableMusElement * CAScoreViewPort::nearestLeftElement ( double  x,
double  y,
CAVoice voice 
)

Returns a pointer to the nearest drawable music element left of the current coordinates with the largest startTime in the given voice. Drawable elements left borders are taken into account.

References _drawableMList, and CAKDTree< T >::findNearestLeft().

Here is the call graph for this function:

CADrawableMusElement * CAScoreViewPort::nearestRightElement ( double  x,
double  y,
CADrawableContext context = 0 
)

Returns a pointer to the nearest drawable music element right of the current coordinates with the largest startTime. Drawable elements left borders are taken into account. If context is non-zero, returns the nearest element in the given context only.

References _drawableMList, and CAKDTree< T >::findNearestRight().

Referenced by coordsToTime(), CAMainWin::insertMusElementAt(), and CAMainWin::pasteAt().

Here is the call graph for this function:

Here is the caller graph for this function:

CADrawableMusElement * CAScoreViewPort::nearestRightElement ( double  x,
double  y,
CAVoice voice 
)

Returns a pointer to the nearest drawable music element right of the current coordinates with the largest startTime in the given voice. Drawable elements left borders are taken into account.

References _drawableMList, and CAKDTree< T >::findNearestRight().

Here is the call graph for this function:

CADrawableContext * CAScoreViewPort::nearestUpContext ( double  x,
double  y 
)
    Returns a pointer to the nearest upper drawable context from the given coordinates.
Todo:
Also look at X coordinate

References _drawableCList, and CAKDTree< T >::findNearestUp().

Referenced by CAMainWin::scoreViewPortMousePress().

Here is the call graph for this function:

Here is the caller graph for this function:

QString CAScoreViewPort::noteName ( ) [inline]

References _noteName.

Referenced by paintEvent().

Here is the caller graph for this function:

References _noteNameVisible.

References _animationStep, _animationTimer, _targetWorldX, _targetWorldY, _targetZoom, _worldX, _worldY, _zoom, ANIMATION_STEPS, drawableHeight(), drawableWidth(), and setWorldCoords().

Referenced by initScoreViewPort(), and startAnimationTimer().

Here is the call graph for this function:

Here is the caller graph for this function:

void CAScoreViewPort::on_clickTimer_timeout ( ) [private, slot]

Clears number of clicks done so far inside one interval. This function is usually click timer's slot.

References _numberOfClicks.

Referenced by initScoreViewPort().

Here is the caller graph for this function:

void CAScoreViewPort::paintEvent ( QPaintEvent *  e) [private, slot]
bool CAScoreViewPort::playing ( ) [inline]

References _playing.

Referenced by CAMainWin::setMode(), and setPlaying().

Here is the caller graph for this function:

void CAScoreViewPort::rebuild ( ) [virtual]

Calls the engraver to reposition the music elements on the canvas. Also updates scrollbars.

Implements CAViewPort.

References _currentContext, _drawableCList, _drawableMList, _selection, _shadowDrawableNote, _shadowNote, addToSelection(), checkScrollBars(), CAKDTree< T >::clear(), CAKDTree< T >::list(), musElementSelection(), CAPlayableLength::Quarter, CAEngraver::reposit(), setCurrentContext(), setWorldCoords(), CAKDTree< T >::size(), updateHelpers(), and worldCoords().

Referenced by CAMainWin::on_uiScoreView_triggered(), and CASettingsDialog::setupPages().

Here is the call graph for this function:

Here is the caller graph for this function:

Removes the given drawable music element elt from the selection, if it exists. Returns True, if element existed in the selection and was removed, false otherwise.

References _selection, and selectionChanged().

Referenced by CAMainWin::scoreViewPortMousePress().

Here is the call graph for this function:

Here is the caller graph for this function:

CAMusElement * CAScoreViewPort::removeMElement ( double  x,
double  y 
)

Removes a drawable music element at the given coordinates x and y, if it exists. Returns the pointer of the abstract music element, if the element was found and deleted.

Warning:
This function only deletes the CADrawable part of the object. You still need to delete the abstract part (the pointer returned)!

References _drawableMList, CADrawableMusElement::DrawableClef, CADrawableMusElement::drawableContext(), CADrawableMusElement::DrawableKeySignature, CADrawableMusElement::drawableMusElementType(), CADrawableMusElement::DrawableTimeSignature, CADrawableMusElement::musElement(), CAKDTree< T >::removeElement(), and CADrawableContext::removeMElement().

Here is the call graph for this function:

void CAScoreViewPort::removeSelectionRegion ( QRect  r) [inline]

References _selectionRegionList.

Removes and deletes the text edit when quitting text editing mode.

References setTextEditVisible(), textEdit(), and updateHelpers().

Referenced by CAMainWin::onTextEditKeyPressEvent(), CAMainWin::scoreViewPortMousePress(), and CAMainWin::setMode().

Here is the call graph for this function:

Here is the caller graph for this function:

void CAScoreViewPort::resizeEvent ( QResizeEvent *  e) [private, slot]

Called when the user resizes the widget. Note that repaint() event is also triggered when the internal drawable canvas changes its size (for eg. when scrollbars are shown/hidden) and the size of the viewport does not change.

References _worldX, _worldY, _zoom, drawableHeight(), drawableWidth(), and setWorldCoords().

Here is the call graph for this function:

Select all elements in the viewport. This function is usually associated with CTRL+A key.

References _drawableMList, addToSelection(), CAKDTree< T >::at(), clearSelection(), selectionChanged(), and CAKDTree< T >::size().

Here is the call graph for this function:

Selects all elements in the current bar. This function is usually called when double clicking on the bar.

References _lastMousePressCoords, addToSelection(), clearSelection(), CADrawableContext::context(), coordsToTime(), currentContext(), CADrawableContext::DrawableStaff, selectedVoice(), and selectionChanged().

Here is the call graph for this function:

Selects all elements in the current context (line). This function is usually called when triple clicking on the context.

References addToSelection(), clearSelection(), currentContext(), and selectionChanged().

Here is the call graph for this function:

CADrawableContext * CAScoreViewPort::selectCElement ( double  x,
double  y 
)

Selects a drawable context element at the given coordinates, if it exists. Returns a pointer to its abstract context element. If multiple elements exist at the same coordinates, they are selected one by another if you click at the same coordinates multiple times. If no elements are present at the coordinates, clear the selection.

References _drawableCList, currentContext(), CAKDTree< T >::findInRange(), and setCurrentContext().

Referenced by CAMainWin::scoreViewPortMousePress().

Here is the call graph for this function:

Here is the caller graph for this function:

Selects the drawable context of the given abstract context. If there are multiple drawable elements representing a single abstract element, selects the first one.

Returns a pointer to the drawable instance of the given context or 0 if the context was not found.

See also:
selectMElement(CAMusElement*)

References _drawableCList, CAKDTree< T >::at(), setCurrentContext(), and CAKDTree< T >::size().

Referenced by CAMainWin::newDocument(), CAMainWin::on_uiImportDocument_triggered(), CAMainWin::openDocument(), and CAMainWin::scoreViewPortMousePress().

Here is the call graph for this function:

Here is the caller graph for this function:

    Selects the lower music element in the current context.
    Returns a pointer to the newly selected drawable music element or 0, if such an element doesn't exist or the selection is empty.

    This method is usually called when using the up arrow key.
Todo:
Still needs to be written. Currently, it only returns the currently selected element.

References _selection.

References _selectedContextColor.

Referenced by initScoreViewPort(), and paintEvent().

Here is the caller graph for this function:

QList< CAMusElement * > CAScoreViewPort::selection ( ) [inline]

Returns a list of the currently selected drawable music elements.

References _selection.

Referenced by CAPlugin::callAction(), coordsToTime(), CAMainWin::copySelection(), CAMainWin::deleteSelection(), CAMainWin::insertMusElementAt(), invertSelection(), mouseMoveEvent(), mousePressEvent(), CATransposeView::on_uiApply_clicked(), CAMainWin::on_uiClefOffset_valueChanged(), CAMainWin::on_uiDynamicCustomText_returnPressed(), CAMainWin::on_uiDynamicText_toggled(), CAMainWin::on_uiDynamicVolume_valueChanged(), CAMainWin::on_uiFermataType_toggled(), CAMainWin::on_uiFinger_toggled(), CAMainWin::on_uiFingeringOriginal_toggled(), CAMainWin::on_uiFMChordArea_toggled(), CAMainWin::on_uiFMEllipse_toggled(), CAMainWin::on_uiFMFunction_toggled(), CAMainWin::on_uiFMTonicDegree_toggled(), CAMainWin::on_uiHiddenRest_toggled(), CAMainWin::on_uiInstrumentChange_activated(), CAMainWin::on_uiKeySig_activated(), CAMainWin::on_uiNoteStemDirection_toggled(), CAMainWin::on_uiPlayableLength_toggled(), CAMainWin::on_uiPlayFromSelection_toggled(), CAMainWin::on_uiRepeatMarkType_toggled(), CAMainWin::on_uiTempoBeat_toggled(), CAMainWin::on_uiTempoBpm_returnPressed(), CAMainWin::on_uiTimeSigBeat_valueChanged(), CAMainWin::on_uiTimeSigBeats_valueChanged(), CAMainWin::on_uiTupletType_toggled(), CAMainWin::onTextEditKeyPressEvent(), CAMainWin::scoreViewPortKeyPress(), CAMainWin::scoreViewPortMouseMove(), CAMainWin::scoreViewPortMousePress(), selectMElement(), CAMainWin::setMode(), CATransposeView::show(), timeToCoords(), CAMainWin::updateClefToolBar(), CAMainWin::updateDynamicToolBar(), CAMainWin::updateFermataToolBar(), CAMainWin::updateFingeringToolBar(), CAMainWin::updateFMToolBar(), CAMainWin::updateInstrumentToolBar(), CAMainWin::updateKeySigToolBar(), CAMainWin::updatePlayableToolBar(), CAMainWin::updateRepeatMarkToolBar(), CAMainWin::updateSheetToolBar(), CAMainWin::updateTempoToolBar(), and CAMainWin::updateTimeSigToolBar().

References _selectionAreaColor.

Referenced by initScoreViewPort(), and paintEvent().

Here is the caller graph for this function:

QColor CAScoreViewPort::selectionColor ( ) [inline]

References _selectionColor.

Referenced by initScoreViewPort(), and paintEvent().

Here is the caller graph for this function:

const QList<QRect>& CAScoreViewPort::selectionRegionList ( ) const [inline]

References _selectionRegionList.

Referenced by paintEvent().

Here is the caller graph for this function:

Selects the drawable music element of the given abstract music element. If there are multiple drawable elements representing a single abstract element, selects the first one.

Returns a pointer to the drawable instance of the given music element or 0 if the music element was not found.

See also:
selectCElement(CAContext*)

References _drawableMList, _selection, addToSelection(), CAKDTree< T >::at(), CADrawable::isSelectable(), CADrawableMusElement::musElement(), selection(), selectionChanged(), and CAKDTree< T >::size().

Referenced by CAMainWin::insertMusElementAt(), CAMainWin::onTextEditKeyPressEvent(), CAMainWin::scoreViewPortKeyPress(), selectNextMusElement(), and selectPrevMusElement().

Here is the call graph for this function:

Here is the caller graph for this function:

Selects the next music element in the current context (voice, if selectedVoice is set) or appends the next music element to the selection, if append is True. Returns a pointer to the newly selected drawable music element or 0, if such an element doesn't exist or the selection is empty.

This method is usually called when using the right arrow key.

References _selection, addToSelection(), CAMusElement::context(), CAContext::next(), CAVoice::next(), selectedVoice(), and selectMElement().

Referenced by CAMainWin::scoreViewPortKeyPress().

Here is the call graph for this function:

Here is the caller graph for this function:

Selects the next music element in the current context (voice, if selectedVoice is set) or appends the next music element to the selection, if append is True. Returns a pointer to the newly selected drawable music element or 0, if such an element doesn't exist or the selection is empty.

This method is usually called when using the left arrow key.

References _selection, addToSelection(), CAMusElement::context(), CAContext::previous(), CAVoice::previous(), selectedVoice(), and selectMElement().

Referenced by CAMainWin::scoreViewPortKeyPress().

Here is the call graph for this function:

Here is the caller graph for this function:

    Selects the upper music element in the current context.
    Returns a pointer to the newly selected drawable music element or 0, if such an element doesn't exist or the selection is empty.

    This method is usually called when using the up arrow key.
Todo:
Still needs to be written. Currently, it only returns the currently selected element.

References _selection.

Referenced by CAMainWin::scoreViewPortKeyPress().

Here is the caller graph for this function:

void CAScoreViewPort::setBackgroundColor ( const QColor  c) [inline]
void CAScoreViewPort::setBorder ( const QPen  pen)

Draws the border with the given pen style, color, width and other pen settings. Enables border.

References _borderPen, and _drawBorder.

Referenced by CAMainWin::on_uiPlayFromSelection_toggled(), and CAMainWin::setMode().

Here is the caller graph for this function:

void CAScoreViewPort::setCenterCoords ( double  x,
double  y,
bool  animate = false,
bool  force = false 
)

Sets the world coordinates of the viewport, so the given coordinates are the center of the new viewport area. If the area has for eg. negative top-left coordinates, the area is moved to the (0,0) coordinates if force is False. ViewPort's width and height stay intact.

Warning:
Repaint is not done automatically!

References _checkScrollBarsDeadLock, _worldH, _worldW, checkScrollBars(), setWorldX(), and setWorldY().

Referenced by setZoom().

Here is the call graph for this function:

Here is the caller graph for this function:

void CAScoreViewPort::setDisabledElementsColor ( const QColor  c) [inline]
void CAScoreViewPort::setDrawShadowNoteAccs ( bool  draw) [inline]

References _drawShadowNoteAccs.

Referenced by initScoreViewPort(), CAMainWin::insertMusElementAt(), and CAMainWin::scoreViewPortKeyPress().

Here is the caller graph for this function:

void CAScoreViewPort::setForegroundColor ( const QColor  c) [inline]
void CAScoreViewPort::setHiddenElementsColor ( const QColor  c) [inline]
void CAScoreViewPort::setLastMousePressCoords ( QPoint  p) [inline, private]

References _lastMousePressCoords.

Referenced by mousePressEvent(), and setLastMousePressCoordsAfter().

Here is the caller graph for this function:

Change the x-coord of the last mouse press coords to after the right most element on the given list.

References _drawableMList, CAKDTree< T >::at(), lastMousePressCoords(), CADrawableMusElement::musElement(), setLastMousePressCoords(), CAKDTree< T >::size(), CADrawable::width(), and CADrawable::xPos().

Referenced by CAMainWin::pasteAt().

Here is the call graph for this function:

Here is the caller graph for this function:

void CAScoreViewPort::setManualScroll ( bool  scroll) [inline]

References _allowManualScroll.

void CAScoreViewPort::setNoteName ( QString  n) [inline]

References _noteName.

void CAScoreViewPort::setNoteNameVisible ( bool  v) [inline]

References _noteNameVisible.

Referenced by initScoreViewPort().

Here is the caller graph for this function:

void CAScoreViewPort::setPlaying ( bool  playing) [inline]

References _playing, and playing().

Referenced by CAMainWin::on_uiPlayFromSelection_toggled().

Here is the call graph for this function:

Here is the caller graph for this function:

void CAScoreViewPort::setRepaintArea ( QRect *  area) [inline]

Sets the area to be repainted, not the whole widget.

See also:
clearRepaintArea()

References _repaintArea.

References _resizeDirection.

Referenced by initScoreViewPort(), mousePressEvent(), and mouseReleaseEvent().

Here is the caller graph for this function:

References _hScrollBar, _scrollBarVisible, _vScrollBar, checkScrollBars(), ScrollBarAlwaysHidden, and ScrollBarAlwaysVisible.

Referenced by CASettingsDialog::setupPages().

Here is the call graph for this function:

Here is the caller graph for this function:

void CAScoreViewPort::setSelectedContextColor ( const QColor  c) [inline]
void CAScoreViewPort::setSelectedVoice ( CAVoice selectedVoice) [inline]

References _selectedVoice, and selectedVoice().

Referenced by initScoreViewPort(), CAMainWin::on_uiVoiceNum_valChanged(), and CAMainWin::sourceViewPortCommit().

Here is the call graph for this function:

Here is the caller graph for this function:

void CAScoreViewPort::setSelectionAreaColor ( const QColor  c) [inline]
void CAScoreViewPort::setSelectionColor ( const QColor  c) [inline]
void CAScoreViewPort::setShadowNoteAccs ( int  accs) [inline]

References _shadowNoteAccs.

Referenced by initScoreViewPort(), CAMainWin::scoreViewPortKeyPress(), and CAMainWin::scoreViewPortMouseMove().

Here is the caller graph for this function:

References _shadowNote, and updateHelpers().

Referenced by CAMainWin::insertMusElementAt(), CAMainWin::on_uiPlayableLength_toggled(), CAMainWin::scoreViewPortKeyPress(), and CAMainWin::scoreViewPortMousePress().

Here is the call graph for this function:

Here is the caller graph for this function:

void CAScoreViewPort::setShadowNoteVisible ( bool  visible) [inline]

References _shadowNoteVisible, and setShadowNoteVisibleOnLeave().

Referenced by initScoreViewPort(), CAMainWin::scoreViewPortMouseMove(), and CAMainWin::setMode().

Here is the call graph for this function:

Here is the caller graph for this function:

void CAScoreViewPort::setShadowNoteVisibleOnLeave ( bool  v) [inline, private]

References _shadowNoteVisibleOnLeave.

Referenced by initScoreViewPort(), and setShadowNoteVisible().

Here is the caller graph for this function:

void CAScoreViewPort::setSheet ( CASheet sheet) [inline]

References _sheet, and sheet().

Referenced by initScoreViewPort(), CASettingsDialog::setupPages(), and CAUndoCommand::undoDocument().

Here is the call graph for this function:

Here is the caller graph for this function:

void CAScoreViewPort::setTextEdit ( CATextEdit e) [inline, private]

References _textEdit.

Referenced by initScoreViewPort().

Here is the caller graph for this function:

void CAScoreViewPort::setTextEditGeometry ( const QRect  r) [inline, private]

References _textEditGeometry.

Referenced by createTextEdit().

Here is the caller graph for this function:

void CAScoreViewPort::setTextEditVisible ( bool  v) [inline, private]

References _textEditVisible.

Referenced by createTextEdit(), initScoreViewPort(), and removeTextEdit().

Here is the caller graph for this function:

void CAScoreViewPort::setWorldCoords ( const QRect  r,
bool  animate = false,
bool  force = false 
)

Sets the world coordinates of the viewport to the given rectangle coords. This is an overloaded member function, provided for convenience.

Warning:
Repaint is not done automatically!

References _checkScrollBarsDeadLock, checkScrollBars(), drawableHeight(), drawableWidth(), setWorldHeight(), setWorldWidth(), setWorldX(), and setWorldY().

Referenced by CAKeybdInput::midiInEventToScore(), on_animationTimer_timeout(), rebuild(), resizeEvent(), zoomToFit(), zoomToHeight(), zoomToSelection(), and zoomToWidth().

Here is the call graph for this function:

Here is the caller graph for this function:

void CAScoreViewPort::setWorldCoords ( double  x,
double  y,
double  w,
double  h,
bool  animate = false,
bool  force = false 
) [inline]

References setWorldCoords().

Referenced by setWorldCoords().

Here is the call graph for this function:

Here is the caller graph for this function:

void CAScoreViewPort::setWorldHeight ( int  h,
bool  force = false 
)

Sets the world height of the viewport. If force is True, sets the value despite the potential illegal value (like negative coordinates).

Warning:
Repaint is not done automatically!

References _drawableCList, _drawableMList, _oldWorldH, _vScrollBar, _vScrollBarDeadLock, _worldH, _worldY, _zoom, checkScrollBars(), drawableHeight(), getMaxYExtended(), and setWorldY().

Referenced by checkScrollBars(), setWorldCoords(), and setZoom().

Here is the call graph for this function:

Here is the caller graph for this function:

void CAScoreViewPort::setWorldWidth ( int  w,
bool  force = false 
)

Sets the world width of the viewport. If force is True, sets the value despite the potential illegal value (like negative coordinates).

Warning:
Repaint is not done automatically!

References _drawableCList, _drawableMList, _hScrollBar, _hScrollBarDeadLock, _oldWorldW, _worldW, _worldX, _zoom, checkScrollBars(), drawableWidth(), getMaxXExtended(), and setWorldX().

Referenced by checkScrollBars(), setWorldCoords(), and setZoom().

Here is the call graph for this function:

Here is the caller graph for this function:

void CAScoreViewPort::setWorldX ( int  x,
bool  animate = false,
bool  force = false 
)

Sets the world Top-Left X coordinate of the viewport. Animates the scroll, if animate is True. If force is True, sets the value despite the potential illegal value (like negative coordinates).

Warning:
Repaint is not done automatically!

References _drawableCList, _drawableMList, _hScrollBar, _hScrollBarDeadLock, _oldWorldX, _targetWorldX, _targetWorldY, _targetZoom, _worldW, _worldX, _worldY, _zoom, checkScrollBars(), getMaxXExtended(), startAnimationTimer(), and updateHelpers().

Referenced by HScrollBarEvent(), CAMainWin::scoreViewPortWheel(), setCenterCoords(), setWorldCoords(), and setWorldWidth().

Here is the call graph for this function:

Here is the caller graph for this function:

void CAScoreViewPort::setWorldY ( int  y,
bool  animate = false,
bool  force = false 
)

Sets the world Top-Left Y coordinate of the viewport. Animates the scroll, if animate is True. If force is True, sets the value despite the potential illegal value (like negative coordinates).

Warning:
Repaint is not done automatically!

References _drawableCList, _drawableMList, _oldWorldY, _targetWorldX, _targetWorldY, _targetZoom, _vScrollBar, _vScrollBarDeadLock, _worldH, _worldX, _worldY, _zoom, checkScrollBars(), getMaxYExtended(), startAnimationTimer(), and updateHelpers().

Referenced by CAMainWin::scoreViewPortWheel(), setCenterCoords(), setWorldCoords(), setWorldHeight(), and VScrollBarEvent().

Here is the call graph for this function:

Here is the caller graph for this function:

void CAScoreViewPort::setZoom ( float  z,
double  x = 0,
double  y = 0,
bool  animate = false,
bool  force = false 
)

Zooms to the given level to given direction.

Warning:
Repaint is not done automatically, if animate is False!
Parameters:
zZoom level. (1.0 = 100%, 1.5 = 150% etc.)
xX coordinate of the point of the zoom direction.
yY coordinate of the point of the zoom direction.
animateUse smooth animated zoom.
forceUse the given world units despite their illegal values (like negative coordinates etc.).

References _targetWorldX, _targetWorldY, _targetZoom, _worldH, _worldW, _worldX, _worldY, _zoom, checkScrollBars(), drawableHeight(), drawableWidth(), setCenterCoords(), setWorldHeight(), setWorldWidth(), startAnimationTimer(), and updateHelpers().

Referenced by CAMainWin::scoreViewPortWheel(), and CASettingsDialog::setupPages().

Here is the call graph for this function:

Here is the caller graph for this function:

void CAScoreViewPort::setZoom ( float  z,
QPoint  p,
bool  animate = false,
bool  force = false 
) [inline]

Zooms to the given level to given direction. This is an overloaded member function, provided for convenience.

Warning:
Repaint is not done automatically, if animate is False!
Parameters:
zZoom level. (1.0 = 100%, 1.5 = 150% etc.)
pQPoint of the zoom direction.
animateUse smooth animated zoom.
forceUse the given world units despite their illegal values (like negative coordinates etc.).

References setZoom().

Referenced by setZoom().

Here is the call graph for this function:

Here is the caller graph for this function:

References _shadowNoteAccs.

References _shadowNoteVisible.

bool CAScoreViewPort::shadowNoteVisibleOnLeave ( ) [inline, private]

References _animationStep, _animationTimer, and on_animationTimer_timeout().

Referenced by setWorldX(), setWorldY(), and setZoom().

Here is the call graph for this function:

Here is the caller graph for this function:

References _textEdit.

Referenced by createTextEdit(), CAMainWin::onTextEditKeyPressEvent(), removeTextEdit(), and updateHelpers().

Here is the caller graph for this function:

QRect CAScoreViewPort::textEditGeometry ( ) [inline, private]

References _textEditGeometry.

Referenced by updateHelpers().

Here is the caller graph for this function:

References _textEditVisible.

Referenced by CAMainWin::setMode(), and updateHelpers().

Here is the caller graph for this function:

double CAScoreViewPort::timeToCoords ( int  time)

Returns the X coordinate for the given Canorus time. Returns -1, if such a time doesn't exist in the score.

References _drawableMList, CAKDTree< T >::at(), CADrawableMusElement::musElement(), selection(), CAKDTree< T >::size(), CAMusElement::timeStart(), and CADrawable::xPos().

Referenced by CAEngraver::reposit(), and CAMainWin::scoreViewPortMouseMove().

Here is the call graph for this function:

Here is the caller graph for this function:

Simple Version of

See also:
timeToCoords( time ): Returns the X coordinate for the given Canorus time. Returns -1, if such a time doesn't exist in the score.

References _drawableMList, CAKDTree< T >::at(), CADrawableMusElement::musElement(), CAKDTree< T >::size(), CAMusElement::timeStart(), and CADrawable::xPos().

Referenced by CAKeybdInput::midiInEventToScore().

Here is the call graph for this function:

Here is the caller graph for this function:

Disables the border.

References _drawBorder.

Referenced by CAMainWin::setMode().

Here is the caller graph for this function:

void CAScoreViewPort::VScrollBarEvent ( int  val) [private, slot]

Processes the Vertical scroll bar event. This method is called when the horizontal scrollbar changes its value, let it be internally or due to user interaction.

References _allowManualScroll, _vScrollBarDeadLock, and setWorldY().

Referenced by initScoreViewPort().

Here is the call graph for this function:

Here is the caller graph for this function:

void CAScoreViewPort::wheelEvent ( QWheelEvent *  e) [private, slot]

Processes the wheelEvent(). A new signal is emitted: CAWheelEvent(), which usually gets processed by the parent class then.

References _worldX, _worldY, _xCursor, _yCursor, _zoom, and CAWheelEvent().

Here is the call graph for this function:

const QRect CAScoreViewPort::worldCoords ( ) [inline]

References worldHeight(), worldWidth(), worldX(), and worldY().

Referenced by CAKeybdInput::midiInEventToScore(), and rebuild().

Here is the call graph for this function:

Here is the caller graph for this function:

References _worldH.

Referenced by checkScrollBars(), and worldCoords().

Here is the caller graph for this function:

References _worldW.

Referenced by checkScrollBars(), and worldCoords().

Here is the caller graph for this function:

const int CAScoreViewPort::worldX ( ) [inline]

References _worldX.

Referenced by CAMainWin::scoreViewPortWheel(), updateHelpers(), and worldCoords().

Here is the caller graph for this function:

const int CAScoreViewPort::worldY ( ) [inline]

References _worldY.

Referenced by CAMainWin::scoreViewPortWheel(), updateHelpers(), and worldCoords().

Here is the caller graph for this function:

float CAScoreViewPort::zoom ( ) [inline]

Returns the zoom level of the viewport (1.0 = 100%, 1.5 = 150% etc.).

References _zoom.

Referenced by CAMainWin::scoreViewPortWheel(), and updateHelpers().

Here is the caller graph for this function:

void CAScoreViewPort::zoomToFit ( bool  animate = false,
bool  force = false 
)

References _drawableCList, _drawableMList, CAKDTree< T >::getMaxX(), CAKDTree< T >::getMaxY(), and setWorldCoords().

Here is the call graph for this function:

void CAScoreViewPort::zoomToHeight ( bool  animate = false,
bool  force = false 
)

References _drawableCList, _drawableMList, getMaxYExtended(), and setWorldCoords().

Here is the call graph for this function:

void CAScoreViewPort::zoomToSelection ( bool  animate = false,
bool  force = false 
)

References _selection, and setWorldCoords().

Here is the call graph for this function:

void CAScoreViewPort::zoomToWidth ( bool  animate = false,
bool  force = false 
)

References _drawableCList, _drawableMList, getMaxXExtended(), and setWorldCoords().

Here is the call graph for this function:


Member Data Documentation

This property holds whether a user interaction with the scrollbars actually triggers the scroll of the viewport.

Referenced by HScrollBarEvent(), initScoreViewPort(), manualScroll(), setManualScroll(), and VScrollBarEvent().

Referenced by border(), paintEvent(), and setBorder().

QTimer* CAScoreViewPort::_clickTimer [private]
QScrollBar* CAScoreViewPort::_hScrollBar [private]
QGridLayout* CAScoreViewPort::_layout [private]

Referenced by initScoreViewPort().

QString CAScoreViewPort::_noteName [private]

Referenced by noteName(), and setNoteName().

double CAScoreViewPort::_oldWorldH [private]
double CAScoreViewPort::_oldWorldW [private]
double CAScoreViewPort::_oldWorldX [private]

Referenced by paintEvent(), and setWorldX().

double CAScoreViewPort::_oldWorldY [private]

Referenced by paintEvent(), and setWorldY().

bool CAScoreViewPort::_playing [private]

Referenced by selectedVoice(), and setSelectedVoice().

QList<QRect> CAScoreViewPort::_selectionRegionList [private]

Referenced by clone(), setSheet(), and sheet().

Referenced by setTextEdit(), and textEdit().

QScrollBar * CAScoreViewPort::_vScrollBar [private]
double CAScoreViewPort::_worldH [private]
double CAScoreViewPort::_worldW [private]
double CAScoreViewPort::_worldX [private]
double CAScoreViewPort::_worldY [private]
double CAScoreViewPort::_xCursor [private]
double CAScoreViewPort::_yCursor [private]
float CAScoreViewPort::_zoom [private]
const int CAScoreViewPort::ANIMATION_STEPS = 7 [static, private]
const int CAScoreViewPort::BOTTOM_EXTRA_SPACE = 30 [static, private]

Referenced by getMaxYExtended().

const int CAScoreViewPort::RIGHT_EXTRA_SPACE = 100 [static, private]

Copyright (c) 2006-2009, Matevž Jekovec, Canorus development team All Rights Reserved. See AUTHORS for a complete list of authors.

Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE.GPL for details.

Referenced by getMaxXExtended().


The documentation for this class was generated from the following files: