summaryrefslogtreecommitdiff
path: root/noncore/multimedia/powerchord/fretboard.h
Unidiff
Diffstat (limited to 'noncore/multimedia/powerchord/fretboard.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/powerchord/fretboard.h101
1 files changed, 101 insertions, 0 deletions
diff --git a/noncore/multimedia/powerchord/fretboard.h b/noncore/multimedia/powerchord/fretboard.h
new file mode 100644
index 0000000..d316df3
--- a/dev/null
+++ b/noncore/multimedia/powerchord/fretboard.h
@@ -0,0 +1,101 @@
1//
2// FretBoard class to display interface for chord finder application
3//
4
5// Copyright (c) 2001 Camilo Mesias
6// camilo@mesias.co.uk
7//
8// This program is free software; you can redistribute it and/or
9// modify it under the terms of the GNU General Public License
10// as published by the Free Software Foundation; either version 2
11// of the License, or (at your option) any later version.
12//
13// This program is distributed in the hope that it will be useful,
14// but WITHOUT ANY WARRANTY; without even the implied warranty of
15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16// GNU General Public License for more details.
17//
18// You should have received a copy of the GNU General Public License
19// along with this program; if not, write to the Free Software
20// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21
22#ifndef __FRETBOARD_H
23#define __FRETBOARD_H
24
25//#include <FL/Fl.H>
26//#include <FL/Fl_Widget.H>
27
28#include <qwidget.h>
29#include <qpixmap.h>
30#include <qstring.h>
31
32#include "chordengine.h"
33
34class FretBoard : public QWidget {
35
36 Q_OBJECT
37
38 private:
39
40 // refresh display based on chord engine
41 void refresh();
42
43 // image stuff
44 QPixmap stringtop_pix;
45 QPixmap string_pix;
46 QPixmap finger_pix;
47 QPixmap mute_pix;
48
49 //saved state of the fretboard
50
51 int initial_fret;
52 int finger[6];
53
54 protected:
55 // void draw_box();
56 // void draw_label();
57 void paintEvent(QPaintEvent *);
58
59 public:
60 // encapsulated chord engine class
61 ChordEngine ce;
62
63 static const int MUTED=7;
64 static const int OPEN=0;
65
66 // void draw();
67 FretBoard(QWidget *parent=0, const char *name=0);
68
69 // not used yet
70 // int Finger(int finger);
71 // int Fret(){return initial_fret;};
72
73 // slots
74 public slots:
75 void Finger(int finger, int position);
76
77 void Fret(int position){
78 initial_fret = position;
79 ce.fret(position);
80 refresh();
81 };
82 void Base(int b){ce.base(b);refresh();};
83 void Chord(int b){ce.chord(b);refresh();};
84 void Span(int b){ce.span(b);refresh();};
85 void Vary(int b){ce.vary(b);refresh();};
86 void Tune(int b){ce.tune(b);refresh();};
87
88 signals:
89 void nameChanged(const QString &);
90 void s1nameChanged(const QString &);
91 void s2nameChanged(const QString &);
92 void s3nameChanged(const QString &);
93 void s4nameChanged(const QString &);
94 void s5nameChanged(const QString &);
95 void s6nameChanged(const QString &);
96
97};
98
99#endif
100
101