- Timestamp:
- May 30, 2002, 4:31:07 PM (23 years ago)
- Location:
- trunk/src/winmm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/winmm/mixer.cpp
r8518 r8530 1 /* $Id: mixer.cpp,v 1.2 4 2002-05-29 15:14:53sandervl Exp $ */1 /* $Id: mixer.cpp,v 1.25 2002-05-30 14:31:07 sandervl Exp $ */ 2 2 3 3 /* … … 126 126 if(mixerDest[i].id == MIXER_DEST_WAVEIN) { 127 127 for(int j=0;j<mixerDest[i].cConnections;j++) { 128 dprintf(("wavein source % d (id %d)", pmixerLines[mixerDest[i].Connections[j]]->id, mixerDest[i].Connections[j]));128 dprintf(("wavein source %s %d (id %d)", pmixerLines[mixerDest[i].Connections[j]]->line.szName, pmixerLines[mixerDest[i].Connections[j]]->id, mixerDest[i].Connections[j])); 129 129 if(pmixerLines[mixerDest[i].Connections[j]]->id == dwRecSrc) { 130 130 pDetails[j].fValue = 1; … … 351 351 if(mixerDest[i].id == MIXER_DEST_WAVEIN) { 352 352 for(int j=0;j<mixerDest[i].cConnections;j++) { 353 dprintf(("wavein source % d (%s)", pmixerLines[mixerDest[i].Connections[j]]->id, pmixerLines[mixerDest[i].Connections[j]]->line.szName));353 dprintf(("wavein source %s %d (%s)", pmixerLines[mixerDest[i].Connections[j]]->line.szName, pmixerLines[mixerDest[i].Connections[j]]->id, pmixerLines[mixerDest[i].Connections[j]]->line.szName)); 354 354 pDetails->dwParam1 = pmixerLines[mixerDest[i].Connections[j]]->line.dwLineID; 355 355 pDetails->dwParam2 = 0; … … 500 500 { 501 501 for(int j=0;j<mixerDest[i].cConnections;j++) { 502 dprintf(("wavein source % d (id %d)", pmixerLines[mixerDest[i].Connections[j]]->id, mixerDest[i].Connections[j]));502 dprintf(("wavein source %s %d (id %d)", pmixerLines[mixerDest[i].Connections[j]]->line.szName, pmixerLines[mixerDest[i].Connections[j]]->id, mixerDest[i].Connections[j])); 503 503 if(pDetails[j].fValue) 504 504 { -
trunk/src/winmm/mixeros2.cpp
r8510 r8530 1 /* $Id: mixeros2.cpp,v 1. 7 2002-05-28 17:10:02sandervl Exp $ */1 /* $Id: mixeros2.cpp,v 1.8 2002-05-30 14:31:07 sandervl Exp $ */ 2 2 3 3 /* … … 81 81 dprintf(("mciSendCommand returned error %x = %s", rc, szError)); 82 82 } 83 83 84 return TRUE; 84 85 } … … 88 89 { 89 90 if(hPDDMix) { 91 MIXSTRUCT mixstruct; 92 93 //unlock recording source 94 if(mixerapiIOCTL90(hPDDMix, RECORDSRCQUERY, &mixstruct, sizeof(mixstruct)) == TRUE) { 95 mixstruct.Mute = 2; 96 if(mixerapiIOCTL90(hPDDMix, RECORDSRCSET, &mixstruct, sizeof(mixstruct)) == FALSE) { 97 dprintf(("OSLibMixerClose: mixerapiIOCTL90 RECORDSRCSET failed!!")); 98 } 99 } 100 else dprintf(("OSLibMixerClose: mixerapiIOCTL90 RECORDSRCQUERY failed!!")); 101 102 //unlock recording gain 103 if(mixerapiIOCTL90(hPDDMix, RECORDGAINQUERY, &mixstruct, sizeof(mixstruct)) == TRUE) { 104 mixstruct.Mute = 2; 105 if(mixerapiIOCTL90(hPDDMix, RECORDGAINSET, &mixstruct, sizeof(mixstruct)) == FALSE) { 106 dprintf(("OSLibMixerClose: mixerapiIOCTL90 RECORDGAINSET failed!!")); 107 } 108 } 109 else dprintf(("OSLibMixerClose: mixerapiIOCTL90 RECORDGAINQUERY failed!!")); 110 111 //unlock PCM volume 112 if(mixerapiIOCTL90(hPDDMix, STREAMVOLQUERY, &mixstruct, sizeof(mixstruct)) == TRUE) { 113 mixstruct.Mute = 2; 114 if(mixerapiIOCTL90(hPDDMix, STREAMVOLSET, &mixstruct, sizeof(mixstruct)) == FALSE) { 115 dprintf(("OSLibMixerClose: mixerapiIOCTL90 STREAMVOLSET failed!!")); 116 } 117 } 118 else dprintf(("OSLibMixerClose: mixerapiIOCTL90 STREAMVOLQUERY failed!!")); 119 90 120 DosClose(hPDDMix); 91 121 } … … 226 256 } 227 257 228 dwIOCT90VolLeft = WIN32_TO_IOCTL90_VOLUME(dwVolLeft); 258 dwIOCT90VolLeft = WIN32_TO_IOCTL90_VOLUME(dwVolLeft); 229 259 dwIOCT90VolRight = WIN32_TO_IOCTL90_VOLUME(dwVolRight); 230 260 … … 341 371 } 342 372 mixstruct.VolumeL = min(MIXER_IOCTL90_MAX_VOLUME, mixstruct.VolumeL); 343 mixstruct.VolumeR = min(MIXER_IOCTL90_MAX_VOLUME, mixstruct.VolumeR); 373 if(dwFunc == RECORDGAINSET) { 374 mixstruct.VolumeR = mixstruct.VolumeL; //only left is valid 375 } 376 else mixstruct.VolumeR = min(MIXER_IOCTL90_MAX_VOLUME, mixstruct.VolumeR); 344 377 345 378 if(dwControl == MIX_CTRL_OUT_L_TREBLE) { … … 447 480 BOOL OSLibMixIsRecSourcePresent(DWORD dwRecSrc) 448 481 { 482 DWORD oldRecSrc; 483 BOOL ret = TRUE; 484 485 OSLibMixGetRecSource(&oldRecSrc); 486 449 487 if(OSLibMixSetRecSource(dwRecSrc) == FALSE) { 450 return FALSE; 451 } 452 return TRUE; 488 ret = FALSE; 489 } 490 OSLibMixSetRecSource(oldRecSrc); 491 return ret; 453 492 } 454 493 /******************************************************************************/ … … 497 536 } 498 537 499 dwVolL = szVolumeLevels[volidx][0]; 500 dwVolR = szVolumeLevels[volidx][1]; 501 mixstruct.VolumeL = WIN32_TO_IOCTL90_VOLUME(dwVolL); 502 mixstruct.VolumeR = WIN32_TO_IOCTL90_VOLUME(dwVolR); 503 mixstruct.Mute = 0; 504 505 //set recording gain to that of the selected source 506 if(mixerapiIOCTL90(hPDDMix, RECORDGAINSET, &mixstruct, sizeof(mixstruct)) == FALSE) { 507 dprintf(("OSLibMixSetRecSource: mixerapiIOCTL90 RECORDGAINSET failed!!")); 508 return FALSE; 538 if(szVolumeLevels[volidx][0] != -1) 539 {//if changed, override recording gain 540 dwVolL = szVolumeLevels[volidx][0]; 541 dwVolR = szVolumeLevels[volidx][1]; 542 mixstruct.VolumeL = WIN32_TO_IOCTL90_VOLUME(dwVolL); 543 mixstruct.VolumeR = WIN32_TO_IOCTL90_VOLUME(dwVolR); 544 mixstruct.Mute = 0; 545 546 //set recording gain to that of the selected source 547 dprintf(("set recording gain to (%d,%d)", mixstruct.VolumeL, mixstruct.VolumeR)); 548 if(mixerapiIOCTL90(hPDDMix, RECORDGAINSET, &mixstruct, sizeof(mixstruct)) == FALSE) { 549 dprintf(("OSLibMixSetRecSource: mixerapiIOCTL90 RECORDGAINSET failed!!")); 550 return FALSE; 551 } 509 552 } 510 553 return TRUE;
Note:
See TracChangeset
for help on using the changeset viewer.