Diffstat (limited to 'noncore/multimedia/powerchord/gs.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/multimedia/powerchord/gs.cpp | 7 |
1 files changed, 6 insertions, 1 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 | |||
@@ -9,24 +9,25 @@ | |||
9 | #include <sys/ioctl.h> | 9 | #include <sys/ioctl.h> |
10 | #include <unistd.h> | 10 | #include <unistd.h> |
11 | #include <fcntl.h> | 11 | #include <fcntl.h> |
12 | #include <sys/soundcard.h> | 12 | #include <sys/soundcard.h> |
13 | 13 | ||
14 | #include <errno.h> | 14 | #include <errno.h> |
15 | #include <string.h> | 15 | #include <string.h> |
16 | 16 | ||
17 | #include <stdlib.h> | 17 | #include <stdlib.h> |
18 | 18 | ||
19 | //#include <qpainter.h> | 19 | //#include <qpainter.h> |
20 | #include <qmessagebox.h> | 20 | #include <qmessagebox.h> |
21 | #include <qstring.h> | ||
21 | 22 | ||
22 | 23 | ||
23 | gs::gs() | 24 | gs::gs() |
24 | { | 25 | { |
25 | 26 | ||
26 | finger[0] = OPEN; | 27 | finger[0] = OPEN; |
27 | finger[1] = OPEN; | 28 | finger[1] = OPEN; |
28 | finger[2] = OPEN; | 29 | finger[2] = OPEN; |
29 | finger[3] = OPEN; | 30 | finger[3] = OPEN; |
30 | finger[4] = OPEN; | 31 | finger[4] = OPEN; |
31 | finger[5] = OPEN; | 32 | finger[5] = OPEN; |
32 | 33 | ||
@@ -64,25 +65,29 @@ gs::gs() | |||
64 | reverb[reverb_ptr] = 0; | 65 | reverb[reverb_ptr] = 0; |
65 | } | 66 | } |
66 | reverb_ptr = 0; | 67 | reverb_ptr = 0; |
67 | reverb_max = 1024; | 68 | reverb_max = 1024; |
68 | 69 | ||
69 | // load sampled 'E' string | 70 | // load sampled 'E' string |
70 | int samplen = 25000; | 71 | int samplen = 25000; |
71 | 72 | ||
72 | signed short *dsp_buf = (signed short *)malloc(samplen * sizeof(signed short)); | 73 | signed short *dsp_buf = (signed short *)malloc(samplen * sizeof(signed short)); |
73 | signed short *dsp_buf_ptr = dsp_buf; | 74 | signed short *dsp_buf_ptr = dsp_buf; |
74 | 75 | ||
75 | int raw_fd; | 76 | int raw_fd; |
76 | raw_fd = open(ACGUITAR_PATH_S, O_RDONLY); | 77 | |
78 | QString path = getenv( "OPIEDIR" ); | ||
79 | path.append( "/share/powerchord/acguitar.raw" ); | ||
80 | |||
81 | raw_fd = open( (const char*) path, O_RDONLY); | ||
77 | 82 | ||
78 | if (raw_fd < 0){ | 83 | if (raw_fd < 0){ |
79 | fprintf(stderr, "Failed to open raw file (%s)\n", strerror(errno)); | 84 | fprintf(stderr, "Failed to open raw file (%s)\n", strerror(errno)); |
80 | exit(-1); | 85 | exit(-1); |
81 | } | 86 | } |
82 | 87 | ||
83 | int totread = 0; | 88 | int totread = 0; |
84 | int i; | 89 | int i; |
85 | 90 | ||
86 | while (totread < samplen*2){ | 91 | while (totread < samplen*2){ |
87 | int want = samplen*2 - totread; | 92 | int want = samplen*2 - totread; |
88 | 93 | ||