1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 157: 158: 159: 160: 161: 162: 163: 164: 165: 166: 167: 168: 169: 170: 171: 172: 173: 174: 175: 176: 177: 178:
| var oldWaveVolLi,oldWaveVolRe, oldMidiVolLi,oldMidiVolRe : Integer;
procedure TForm1.Timer1Timer(Sender: TObject); var VolLi, VolRe: Word; begin GetWavevolume(VolLi, VolRe); Pbvolre.position:= VolRe; Pbvolli.position:= Volli; GetMidivolume(VolLi, VolRe); PbMidivolre.position:= VolRe; PbMidivolli.position:= Volli; end;
procedure TForm1.GetWaveVolume(var volL, volR: Word); var hWO: HWAVEOUT; waveF: TWAVEFORMATEX; vol: DWORD; begin volL:= 0; volR:= 0; FillChar(waveF, SizeOf(waveF), 0); waveOutOpen(@hWO, WAVE_MAPPER, @waveF, 0, 0, 0); waveOutGetVolume(hWO, @vol); volL:= vol and $FFFF; volR:= vol shr 16; waveOutClose(hWO); end;
procedure TForm1.SetWaveVolume(var volL, volR: Word); var hWO: HWAVEOUT; waveF: TWAVEFORMATEX; vol: DWORD; begin FillChar(waveF, SizeOf(waveF), 0); waveOutOpen(@hWO, WAVE_MAPPER, @waveF, 0, 0, 0); vol:= volL + volR shl 16; waveOutSetVolume(hWO, vol); waveOutClose(hWO); end;
procedure TForm1.VolminusClick(Sender: TObject); var VolLi, VolRe: Word; begin GetWaveVolume(VolLi,VolRe); if (VolLi>5000) and (VolRe>5000) then Begin VolLi:=VolLi-5000; VolRe:=VolRe-5000; SetWaveVolume(VolLi,VolRe); Pbvolre.position:= VolRe; Pbvolli.position:= Volli; end; end;
procedure TForm1.VolplusClick(Sender: TObject); var VolLi, VolRe: Word; begin GetWaveVolume(VolLi,VolRe); if (VolLi<60535) and (VolRe<60535) then Begin VolLi:=VolLi+5000; VolRe:=VolRe+5000; SetWaveVolume(VolLi,VolRe); Pbvolre.position:= VolRe; Pbvolli.position:= Volli; end; end;
procedure TForm1.Volume1Click(Sender: TObject); var VolLi, VolRe: Word; begin if Mute1.checked=false then Begin GetWaveVolume(VolLi,VolRe); oldWaveVolLi:=VolLi; oldWaveVolRe:=VolRe; VolLi:=0; VolRe:=0; SetWaveVolume(VolLi,VolRe); Pbvolre.position:= VolRe; Pbvolli.position:= Volli; Mute1.checked:=true; end else begin VolLi:=oldWaveVolLi; VolRe:=oldWaveVolRe; SetWaveVolume(VolLi,VolRe); Pbvolre.position:= VolRe; Pbvolli.position:= Volli; Mute1.checked:=false; end; end;
procedure TForm1.getMidiVolume(var volL, volR: Word); var hMO: HMidiOUT; vol: DWORD; begin volL:= 0; volR:= 0; MidiOutOpen(@hMO, Midi_MAPPER, 0, 0, 0); midiOutGetVolume(hMO, @vol); volL:= vol and $FFFF; volR:= vol shr 16; midiOutClose(hmO); end;
procedure TForm1.SetMidiVolume(var volL, volR: Word); var hMO: HMidiOUT; vol: DWORD; begin midiOutOpen(@hMO, Midi_MAPPER, 0, 0, 0); vol:= volL + volR shl 16; MidiOutSetVolume(hMO, vol); MidiOutClose(hMO); end;
procedure TForm1.VolMidiMinusClick(Sender: TObject); var VolLi, VolRe: Word; begin GetMidiVolume(VolLi,VolRe); if (VolLi>5000) and (VolRe>5000) then Begin VolLi:=VolLi-5000; VolRe:=VolRe-5000; SetMidiVolume(VolLi,VolRe); PbMidivolre.position:= VolRe; PbMidivolli.position:= Volli; end; end;
procedure TForm1.VolMidiPlusClick(Sender: TObject); var VolLi, VolRe: Word; begin GetMidiVolume(VolLi,VolRe); if (VolLi<60535) and (VolRe<60535) then Begin VolLi:=VolLi+5000; VolRe:=VolRe+5000; SetMidiVolume(VolLi,VolRe); PbMidivolre.position:= VolRe; PbMidivolli.position:= Volli; end; end;
procedure TForm1.VolumeMidi1Click(Sender: TObject); var VolLi, VolRe: Word; begin if MuteMidi.checked=false then Begin GetMidiVolume(VolLi,VolRe); oldMidiVolLi:=VolLi; oldMidiVolRe:=VolRe; VolLi:=0; VolRe:=0; SetMidiVolume(VolLi,VolRe); Pbmidivolre.position:= VolRe; Pbmidivolli.position:= Volli; MuteMidi.checked:=true; end else begin VolLi:=oldMidiVolLi; VolRe:=oldMidiVolRe; SetMidiVolume(VolLi,VolRe); Pbmidivolre.position:= VolRe; Pbmidivolli.position:= Volli; Mutemidi.checked:=false; end; end;
end. |