Changeset 7561 in vbox for trunk/src/VBox/Devices/Audio
- Timestamp:
- Mar 25, 2008 7:49:23 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/audio.c
r7558 r7561 155 155 156 156 #ifdef VBOX 157 volume_t sum_out_volume = 158 { 159 0, 160 INT_MAX, 161 INT_MAX 162 }; 163 volume_t master_out_volume = 164 { 165 0, 166 INT_MAX, 167 INT_MAX 168 }; 157 169 volume_t pcm_out_volume = 158 170 { … … 1009 1021 sw->conv (sw->buf, buf, swlim, &sw->vol); 1010 1022 #else 1011 sw->conv (sw->buf, buf, swlim, & pcm_out_volume);1023 sw->conv (sw->buf, buf, swlim, &sum_out_volume); 1012 1024 #endif 1013 1025 } … … 1866 1878 case AUD_MIXER_VOLUME: 1867 1879 name = "MASTER"; 1868 vol = & pcm_out_volume;1880 vol = &master_out_volume; 1869 1881 break; 1870 1882 case AUD_MIXER_PCM: 1871 1883 name = "PCM_OUT"; 1884 vol = &pcm_out_volume; 1872 1885 break; 1873 1886 case AUD_MIXER_LINE_IN: … … 1882 1895 if (vol) 1883 1896 { 1897 uint32_t u32VolumeLeft = (uint32_t)*lvol; 1898 uint32_t u32VolumeRight = (uint32_t)*rvol; 1899 /* 0x00..0xff => 0x01..0x100 */ 1900 if (u32VolumeLeft) 1901 u32VolumeLeft++; 1902 if (u32VolumeRight) 1903 u32VolumeRight++; 1884 1904 vol->mute = *mute; 1885 vol->l = ((uint32_t)*lvol) * 0x808080; /* maximum is INT_MAX = 0x7fffffff*/1886 vol->r = ((uint32_t)*rvol) * 0x808080; /* maximum is INT_MAX = 0x7fffffff*/1887 } 1888 #if 0 1889 LogRel(("AUDIO: Set '%s' volume to %d%%/%d%%\n", name, (*lvol*100)/255, (*rvol*100)/255l));1890 #endif 1905 vol->l = u32VolumeLeft * 0x800000; /* maximum is 0x80000000 */ 1906 vol->r = u32VolumeRight * 0x800000; /* maximum is 0x80000000 */ 1907 } 1908 sum_out_volume.mute = master_out_volume.mute || pcm_out_volume.mute; 1909 sum_out_volume.l = ASMMultU64ByU32DivByU32(master_out_volume.l, pcm_out_volume.l, 0x80000000U); 1910 sum_out_volume.r = ASMMultU64ByU32DivByU32(master_out_volume.r, pcm_out_volume.r, 0x80000000U); 1891 1911 } 1892 1912
Note:
See TracChangeset
for help on using the changeset viewer.