/// <summary>
 /// Creates a new Resampler based on the DMO Resampler
 /// </summary>
 public DmoResampler()
 {
     mediaComObject = new ResamplerMediaComObject();
     mediaObject = new MediaObject((IMediaObject)mediaComObject);
     propertyStoreInterface = (IPropertyStore)mediaComObject;
     resamplerPropsInterface = (IWMResamplerProps)mediaComObject;
 }
 /// <summary>
 /// Creates a new Resampler based on the DMO Resampler
 /// </summary>
 public WindowsMediaMp3Decoder()
 {
     mediaComObject = new WindowsMediaMp3DecoderComObject();
     mediaObject = new MediaObject((IMediaObject)mediaComObject);
     propertyStoreInterface = (IPropertyStore)mediaComObject;
     //resamplerPropsInterface = (IWMResamplerProps)mediaComObject;
 }
 public void Dispose()
 {
     _properties = null;
     ComThread.BeginInvoke(() =>
     {
         _propertyStoreInteface = null;
     });
 }
Beispiel #4
0
 public FontPropertyStore(IPropertyStore propertyStore)
 {
     if (propertyStore == null)
     {
         throw new ArgumentException("Parameter propertyStore cannot be null.", "propertyStore");
     }
     _propertyStore = propertyStore;
 }
Beispiel #5
0
		/// <summary>
		/// Release the native and managed objects
		/// </summary>
		/// <param name="disposing">Indicates that this is being called from Dispose(), rather than the finalizer.</param>
		protected virtual void Dispose(bool disposing) {
			if (nativePropertyStore != null) {
				Marshal.ReleaseComObject(nativePropertyStore);
				nativePropertyStore = null;
			}

			if (nativeShellLink != null) {
				Marshal.ReleaseComObject(nativeShellLink);
				nativeShellLink = null;
			}
		}
 /// <summary>
 /// Dispose code - experimental at the moment
 /// Was added trying to track down why Resampler crashes NUnit
 /// This code not currently being called by ResamplerDmoStream
 /// </summary>
 public void Dispose()
 {
     if(propertyStoreInterface != null)
     {
         Marshal.ReleaseComObject(propertyStoreInterface);
         propertyStoreInterface = null;
     }
     /*if(resamplerPropsInterface != null)
     {
         Marshal.ReleaseComObject(resamplerPropsInterface);
         resamplerPropsInterface = null;
     }*/
     if (mediaObject != null)
     {
         mediaObject.Dispose();
         mediaObject = null;
     }
     if (mediaComObject != null)
     {
         Marshal.ReleaseComObject(mediaComObject);
         mediaComObject = null;
     }
 }
 /// <summary>
 /// Sets a property value.
 /// </summary>
 /// <param name="propertyStore">The property store to set the property in.</param>
 /// <param name="property">The property to set.</param>
 /// <param name="value">The value to set the property to.</param>
 private static void SetPropertyValue(IPropertyStore propertyStore, PropertyKey property, string value)
 {
     var variant = new PropertyVariant(value);
     propertyStore.SetValue(ref property, ref variant);
     variant.Dispose();
 }
 public TablixRow(IPropertyStore propertyStore)
     : base(propertyStore)
 {
 }
 public Paragraph(IPropertyStore propertyStore)
     : base(propertyStore)
 {
 }
Beispiel #10
0
 public bool Evaluate(IOutput console, IPropertyProvider propertyProvider, IPropertyStore propertyStore, ProcessorItem item)
 {
     return(Left.Evaluate(console, propertyProvider, propertyStore, item) || Right.Evaluate(console, propertyProvider, propertyStore, item));
 }
Beispiel #11
0
 public Subreport(IPropertyStore propertyStore)
     : base(propertyStore)
 {
 }
 public static extern int SHGetPropertyStoreForWindow(
     IntPtr hwnd,
     ref Guid iid /*IID_IPropertyStore*/,
     [Out(), MarshalAs(UnmanagedType.Interface)]
     out IPropertyStore propertyStore);
 internal PropertyStore(IPropertyStore store)
 {
     _Store = store;
 }
