summaryrefslogtreecommitdiff
path: root/firmware/target/arm/pnx0101/pcm-pnx0101.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2011-06-29 06:37:04 +0000
committerMichael Sevakis <jethead71@rockbox.org>2011-06-29 06:37:04 +0000
commita2b6703a369f6cdbfec1f150c408dadc877631fb (patch)
tree3145a8c1372c44711d38feefeba39c7d4098f139 /firmware/target/arm/pnx0101/pcm-pnx0101.c
parent8411614b8a068a4f274c3841aa55aab1df1bc246 (diff)
downloadrockbox-a2b6703a369f6cdbfec1f150c408dadc877631fb.tar.gz
rockbox-a2b6703a369f6cdbfec1f150c408dadc877631fb.zip
Commit FS#12150 - Fully-functional audio mixer - and finally whip old limitations about playback of voice and other sounds when paused. Channels are independent in state and amplitude. Fade on stop/pause is handled by the channel's volume control rather than global volume which means it now works from anywhere. Opens up the possibility of plugin sounds during music playback by merely adding an additional channel enum. If any PCM drivers were not properly modified, see one of the last comments in the task for a description of the simple change that is expected. Some params are tunable in firmware/export/pcm-mixer.h as well.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30097 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/pnx0101/pcm-pnx0101.c')
-rw-r--r--firmware/target/arm/pnx0101/pcm-pnx0101.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/firmware/target/arm/pnx0101/pcm-pnx0101.c b/firmware/target/arm/pnx0101/pcm-pnx0101.c
index 9d4ffbd773..d4c17454ed 100644
--- a/firmware/target/arm/pnx0101/pcm-pnx0101.c
+++ b/firmware/target/arm/pnx0101/pcm-pnx0101.c
@@ -21,6 +21,7 @@
21#include "system.h" 21#include "system.h"
22#include "audio.h" 22#include "audio.h"
23#include "string.h" 23#include "string.h"
24#include "pcm-internal.h"
24 25
25#define DMA_BUF_SAMPLES 0x100 26#define DMA_BUF_SAMPLES 0x100
26 27
@@ -63,6 +64,8 @@ static inline void fill_dma_buf(int offset)
63 64
64 if (pcm_playing && !pcm_paused) 65 if (pcm_playing && !pcm_paused)
65 { 66 {
67 bool new_buffer =false;
68
66 do 69 do
67 { 70 {
68 int count; 71 int count;
@@ -102,10 +105,20 @@ static inline void fill_dma_buf(int offset)
102 count--; 105 count--;
103 } 106 }
104 p = tmp_p; 107 p = tmp_p;
108
109 if (new_buffer)
110 {
111 new_buffer = false;
112 pcm_play_dma_started_callback();
113 }
114
105 if (l >= lend) 115 if (l >= lend)
106 return; 116 return;
107 117
108 pcm_play_get_more_callback((void**)&p, &p_size); 118 pcm_play_get_more_callback((void**)&p, &p_size);
119
120 if (p_size)
121 new_buffer = true;
109 } 122 }
110 while (p_size); 123 while (p_size);
111 } 124 }