summaryrefslogtreecommitdiff
authormickeyl <mickeyl>2004-01-20 15:51:03 (UTC)
committer mickeyl <mickeyl>2004-01-20 15:51:03 (UTC)
commit996826e77a8f96ada424814716178e65caba9287 (patch) (side-by-side diff)
tree09c60dcc4437dba1838c086b7eeb5480800716d5
parent557eb6a25f2cfc6e350c1731ead4df0e07861f25 (diff)
downloadopie-996826e77a8f96ada424814716178e65caba9287.zip
opie-996826e77a8f96ada424814716178e65caba9287.tar.gz
opie-996826e77a8f96ada424814716178e65caba9287.tar.bz2
package the guitar sample
fix reading from share/powerchord/
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/multimedia/powerchord/gs.cpp7
-rw-r--r--noncore/multimedia/powerchord/gs.h1
-rw-r--r--noncore/multimedia/powerchord/opie-powerchord.control8
-rw-r--r--share/powerchord/acguitar.rawbin0 -> 50000 bytes
4 files changed, 10 insertions, 6 deletions
diff --git a/noncore/multimedia/powerchord/gs.cpp b/noncore/multimedia/powerchord/gs.cpp
index a3e85c9..fdcfb74 100644
--- a/noncore/multimedia/powerchord/gs.cpp
+++ b/noncore/multimedia/powerchord/gs.cpp
@@ -5,32 +5,33 @@
#include <stdio.h>
//#include <qpixmap.h>
#include "gs.h"
#include <sys/ioctl.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/soundcard.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
//#include <qpainter.h>
#include <qmessagebox.h>
+#include <qstring.h>
gs::gs()
{
finger[0] = OPEN;
finger[1] = OPEN;
finger[2] = OPEN;
finger[3] = OPEN;
finger[4] = OPEN;
finger[5] = OPEN;
tuning[0] = 0;
tuning[1] = 0;
tuning[2] = 0;
tuning[3] = 0;
@@ -60,33 +61,37 @@ gs::gs()
// initialise reverb buffer
reverb = (signed short *)malloc(1024 * sizeof(signed short));
for (reverb_ptr=0;reverb_ptr<1024;reverb_ptr++){
reverb[reverb_ptr] = 0;
}
reverb_ptr = 0;
reverb_max = 1024;
// load sampled 'E' string
int samplen = 25000;
signed short *dsp_buf = (signed short *)malloc(samplen * sizeof(signed short));
signed short *dsp_buf_ptr = dsp_buf;
int raw_fd;
- raw_fd = open(ACGUITAR_PATH_S, O_RDONLY);
+
+ QString path = getenv( "OPIEDIR" );
+ path.append( "/share/powerchord/acguitar.raw" );
+
+ raw_fd = open( (const char*) path, O_RDONLY);
if (raw_fd < 0){
fprintf(stderr, "Failed to open raw file (%s)\n", strerror(errno));
exit(-1);
}
int totread = 0;
int i;
while (totread < samplen*2){
int want = samplen*2 - totread;
int numread = read(raw_fd, dsp_buf_ptr, want);
fprintf(stderr, "read %d bytes\n", numread);
totread += numread;
dsp_buf_ptr += numread/2;
diff --git a/noncore/multimedia/powerchord/gs.h b/noncore/multimedia/powerchord/gs.h
index 3e4c04d..f2b309f 100644
--- a/noncore/multimedia/powerchord/gs.h
+++ b/noncore/multimedia/powerchord/gs.h
@@ -1,27 +1,26 @@
#ifndef __GS_H
#define __GS_H
#include <qobject.h>
// sound includes
#include <sys/soundcard.h>
#define BUFSIZE 256
#define NUMCHANS 7
-#define ACGUITAR_PATH_S "/usr/local/projects/opie-head/noncore/multimedia/powerchord/acguitar.raw"
class gs : public QObject {
Q_OBJECT
public:
gs();
~gs();
private:
int initial_fret;
int finger[6];
int tuning[6];
signed short *reverb;
diff --git a/noncore/multimedia/powerchord/opie-powerchord.control b/noncore/multimedia/powerchord/opie-powerchord.control
index 7f45999..d295031 100644
--- a/noncore/multimedia/powerchord/opie-powerchord.control
+++ b/noncore/multimedia/powerchord/opie-powerchord.control
@@ -1,10 +1,10 @@
-Files: bin/powerchord apps/Applications/powerchord.desktop pics/powerchord sounds/powerchord
+Files: bin/powerchord apps/Applications/powerchord.desktop pics/powerchord share/powerchord
Priority: optional
-Section: qpe/applications
+Section: Applications
Maintainer: Camilo Mesias <camilo@mesias.co.uk>
Architecture: arm
-Version: 0.0.7
-Depends: qpe-base ($QPE_VERSION)
+Version: 0.0.8
+Depends: task-opie-minimal
Description: Guitar Chord generator application
Allows naming of chords using base note and key. Fretboard diagrams are
produced illustrating ways to play the chord.
diff --git a/share/powerchord/acguitar.raw b/share/powerchord/acguitar.raw
new file mode 100644
index 0000000..1452147
--- a/dev/null
+++ b/share/powerchord/acguitar.raw
Binary files differ