summaryrefslogtreecommitdiff
path: root/attic/muse_qt4_evolution/muse/midiedit/prcanvas.h
blob: 7f92e95eeabd58df65c4906387e621c8fc072931 (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
67
68
69
70
71
72
73
74
75
//=============================================================================
//  MusE
//  Linux Music Editor
//  $Id:$
//
//  Copyright (C) 2002-2006 by Werner Schweer and others
//
//  This program is free software; you can redistribute it and/or modify
//  it under the terms of the GNU General Public License version 2.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program; if not, write to the Free Software
//  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//=============================================================================

#ifndef __PRCANVAS_H__
#define __PRCANVAS_H__

#include "ecanvas.h"

class CItem;
class MidiCmd;

//---------------------------------------------------------
//   PianoCanvas
//---------------------------------------------------------

class PianoCanvas : public EventCanvas {
      Q_OBJECT

      int colorMode;
      int playedPitch;

      MidiCmd* cmdModifyGateTime;
      MidiCmd* cmdModifyVelocity;

      virtual void paint(QPainter&, QRect);
      virtual CItem* searchItem(const QPoint& p) const;
      virtual void addItem(Part* part, const Event& event);
      virtual void viewMouseDoubleClickEvent(QMouseEvent*);
      virtual void moveItem(CItem*, DragType);
      virtual CItem* newItem(const QPoint&, int);
      virtual void resizeItem(CItem*, bool noSnap);
      virtual void newItem(CItem*, bool noSnap);
      virtual bool deleteItem(CItem*);
      virtual void startDrag(CItem* item, bool copymode);
      virtual void dragEnterEvent(QDragEnterEvent* event);
      virtual void dragMoveEvent(QDragMoveEvent*);
      virtual void dragLeaveEvent(QDragLeaveEvent*);
      virtual void viewDropEvent(QDropEvent* event);
      virtual void selectLasso(bool toggle);
      virtual void timeTypeChanged();

      void quantize(int, int, bool);
      void paste();
      virtual void itemPressed(const CItem*);
      virtual void itemReleased();
      virtual void itemMoved(const CItem*);

   public slots:
      void pianoCmd(int);

   public:
      PianoCanvas(MidiEditor*);
      void cmd(QAction*, int, int, bool);
      void setColorMode(int mode);
      virtual void modifySelected(NoteInfo::ValType type, int delta);
      };
#endif