Вверх ↑
Ответов: 1343
Рейтинг: 31
#1: 2022-08-04 20:22:55 ЛС | профиль | цитата
Леонид писал(а):
Rysik, достаньте с помощью API до этого "ползунка", а уже с помощью HiAsm его двигайте



так что ли))?

работает только с компилятором FPC
Add(MainForm,2953706,21,105)
{
}
Add(InlineCode,10053706,182,140)
{
@Hint=#9:Hex2Int64|
@Color=5592575
WorkPoints=#9:doCreateI|5:doSet|
EventPoints=#9:onCreateI|
DataPoints=#3:vol|
Code=#15:unit HiAsmUnit;|0:|9:interface|0:|46:uses Windows,kol,Share,Debug,tlhelp32,ActiveX;|0:|4:type|28: THiAsmClass = class(TDebug)|0:|10: private|0:|9: public|17: vol:THI_Event;|25: onCreateI:THI_Event;|54: procedure doCreateI(var _Data:TData; Index:word);|50: procedure doSet(var _Data:TData; Index:word);|0:|5: end;|1: |0:|5:const|77:CLASS_IMMDeviceEnumerator : TGUID = '{BCDE0395-E52F-467C-8E3D-C4579291692E}';|75:IID_IMMDeviceEnumerator : TGUID = '{A95664D2-9614-4F35-A746-DE8DB63617E6}';|65:IID_IMMDevice : TGUID = '{D666063F-1587-4E43-81F1-B948E807363F}';|75:IID_IMMDeviceCollection : TGUID = '{0BD7A1BE-7A1A-44DB-8397-CC5392387B5E}';|76:IID_IAudioEndpointVolume : TGUID = '{5CDF2C82-841E-4546-9722-0CF74078229A}';|78:IID_IAudioMeterInformation : TGUID = '{C02216F6-8C67-4B5B-9D00-D008E73E0064}';|84:IID_IAudioEndpointVolumeCallback : TGUID = '{657804FA-D6AD-4496-8A60-352752AF4F89}';|1: |32:DEVICE_STATE_ACTIVE = $00000001;|35:DEVICE_STATE_UNPLUGGED = $00000002;|36:DEVICE_STATE_NOTPRESENT = $00000004;|33:DEVICE_STATEMASK_ALL = $00000007;|1: |4:type|21:EDataFlow = TOleEnum;|1: |5:const|20:eRender = $00000000;|21:eCapture = $00000001;|17:eAll = $00000002;|33:EDataFlow_enum_count = $00000003;|1: |4:type|17:ERole = TOleEnum;|1: |5:const|21:eConsole = $00000000;|24:eMultimedia = $00000001;|28:eCommunications = $00000002;|29:ERole_enum_count = $00000003;|1: |4:type|50:IAudioEndpointVolumeCallback = interface(IUnknown)|42:['{657804FA-D6AD-4496-8A60-352752AF4F89}']|4:end;|1: |42:IAudioEndpointVolume = interface(IUnknown)|42:['{5CDF2C82-841E-4546-9722-0CF74078229A}']|100:function RegisterControlChangeNotify(AudioEndPtVol: IAudioEndpointVolumeCallback): Integer; stdcall;|102:function UnregisterControlChangeNotify(AudioEndPtVol: IAudioEndpointVolumeCallback): Integer; stdcall;|57:function GetChannelCount(out PInteger): Integer; stdcall;|92:function SetMasterVolumeLevel(fLevelDB: single; pguidEventContext: PGUID): Integer; stdcall;|98:function SetMasterVolumeLevelScalar(fLevelDB: single; pguidEventContext: PGUID): Integer; stdcall;|70:function GetMasterVolumeLevel(out fLevelDB: single): Integer; stdcall;|76:function GetMasterVolumeLevelScaler(out fLevelDB: single): Integer; stdcall;|112:function SetChannelVolumeLevel(nChannel: Integer; fLevelDB: double; pguidEventContext: PGUID): Integer; stdcall;|118:function SetChannelVolumeLevelScalar(nChannel: Integer; fLevelDB: double; pguidEventContext: PGUID): Integer; stdcall;|90:function GetChannelVolumeLevel(nChannel: Integer; out fLevelDB: double): Integer; stdcall;|94:function GetChannelVolumeLevelScalar(nChannel: Integer; out fLevel: double): Integer; stdcall;|77:function SetMute(bMute: Boolean; pguidEventContext: PGUID): Integer; stdcall;|55:function GetMute(out bMute: Boolean): Integer; stdcall;|88:function GetVolumeStepInfo(pnStep: Integer; out pnStepCount: Integer): Integer; stdcall;|66:function VolumeStepUp(pguidEventContext: PGUID): Integer; stdcall;|68:function VolumeStepDown(pguidEventContext: PGUID): Integer; stdcall;|76:function QueryHardwareSupport(out pdwHardwareSupportMask): Integer; stdcall;|132:function GetVolumeRange(out pflVolumeMindB: double; out pflVolumeMaxdB: double; out pflVolumeIncrementdB: double): Integer; stdcall;|4:end;|1: |44:IAudioMeterInformation = interface(IUnknown)|42:['{C02216F6-8C67-4B5B-9D00-D008E73E0064}']|4:end;|1: |36:IPropertyStore = interface(IUnknown)|4:end;|1: |31:IMMDevice = interface(IUnknown)|42:['{D666063F-1587-4E43-81F1-B948E807363F}']|37:function Activate(const refId: TGUID;|16:dwClsCtx: DWORD;|28:pActivationParams: PInteger;|61:out pEndpointVolume: IAudioEndpointVolume): Hresult; stdCall;|98:function OpenPropertyStore(stgmAccess: DWORD; out ppProperties: IPropertyStore): Hresult; stdcall;|55:function GetId(out ppstrId: PLPWSTR): Hresult; stdcall;|56:function GetState(out State: Integer): Hresult; stdcall;|4:end;|1: |1: |41:IMMDeviceCollection = interface(IUnknown)|42:['{0BD7A1BE-7A1A-44DB-8397-CC5392387B5E}']|4:end;|1: |43:IMMNotificationClient = interface(IUnknown)|42:['{7991EEC9-7E89-4D85-8390-6C703CEC60C0}']|4:end;|1: |41:IMMDeviceEnumerator = interface(IUnknown)|42:['{A95664D2-9614-4F35-A746-DE8DB63617E6}']|125:function EnumAudioEndpoints(dataFlow: EDataFlow; deviceState: SYSUINT; DevCollection: IMMDeviceCollection): Hresult; stdcall;|99:function GetDefaultAudioEndpoint(EDF: SYSUINT; ER: SYSUINT; out Dev :IMMDevice ): Hresult; stdcall;|75:function GetDevice(pwstrId: pointer; out Dev: IMMDevice): HResult; stdcall;|96:function RegisterEndpointNotificationCallback(pClient: IMMNotificationClient): Hresult; stdcall;|4:end;|0:|0:|3:var|45: endpointVolume: IAudioEndpointVolume = nil;|51: VolumeLevel , VolumeLevel1, VolumeLevel2: Single;|2: |2: |0:|0:|14:implementation|0:|0:|32:procedure THiAsmClass.doCreateI;|0:|3:var|38:deviceEnumerator: IMMDeviceEnumerator;|25:defaultDevice: IMMDevice;|0:|5:begin|114:CoCreateInstance(CLASS_IMMDeviceEnumerator, nil, CLSCTX_INPROC_SERVER, IID_IMMDeviceEnumerator, deviceEnumerator);|75:deviceEnumerator.GetDefaultAudioEndpoint(eRender, eConsole, defaultDevice);|92:defaultDevice.Activate(IID_IAudioEndpointVolume, CLSCTX_INPROC_SERVER, nil, endpointVolume);|23:_hi_onEvent(onCreateI);|4:end;|0:|0:|0:|0:|28:procedure THiAsmClass.doSet;|0:|5:begin|53: if endpointVolume = nil then _debug('not CreateI');|77: endpointVolume.SetMasterVolumeLevelScalar(ReadInteger(_Data,vol)/100, nil);|0:|4:end;|0:|0:|4:end.|
}
Add(TrackBar,16508131,119,147)
{
Left=20
Top=15
Width=310
Max=100
link(onPosition,10053706:doSet,[])
}
Add(Button,8455208,119,105)
{
Left=25
Top=65
Caption="CreateI"
link(onClick,10053706:doCreateI,[(167,111)(167,146)])
}
карма: 2

0
Редактировалось 1 раз(а), последний 2022-08-04 20:23:19