Mercurial > pygar
comparison modules/bluespec/Pygar/core/AudioCoreSystem.cpp @ 41:16ba43f0a7c3 pygar svn.42
[svn r42] got channels working
author | rlm |
---|---|
date | Tue, 04 May 2010 22:32:52 -0400 |
parents | 5a30f173bbac |
children | ced2ebd41347 |
comparison
equal
deleted
inserted
replaced
40:7ac38b0f93fa | 41:16ba43f0a7c3 |
---|---|
67 // FILE *inputFile1; | 67 // FILE *inputFile1; |
68 UINT16 sample; | 68 UINT16 sample; |
69 //UINT16 sample1; | 69 //UINT16 sample1; |
70 | 70 |
71 //rlm: not sure if normal ints are ok here; using UINT16 because I know it works | 71 //rlm: not sure if normal ints are ok here; using UINT16 because I know it works |
72 UINT16 channel0 = 0; | 72 UINT16 channel0 = 5; |
73 //UINT16 channel1 = 1; | 73 //UINT16 channel1 = 1; |
74 | 74 |
75 //init processor | 75 //init processor |
76 int sleepCount = 0; | 76 int sleepCount = 0; |
77 int result = 0; | 77 int result = 0; |
130 count++; | 130 count++; |
131 sem_wait(&throttle); | 131 sem_wait(&throttle); |
132 | 132 |
133 printf("sending file\n"); | 133 printf("sending file\n"); |
134 //rlm: two files. | 134 //rlm: two files. |
135 clientStub->SendUnprocessedStream( Data,(UINT32)sample); | 135 // clientStub->SendUnprocessedStream( Data,(UINT32)sample); |
136 //clientStub->SendUnprocessedStream(channel0 , Data,(UINT32)sample); | 136 clientStub->SendUnprocessedStream((UINT32)channel0 , Data,(UINT32)sample); |
137 //clientStub->SendUnprocessedStream(channel1 , Data,(UINT32)sample1); | 137 //clientStub->SendUnprocessedStream(channel1 , Data,(UINT32)sample1); |
138 | 138 |
139 } | 139 } |
140 | 140 |
141 printf("main: out of loop\n"); | 141 printf("main: out of loop\n"); |
143 // Need to put lock here to prevent potential race condition | 143 // Need to put lock here to prevent potential race condition |
144 pthread_mutex_lock(&lock); | 144 pthread_mutex_lock(&lock); |
145 | 145 |
146 //rlm: have to send end-files to both voices. | 146 //rlm: have to send end-files to both voices. |
147 // all of these operations wil eventually be moved into functions. | 147 // all of these operations wil eventually be moved into functions. |
148 clientStub->SendUnprocessedStream(EndOfFile,0); | 148 //clientStub->SendUnprocessedStream(EndOfFile,0); |
149 //clientStub->SendUnprocessedStream(channel0, EndOfFile,0); | 149 clientStub->SendUnprocessedStream((UINT32)channel0, EndOfFile,0); |
150 // clientStub->SendUnprocessedStream(channel1, EndOfFile,0); | 150 // clientStub->SendUnprocessedStream(channel1, EndOfFile,0); |
151 | 151 |
152 printf("main: wait for end of file\n"); | 152 printf("main: wait for end of file\n"); |
153 | 153 |
154 pthread_cond_wait(&cond, &lock); | 154 pthread_cond_wait(&cond, &lock); |
155 pthread_mutex_unlock(&lock); | 155 pthread_mutex_unlock(&lock); |