+DocumentTrack *TrackView::panelAt(int y)
+{
+ return NULL;
+}
+
+QGraphicsScene *TrackView::projectScene()
+{
+ return m_scene;
+}
+
+CustomTrackView *TrackView::projectView()
+{
+ return m_trackview;
+}
+
+void TrackView::setEditMode(const QString & editMode)
+{
+ m_editMode = editMode;
+}
+
+const QString & TrackView::editMode() const
+{
+ return m_editMode;
+}
+
+/** This event occurs when the mouse has been moved. */
+ void TrackView::mouseMoveEvent(QMouseEvent * event) {
+ if (m_panelUnderMouse) {
+ if (event->buttons() & Qt::LeftButton) {
+ bool result = false;
+ if (m_function)
+ result =
+ m_function->mouseMoved(m_panelUnderMouse, event);
+ if (!result) {
+ m_panelUnderMouse = 0;
+ m_function = 0;
+ }
+ } else {
+ if (m_function) {
+ m_function->mouseReleased(m_panelUnderMouse, event);
+ m_function = 0;
+ }
+ m_panelUnderMouse = 0;
+ }
+ } else {
+ DocumentTrack *panel = panelAt(event->y());
+ if (panel) {
+ QCursor result(Qt::ArrowCursor);
+
+ TrackPanelFunction *function =
+ getApplicableFunction(panel, editMode(),
+ event);
+ if (function)
+ result = function->getMouseCursor(panel, event);
+
+ setCursor(result);
+ } else {
+ setCursor(QCursor(Qt::ArrowCursor));
+ }
+ }
+ }
+
+ TrackPanelFunction *TrackView::getApplicableFunction(DocumentTrack *
+ panel, const QString & editMode, QMouseEvent * event) {
+ TrackPanelFunction *function = 0;
+
+ QStringList list = panel->applicableFunctions(editMode);
+ QStringList::iterator itt = list.begin();
+
+ while (itt != list.end()) {
+ TrackPanelFunction *testFunction = m_factory.function(*itt);
+ if (testFunction) {
+ if (testFunction->mouseApplies(panel, event)) {
+ function = testFunction;
+ break;
+ }
+ }
+
+ ++itt;
+ }
+
+ return function;
+ }
+
+