Beispiel #14
0
 public MapSizeRule(IPropertyStore propertyStore)
     : base(propertyStore)
 {
 }
Beispiel #15
0
 public virtual extern void CopyValuesToPropertyStore([In, MarshalAs(UnmanagedType.Interface)] IPropertyStore pStore);
 internal ScaleRange(IPropertyStore propertyStore)
     : base(propertyStore)
 {
 }
Beispiel #17
0
 internal MapPointRules(IPropertyStore propertyStore)
     : base(propertyStore)
 {
 }
Beispiel #18
0
 public GridLines2005(IPropertyStore propertyStore)
     : base(propertyStore)
 {
 }
Beispiel #19
0
 public ChartSeriesHierarchy(IPropertyStore propertyStore)
     : base(propertyStore)
 {
 }
Beispiel #20
0
        /// <summary>
        /// Release the native and managed objects
        /// </summary>
        /// <param name="disposing">Indicates that this is being called from Dispose(), rather than the finalizer.</param>
        public void Dispose(bool disposing)
        {
            if (disposing)
            {
                title = null;
            }

            if (nativePropertyStore != null)
            {
                Marshal.ReleaseComObject(nativePropertyStore);
                nativePropertyStore = null;
            }

            if (nativeShellLink != null)
            {
                Marshal.ReleaseComObject(nativeShellLink);
                nativeShellLink = null;
            }
        }
 public virtual IPropertyStore WrapPropertyStore(IPropertyStore propertyStore)
 {
     return(propertyStore);
 }
Beispiel #22
0
 /// <summary>
 /// Creates a new property store
 /// </summary>
 /// <param name="store">IPropertyStore COM interface</param>
 internal PropertyStore(IPropertyStore store)
 {
     this.storeInterface = store;
 }
Beispiel #23
0
 public ReportItem(IPropertyStore propertyStore)
     : base(propertyStore)
 {
 }
Beispiel #24
0
 public MapDistanceScale(IPropertyStore propertyStore)
     : base(propertyStore)
 {
 }
 internal MapTitle(IPropertyStore propertyStore)
     : base(propertyStore)
 {
 }
Beispiel #26
0
 internal MapAppearanceRule(IPropertyStore propertyStore)
     : base(propertyStore)
 {
 }
