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

« back to all changes in this revision

Viewing changes to key.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: key.h,v 1.2 2001/11/20 15:19:31 muse Exp $
 
5
//
 
6
//  (C) Copyright 1999/2000 Werner Schweer (ws@seh.de)
 
7
//=========================================================
 
8
 
 
9
#ifndef __KEY_H__
 
10
#define __KEY_H__
 
11
 
 
12
#include <stdio.h>
 
13
class QPainter;
 
14
class QPoint;
 
15
class Xml;
 
16
 
 
17
//---------------------------------------------------------
 
18
//   NKey
 
19
//---------------------------------------------------------
 
20
 
 
21
class NKey {
 
22
      static int offsets[14];
 
23
      int val;
 
24
   public:
 
25
      NKey() { val = 7; }
 
26
      NKey(int k) { val = k; }
 
27
      void draw(QPainter& p, const QPoint& pt) const;
 
28
      int idx() const  { return val; }
 
29
      int offset() const { return offsets[val]; }
 
30
      void read(Xml&);
 
31
      void write(int, Xml&) const;
 
32
      void set(int n) { val = n; }
 
33
      int width() const;
 
34
      };
 
35
 
 
36
//---------------------------------------------------------
 
37
//   Scale
 
38
//---------------------------------------------------------
 
39
 
 
40
class Scale {
 
41
      int val;                // 1 = 1 sharp,  -1 1 flat
 
42
      bool minor;
 
43
   public:
 
44
      Scale() { val = 0; minor = false; }
 
45
      Scale(int s, bool m = false) { val = s; minor = m; }
 
46
      void draw(NKey&, QPainter&, const QPoint&) const;
 
47
      void print(NKey& key, FILE* f, const QPoint& pto) const;
 
48
      int idx() const             { return val; }
 
49
      void read(Xml&);
 
50
      void write(int, Xml&) const;
 
51
      void set(int n)             { val = n; }
 
52
      void setMajorMinor(bool f)  { minor = f; }      // true == minor
 
53
      int width() const;
 
54
      };
 
55
#endif
 
56