Diffstat (limited to 'noncore/multimedia/powerchord/gs.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/powerchord/gs.cpp | 17 |
1 files changed, 11 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 | |||
@@ -19,4 +19,5 @@ | |||
19 | //#include <qpainter.h> | 19 | //#include <qpainter.h> |
20 | #include <qmessagebox.h> | 20 | #include <qmessagebox.h> |
21 | #include <qstring.h> | ||
21 | 22 | ||
22 | 23 | ||
@@ -67,5 +68,5 @@ gs::gs() | |||
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 | ||
@@ -74,6 +75,10 @@ gs::gs() | |||
74 | 75 | ||
75 | int raw_fd; | 76 | int raw_fd; |
76 | raw_fd = open(ACGUITAR_PATH_S, O_RDONLY); | 77 | |
77 | 78 | QString path = getenv( "OPIEDIR" ); | |
79 | path.append( "/share/powerchord/acguitar.raw" ); | ||
80 | |||
81 | raw_fd = open( (const char*) path, O_RDONLY); | ||
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)); |
@@ -83,5 +88,5 @@ gs::gs() | |||
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; |
@@ -91,8 +96,8 @@ gs::gs() | |||
91 | totread += numread; | 96 | totread += numread; |
92 | dsp_buf_ptr += numread/2; | 97 | dsp_buf_ptr += numread/2; |
93 | 98 | ||
94 | if (numread == 0){ | 99 | if (numread == 0){ |
95 | fprintf(stderr, "failed to read bytes\n"); | 100 | fprintf(stderr, "failed to read bytes\n"); |
96 | exit(-1); | 101 | exit(-1); |
97 | } | 102 | } |
98 | } | 103 | } |