summaryrefslogtreecommitdiff
path: root/servers/audio
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-01-07 18:25:37 -0300
committerJuan Linietsky <reduzio@gmail.com>2017-01-07 18:26:38 -0300
commit2ab83e1abbf5ee6d00e16056a9e9394114026f28 (patch)
tree7efbb375cc4d00d8e8589fcf1b6a1303bec5df2d /servers/audio
parent2a38a5eaa844043b846e03d6655f84caf8a31e74 (diff)
Memory pool vectors (DVector) have been enormously simplified in code, and renamed to PoolVector
Diffstat (limited to 'servers/audio')
-rw-r--r--servers/audio/audio_server_sw.cpp4
-rw-r--r--servers/audio/audio_server_sw.h4
-rw-r--r--servers/audio/sample_manager_sw.cpp14
-rw-r--r--servers/audio/sample_manager_sw.h8
4 files changed, 15 insertions, 15 deletions
diff --git a/servers/audio/audio_server_sw.cpp b/servers/audio/audio_server_sw.cpp
index edf8143eb5..f508a130b4 100644
--- a/servers/audio/audio_server_sw.cpp
+++ b/servers/audio/audio_server_sw.cpp
@@ -384,11 +384,11 @@ const void* AudioServerSW::sample_get_data_ptr(RID p_sample) const {
return sample_manager->sample_get_data_ptr(p_sample);
}
-void AudioServerSW::sample_set_data(RID p_sample, const DVector<uint8_t>& p_buffer) {
+void AudioServerSW::sample_set_data(RID p_sample, const PoolVector<uint8_t>& p_buffer) {
AUDIO_LOCK
sample_manager->sample_set_data(p_sample,p_buffer);
}
-DVector<uint8_t> AudioServerSW::sample_get_data(RID p_sample) const {
+PoolVector<uint8_t> AudioServerSW::sample_get_data(RID p_sample) const {
AUDIO_LOCK
return sample_manager->sample_get_data(p_sample);
}
diff --git a/servers/audio/audio_server_sw.h b/servers/audio/audio_server_sw.h
index f97ae8db82..52b45351c3 100644
--- a/servers/audio/audio_server_sw.h
+++ b/servers/audio/audio_server_sw.h
@@ -125,8 +125,8 @@ public:
virtual int sample_get_length(RID p_sample) const;
const void* sample_get_data_ptr(RID p_sample) const;
- virtual void sample_set_data(RID p_sample, const DVector<uint8_t>& p_buffer);
- virtual DVector<uint8_t> sample_get_data(RID p_sample) const;
+ virtual void sample_set_data(RID p_sample, const PoolVector<uint8_t>& p_buffer);
+ virtual PoolVector<uint8_t> sample_get_data(RID p_sample) const;
virtual void sample_set_mix_rate(RID p_sample,int p_rate);
virtual int sample_get_mix_rate(RID p_sample) const;
diff --git a/servers/audio/sample_manager_sw.cpp b/servers/audio/sample_manager_sw.cpp
index 623bb0f9cb..fe4cc36776 100644
--- a/servers/audio/sample_manager_sw.cpp
+++ b/servers/audio/sample_manager_sw.cpp
@@ -125,7 +125,7 @@ int SampleManagerMallocSW::sample_get_length(RID p_sample) const {
return s->length;
}
-void SampleManagerMallocSW::sample_set_data(RID p_sample, const DVector<uint8_t>& p_buffer) {
+void SampleManagerMallocSW::sample_set_data(RID p_sample, const PoolVector<uint8_t>& p_buffer) {
Sample *s = sample_owner.get(p_sample);
ERR_FAIL_COND(!s);
@@ -137,7 +137,7 @@ void SampleManagerMallocSW::sample_set_data(RID p_sample, const DVector<uint8_t>
ERR_EXPLAIN("Sample buffer size does not match sample size.");
//print_line("len bytes: "+itos(s->length_bytes)+" bufsize: "+itos(buff_size));
ERR_FAIL_COND(s->length_bytes!=buff_size);
- DVector<uint8_t>::Read buffer_r=p_buffer.read();
+ PoolVector<uint8_t>::Read buffer_r=p_buffer.read();
const uint8_t *src = buffer_r.ptr();
uint8_t *dst = (uint8_t*)s->data;
//print_line("set data: "+itos(s->length_bytes));
@@ -181,14 +181,14 @@ void SampleManagerMallocSW::sample_set_data(RID p_sample, const DVector<uint8_t>
}
-const DVector<uint8_t> SampleManagerMallocSW::sample_get_data(RID p_sample) const {
+const PoolVector<uint8_t> SampleManagerMallocSW::sample_get_data(RID p_sample) const {
Sample *s = sample_owner.get(p_sample);
- ERR_FAIL_COND_V(!s,DVector<uint8_t>());
+ ERR_FAIL_COND_V(!s,PoolVector<uint8_t>());
- DVector<uint8_t> ret_buffer;
+ PoolVector<uint8_t> ret_buffer;
ret_buffer.resize(s->length_bytes);
- DVector<uint8_t>::Write buffer_w=ret_buffer.write();
+ PoolVector<uint8_t>::Write buffer_w=ret_buffer.write();
uint8_t *dst = buffer_w.ptr();
const uint8_t *src = (const uint8_t*)s->data;
@@ -197,7 +197,7 @@ const DVector<uint8_t> SampleManagerMallocSW::sample_get_data(RID p_sample) cons
dst[i]=src[i];
}
- buffer_w = DVector<uint8_t>::Write(); //unlock
+ buffer_w = PoolVector<uint8_t>::Write(); //unlock
return ret_buffer;
}
diff --git a/servers/audio/sample_manager_sw.h b/servers/audio/sample_manager_sw.h
index ad71723cd6..93cad96f1a 100644
--- a/servers/audio/sample_manager_sw.h
+++ b/servers/audio/sample_manager_sw.h
@@ -45,8 +45,8 @@ public:
virtual bool sample_is_stereo(RID p_sample) const=0;
virtual int sample_get_length(RID p_sample) const=0;
- virtual void sample_set_data(RID p_sample, const DVector<uint8_t>& p_buffer)=0;
- virtual const DVector<uint8_t> sample_get_data(RID p_sample) const=0;
+ virtual void sample_set_data(RID p_sample, const PoolVector<uint8_t>& p_buffer)=0;
+ virtual const PoolVector<uint8_t> sample_get_data(RID p_sample) const=0;
virtual void *sample_get_data_ptr(RID p_sample) const=0;
@@ -102,8 +102,8 @@ public:
virtual bool sample_is_stereo(RID p_sample) const;
virtual int sample_get_length(RID p_sample) const;
- virtual void sample_set_data(RID p_sample, const DVector<uint8_t>& p_buffer);
- virtual const DVector<uint8_t> sample_get_data(RID p_sample) const;
+ virtual void sample_set_data(RID p_sample, const PoolVector<uint8_t>& p_buffer);
+ virtual const PoolVector<uint8_t> sample_get_data(RID p_sample) const;
virtual void *sample_get_data_ptr(RID p_sample) const;