~ubuntu-branches/ubuntu/karmic/muse/karmic-proposed

« back to all changes in this revision

Viewing changes to midiedit/dcanvas.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Kobras
  • Date: 2002-04-23 17:28:23 UTC
  • Revision ID: james.westby@ubuntu.com-20020423172823-w8yplzr81a759xa3
Tags: upstream-0.5.2
ImportĀ upstreamĀ versionĀ 0.5.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//=========================================================
 
2
//  MusE
 
3
//  Linux Music Editor
 
4
//    $Id: dcanvas.h,v 1.2 2001/11/20 15:19:33 muse Exp $
 
5
//  (C) Copyright 1999 Werner Schweer (ws@seh.de)
 
6
//=========================================================
 
7
 
 
8
#ifndef __DCANVAS_H__
 
9
#define __DCANVAS_H__
 
10
 
 
11
#include "ecanvas.h"
 
12
#include "song.h"
 
13
 
 
14
#define TH 18
 
15
 
 
16
class MidiEvent;
 
17
class MidiEditor;
 
18
 
 
19
//---------------------------------------------------------
 
20
//   DEvent
 
21
//    ''visual'' Drum Event
 
22
//---------------------------------------------------------
 
23
 
 
24
class DEvent : public CItem {
 
25
   public:
 
26
      DEvent(MidiEvent* e, Part* p);
 
27
      };
 
28
 
 
29
class ScrollScale;
 
30
class PianoRoll;
 
31
class QTextDrag;
 
32
 
 
33
//---------------------------------------------------------
 
34
//   DrumCanvas
 
35
//---------------------------------------------------------
 
36
 
 
37
class DrumCanvas : public EventCanvas {
 
38
 
 
39
      Q_OBJECT
 
40
      virtual void drawCanvas(QPainter&, const QRect&);
 
41
      virtual void drawItem(QPainter&, const CItem*, const QRect&) const;
 
42
      virtual bool moveItem(CItem*, const QPoint&, bool);
 
43
      virtual CItem* newItem(const QPoint&, int);
 
44
      virtual void resizeItem(CItem*, bool);
 
45
      virtual void newItem(CItem*, bool);
 
46
      virtual bool deleteItem(CItem*);
 
47
 
 
48
      int y2pitch(int y) const;
 
49
      int pitch2y(int pitch) const;
 
50
      QTextDrag* getTextDrag(QWidget* parent);
 
51
      void copy();
 
52
      int pasteAt(const QString& pt, int pos);
 
53
      void paste();
 
54
      void startDrag(CItem*, bool copymode);
 
55
      void dragEnterEvent(QDragEnterEvent* event);
 
56
      void dragMoveEvent(QDragMoveEvent*);
 
57
      void dragLeaveEvent(QDragLeaveEvent*);
 
58
      void viewDropEvent(QDropEvent* event);
 
59
      virtual void addItem(Part*, Event*);
 
60
      virtual void resizeEvent(QResizeEvent*);
 
61
 
 
62
   signals:
 
63
      void newWidth(int);
 
64
 
 
65
   public slots:
 
66
      void mapChanged()       { songChanged(0); }
 
67
      void keyPressed(int, bool);
 
68
      void keyReleased(int, bool);
 
69
 
 
70
   public:
 
71
      enum {CMD_CUT, CMD_COPY, CMD_PASTE, CMD_SAVE, CMD_LOAD,
 
72
         CMD_SELECT_ALL, CMD_SELECT_NONE, CMD_SELECT_INVERT,
 
73
         CMD_SELECT_ILOOP, CMD_SELECT_OLOOP, CMD_DEL
 
74
         };
 
75
      DrumCanvas(MidiEditor*, QWidget*, int, int,
 
76
         const char* name = 0);
 
77
      void cmd(int);
 
78
      };
 
79
#endif
 
80