@@ -86,7 +86,7 @@ class StreamCopyT {
86
86
delete[] buffer;
87
87
}
88
88
89
- // copies the data from one channel from the source to 2 channels on the destination - the result is in bytes
89
+ // copies the data from the source to the destination - the result is in bytes
90
90
inline size_t copy (){
91
91
TRACED ();
92
92
// if not initialized we do nothing
@@ -144,44 +144,6 @@ class StreamCopyT {
144
144
}
145
145
146
146
147
- // copies the data from one channel from the source to 2 channels on the destination - the result is in bytes
148
- size_t copy2 (){
149
- if (from==nullptr || to == nullptr )
150
- return 0 ;
151
- size_t result = 0 ;
152
- size_t delayCount = 0 ;
153
- size_t bytes_read;
154
- size_t len = available ();
155
- size_t bytes_to_read;
156
-
157
- if (len>0 ){
158
- bytes_to_read = min (len, static_cast <size_t >(buffer_size / 2 ));
159
- size_t samples = bytes_to_read / sizeof (T);
160
- bytes_to_read = samples * sizeof (T);
161
-
162
- T temp_data[samples];
163
- bytes_read = from->readBytes ((uint8_t *)temp_data, bytes_to_read);
164
- // callback with unconverted data
165
- if (onWrite!=nullptr ) onWrite (onWriteObj, temp_data, bytes_read);
166
-
167
- T* bufferT = (T*) buffer;
168
- for (size_t j=0 ;j<samples;j++){
169
- *bufferT = temp_data[j];
170
- bufferT++;
171
- *bufferT = temp_data[j];
172
- bufferT++;
173
- }
174
- result = write (samples * sizeof (T)*2 , delayCount);
175
- #ifndef COPY_LOG_OFF
176
- LOGI (" StreamCopy::copy %u -> %u bytes - in %d hops" , (unsigned int )bytes_to_read, (unsigned int )result, delayCount);
177
- #endif
178
- CHECK_MEMORY ();
179
- } else {
180
- delay (delay_on_no_data);
181
- }
182
- return result;
183
- }
184
-
185
147
// / available bytes in the data source
186
148
int available () {
187
149
return from == nullptr ? 0 : from->available ();
@@ -370,10 +332,11 @@ class StreamCopy : public StreamCopyT<uint8_t> {
370
332
return result;
371
333
}
372
334
373
- inline size_t copy () {
335
+ // / Copies all bytes from the input to the output
336
+ inline size_t copy () {
374
337
return StreamCopyT<uint8_t >::copy ();
375
338
}
376
-
339
+
377
340
int available () {
378
341
return from == nullptr ? 0 : from->available ();
379
342
}
0 commit comments