summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2004-05-20 08:02:37 (UTC)
committer llornkcor <llornkcor>2004-05-20 08:02:37 (UTC)
commit47245723b724beb24183aa32b047d77f3469b7df (patch) (unidiff)
treec20cc2984589db4f9888163018d1ce647af59518
parent7ee7f26e39ef6c3ed164f307c1c3906961c1b189 (diff)
downloadopie-47245723b724beb24183aa32b047d77f3469b7df.zip
opie-47245723b724beb24183aa32b047d77f3469b7df.tar.gz
opie-47245723b724beb24183aa32b047d77f3469b7df.tar.bz2
always compile before commit
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/powerchord/powerchordbase.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/multimedia/powerchord/powerchordbase.cpp b/noncore/multimedia/powerchord/powerchordbase.cpp
index 92198bf..98fe3f7 100644
--- a/noncore/multimedia/powerchord/powerchordbase.cpp
+++ b/noncore/multimedia/powerchord/powerchordbase.cpp
@@ -1,593 +1,593 @@
1/**************************************************************************** 1/****************************************************************************
2** Form implementation generated from reading ui file 'powerchordbase.ui' 2** Form implementation generated from reading ui file 'powerchordbase.ui'
3** 3**
4** Created: Sun Jan 13 23:05:11 2002 4** Created: Sun Jan 13 23:05:11 2002
5** by: The User Interface Compiler (uic) 5** by: The User Interface Compiler (uic)
6** 6**
7** WARNING! All changes made in this file will be lost! 7** WARNING! All changes made in this file will be lost!
8****************************************************************************/ 8****************************************************************************/
9#include "powerchordbase.h" 9#include "powerchordbase.h"
10#include "fretboard.h" 10#include "fretboard.h"
11#include "vumeter.h" 11#include "vumeter.h"
12 12
13/* OPIE */ 13/* OPIE */
14#include <opie2/odebug.h> 14#include <opie2/odebug.h>
15#include <qpe/resource.h> 15#include <qpe/resource.h>
16using namespace Opie::Core; 16using namespace Opie::Core;
17 17
18/* QT */ 18/* QT */
19#include <qcombobox.h> 19#include <qcombobox.h>
20#include <qlabel.h> 20#include <qlabel.h>
21#include <qlistbox.h> 21#include <qlistbox.h>
22#include <qpushbutton.h> 22#include <qpushbutton.h>
23#include <qspinbox.h> 23#include <qspinbox.h>
24#include <qtabwidget.h> 24#include <qtabwidget.h>
25#include <qlayout.h> 25#include <qlayout.h>
26#include <qtooltip.h> 26#include <qtooltip.h>
27 27
28/* 28/*
29 * Constructs a PowerchordBase which is a child of 'parent', with the 29 * Constructs a PowerchordBase which is a child of 'parent', with the
30 * name 'name' and widget flags set to 'f' 30 * name 'name' and widget flags set to 'f'
31 */ 31 */
32PowerchordBase::PowerchordBase( QWidget* parent, const char* name, WFlags fl ) 32PowerchordBase::PowerchordBase( QWidget* parent, const char* name, WFlags fl )
33 : QWidget( parent, name, fl ) 33 : QWidget( parent, name, fl )
34{ 34{
35 simulation_timer = 0; 35 simulation_timer = 0;
36 audio_timer = 0; 36 audio_timer = 0;
37 37
38 // setPalette( QPalette( QColor( 232, 227, 215) ) ); 38 // setPalette( QPalette( QColor( 232, 227, 215) ) );
39 39
40 // QPixmap image0(QString("/opt/Qtopia/pics/powerchord/image0")); 40 // QPixmap image0(QString("/opt/Qtopia/pics/powerchord/image0"));
41 QPixmap image1 = Resource::loadPixmap( "powerchord/image1"); 41 QPixmap image1 = Resource::loadPixmap( "powerchord/image1");
42 QPixmap image2 = Resource::loadPixmap( "powerchord/image2"); 42 QPixmap image2 = Resource::loadPixmap( "powerchord/image2");
43 QPixmap image3 = Resource::loadPixmap( "powerchord/image3"); 43 QPixmap image3 = Resource::loadPixmap( "powerchord/image3");
44 QPixmap image4 = Resource::loadPixmap( "powerchord/image4"); 44 QPixmap image4 = Resource::loadPixmap( "powerchord/image4");
45 QPixmap image5 = Resource::loadPixmap( "powerchord/image5"); 45 QPixmap image5 = Resource::loadPixmap( "powerchord/image5");
46 image6 = Resource::loadPixmap( "powerchord/image6"); 46 image6 = Resource::loadPixmap( "powerchord/image6");
47 image_open = Resource::loadPixmap( "powerchord/image_open"); 47 image_open = Resource::loadPixmap( "powerchord/image_open");
48 48
49 // image0.setMask(image0.createHeuristicMask()); 49 // image0.setMask(image0.createHeuristicMask());
50 image1.setMask(image1.createHeuristicMask()); 50 image1.setMask(image1.createHeuristicMask());
51 // image2.setMask(image2.createHeuristicMask()); 51 // image2.setMask(image2.createHeuristicMask());
52 // image3.setMask(image3.createHeuristicMask()); 52 // image3.setMask(image3.createHeuristicMask());
53 // image4.setMask(image4.createHeuristicMask()); 53 // image4.setMask(image4.createHeuristicMask());
54 // image5.setMask(image5.createHeuristicMask()); 54 // image5.setMask(image5.createHeuristicMask());
55 // image6->setMask(image6->createHeuristicMask()); 55 // image6->setMask(image6->createHeuristicMask());
56 // image_open->setMask(image_open->createHeuristicMask()); 56 // image_open->setMask(image_open->createHeuristicMask());
57 57
58 if ( !name ) 58 if ( !name )
59 setName( "PowerchordBase" ); 59 setName( "PowerchordBase" );
60 resize( 240, 284 ); 60 resize( 240, 284 );
61 setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, sizePolicy().hasHeightForWidth() ) ); 61 setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, sizePolicy().hasHeightForWidth() ) );
62 setMinimumSize( QSize( 240, 284 ) ); 62 setMinimumSize( QSize( 240, 284 ) );
63 setMaximumSize( QSize( 240, 284 ) ); 63 setMaximumSize( QSize( 240, 284 ) );
64 setCaption( tr( "Powerchord" ) ); 64 setCaption( tr( "Powerchord" ) );
65 65
66 tabs = new QTabWidget( this, "tabs" ); 66 tabs = new QTabWidget( this, "tabs" );
67 tabs->setEnabled( TRUE ); 67 tabs->setEnabled( TRUE );
68 tabs->setGeometry( QRect( 0, 0, 240, 286 ) ); 68 tabs->setGeometry( QRect( 0, 0, 240, 286 ) );
69 tabs->setTabPosition( QTabWidget::Bottom ); 69 tabs->setTabPosition( QTabWidget::Bottom );
70 70
71 tab = new QWidget( tabs, "tab" ); 71 tab = new QWidget( tabs, "tab" );
72 72
73 chordkey = new QComboBox( FALSE, tab, "chordkey" ); 73 chordkey = new QComboBox( FALSE, tab, "chordkey" );
74 chordkey->insertItem( tr( "maj" ) ); 74 chordkey->insertItem( tr( "maj" ) );
75 chordkey->insertItem( tr( "min" ) ); 75 chordkey->insertItem( tr( "min" ) );
76 chordkey->insertItem( tr( "7th" ) ); 76 chordkey->insertItem( tr( "7th" ) );
77 chordkey->insertItem( tr( "m7" ) ); 77 chordkey->insertItem( tr( "m7" ) );
78 chordkey->insertItem( tr( "maj7" ) ); 78 chordkey->insertItem( tr( "maj7" ) );
79 chordkey->insertItem( tr( "6th" ) ); 79 chordkey->insertItem( tr( "6th" ) );
80 chordkey->insertItem( tr( "m6th" ) ); 80 chordkey->insertItem( tr( "m6th" ) );
81 chordkey->insertItem( tr( "aug" ) ); 81 chordkey->insertItem( tr( "aug" ) );
82 chordkey->insertItem( tr( "dim" ) ); 82 chordkey->insertItem( tr( "dim" ) );
83 chordkey->insertItem( tr( "sus4" ) ); 83 chordkey->insertItem( tr( "sus4" ) );
84 chordkey->insertItem( tr( "7sus4" ) ); 84 chordkey->insertItem( tr( "7sus4" ) );
85 chordkey->insertItem( tr( "9th" ) ); 85 chordkey->insertItem( tr( "9th" ) );
86 chordkey->insertItem( tr( "add9" ) ); 86 chordkey->insertItem( tr( "add9" ) );
87 chordkey->insertItem( tr( "m9th" ) ); 87 chordkey->insertItem( tr( "m9th" ) );
88 chordkey->insertItem( tr( "maj9" ) ); 88 chordkey->insertItem( tr( "maj9" ) );
89 chordkey->insertItem( tr( "sus2" ) ); 89 chordkey->insertItem( tr( "sus2" ) );
90 chordkey->insertItem( tr( "7sus2" ) ); 90 chordkey->insertItem( tr( "7sus2" ) );
91 chordkey->insertItem( tr( "11th" ) ); 91 chordkey->insertItem( tr( "11th" ) );
92 chordkey->insertItem( tr( "m11th" ) ); 92 chordkey->insertItem( tr( "m11th" ) );
93 chordkey->insertItem( tr( "13th" ) ); 93 chordkey->insertItem( tr( "13th" ) );
94 chordkey->insertItem( tr( "m13th" ) ); 94 chordkey->insertItem( tr( "m13th" ) );
95 chordkey->insertItem( tr( "maj13" ) ); 95 chordkey->insertItem( tr( "maj13" ) );
96 chordkey->insertItem( tr( "6/9" ) ); 96 chordkey->insertItem( tr( "6/9" ) );
97 chordkey->insertItem( tr( "flat5" ) ); 97 chordkey->insertItem( tr( "flat5" ) );
98 chordkey->insertItem( tr( "7#9" ) ); 98 chordkey->insertItem( tr( "7#9" ) );
99 chordkey->insertItem( tr( QString::fromUtf8( "ø7" ) ) ); 99 chordkey->insertItem( tr( QString::fromUtf8( "ø7" ) ) );
100 chordkey->insertItem( tr( "5" ) ); 100 chordkey->insertItem( tr( "5" ) );
101 chordkey->setGeometry( QRect( 40, 0, 51, 21 ) ); 101 chordkey->setGeometry( QRect( 40, 0, 51, 21 ) );
102 102
103 chordfret = new QComboBox( FALSE, tab, "chordfret" ); 103 chordfret = new QComboBox( FALSE, tab, "chordfret" );
104 chordfret->insertItem( tr( "open" ) ); 104 chordfret->insertItem( tr( "open" ) );
105 chordfret->insertItem( tr( "1st" ) ); 105 chordfret->insertItem( tr( "1st" ) );
106 chordfret->insertItem( tr( "2nd" ) ); 106 chordfret->insertItem( tr( "2nd" ) );
107 chordfret->insertItem( tr( "3rd" ) ); 107 chordfret->insertItem( tr( "3rd" ) );
108 chordfret->insertItem( tr( "4th" ) ); 108 chordfret->insertItem( tr( "4th" ) );
109 chordfret->insertItem( tr( "5th" ) ); 109 chordfret->insertItem( tr( "5th" ) );
110 chordfret->insertItem( tr( "6th" ) ); 110 chordfret->insertItem( tr( "6th" ) );
111 chordfret->insertItem( tr( "7th" ) ); 111 chordfret->insertItem( tr( "7th" ) );
112 chordfret->insertItem( tr( "8th" ) ); 112 chordfret->insertItem( tr( "8th" ) );
113 chordfret->insertItem( tr( "9th" ) ); 113 chordfret->insertItem( tr( "9th" ) );
114 chordfret->insertItem( tr( "10th" ) ); 114 chordfret->insertItem( tr( "10th" ) );
115 chordfret->insertItem( tr( "11th" ) ); 115 chordfret->insertItem( tr( "11th" ) );
116 chordfret->insertItem( tr( "12th" ) ); 116 chordfret->insertItem( tr( "12th" ) );
117 chordfret->insertItem( tr( "13th" ) ); 117 chordfret->insertItem( tr( "13th" ) );
118 chordfret->insertItem( tr( "14th" ) ); 118 chordfret->insertItem( tr( "14th" ) );
119 chordfret->insertItem( tr( "15th" ) ); 119 chordfret->insertItem( tr( "15th" ) );
120 chordfret->insertItem( tr( "16th" ) ); 120 chordfret->insertItem( tr( "16th" ) );
121 chordfret->setGeometry( QRect( 90, 0, 55, 21 ) ); //cxm less 5 width 121 chordfret->setGeometry( QRect( 90, 0, 55, 21 ) ); //cxm less 5 width
122 122
123 chordnote = new QComboBox( FALSE, tab, "chordnote" ); 123 chordnote = new QComboBox( FALSE, tab, "chordnote" );
124 chordnote->insertItem( tr( "C" ) ); 124 chordnote->insertItem( tr( "C" ) );
125 chordnote->insertItem( tr( "C#" ) ); 125 chordnote->insertItem( tr( "C#" ) );
126 chordnote->insertItem( tr( "D" ) ); 126 chordnote->insertItem( tr( "D" ) );
127 chordnote->insertItem( tr( "Eb" ) ); 127 chordnote->insertItem( tr( "Eb" ) );
128 chordnote->insertItem( tr( "E" ) ); 128 chordnote->insertItem( tr( "E" ) );
129 chordnote->insertItem( tr( "F" ) ); 129 chordnote->insertItem( tr( "F" ) );
130 chordnote->insertItem( tr( "F#" ) ); 130 chordnote->insertItem( tr( "F#" ) );
131 chordnote->insertItem( tr( "G" ) ); 131 chordnote->insertItem( tr( "G" ) );
132 chordnote->insertItem( tr( "G#" ) ); 132 chordnote->insertItem( tr( "G#" ) );
133 chordnote->insertItem( tr( "A" ) ); 133 chordnote->insertItem( tr( "A" ) );
134 chordnote->insertItem( tr( "Bb" ) ); 134 chordnote->insertItem( tr( "Bb" ) );
135 chordnote->insertItem( tr( "B" ) ); 135 chordnote->insertItem( tr( "B" ) );
136 chordnote->setGeometry( QRect( 0, 0, 40, 21 ) ); 136 chordnote->setGeometry( QRect( 0, 0, 40, 21 ) );
137 chordnote->setCurrentItem( 9 ); 137 chordnote->setCurrentItem( 9 );
138 138
139 QWidget* privateLayoutWidget = new QWidget( tab, "Layout1" ); 139 QWidget* privateLayoutWidget = new QWidget( tab, "Layout1" );
140 privateLayoutWidget->setGeometry( QRect( 5, 232, 160, 20 ) ); 140 privateLayoutWidget->setGeometry( QRect( 5, 232, 160, 20 ) );
141 Layout1 = new QHBoxLayout( privateLayoutWidget ); 141 Layout1 = new QHBoxLayout( privateLayoutWidget );
142 Layout1->setSpacing( 6 ); 142 Layout1->setSpacing( 6 );
143 Layout1->setMargin( 0 ); 143 Layout1->setMargin( 0 );
144 144
145 s1_1 = new QLabel( privateLayoutWidget, "s1_1" ); 145 s1_1 = new QLabel( privateLayoutWidget, "s1_1" );
146 s1_1->setText( tr( "E" ) ); 146 s1_1->setText( tr( "E" ) );
147 s1_1->setAlignment( int( QLabel::AlignCenter ) ); 147 s1_1->setAlignment( int( QLabel::AlignCenter ) );
148 Layout1->addWidget( s1_1 ); 148 Layout1->addWidget( s1_1 );
149 149
150 s1_2 = new QLabel( privateLayoutWidget, "s1_2" ); 150 s1_2 = new QLabel( privateLayoutWidget, "s1_2" );
151 s1_2->setText( tr( "A" ) ); 151 s1_2->setText( tr( "A" ) );
152 s1_2->setAlignment( int( QLabel::AlignCenter ) ); 152 s1_2->setAlignment( int( QLabel::AlignCenter ) );
153 Layout1->addWidget( s1_2 ); 153 Layout1->addWidget( s1_2 );
154 154
155 s1_3 = new QLabel( privateLayoutWidget, "s1_3" ); 155 s1_3 = new QLabel( privateLayoutWidget, "s1_3" );
156 s1_3->setText( tr( "E" ) ); 156 s1_3->setText( tr( "E" ) );
157 s1_3->setAlignment( int( QLabel::AlignCenter ) ); 157 s1_3->setAlignment( int( QLabel::AlignCenter ) );
158 Layout1->addWidget( s1_3 ); 158 Layout1->addWidget( s1_3 );
159 159
160 s1_4 = new QLabel( privateLayoutWidget, "s1_4" ); 160 s1_4 = new QLabel( privateLayoutWidget, "s1_4" );
161 s1_4->setText( tr( "A" ) ); 161 s1_4->setText( tr( "A" ) );
162 s1_4->setAlignment( int( QLabel::AlignCenter ) ); 162 s1_4->setAlignment( int( QLabel::AlignCenter ) );
163 Layout1->addWidget( s1_4 ); 163 Layout1->addWidget( s1_4 );
164 164
165 s1_5 = new QLabel( privateLayoutWidget, "s1_5" ); 165 s1_5 = new QLabel( privateLayoutWidget, "s1_5" );
166 s1_5->setText( tr( "C#" ) ); 166 s1_5->setText( tr( "C#" ) );
167 s1_5->setAlignment( int( QLabel::AlignCenter ) ); 167 s1_5->setAlignment( int( QLabel::AlignCenter ) );
168 Layout1->addWidget( s1_5 ); 168 Layout1->addWidget( s1_5 );
169 169
170 s1_6 = new QLabel( privateLayoutWidget, "s1_6" ); 170 s1_6 = new QLabel( privateLayoutWidget, "s1_6" );
171 s1_6->setText( tr( "E" ) ); 171 s1_6->setText( tr( "E" ) );
172 s1_6->setAlignment( int( QLabel::AlignCenter ) ); 172 s1_6->setAlignment( int( QLabel::AlignCenter ) );
173 Layout1->addWidget( s1_6 ); 173 Layout1->addWidget( s1_6 );
174 174
175 // sound_label = new QLabel( tab, "sound_label" ); 175 // sound_label = new QLabel( tab, "sound_label" );
176 // sound_label->setGeometry( QRect( 185, 160, 32, 17 ) ); 176 // sound_label->setGeometry( QRect( 185, 160, 32, 17 ) );
177 // sound_label->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, sound_label->sizePolicy().hasHeightForWidth() ) ); 177 // sound_label->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, sound_label->sizePolicy().hasHeightForWidth() ) );
178 // sound_label->setPixmap( image0 ); 178 // sound_label->setPixmap( image0 );
179 // sound_label->pixmap()->setMask(*image0.mask()); 179 // sound_label->pixmap()->setMask(*image0.mask());
180 // sound_label->setScaledContents( TRUE ); 180 // sound_label->setScaledContents( TRUE );
181 // sound_label->setBackgroundMode( QWidget::PaletteButton ); 181 // sound_label->setBackgroundMode( QWidget::PaletteButton );
182 // sound_label->setBackgroundColor(this->backgroundColor()); 182 // sound_label->setBackgroundColor(this->backgroundColor());
183 // sound_label->setPalette( QPalette( QColor( 232, 227, 215) ) ); 183 // sound_label->setPalette( QPalette( QColor( 232, 227, 215) ) );
184 184
185 185
186 Frame6 = new QFrame( tab, "Frame6" ); 186 Frame6 = new QFrame( tab, "Frame6" );
187 Frame6->setGeometry( QRect( 170, 145, 66, 10 ) ); 187 Frame6->setGeometry( QRect( 170, 145, 66, 10 ) );
188 Frame6->setFrameShape( QFrame::HLine ); 188 Frame6->setFrameShape( QFrame::HLine );
189 Frame6->setFrameShadow( QFrame::Raised ); 189 Frame6->setFrameShadow( QFrame::Raised );
190 190
191 chordshow_label = new QLabel( tab, "chordshow_label" ); 191 chordshow_label = new QLabel( tab, "chordshow_label" );
192 chordshow_label->setGeometry( QRect( 185, 60, 32, 17 ) ); 192 chordshow_label->setGeometry( QRect( 185, 60, 32, 17 ) );
193 // chordshow_label->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, chordshow_label->sizePolicy().hasHeightForWidth() ) ); 193 // chordshow_label->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, chordshow_label->sizePolicy().hasHeightForWidth() ) );
194 chordshow_label->setFrameShape( QLabel::NoFrame ); 194 chordshow_label->setFrameShape( QLabel::NoFrame );
195 chordshow_label->setPixmap( image1 ); 195 chordshow_label->setPixmap( image1 );
196 chordshow_label->setScaledContents( TRUE ); 196 chordshow_label->setScaledContents( TRUE );
197 // chordshow_label->setBackgroundMode( QWidget::PaletteButton ); 197 // chordshow_label->setBackgroundMode( QWidget::PaletteButton );
198 198
199 transport_rec = new QPushButton( tab, "transport_rec" ); 199 transport_rec = new QPushButton( tab, "transport_rec" );
200 transport_rec->setGeometry( QRect( 170, 80, 30, 30 ) ); 200 transport_rec->setGeometry( QRect( 170, 80, 30, 30 ) );
201 transport_rec->setText( tr( "" ) ); 201 transport_rec->setText( tr( "" ) );
202 transport_rec->setPixmap( image2 ); 202 transport_rec->setPixmap( image2 );
203 203
204 play_sound = new QPushButton( tab, "play_sound" ); 204 play_sound = new QPushButton( tab, "play_sound" );
205 play_sound->setGeometry( QRect( 170, 180, 60, 55 ) ); 205 play_sound->setGeometry( QRect( 170, 180, 60, 55 ) );
206 play_sound->setText( tr( "" ) ); 206 play_sound->setText( tr( "" ) );
207 play_sound->setPixmap( image3 ); 207 play_sound->setPixmap( image3 );
208 208
209 Frame6_2 = new QFrame( tab, "Frame6_2" ); 209 Frame6_2 = new QFrame( tab, "Frame6_2" );
210 Frame6_2->setGeometry( QRect( 170, 45, 66, 10 ) ); 210 Frame6_2->setGeometry( QRect( 170, 45, 66, 10 ) );
211 Frame6_2->setFrameShape( QFrame::HLine ); 211 Frame6_2->setFrameShape( QFrame::HLine );
212 Frame6_2->setFrameShadow( QFrame::Raised ); 212 Frame6_2->setFrameShadow( QFrame::Raised );
213 213
214 transport_play = new QPushButton( tab, "transport_play" ); 214 transport_play = new QPushButton( tab, "transport_play" );
215 transport_play->setEnabled( FALSE ); 215 transport_play->setEnabled( FALSE );
216 transport_play->setGeometry( QRect( 200, 80, 30, 30 ) ); 216 transport_play->setGeometry( QRect( 200, 80, 30, 30 ) );
217 transport_play->setText( tr( "" ) ); 217 transport_play->setText( tr( "" ) );
218 transport_play->setPixmap( image3 ); 218 transport_play->setPixmap( image3 );
219 219
220 transport_rew = new QPushButton( tab, "transport_rew" ); 220 transport_rew = new QPushButton( tab, "transport_rew" );
221 transport_rew->setEnabled( FALSE ); 221 transport_rew->setEnabled( FALSE );
222 transport_rew->setGeometry( QRect( 170, 110, 30, 30 ) ); 222 transport_rew->setGeometry( QRect( 170, 110, 30, 30 ) );
223 transport_rew->setText( tr( "" ) ); 223 transport_rew->setText( tr( "" ) );
224 transport_rew->setPixmap( image4 ); 224 transport_rew->setPixmap( image4 );
225 225
226 transport_fwd = new QPushButton( tab, "transport_fwd" ); 226 transport_fwd = new QPushButton( tab, "transport_fwd" );
227 transport_fwd->setEnabled( FALSE ); 227 transport_fwd->setEnabled( FALSE );
228 transport_fwd->setGeometry( QRect( 200, 110, 30, 30 ) ); 228 transport_fwd->setGeometry( QRect( 200, 110, 30, 30 ) );
229 transport_fwd->setText( tr( "" ) ); 229 transport_fwd->setText( tr( "" ) );
230 transport_fwd->setPixmap( image5 ); 230 transport_fwd->setPixmap( image5 );
231 231
232 chordname = new QLabel( tab, "chordname" ); 232 chordname = new QLabel( tab, "chordname" );
233 chordname->setGeometry( QRect( 146, 0, 90, 20 ) ); //cxm moved l 5 233 chordname->setGeometry( QRect( 146, 0, 90, 20 ) ); //cxm moved l 5
234 chordname->setText( tr( "A" ) ); 234 chordname->setText( tr( "A" ) );
235 chordname->setAlignment( int( QLabel::AlignCenter ) ); 235 chordname->setAlignment( int( QLabel::AlignCenter ) );
236 QToolTip::add( chordname, tr( "" ) ); 236 QToolTip::add( chordname, tr( "" ) );
237 237
238 synth = new gs(); 238 synth = new gs();
239 tuner = new gt(); 239 tuner = new gt();
240 frets = new FretBoard( tab, "frets" ); 240 frets = new FretBoard( tab, "frets" );
241 frets->setGeometry( QRect( 0, 20, 168, 210 ) ); 241 frets->setGeometry( QRect( 0, 20, 168, 210 ) );
242 tabs->insertTab( tab, tr( "Guitar" ) ); 242 tabs->insertTab( tab, tr( "Guitar" ) );
243 243
244 tab_2 = new QWidget( tabs, "tab_2" ); 244 tab_2 = new QWidget( tabs, "tab_2" );
245 245
246 optlab2 = new QLabel( tab_2, "optlab2" ); 246 optlab2 = new QLabel( tab_2, "optlab2" );
247 optlab2->setGeometry( QRect( 9, 58, 120, 41 ) ); 247 optlab2->setGeometry( QRect( 9, 58, 120, 41 ) );
248 optlab2->setText( tr( "Alternative tunings are possible" ) ); 248 optlab2->setText( tr( "Alternative tunings are possible" ) );
249 optlab2->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter | QLabel::AlignLeft ) ); 249 optlab2->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter | QLabel::AlignLeft ) );
250 250
251 span = new QComboBox( FALSE, tab_2, "span" ); 251 span = new QComboBox( FALSE, tab_2, "span" );
252 span->insertItem( tr( "2" ) ); 252 span->insertItem( tr( "2" ) );
253 span->insertItem( tr( "3" ) ); 253 span->insertItem( tr( "3" ) );
254 span->insertItem( tr( "4" ) ); 254 span->insertItem( tr( "4" ) );
255 span->insertItem( tr( "5" ) ); 255 span->insertItem( tr( "5" ) );
256 span->insertItem( tr( "6" ) ); 256 span->insertItem( tr( "6" ) );
257 span->setGeometry( QRect( 180, 20, 50, 21 ) ); 257 span->setGeometry( QRect( 180, 20, 50, 21 ) );
258 span->setCurrentItem( 1 ); 258 span->setCurrentItem( 1 );
259 259
260 TextLabel1 = new QLabel( tab_2, "TextLabel1" ); 260 TextLabel1 = new QLabel( tab_2, "TextLabel1" );
261 TextLabel1->setGeometry( QRect( 3, 109, 226, 140 ) ); 261 TextLabel1->setGeometry( QRect( 3, 109, 226, 140 ) );
262 TextLabel1->setText( tr( QString::fromUtf8( "©2002 Camilo Mesias\n" 262 TextLabel1->setText( tr( QString::fromUtf8( "©2002 Camilo Mesias\n"
263"camilo@mesias.co.uk\n" 263"camilo@mesias.co.uk\n"
264"Version 0.0.7 beta" ) ) ); 264"Version 0.0.7 beta" ) ) );
265 TextLabel1->setAlignment( int( QLabel::AlignBottom | QLabel::AlignLeft ) ); 265 TextLabel1->setAlignment( int( QLabel::AlignBottom | QLabel::AlignLeft ) );
266 266
267 tuning = new QComboBox( FALSE, tab_2, "tuning" ); 267 tuning = new QComboBox( FALSE, tab_2, "tuning" );
268 tuning->insertItem( tr( "EADGBE" ) ); 268 tuning->insertItem( tr( "EADGBE" ) );
269 tuning->insertItem( tr( "EBEG#BE" ) ); 269 tuning->insertItem( tr( "EBEG#BE" ) );
270 tuning->insertItem( tr( "EAEAC#E" ) ); 270 tuning->insertItem( tr( "EAEAC#E" ) );
271 tuning->insertItem( tr( "EADF#BE" ) ); 271 tuning->insertItem( tr( "EADF#BE" ) );
272 tuning->insertItem( tr( "EADGCF" ) ); 272 tuning->insertItem( tr( "EADGCF" ) );
273 tuning->insertItem( tr( "DADGAD" ) ); 273 tuning->insertItem( tr( "DADGAD" ) );
274 tuning->insertItem( tr( "DGCGCD" ) ); 274 tuning->insertItem( tr( "DGCGCD" ) );
275 tuning->insertItem( tr( "DADF#AD" ) ); 275 tuning->insertItem( tr( "DADF#AD" ) );
276 tuning->insertItem( tr( "DADGBE" ) ); 276 tuning->insertItem( tr( "DADGBE" ) );
277 tuning->insertItem( tr( "DGDGBD" ) ); 277 tuning->insertItem( tr( "DGDGBD" ) );
278 tuning->insertItem( tr( "DADACD" ) ); 278 tuning->insertItem( tr( "DADACD" ) );
279 tuning->insertItem( tr( "CGCGAE" ) ); 279 tuning->insertItem( tr( "CGCGAE" ) );
280 tuning->insertItem( tr( "FADGBE" ) ); 280 tuning->insertItem( tr( "FADGBE" ) );
281 tuning->insertItem( tr( "G minor" ) ); 281 tuning->insertItem( tr( "G minor" ) );
282 tuning->setGeometry( QRect( 140, 70, 91, 21 ) ); 282 tuning->setGeometry( QRect( 140, 70, 91, 21 ) );
283 283
284 optlab1 = new QLabel( tab_2, "optlab1" ); 284 optlab1 = new QLabel( tab_2, "optlab1" );
285 optlab1->setGeometry( QRect( 8, 8, 160, 40 ) ); 285 optlab1->setGeometry( QRect( 8, 8, 160, 40 ) );
286 optlab1->setText( tr( "Span: the greatest number of frets over which you want chords to be generated" ) ); 286 optlab1->setText( tr( "Span: the greatest number of frets over which you want chords to be generated" ) );
287 optlab1->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter | QLabel::AlignLeft ) ); 287 optlab1->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter | QLabel::AlignLeft ) );
288 tabs->insertTab( tab_2, tr( "Options" ) ); 288 tabs->insertTab( tab_2, tr( "Options" ) );
289 289
290 Tuner = new QWidget( tabs, "Tuner" ); 290 Tuner = new QWidget( tabs, "Tuner" );
291 291
292 Frame4 = new QFrame( Tuner, "Frame4" ); 292 Frame4 = new QFrame( Tuner, "Frame4" );
293 Frame4->setGeometry( QRect( 0, 0, 230, 126 ) ); 293 Frame4->setGeometry( QRect( 0, 0, 230, 126 ) );
294 Frame4->setFrameShape( QFrame::Box ); 294 Frame4->setFrameShape( QFrame::Box );
295 Frame4->setFrameShadow( QFrame::Raised ); 295 Frame4->setFrameShadow( QFrame::Raised );
296 296
297 vu = new VUMeter( Frame4, "vu" ); 297 vu = new VUMeter( Frame4, "vu" );
298 vu->setGeometry( QRect( 5, 5, 220, 115 ) ); 298 vu->setGeometry( QRect( 5, 5, 220, 115 ) );
299 299
300 tuner_note = new QComboBox( FALSE, Tuner, "tuner_note" ); 300 tuner_note = new QComboBox( FALSE, Tuner, "tuner_note" );
301 tuner_note->insertItem( tr( "auto" ) ); 301 tuner_note->insertItem( tr( "auto" ) );
302 tuner_note->insertItem( tr( "E" ) ); 302 tuner_note->insertItem( tr( "E" ) );
303 tuner_note->insertItem( tr( "D" ) ); 303 tuner_note->insertItem( tr( "D" ) );
304 tuner_note->insertItem( tr( "G" ) ); 304 tuner_note->insertItem( tr( "G" ) );
305 tuner_note->insertItem( tr( "A" ) ); 305 tuner_note->insertItem( tr( "A" ) );
306 tuner_note->insertItem( tr( "B" ) ); 306 tuner_note->insertItem( tr( "B" ) );
307 tuner_note->insertItem( tr( "C" ) ); 307 tuner_note->insertItem( tr( "C" ) );
308 tuner_note->insertItem( tr( "F" ) ); 308 tuner_note->insertItem( tr( "F" ) );
309 tuner_note->setGeometry( QRect( 5, 160, 90, 20 ) ); 309 tuner_note->setGeometry( QRect( 5, 160, 90, 20 ) );
310 310
311 Frame8 = new QFrame( Tuner, "Frame8" ); 311 Frame8 = new QFrame( Tuner, "Frame8" );
312 Frame8->setGeometry( QRect( -2, 188, 231, 10 ) ); 312 Frame8->setGeometry( QRect( -2, 188, 231, 10 ) );
313 Frame8->setFrameShape( QFrame::HLine ); 313 Frame8->setFrameShape( QFrame::HLine );
314 Frame8->setFrameShadow( QFrame::Raised ); 314 Frame8->setFrameShadow( QFrame::Raised );
315 315
316 tuner_start = new QPushButton( Tuner, "tuner_start" ); 316 tuner_start = new QPushButton( Tuner, "tuner_start" );
317 tuner_start->setGeometry( QRect( 100, 155, 91, 30 ) ); 317 tuner_start->setGeometry( QRect( 100, 155, 91, 30 ) );
318 tuner_start->setText( tr( "Start" ) ); 318 tuner_start->setText( tr( "Start" ) );
319 319
320 tuner_lab1 = new QLabel( Tuner, "tuner_lab1" ); 320 tuner_lab1 = new QLabel( Tuner, "tuner_lab1" );
321 tuner_lab1->setGeometry( QRect( 10, 130, 100, 21 ) ); 321 tuner_lab1->setGeometry( QRect( 10, 130, 100, 21 ) );
322 tuner_lab1->setText( tr( "Tuner operation" ) ); 322 tuner_lab1->setText( tr( "Tuner operation" ) );
323 323
324 tuner_lab2 = new QLabel( Tuner, "tuner_lab2" ); 324 tuner_lab2 = new QLabel( Tuner, "tuner_lab2" );
325 tuner_lab2->setGeometry( QRect( 10, 200, 100, 16 ) ); 325 tuner_lab2->setGeometry( QRect( 10, 200, 100, 16 ) );
326 tuner_lab2->setText( tr( "Pitch calibration" ) ); 326 tuner_lab2->setText( tr( "Pitch calibration" ) );
327 327
328 tuner_calib_note = new QComboBox( FALSE, Tuner, "tuner_calib_note" ); 328 tuner_calib_note = new QComboBox( FALSE, Tuner, "tuner_calib_note" );
329 tuner_calib_note->insertItem( tr( "A" ) ); 329 tuner_calib_note->insertItem( tr( "A" ) );
330 tuner_calib_note->insertItem( tr( "C" ) ); 330 tuner_calib_note->insertItem( tr( "C" ) );
331 tuner_calib_note->setGeometry( QRect( 5, 225, 90, 21 ) ); 331 tuner_calib_note->setGeometry( QRect( 5, 225, 90, 21 ) );
332 332
333 tuner_calib_freq = new QSpinBox( Tuner, "tuner_calib_freq" ); 333 tuner_calib_freq = new QSpinBox( Tuner, "tuner_calib_freq" );
334 tuner_calib_freq->setGeometry( QRect( 105, 225, 71, 21 ) ); 334 tuner_calib_freq->setGeometry( QRect( 105, 225, 71, 21 ) );
335 tuner_calib_freq->setSuffix( tr( "Hz" ) ); 335 tuner_calib_freq->setSuffix( tr( "Hz" ) );
336 tuner_calib_freq->setWrapping( TRUE ); 336 tuner_calib_freq->setWrapping( TRUE );
337 tuner_calib_freq->setMaxValue( 500 ); 337 tuner_calib_freq->setMaxValue( 500 );
338 tuner_calib_freq->setMinValue( 300 ); 338 tuner_calib_freq->setMinValue( 300 );
339 tuner_calib_freq->setValue( 440 ); 339 tuner_calib_freq->setValue( 440 );
340 340
341 tuner_lab3 = new QLabel( Tuner, "tuner_lab3" ); 341 tuner_lab3 = new QLabel( Tuner, "tuner_lab3" );
342 tuner_lab3->setGeometry( QRect( 185, 225, 40, 21 ) ); 342 tuner_lab3->setGeometry( QRect( 185, 225, 40, 21 ) );
343 tuner_lab3->setText( tr( "Pitch" ) ); 343 tuner_lab3->setText( tr( "Pitch" ) );
344 344
345 tuner_pic1 = new QLabel( Tuner, "tuner_pic1" ); 345 tuner_pic1 = new QLabel( Tuner, "tuner_pic1" );
346 tuner_pic1->setGeometry( QRect( 195, 155, 31, 31 ) ); 346 tuner_pic1->setGeometry( QRect( 195, 155, 31, 31 ) );
347 tuner_pic1->setFrameShape( QLabel::NoFrame ); 347 tuner_pic1->setFrameShape( QLabel::NoFrame );
348 tuner_pic1->setPixmap( image6 ); 348 tuner_pic1->setPixmap( image6 );
349 tuner_pic1->setScaledContents( TRUE ); 349 tuner_pic1->setScaledContents( TRUE );
350 tabs->insertTab( Tuner, tr( "Tuner" ) ); 350 tabs->insertTab( Tuner, tr( "Tuner" ) );
351 351
352 tab_3 = new QWidget( tabs, "tab_3" ); 352 tab_3 = new QWidget( tabs, "tab_3" );
353 353
354 chordlistlab1 = new QLabel( tab_3, "chordlistlab1" ); 354 chordlistlab1 = new QLabel( tab_3, "chordlistlab1" );
355 chordlistlab1->setGeometry( QRect( 5, 5, 216, 16 ) ); 355 chordlistlab1->setGeometry( QRect( 5, 5, 216, 16 ) );
356 chordlistlab1->setText( tr( "Chord list" ) ); 356 chordlistlab1->setText( tr( "Chord list" ) );
357 357
358 chordlist = new QListBox( tab_3, "chordlist" ); 358 chordlist = new QListBox( tab_3, "chordlist" );
359 chordlist->setGeometry( QRect( 5, 25, 220, 200 ) ); 359 chordlist->setGeometry( QRect( 5, 25, 220, 200 ) );
360 360
361 list_remove_btn = new QPushButton( tab_3, "list_remove_btn" ); 361 list_remove_btn = new QPushButton( tab_3, "list_remove_btn" );
362 list_remove_btn->setGeometry( QRect( 150, 230, 71, 25 ) ); 362 list_remove_btn->setGeometry( QRect( 150, 230, 71, 25 ) );
363 list_remove_btn->setText( tr( "Remove" ) ); 363 list_remove_btn->setText( tr( "Remove" ) );
364 tabs->insertTab( tab_3, tr( "Chords" ) ); 364 tabs->insertTab( tab_3, tr( "Chords" ) );
365 365
366 // hope this does what it's supposed to!! 366 // hope this does what it's supposed to!!
367 // setPalette( QPalette( QColor( 232, 227, 215) ) ); 367 // setPalette( QPalette( QColor( 232, 227, 215) ) );
368 368
369 // signals and slots connections 369 // signals and slots connections
370 370
371 //cxm 371 //cxm
372 connect( tuning, SIGNAL( activated(int) ), frets, SLOT( Tune(int) ) ); 372 connect( tuning, SIGNAL( activated(int) ), frets, SLOT( Tune(int) ) );
373 connect( span, SIGNAL( activated(int) ), frets, SLOT( Span(int) ) ); 373 connect( span, SIGNAL( activated(int) ), frets, SLOT( Span(int) ) );
374 connect( transport_rec, SIGNAL( clicked() ), this, SLOT( transport_rec_cb() )); 374 connect( transport_rec, SIGNAL( clicked() ), this, SLOT( transport_rec_cb() ));
375 connect( play_sound, SIGNAL( clicked() ), this, SLOT( play_chord_cb() )); 375 connect( play_sound, SIGNAL( clicked() ), this, SLOT( play_chord_cb() ));
376 connect( tuner_start, SIGNAL( clicked() ), this, SLOT( tuner_start_cb() )); 376 connect( tuner_start, SIGNAL( clicked() ), this, SLOT( tuner_start_cb() ));
377 connect( tuner_note, SIGNAL( textChanged(const QString&) ), vu, SLOT( AnnotL(const QString&) )); 377 connect( tuner_note, SIGNAL( textChanged(const QString&) ), vu, SLOT( AnnotL(const QString&) ));
378 connect( this, SIGNAL( frequency_change(int) ), vu, SLOT( Value(int) )); 378 connect( this, SIGNAL( frequency_change(int) ), vu, SLOT( Value(int) ));
379 379
380 connect( chordnote, SIGNAL( activated(int) ), frets, SLOT( Base(int) ) ); 380 connect( chordnote, SIGNAL( activated(int) ), frets, SLOT( Base(int) ) );
381 connect( chordkey, SIGNAL( activated(int) ), frets, SLOT( Chord(int) ) ); 381 connect( chordkey, SIGNAL( activated(int) ), frets, SLOT( Chord(int) ) );
382 connect( chordfret, SIGNAL( activated(int) ), frets, SLOT( Fret(int) ) ); 382 connect( chordfret, SIGNAL( activated(int) ), frets, SLOT( Fret(int) ) );
383 connect( list_remove_btn, SIGNAL( clicked() ), this, SLOT( list_remove_cb() ) ); 383 connect( list_remove_btn, SIGNAL( clicked() ), this, SLOT( list_remove_cb() ) );
384 connect( frets, SIGNAL( s1nameChanged(const QString&) ), s1_1, SLOT( setText(const QString&) ) ); 384 connect( frets, SIGNAL( s1nameChanged(const QString&) ), s1_1, SLOT( setText(const QString&) ) );
385 connect( frets, SIGNAL( s2nameChanged(const QString&) ), s1_2, SLOT( setText(const QString&) ) ); 385 connect( frets, SIGNAL( s2nameChanged(const QString&) ), s1_2, SLOT( setText(const QString&) ) );
386 connect( frets, SIGNAL( s3nameChanged(const QString&) ), s1_3, SLOT( setText(const QString&) ) ); 386 connect( frets, SIGNAL( s3nameChanged(const QString&) ), s1_3, SLOT( setText(const QString&) ) );
387 connect( frets, SIGNAL( s4nameChanged(const QString&) ), s1_4, SLOT( setText(const QString&) ) ); 387 connect( frets, SIGNAL( s4nameChanged(const QString&) ), s1_4, SLOT( setText(const QString&) ) );
388 connect( frets, SIGNAL( s5nameChanged(const QString&) ), s1_5, SLOT( setText(const QString&) ) ); 388 connect( frets, SIGNAL( s5nameChanged(const QString&) ), s1_5, SLOT( setText(const QString&) ) );
389 connect( frets, SIGNAL( s6nameChanged(const QString&) ), s1_6, SLOT( setText(const QString&) ) ); 389 connect( frets, SIGNAL( s6nameChanged(const QString&) ), s1_6, SLOT( setText(const QString&) ) );
390 connect( frets, SIGNAL( nameChanged(const QString&) ), chordname, SLOT( setText(const QString&) ) ); 390 connect( frets, SIGNAL( nameChanged(const QString&) ), chordname, SLOT( setText(const QString&) ) );
391} 391}
392 392
393 393
394static int known=0; 394static int known=0;
395#include <qmessagebox.h> 395#include <qmessagebox.h>
396void PowerchordBase::transport_rec_cb(){ 396void PowerchordBase::transport_rec_cb(){
397 chordlist->insertItem(chordname->text(),-1); 397 chordlist->insertItem(chordname->text(),-1);
398 if (!known){ 398 if (!known){
399 QMessageBox::information(this, tr("Powerchord"), 399 QMessageBox::information(this, tr("Powerchord"),
400 tr("<P>This chord has been saved into the list of chords, for later playback.<P>"); 400 tr("<P>This chord has been saved into the list of chords, for later playback.<P>"));
401 known = 1; 401 known = 1;
402 } 402 }
403} 403}
404void PowerchordBase::list_remove_cb(){ 404void PowerchordBase::list_remove_cb(){
405 if (chordlist->count() > 0){ 405 if (chordlist->count() > 0){
406 chordlist->removeItem(0); 406 chordlist->removeItem(0);
407 } 407 }
408} 408}
409void PowerchordBase::play_chord_cb(){ 409void PowerchordBase::play_chord_cb(){
410 // QMessageBox::information(this, "Coming soon!", "This button plays\nthe chord by synthesizing\nthe sound of the notes."); 410 // QMessageBox::information(this, "Coming soon!", "This button plays\nthe chord by synthesizing\nthe sound of the notes.");
411 411
412 412
413 if (audio_timer){ 413 if (audio_timer){
414 audio_timer->stop(); 414 audio_timer->stop();
415 // set pixmap? 415 // set pixmap?
416 synth->Stop(); 416 synth->Stop();
417 delete(audio_timer); 417 delete(audio_timer);
418 audio_timer = 0; 418 audio_timer = 0;
419 }else{ 419 }else{
420 // get notes from chord engine 420 // get notes from chord engine
421 421
422 int note; 422 int note;
423 int base; 423 int base;
424 int octave; 424 int octave;
425 note = frets->ce.noteindex(0); 425 note = frets->ce.noteindex(0);
426 if (note >= 0){ 426 if (note >= 0){
427 //fprintf(stderr, "Note was %d\n", note); 427 //fprintf(stderr, "Note was %d\n", note);
428 base = note % 12; 428 base = note % 12;
429 octave = note / 12; 429 octave = note / 12;
430 synth->note_start(0, base, octave); 430 synth->note_start(0, base, octave);
431 }else{ 431 }else{
432 // subtle bug here - replay second note if 1st one muted 432 // subtle bug here - replay second note if 1st one muted
433 note = frets->ce.noteindex(1); 433 note = frets->ce.noteindex(1);
434 base = note % 12; 434 base = note % 12;
435 octave = note / 12; 435 octave = note / 12;
436 synth->note_start(1, base, octave); 436 synth->note_start(1, base, octave);
437 437
438 } 438 }
439 439
440 // init synth 440 // init synth
441 if (synth->Play()){ 441 if (synth->Play()){
442 // error 442 // error
443 QMessageBox::information(this, tr("Powerchord"), 443 QMessageBox::information(this, tr("Powerchord"),
444 tr("<P>Unable to open device for sound playback - check that no other application is using it.</P>")); 444 tr("<P>Unable to open device for sound playback - check that no other application is using it.</P>"));
445 return; 445 return;
446 } 446 }
447 synth->fill_buffer(); 447 synth->fill_buffer();
448 448
449 // start timer 449 // start timer
450 audio_timer = new QTimer(); 450 audio_timer = new QTimer();
451 connect(audio_timer, SIGNAL( timeout() ), this, SLOT( audio_cb() )); 451 connect(audio_timer, SIGNAL( timeout() ), this, SLOT( audio_cb() ));
452 // set pixmap on player? 452 // set pixmap on player?
453 audio_timer->start(19); // 19 msec (fudge factor!!) 453 audio_timer->start(19); // 19 msec (fudge factor!!)
454 } 454 }
455} 455}
456 456
457 457
458 458
459void PowerchordBase::audio_cb(){ 459void PowerchordBase::audio_cb(){
460 // play the next bit of audio until quiet 460 // play the next bit of audio until quiet
461 461
462 // strum timing 462 // strum timing
463#define INTERVAL 2 463#define INTERVAL 2
464 464
465 if ((synth->Frames() % INTERVAL) == 0){ 465 if ((synth->Frames() % INTERVAL) == 0){
466 int string = synth->Frames() / INTERVAL; 466 int string = synth->Frames() / INTERVAL;
467 if (string <= 5){ 467 if (string <= 5){
468 int note; 468 int note;
469 int base; 469 int base;
470 int octave; 470 int octave;
471 note = frets->ce.noteindex(string); 471 note = frets->ce.noteindex(string);
472 // check not muted... 472 // check not muted...
473 if (note > 0){ 473 if (note > 0){
474 base = note % 12; 474 base = note % 12;
475 octave = note / 12; 475 octave = note / 12;
476 synth->note_start(string, base, octave); 476 synth->note_start(string, base, octave);
477 } 477 }
478 } 478 }
479 } 479 }
480 480
481 if (synth->Playing()){ 481 if (synth->Playing()){
482 synth->write_buffer(); 482 synth->write_buffer();
483 synth->fill_buffer(); 483 synth->fill_buffer();
484 }else{ 484 }else{
485 audio_timer->stop(); 485 audio_timer->stop();
486 // set pixmap? 486 // set pixmap?
487 synth->Stop(); 487 synth->Stop();
488 delete(audio_timer); 488 delete(audio_timer);
489 audio_timer = 0; 489 audio_timer = 0;
490 } 490 }
491} 491}
492 492
493// the real tuner 493// the real tuner
494// void PowerchordBase::tuner_start_cb(){ 494// void PowerchordBase::tuner_start_cb(){
495 495
496// if (tuner->Listening()){ 496// if (tuner->Listening()){
497// simulation_timer->stop(); 497// simulation_timer->stop();
498// tuner->Stop(); 498// tuner->Stop();
499// tuner_pic1->setPixmap( *image6 ); 499// tuner_pic1->setPixmap( *image6 );
500 500
501// }else{ 501// }else{
502// tuner_pic1->setPixmap( *image_open ); 502// tuner_pic1->setPixmap( *image_open );
503 503
504// if (!simulation_timer){ 504// if (!simulation_timer){
505// simulation_timer = new QTimer(); 505// simulation_timer = new QTimer();
506 506
507 507
508// connect(simulation_timer, SIGNAL( timeout() ), this, SLOT( tuner_cb() )); 508// connect(simulation_timer, SIGNAL( timeout() ), this, SLOT( tuner_cb() ));
509// } 509// }
510 510
511// simulation_timer->start(50); 511// simulation_timer->start(50);
512// tuner->Listen(); 512// tuner->Listen();
513 513
514// } 514// }
515// } 515// }
516 516
517void PowerchordBase::tuner_cb(){ 517void PowerchordBase::tuner_cb(){
518 if (tuner->Listening()){ 518 if (tuner->Listening()){
519 tuner->read_buffer(); 519 tuner->read_buffer();
520 tuner->process_buffer(); 520 tuner->process_buffer();
521 521
522 // update gui 522 // update gui
523 // do something with the note: tuner->Note() 523 // do something with the note: tuner->Note()
524 emit frequency_change(tuner->Tuning()); 524 emit frequency_change(tuner->Tuning());
525 525
526 }else{ 526 }else{
527 simulation_timer->stop(); 527 simulation_timer->stop();
528 tuner->Stop(); 528 tuner->Stop();
529 tuner_pic1->setPixmap( image6 ); 529 tuner_pic1->setPixmap( image6 );
530 } 530 }
531} 531}
532 532
533 533
534void PowerchordBase::tuner_start_cb(){ 534void PowerchordBase::tuner_start_cb(){
535 if (0 == QMessageBox::information(this, tr("Powerchord"), 535 if (0 == QMessageBox::information(this, tr("Powerchord"),
536 tr("<P>Using the microphone, the note's frequency is analysed. This is a simulation.</P>"), 536 tr("<P>Using the microphone, the note's frequency is analysed. This is a simulation.</P>"),
537 tr("OK"), tr("Cancel"), 0, 1)){ 537 tr("OK"), tr("Cancel"), 0, 1)){
538 if (simulation_timer){ 538 if (simulation_timer){
539 simulation_timer->stop(); 539 simulation_timer->stop();
540 }else{ 540 }else{
541 simulation_timer = new QTimer(); 541 simulation_timer = new QTimer();
542 connect(simulation_timer, SIGNAL( timeout() ), this, SLOT( tuner_simulation_cb() )); 542 connect(simulation_timer, SIGNAL( timeout() ), this, SLOT( tuner_simulation_cb() ));
543 543
544 } 544 }
545 simulation_x = -45; 545 simulation_x = -45;
546 simulation_v = 0; 546 simulation_v = 0;
547 simulation_iter = 0; 547 simulation_iter = 0;
548 548
549 tuner_pic1->setPixmap( image_open ); 549 tuner_pic1->setPixmap( image_open );
550 simulation_timer->start(100); 550 simulation_timer->start(100);
551 } 551 }
552} 552}
553 553
554#include <stdio.h> 554#include <stdio.h>
555 555
556void PowerchordBase::tuner_simulation_cb(){ 556void PowerchordBase::tuner_simulation_cb(){
557 if (simulation_x < -10 || simulation_x > 10){ 557 if (simulation_x < -10 || simulation_x > 10){
558 simulation_v = (simulation_v/2)-(simulation_x/5); 558 simulation_v = (simulation_v/2)-(simulation_x/5);
559 } 559 }
560 560
561 simulation_x += simulation_v; 561 simulation_x += simulation_v;
562 simulation_iter++; 562 simulation_iter++;
563 563
564 if (simulation_x > 50){ 564 if (simulation_x > 50){
565 simulation_x = 50; 565 simulation_x = 50;
566 } 566 }
567 567
568 if (simulation_x < -50){ 568 if (simulation_x < -50){
569 simulation_x = -50; 569 simulation_x = -50;
570 } 570 }
571 571
572 if (simulation_iter > 50){ 572 if (simulation_iter > 50){
573 simulation_timer->stop(); 573 simulation_timer->stop();
574 emit frequency_change(0); 574 emit frequency_change(0);
575 tuner_pic1->setPixmap( image6 ); 575 tuner_pic1->setPixmap( image6 );
576 }else{ 576 }else{
577 emit frequency_change(simulation_x); 577 emit frequency_change(simulation_x);
578 } 578 }
579} 579}
580 580
581/* 581/*
582 * Destroys the object and frees any allocated resources 582 * Destroys the object and frees any allocated resources
583 */ 583 */
584PowerchordBase::~PowerchordBase() 584PowerchordBase::~PowerchordBase()
585{ 585{
586 // no need to delete child widgets, Qt does it all for us 586 // no need to delete child widgets, Qt does it all for us
587} 587}
588 588
589void PowerchordBase::change_handler() 589void PowerchordBase::change_handler()
590{ 590{
591 owarn << "PowerchordBase::change_handler(): Not implemented yet!" << oendl; 591 owarn << "PowerchordBase::change_handler(): Not implemented yet!" << oendl;
592} 592}
593 593