Changeset 6233c4e in mainline for uspace/drv/audio/sb16/dsp.c
- Timestamp:
- 2011-10-24T21:50:31Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 88dcd19
- Parents:
- 0b4f060
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/audio/sb16/dsp.c
r0b4f060 r6233c4e 43 43 #include "dsp.h" 44 44 45 #define PLAYBACK_16BIT 0x1046 #define PLAYBACK_STEREO 0x2047 48 45 #define BUFFER_SIZE (PAGE_SIZE / 4) 49 46 #define PLAY_BLOCK_SIZE (BUFFER_SIZE / 2) … … 145 142 static inline size_t sample_count(uint8_t mode, size_t byte_count) 146 143 { 147 if (mode & PLAYBACK_16BIT) {144 if (mode & DSP_MODE_16BIT) { 148 145 return byte_count / 2; 149 146 } … … 279 276 dsp->playing.mode = 0; 280 277 if (sample_size == 16) 281 dsp->playing.mode |= PLAYBACK_16BIT;278 dsp->playing.mode |= DSP_MODE_16BIT; 282 279 if (channels == 2) 283 dsp->playing.mode |= PLAYBACK_STEREO;280 dsp->playing.mode |= DSP_MODE_STEREO; 284 281 285 282 const size_t samples = sample_count(dsp->playing.mode, play_size); 286 283 287 ddf_log_debug("Playing sound(%hhx): %zu(%zu) bytes => %zu samples.\n",288 dsp->playing.mode, play_size, size, samples);284 ddf_log_debug("Playing %s sound: %zu(%zu) bytes => %zu samples.\n", 285 mode_to_str(dsp->playing.mode), play_size, size, samples); 289 286 290 287 memcpy(dsp->buffer.data, dsp->playing.data, copy_size);
Note:
See TracChangeset
for help on using the changeset viewer.