summaryrefslogtreecommitdiff
path: root/muse/muse/master/master.h
blob: 3e389ad156150aee7f97e4764a8acfebc53a4dba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//=========================================================
//  MusE
//  Linux Music Editor
//    $Id: master.h,v 1.3 2004/04/11 13:03:32 wschweer Exp $
//  (C) Copyright 1999 Werner Schweer (ws@seh.de)
//=========================================================

#ifndef __MASTER_H__
#define __MASTER_H__

#include <qpoint.h>

#include "view.h"
#include "song.h"
#include "tools.h"

class ScrollScale;
class QPainter;
class QRect;
class MidiEditor;

//---------------------------------------------------------
//   Master
//---------------------------------------------------------

class Master : public View {
      enum DragMode { DRAG_OFF, DRAG_NEW, DRAG_MOVE_START, DRAG_MOVE,
            DRAG_DELETE, DRAG_COPY_START, DRAG_COPY,
            DRAG_RESIZE, DRAG_LASSO_START, DRAG_LASSO
            };
      ScrollScale* vscroll;
      unsigned pos[3];
      QPoint start;
      Tool tool;
      DragMode drag;
      MidiEditor* editor;

      Q_OBJECT
      virtual void pdraw(QPainter&, const QRect&);
      virtual void viewMouseMoveEvent(QMouseEvent* event);
      virtual void leaveEvent(QEvent*e);
      virtual void viewMousePressEvent(QMouseEvent* event);
      virtual void viewMouseReleaseEvent(QMouseEvent*);

      void draw(QPainter&, const QRect&);
      void newVal(int x1, int x2, int y);
      bool deleteVal1(unsigned int x1, unsigned int x2);
      void deleteVal(int x1, int x2);

   signals:
      void followEvent(int);
      void xposChanged(int);
      void yposChanged(int);
      void timeChanged(unsigned);
      void tempoChanged(int);

   public slots:
      void setPos(int, unsigned, bool adjustScrollbar);
      void setTool(int t);

   public:
      Master(MidiEditor*, QWidget* parent, int xmag, int ymag);
      };

#endif