Esempio n. 1
0
        public void Dispose()
        {
            // Load the class
            ClassHolder instance;

            // Protected
            lock (this)
            {
                // Load
                instance = m_Class;

                // Forget
                m_Class = null;
            }

            // Wipe out
            if (null != instance)
            {
                // Try to stop
                try
                {
                    // Shut down
                    _EnableDataDMA( instance.ClassPointer, false );
                }
                catch
                {
                    // Ignore any error
                }

                // Discard
                instance.Dispose();
            }
        }
Esempio n. 2
0
        /// <summary>
        /// On the first call <see cref="ClassHolder.Dispose"/> is called on the
        /// <see cref="m_Class"/> wrapper.
        /// </summary>
        public void Dispose()
        {
            // Forward
            if (null != m_Class) m_Class.Dispose();

            // Once
            m_Class = null;

            // No need to finalize
            GC.SuppressFinalize( this );
        }
Esempio n. 3
0
        /// <summary>
        /// Create a new <i>CString</i> initialized with the indicated data.
        /// </summary>
        /// <param name="sData">Initial data.</param>
        public MFCString( string sData )
        {
            // Create memory
            m_Class = new ClassHolder( 4, 0 );

            // Construct it
            CString_Construct( m_Class.ClassPointer, sData );

            // Prepare for shut down
            m_Class.Destructor = new ClassHolder.DestructHandler( CString_Destruct );
        }
Esempio n. 4
0
        public Frontend()
        {
            // Create the MFC wrapper
            m_Class = new ClassHolder( TTBudget.LegacySize.CDVBFrontend );

            // Construct C++ instance
            _Construct( m_Class.ClassPointer );

            // Attach destructor
            m_Class.Destructor = new ClassHolder.DestructHandler( _Destruct );
        }
Esempio n. 5
0
        /// <summary>
        /// Create a new <i>CString</i> initialized with the indicated data.
        /// </summary>
        /// <param name="sData">Initial data.</param>
        public MFCString(string sData)
        {
            // Create memory
            m_Class = new ClassHolder(4, 0);

            // Construct it
            CString_Construct(m_Class.ClassPointer, sData);

            // Prepare for shut down
            m_Class.Destructor = new ClassHolder.DestructHandler(CString_Destruct);
        }
Esempio n. 6
0
        /// <summary>
        /// On the first call <see cref="ClassHolder.Dispose"/> is called on the
        /// <see cref="m_Class"/> wrapper.
        /// </summary>
        public void Dispose()
        {
            // Forward
            if (null != m_Class)
            {
                m_Class.Dispose();
            }

            // Once
            m_Class = null;

            // No need to finalize
            GC.SuppressFinalize(this);
        }
Esempio n. 7
0
        public FilterToCode( ushort pid, Action<byte[]> callback )
            : base( pid )
        {
            // Remember
            m_FilterQueue = new FilterQueue( callback );

            // Create the MFC wrapper
            m_Class = new ClassHolder( TTBudget.LegacySize.CDVBTSFilter );

            // Construct C++ instance
            _Construct( m_Class.ClassPointer );

            // Attach destructor
            m_Class.Destructor = new ClassHolder.DestructHandler( _Destruct );

            // Overload virtual function
            m_Class[1] = new InternalDataArrivalHandler( OnDataArrival );
        }
Esempio n. 8
0
        public FilterToFile( ushort pid, string filePath )
            : base( pid )
        {
            // Create the MFC wrapper
            m_Class = new ClassHolder( TTBudget.LegacySize.CDVBFilterToFile );

            // Construct C++ instance
            _Construct( m_Class.ClassPointer );

            // Attach destructor
            m_Class.Destructor = new ClassHolder.DestructHandler( _Destruct );

            // Create MFC string
            using (MFCString path = new MFCString( filePath ))
            {
                // Configure file - flags are Create and Write
                _SetFileParams( m_Class.ClassPointer, path.ClassPointer, 0x1001 );
            }
        }
Esempio n. 9
0
        public void Dispose()
        {
            // Load the class
            ClassHolder instance;

            // Protected
            lock (this)
            {
                // Load
                instance = m_Class;

                // Forget
                m_Class = null;
            }

            // Wipe out
            if (null != instance) instance.Dispose();
        }
Esempio n. 10
0
        public virtual void Dispose()
        {
            // Make sure that filter is deactivated
            Stop();

            // Load the class
            ClassHolder instance;

            // Protected
            lock (this)
            {
                // Load
                instance = m_Class;

                // Forget
                m_Class = null;
            }

            // Wipe out
            if (null != instance) instance.Dispose();
        }