summaryrefslogtreecommitdiff
path: root/apps/gui
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 /apps/gui
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 'apps/gui')
-rw-r--r--apps/gui/wps.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/apps/gui/wps.c b/apps/gui/wps.c
index e686fcc533..cbf003adbd 100644
--- a/apps/gui/wps.c
+++ b/apps/gui/wps.c
@@ -121,9 +121,11 @@ char* wps_default_skin(enum screen_type screen)
121 121
122void pause_action(bool may_fade, bool updatewps) 122void pause_action(bool may_fade, bool updatewps)
123{ 123{
124#if CONFIG_CODEC != SWCODEC
124 if (may_fade && global_settings.fade_on_stop) 125 if (may_fade && global_settings.fade_on_stop)
125 fade(false, updatewps); 126 fade(false, updatewps);
126 else 127 else
128#endif
127 audio_pause(); 129 audio_pause();
128 130
129 if (global_settings.pause_rewind) { 131 if (global_settings.pause_rewind) {
@@ -136,16 +138,22 @@ void pause_action(bool may_fade, bool updatewps)
136 - global_settings.pause_rewind * 1000; 138 - global_settings.pause_rewind * 1000;
137 audio_ff_rewind(newpos > 0 ? newpos : 0); 139 audio_ff_rewind(newpos > 0 ? newpos : 0);
138 } 140 }
141
142 (void)may_fade; (void)updatewps;
139} 143}
140 144
141void unpause_action(bool may_fade, bool updatewps) 145void unpause_action(bool may_fade, bool updatewps)
142{ 146{
147#if CONFIG_CODEC != SWCODEC
143 if (may_fade && global_settings.fade_on_stop) 148 if (may_fade && global_settings.fade_on_stop)
144 fade(true, updatewps); 149 fade(true, updatewps);
145 else 150 else
151#endif
146 audio_resume(); 152 audio_resume();
153 (void)may_fade; (void)updatewps;
147} 154}
148 155
156#if CONFIG_CODEC != SWCODEC
149void fade(bool fade_in, bool updatewps) 157void fade(bool fade_in, bool updatewps)
150{ 158{
151 int fp_global_vol = global_settings.volume << 8; 159 int fp_global_vol = global_settings.volume << 8;
@@ -204,6 +212,7 @@ void fade(bool fade_in, bool updatewps)
204 sound_set_volume(global_settings.volume); 212 sound_set_volume(global_settings.volume);
205 } 213 }
206} 214}
215#endif /* SWCODEC */
207 216
208static bool update_onvol_change(enum screen_type screen) 217static bool update_onvol_change(enum screen_type screen)
209{ 218{
@@ -569,7 +578,7 @@ static void play_hop(int direction)
569 { 578 {
570#if CONFIG_CODEC == SWCODEC 579#if CONFIG_CODEC == SWCODEC
571 if(global_settings.beep) 580 if(global_settings.beep)
572 pcmbuf_beep(1000, 150, 1500*global_settings.beep); 581 beep_play(1000, 150, 1500*global_settings.beep);
573#endif 582#endif
574 return; 583 return;
575 } 584 }
@@ -1127,9 +1136,12 @@ long gui_wps_show(void)
1127 status_set_record(false); 1136 status_set_record(false);
1128 status_set_audio(false); 1137 status_set_audio(false);
1129#endif 1138#endif
1139#if CONFIG_CODEC != SWCODEC
1130 if (global_settings.fade_on_stop) 1140 if (global_settings.fade_on_stop)
1131 fade(false, true); 1141 fade(false, true);
1132 1142#else
1143 audio_pause();
1144#endif
1133 if (bookmark) 1145 if (bookmark)
1134 bookmark_autobookmark(true); 1146 bookmark_autobookmark(true);
1135 audio_stop(); 1147 audio_stop();