private void GetAudioLoudness() { _Part.Activate(CLSCTX.ALL, ref IIDs.IID_IAudioLoudness, out object result); if (result != null) { _AudioLoudness = new AudioLoudness(result as IAudioLoudness); _AudioLoudnessChangeNotification = new ControlChangeNotify(this); Marshal.ThrowExceptionForHR(_Part.RegisterControlChangeCallback(ref IIDs.IID_IAudioLoudness, _AudioLoudnessChangeNotification)); } }
private void GetAudioMute() { object result = null; _Part.Activate(CLSCTX.ALL, ref IIDs.IID_IAudioMute, out result); if (result != null) { _AudioMute = new AudioMute(result as IAudioMute); _AudioMuteChangeNotification = new ControlChangeNotify(this); Marshal.ThrowExceptionForHR(_Part.RegisterControlChangeCallback(ref IIDs.IID_IAudioMute, _AudioMuteChangeNotification)); } }
private void GetAudioPeakMeter() { object result = null; _Part.Activate(CLSCTX.ALL, ref IIDs.IID_IAudioPeakMeter, out result); if (result != null) { _AudioPeakMeter = new AudioPeakMeter(result as IAudioPeakMeter); _AudioPeakMeterChangeNotification = new ControlChangeNotify(this); Marshal.ThrowExceptionForHR(_Part.RegisterControlChangeCallback(ref IIDs.IID_IAudioPeakMeter, _AudioPeakMeterChangeNotification)); } }
private void DisposeCtrlChangeNotify(ref ControlChangeNotify obj) { if (obj != null) { try { ControlChangeNotify cn = (ControlChangeNotify)obj; if (cn.IsAllocated) { Marshal.ThrowExceptionForHR(_Part.UnregisterControlChangeCallback(cn)); cn.Dispose(); } } catch { } obj = null; } }
private void DisposeCtrlChangeNotify(ref ControlChangeNotify obj) { if(obj != null) { try { ControlChangeNotify cn = (ControlChangeNotify)obj; if(cn.IsAllocated) { Marshal.ThrowExceptionForHR(_Part.UnregisterControlChangeCallback(cn)); cn.Dispose(); } } catch { } obj = null; } }