Beispiel #27
0
 public ColumnGrouping2005(IPropertyStore propertyStore)
     : base(propertyStore)
 {
 }
 internal ChartDataPoint(IPropertyStore propertyStore)
     : base(propertyStore)
 {
 }
 internal MapDataBoundView(IPropertyStore propertyStore)
     : base(propertyStore)
 {
 }
        /// <summary>
        /// Handles IUICommandHandler.UpdateProperty function for the supported properties
        /// </summary>
        /// <param name="key">The Property Key to update</param>
        /// <param name="currentValue">A pointer to the current value for key. This parameter can be NULL</param>
        /// <param name="newValue">When this method returns, contains a pointer to the new value for key</param>
        /// <returns>Returns S_OK if successful, or an error value otherwise</returns>
        public override HRESULT UpdateProperty(ref PropertyKey key, PropVariantRef currentValue, ref PropVariant newValue)
        {
            if (key == RibbonProperties.FontProperties)
            {
                if (currentValue != null)
                {
                    // get current font properties
                    IPropertyStore fontProperties = (IPropertyStore)currentValue.PropVariant.Value;

                    // set family
                    if ((_family == null) || (_family.Trim() == string.Empty))
                    {
                        PropVariant propFamily = PropVariant.Empty;
                        fontProperties.SetValue(ref RibbonProperties.FontProperties_Family, ref propFamily);
                    }
                    else
                    {
                        PropVariant propFamily = PropVariant.FromObject(_family);
                        fontProperties.SetValue(ref RibbonProperties.FontProperties_Family, ref propFamily);
                    }

                    // set size
                    if (_size.HasValue)
                    {
                        PropVariant propSize = PropVariant.FromObject(_size.Value);
                        fontProperties.SetValue(ref RibbonProperties.FontProperties_Size, ref propSize);
                    }

                    // set bold
                    if (_bold.HasValue)
                    {
                        PropVariant propBold = PropVariant.FromObject((uint)_bold.Value);
                        fontProperties.SetValue(ref RibbonProperties.FontProperties_Bold, ref propBold);
                    }

                    // set italic
                    if (_italic.HasValue)
                    {
                        PropVariant propItalic = PropVariant.FromObject((uint)_italic.Value);
                        fontProperties.SetValue(ref RibbonProperties.FontProperties_Italic, ref propItalic);
                    }

                    // set underline
                    if (_underline.HasValue)
                    {
                        PropVariant propUnderline = PropVariant.FromObject((uint)_underline.Value);
                        fontProperties.SetValue(ref RibbonProperties.FontProperties_Underline, ref propUnderline);
                    }

                    // set strikethrough
                    if (_strikethrough.HasValue)
                    {
                        PropVariant propStrikethrough = PropVariant.FromObject((uint)_strikethrough.Value);
                        fontProperties.SetValue(ref RibbonProperties.FontProperties_Strikethrough, ref propStrikethrough);
                    }

                    // set foregroundColor
                    if (_foregroundColor.HasValue)
                    {
                        PropVariant propForegroundColor = PropVariant.FromObject((uint)ColorTranslator.ToWin32(_foregroundColor.Value));
                        fontProperties.SetValue(ref RibbonProperties.FontProperties_ForegroundColor, ref propForegroundColor);
                    }

                    // set foregroundColorType
                    if (_foregroundColorType.HasValue)
                    {
                        PropVariant propForegroundColorType = PropVariant.FromObject((uint)_foregroundColorType.Value);
                        fontProperties.SetValue(ref RibbonProperties.FontProperties_ForegroundColorType, ref propForegroundColorType);
                    }

                    // set backgroundColor
                    if (_backgroundColor.HasValue)
                    {
                        PropVariant propBackgroundColor = PropVariant.FromObject((uint)ColorTranslator.ToWin32(_backgroundColor.Value));
                        fontProperties.SetValue(ref RibbonProperties.FontProperties_BackgroundColor, ref propBackgroundColor);
                    }

                    // set backgroundColorType
                    if (_backgroundColorType.HasValue)
                    {
                        PropVariant propBackgroundColorType = PropVariant.FromObject((uint)_backgroundColorType.Value);
                        fontProperties.SetValue(ref RibbonProperties.FontProperties_BackgroundColorType, ref propBackgroundColorType);
                    }

                    // set verticalPositioning
                    if (_verticalPositioning.HasValue)
                    {
                        PropVariant propVerticalPositioning = PropVariant.FromObject((uint)_verticalPositioning.Value);
                        fontProperties.SetValue(ref RibbonProperties.FontProperties_VerticalPositioning, ref propVerticalPositioning);
                    }

                    // set new font properties
                    newValue.SetIUnknown(fontProperties);
                }
            }

            return(HRESULT.S_OK);
        }
Beispiel #31
0
 public CustomReportItem2005(IPropertyStore propertyStore)
     : base(propertyStore)
 {
 }
Beispiel #32
0
 public Details2005(IPropertyStore propertyStore)
     : base(propertyStore)
 {
 }
Beispiel #33
0
 public BackupPropertyStore(IPropertyStore originalPropertyStore)
 {
     _original = originalPropertyStore;
 }
Beispiel #34
0
 internal ChartSeries(IPropertyStore propertyStore)
     : base(propertyStore)
 {
 }
 /// <summary>
 /// Creates a new property store
 /// </summary>
 /// <param name="store">IPropertyStore COM interface</param>
 internal PropertyStore(IPropertyStore store)
 {
    _underlyingStore = store;
 }
