History

removing unneeded tBuffer init args

Matthew Wang committed 6 years ago

Commit ef64cc01 parent f2d7e1a2 files · +4 −6Browse files

Unified · Split

2 files
  1. leaf/Inc/leaf-sampling.h +1 −1
  2. leaf/Src/leaf-sampling.c +3 −5
leaf/Inc/leaf-sampling.h+1−1
@@ -132,7 +132,7 @@ extern "C" { · 131 unmodified lines
132 typedef _tBuffer* tBuffer;132 typedef _tBuffer* tBuffer;
133 133
134 void tBuffer_init (tBuffer* const, uint32_t length, LEAF* const leaf);134 void tBuffer_init (tBuffer* const, uint32_t length, LEAF* const leaf);
135 void tBuffer_initToPool (tBuffer* const sb, uint32_t length, tMempool* const mp, LEAF* const leaf);135 void tBuffer_initToPool (tBuffer* const sb, uint32_t length, tMempool* const mp);
136 void tBuffer_free (tBuffer* const);136 void tBuffer_free (tBuffer* const);
137 137
138 void tBuffer_tick (tBuffer* const, float sample);138 void tBuffer_tick (tBuffer* const, float sample);
leaf/Src/leaf-sampling.c+3−5
@@ -26,17 +26,17 @@ · 25 unmodified lines
26 26
27void tBuffer_init (tBuffer* const sb, uint32_t length, LEAF* const leaf)27void tBuffer_init (tBuffer* const sb, uint32_t length, LEAF* const leaf)
28{28{
29 tBuffer_initToPool(sb, length, &leaf->mempool, leaf);29 tBuffer_initToPool(sb, length, &leaf->mempool);
30}30}
31 31
32void tBuffer_initToPool (tBuffer* const sb, uint32_t length, tMempool* const mp, LEAF* const leaf)32void tBuffer_initToPool (tBuffer* const sb, uint32_t length, tMempool* const mp)
33{33{
34 _tMempool* m = *mp;34 _tMempool* m = *mp;
35 _tBuffer* s = *sb = (_tBuffer*) mpool_alloc(sizeof(_tBuffer), m);35 _tBuffer* s = *sb = (_tBuffer*) mpool_alloc(sizeof(_tBuffer), m);
36 s->mempool = m;36 s->mempool = m;
37 37
38 s->buff = (float*) mpool_alloc( sizeof(float) * length, m);38 s->buff = (float*) mpool_alloc( sizeof(float) * length, m);
39 s->sampleRate = leaf->sampleRate;39 s->sampleRate = s->mempool->leaf->sampleRate;
40 s->channels = 1;40 s->channels = 1;
41 s->bufferLength = length;41 s->bufferLength = length;
42 s->recordedLength = 0;42 s->recordedLength = 0;
@@ -273,7 +273,6 @@ void tSampler_setSample (tSampler* const sp, tBuffer* const b) · 230 unmodified lines
273float tSampler_tick (tSampler* const sp)273float tSampler_tick (tSampler* const sp)
274{274{
275 _tSampler* p = *sp;275 _tSampler* p = *sp;
276 LEAF* leaf = p->mempool->leaf;
277 276
278 attemptStartEndChange(sp);277 attemptStartEndChange(sp);
279 278
@@ -538,7 +537,6 @@ float tSampler_tick (tSampler* const sp) · 258 unmodified lines
538float tSampler_tickStereo (tSampler* const sp, float* outputArray)537float tSampler_tickStereo (tSampler* const sp, float* outputArray)
539{538{
540 _tSampler* p = *sp;539 _tSampler* p = *sp;
541 LEAF* leaf = p->mempool->leaf;
542 540
543 attemptStartEndChange(sp);541 attemptStartEndChange(sp);
544 542

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t