~ubuntu-branches/ubuntu/quantal/muse/quantal

« back to all changes in this revision

Viewing changes to mplugins/mittranspose.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: mittranspose.h,v 1.3 2002/01/03 11:30:04 muse Exp $
 
5
//
 
6
//  (C) Copyright 2001 Werner Schweer (ws@seh.de)
 
7
//=========================================================
 
8
 
 
9
#ifndef __MITTRANSPOSE_H__
 
10
#define __MITTRANSPOSE_H__
 
11
 
 
12
#include "mitplugin.h"
 
13
#include "mittransposebase.h"
 
14
#include <list>
 
15
 
 
16
struct KeyOn {
 
17
      unsigned char pitch;
 
18
      unsigned char channel;
 
19
      unsigned char port;
 
20
      char transpose;
 
21
      KeyOn(int a, int b, int c, int d) {
 
22
            pitch = a;
 
23
            transpose = d;
 
24
            channel = b;
 
25
            port = c;
 
26
            }
 
27
      };
 
28
 
 
29
typedef std::list<KeyOn > KeyOnList;
 
30
typedef KeyOnList::iterator iKeyOn;
 
31
 
 
32
class Xml;
 
33
 
 
34
//---------------------------------------------------------
 
35
//   MITPluginTranspose
 
36
//---------------------------------------------------------
 
37
 
 
38
class MITPluginTranspose : public MITTransposeBase, public MITPlugin {
 
39
      Q_OBJECT
 
40
 
 
41
      KeyOnList keyOnList;
 
42
      int transpose;    // current pitch offset
 
43
      int trigger;
 
44
      bool on;
 
45
      bool transposeChangedFlag;
 
46
 
 
47
      void transposeChanged();
 
48
      virtual void closeEvent(QCloseEvent*);
 
49
 
 
50
   signals:
 
51
      void hideWindow();
 
52
 
 
53
   private slots:
 
54
      void onToggled(bool);
 
55
      void triggerKeyChanged(int);
 
56
      void noteReceived();
 
57
 
 
58
   public:
 
59
      MITPluginTranspose(QWidget* parent = 0, const char* name = 0, WFlags fl = 0);
 
60
      virtual void process(MidiEvent*);
 
61
      virtual void readStatus(Xml&);
 
62
      virtual void writeStatus(int, Xml&) const;
 
63
      };
 
64
 
 
65
extern MITPluginTranspose* mitPluginTranspose;
 
66
 
 
67
#endif
 
68