Beispiel #36
0
 internal Border(IPropertyStore propertyStore)
     : base(propertyStore)
 {
 }
 public MatrixRow2005(IPropertyStore propertyStore)
     : base(propertyStore)
 {
 }
        public int BeginCreateObject(
            IMFByteStream pByteStream,
            string pwszURL,
            MFResolution dwFlags,
            IPropertyStore pProps,              // Can be NULL.
            out object ppIUnknownCancelCookie,  // Can be NULL.
            IMFAsyncCallback pCallback,
            object punkState                  // Can be NULL
        )
        {
            // Make sure we *never* leave this entry point with an exception
            try
            {
                int hr;
                m_Log.WriteLine("BeginCreateObject");

                ppIUnknownCancelCookie = null; // We don't return a cancellation cookie.

                if ((pByteStream == null) || (pwszURL == null) || (pCallback == null))
                {
                    throw new COMException("bad stream, url, or callback", E_InvalidArgument);
                }

                IMFAsyncResult pResult = null;

                WavSource pSource = new WavSource();

                pSource.Open(pByteStream);

                hr = MFExtern.MFCreateAsyncResult(pSource as IMFMediaSource, pCallback, punkState, out pResult);
                MFError.ThrowExceptionForHR(hr);

                hr = MFExtern.MFInvokeCallback(pResult);
                MFError.ThrowExceptionForHR(hr);

                if (pResult != null)
                {
                    Marshal.ReleaseComObject(pResult);
                }
                return S_Ok;
            }
            catch (Exception e)
            {
                ppIUnknownCancelCookie = null;
                return Marshal.GetHRForException(e);
            }
        }
 /// <summary>
 /// Creates a new property store
 /// </summary>
 /// <param name="store">IPropertyStore COM interface</param>
 internal PropertyStore(IPropertyStore store)
 {
     this.storeInterface = store;
 }
 internal ReportElement(IPropertyStore propertyStore)
     : base(propertyStore)
 {
 }
Beispiel #41
0
 public DataSet(IPropertyStore propertyStore)
     : base(propertyStore)
 {
 }
 public MapLegendTitle(IPropertyStore propertyStore)
     : base(propertyStore)
 {
 }
Beispiel #43
0
        private object GetPropertyValue(IPropertyStore propertyStore, PROPERTYKEY propertyKey)
        {
            object returnObj = null;
            PROPVARIANT propVariant;
            var result = propertyStore.GetValue(ref propertyKey, out propVariant);
            AssertCoreAudio.IsHResultOk(result);

            var vType = (VarEnum)propVariant.vt;
            if (vType == VarEnum.VT_EMPTY)
                return null;

            switch (vType)
            {
                case VarEnum.VT_BOOL:
                    returnObj = propVariant.Data.AsBoolean;
                    break;
                case VarEnum.VT_UI4:
                    returnObj = propVariant.Data.AsUInt32;
                    break;
                case VarEnum.VT_LPWSTR:
                case VarEnum.VT_CLSID:
                    returnObj = Marshal.PtrToStringUni(propVariant.Data.AsStringPtr);
                    break;
                case VarEnum.VT_BLOB:
                    returnObj = propVariant.Data.AsFormatPtr;
                    break;
            }

            if (propertyKey.fmtid == PropertyKeys.PKEY_AudioEngine_DeviceFormat ||
                propertyKey.fmtid == PropertyKeys.PKEY_AudioEngine_OEMFormat)
            {
                Assert.AreEqual(VarEnum.VT_BLOB, vType, "The device format property was not of varient type VT_BLOB.");
                var format = (WAVEFORMATEX)Marshal.PtrToStructure((IntPtr)returnObj, typeof(WAVEFORMATEX));

                if (format.nChannels != 0 && format.nSamplesPerSec != 0 && format.wBitsPerSample != 0)
                    Assert.AreEqual(format.nChannels * format.nSamplesPerSec * format.wBitsPerSample, format.nAvgBytesPerSec * 8, "The wave format was not valid.");
            }

            return returnObj;
        }
 internal ChartLegend(IPropertyStore propertyStore)
     : base(propertyStore)
 {
 }