Exemplo n.º 1
0
void MP4ElstAtom::Generate() 
{
    SetVersion(0);
    AddProperties(GetVersion());

    MP4Atom::Generate();
}
Exemplo n.º 2
0
void OCLContextProperties::AddOpenGLContextProperties() {
#ifdef __linux__
    cl_context_properties props[7] = {
        CL_GL_CONTEXT_KHR, (cl_context_properties) glXGetCurrentContext(),
        CL_GLX_DISPLAY_KHR, (cl_context_properties) glXGetCurrentDisplay(),
        0
    };
#elif __APPLE__
    CGLContextObj kGLContext = CGLGetCurrentContext();
    CGLShareGroupObj kCGLShareGroup = CGLGetShareGroup(kGLContext);

    cl_context_properties props[5] = {
        CL_CONTEXT_PROPERTY_USE_CGL_SHAREGROUP_APPLE, (cl_context_properties) kCGLShareGroup,
        NULL
    };
    //foundCtx = clCreateContext(
    //props, 0, 0, NULL, NULL, clerr);
#elif WIN32
    cl_context_properties props[5] = {
        CL_GL_CONTEXT_KHR, (cl_context_properties) wglGetCurrentContext(),
        CL_WGL_HDC_KHR, (cl_context_properties) wglGetCurrentDC()
    };
#else
#error "Platform Not avalible for GL intergration"
#endif

    AddProperties(props);
}
Exemplo n.º 3
0
LRESULT CPropertyView::OnUpdate(WPARAM /*wParam*/, LPARAM /*lParam*/)
{
	SPropertyList FinalProperties;
	memset(&FinalProperties, 0, sizeof(SPropertyList));

	for(int idx = 0; idx < m_ctrlComboBox.GetCount(); idx++) {
		IPropertyEnabled *pProperty = (IPropertyEnabled *)m_ctrlComboBox.GetItemDataPtr(idx);
		ASSERT((int)pProperty != -1);
		if((int)pProperty == -1) return 0;
		if(pProperty->isFlagged()) {
			SPropertyList Properties;
			memset(&Properties, 0, sizeof(SPropertyList));
			pProperty->GetProperties(&Properties);
			if(!FinalProperties.Merge(&Properties)) break;
			m_ctrlComboBox.SetSel(idx, TRUE);
		} else {
			m_ctrlComboBox.SetSel(idx, FALSE);
		}
	}

	if(FinalProperties.nProperties == 0) m_ctrlList.ResetContent();
	AddProperties(&FinalProperties);

	BOOL bDummy;
	m_ctrlComboBox.OnSelChange(0,0,0,bDummy);

	return 0;
}
Exemplo n.º 4
0
void MP4SoundAtom::Read()
{
  MP4Atom *parent = GetParentAtom();
  if (ATOMID(parent->GetType()) != ATOMID("stsd")) {
    // Quicktime has an interesting thing - they'll put an mp4a atom
    // which is blank inside a wave atom, which is inside an mp4a atom
    // we have a mp4a inside an wave inside an mp4a - delete all properties
    m_pProperties.Delete(8);
    m_pProperties.Delete(7);
    m_pProperties.Delete(6);
    m_pProperties.Delete(5);
    m_pProperties.Delete(4);
    m_pProperties.Delete(3);
    m_pProperties.Delete(2);
    m_pProperties.Delete(1);
    m_pProperties.Delete(0);
    if (ATOMID(GetType()) == ATOMID("alac")) {
      AddProperty(new MP4BytesProperty("decoderConfig", m_size));
      ReadProperties();
    }
    if (m_pChildAtomInfos.Size() > 0) {
      ReadChildAtoms();
    }
  } else {
    ReadProperties(0, 3); // read first 3 properties
    AddProperties(((MP4IntegerProperty *)m_pProperties[2])->GetValue());
    ReadProperties(3); // continue
    if (m_pChildAtomInfos.Size() > 0) {
      ReadChildAtoms();
    }
  }
  Skip();
}
Exemplo n.º 5
0
	wxObject* Create(IObject *obj, wxObject * /*parent*/)
	{
		wxFlexGridSizer *sizer = new wxFlexGridSizer(
			obj->GetPropertyAsInteger(_("rows")),
			obj->GetPropertyAsInteger(_("cols")),
			obj->GetPropertyAsInteger(_("vgap")),
			obj->GetPropertyAsInteger(_("hgap")));

		AddProperties( obj, sizer );

		return sizer;
	}
Exemplo n.º 6
0
void MP4MvhdAtom::Generate() 
{
    u_int8_t version = m_pFile->Use64Bits(GetType()) ? 1 : 0;
    SetVersion(version);
    AddProperties(version);

    MP4Atom::Generate();

    // set creation and modification times
    MP4Timestamp now = MP4GetAbsTimestamp();
    if (version == 1) {
        ((MP4Integer64Property*)m_pProperties[2])->SetValue(now);
        ((MP4Integer64Property*)m_pProperties[3])->SetValue(now);
    } else {
        ((MP4Integer32Property*)m_pProperties[2])->SetValue(now);
        ((MP4Integer32Property*)m_pProperties[3])->SetValue(now);
    }

    ((MP4Integer32Property*)m_pProperties[4])->SetValue(1000);

    ((MP4Float32Property*)m_pProperties[6])->SetValue(1.0);
    ((MP4Float32Property*)m_pProperties[7])->SetValue(1.0);

    // property reserved has non-zero fixed values
    static u_int8_t reserved[70] = {
        0x00, 0x00, 
        0x00, 0x00, 0x00, 0x00, 
        0x00, 0x00, 0x00, 0x00, 
        0x00, 0x01, 0x00, 0x00, 
        0x00, 0x00, 0x00, 0x00, 
        0x00, 0x00, 0x00, 0x00, 
        0x00, 0x00, 0x00, 0x00, 
        0x00, 0x01, 0x00, 0x00, 
        0x00, 0x00, 0x00, 0x00, 
        0x00, 0x00, 0x00, 0x00, 
        0x00, 0x00, 0x00, 0x00, 
        0x40, 0x00, 0x00, 0x00, 
        0x00, 0x00, 0x00, 0x00, 
        0x00, 0x00, 0x00, 0x00, 
        0x00, 0x00, 0x00, 0x00, 
        0x00, 0x00, 0x00, 0x00, 
        0x00, 0x00, 0x00, 0x00, 
        0x00, 0x00, 0x00, 0x00, 
    };
    m_pProperties[8]->SetReadOnly(false);
    ((MP4BytesProperty*)m_pProperties[8])->
        SetValue(reserved, sizeof(reserved));
    m_pProperties[8]->SetReadOnly(true);

    // set next track id
    ((MP4Integer32Property*)m_pProperties[9])->SetValue(1);
}
Exemplo n.º 7
0
void MP4ElstAtom::Read() 
{
    /* read atom version */
    ReadProperties(0, 1);

    /* need to create the properties based on the atom version */
    AddProperties(GetVersion());

    /* now we can read the remaining properties */
    ReadProperties(1);

    Skip();    // to end of atom
}
Exemplo n.º 8
0
void MP4TrunAtom::Read()
{
	/* read atom version, flags, and sampleCount */
	ReadProperties(0, 3);

	/* need to create the properties based on the atom flags */
	AddProperties(GetFlags());

	/* now we can read the remaining properties */
	ReadProperties(3);

	Skip();	// to end of atom
}
Exemplo n.º 9
0
void MP4TkhdAtom::Generate()
{
    uint8_t version = m_File.Use64Bits(GetType()) ? 1 : 0;
    SetVersion(version);
    AddProperties(version);

    MP4Atom::Generate();

	MP4Timestamp now = 0;
	if(1)
	{//»ñµÃʱ¼ä
		now = m_File.GetAllCreateTime();
	}
	else
	{
	    // set creation and modification times
	    now = MP4GetAbsTimestamp();
	}

    if (version == 1) {
        ((MP4Integer64Property*)m_pProperties[2])->SetValue(now);
        ((MP4Integer64Property*)m_pProperties[3])->SetValue(now);
    } else {
        ((MP4Integer32Property*)m_pProperties[2])->SetValue(now);
        ((MP4Integer32Property*)m_pProperties[3])->SetValue(now);
    }

    // property "matrix" has non-zero fixed values
    // this default identity matrix indicates no transformation, i.e.
    // 1, 0, 0
    // 0, 1, 0
    // 0, 0, 1
    // see http://developer.apple.com/documentation/QuickTime/QTFF/QTFFChap4/chapter_5_section_4.html

    static uint8_t matrix[36] = {
        0x00, 0x01, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x01, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
        0x40, 0x00, 0x00, 0x00,
    };

    ((MP4BytesProperty*)m_pProperties[12])->
    SetValue(matrix, sizeof(matrix));
}
Exemplo n.º 10
0
	wxObject* Create(IObject *obj, wxObject * /*parent*/)
	{
		wxGridBagSizer* sizer = new wxGridBagSizer(
			obj->GetPropertyAsInteger(_("vgap")),
			obj->GetPropertyAsInteger(_("hgap")));

		sizer->SetCols(0);

		AddProperties( obj, sizer );

		if ( !obj->IsNull( _("empty_cell_size") ) )
		{
			sizer->SetEmptyCellSize( obj->GetPropertyAsSize( _("empty_cell_size") ) );
		}

		return sizer;
	}
Exemplo n.º 11
0
void MP4MdhdAtom::Generate() 
{
	u_int8_t version = m_pFile->Use64Bits(GetType()) ? 1 : 0;
	SetVersion(version);
	AddProperties(version);

	MP4Atom::Generate();

	// set creation and modification times
	MP4Timestamp now = MP4GetAbsTimestamp();
	if (version == 1) {
		((MP4Integer64Property*)m_pProperties[2])->SetValue(now);
		((MP4Integer64Property*)m_pProperties[3])->SetValue(now);
	} else {
		((MP4Integer32Property*)m_pProperties[2])->SetValue(now);
		((MP4Integer32Property*)m_pProperties[3])->SetValue(now);
	}
}
Exemplo n.º 12
0
CArcView::CArcView(CShapeView* source, CShapeView* end, std::vector<Point> interPoints, pm::Arc* arcModel)
	: CElement(ARC)
	, source(source)
	, end(end)
	, arcModel(arcModel)
	, arrowCap(new AdjustableArrowCap(5,5))
	, valPosition(40)
	, valDistance(-15)
{
	AddProperties();

	for(auto it=interPoints.begin(); it!=interPoints.end(); ++it)
	{
		pathPoints.push_back(*it);
	}

	computeCollisionPoints(TRUE);
	cleanDouble();
	computeEnclosingRect(TRUE);
}
void
EngineList::SetFromNode(DataNode *parentNode)
{
    if(parentNode == 0)
        return;

    DataNode *searchNode = parentNode->GetNode("EngineList");
    if(searchNode == 0)
        return;

    DataNode *node;
    DataNode **children;
    if((node = searchNode->GetNode("engineName")) != 0)
        SetEngineName(node->AsStringVector());
    if((node = searchNode->GetNode("simulationName")) != 0)
        SetSimulationName(node->AsStringVector());

    // Clear all the EnginePropertiess if we got any.
    bool clearedProperties = false;
    // Go through all of the children and construct a new
    // EngineProperties for each one of them.
    children = searchNode->GetChildren();
    if(children != 0)
    {
        for(int i = 0; i < searchNode->GetNumChildren(); ++i)
        {
            if(children[i]->GetKey() == std::string("EngineProperties"))
            {
                if (!clearedProperties)
                {
                    ClearProperties();
                    clearedProperties = true;
                }
                EngineProperties temp;
                temp.SetFromNode(children[i]);
                AddProperties(temp);
            }
        }
    }

}
Exemplo n.º 14
0
void MP4TkhdAtom::Generate() 
{
    u_int8_t version = m_pFile->Use64Bits(GetType()) ? 1 : 0;
    SetVersion(version);
    AddProperties(version);

    MP4Atom::Generate();

    // set creation and modification times
    MP4Timestamp now = MP4GetAbsTimestamp();
    if (version == 1) {
        ((MP4Integer64Property*)m_pProperties[2])->SetValue(now);
        ((MP4Integer64Property*)m_pProperties[3])->SetValue(now);
    } else {
        ((MP4Integer32Property*)m_pProperties[2])->SetValue(now);
        ((MP4Integer32Property*)m_pProperties[3])->SetValue(now);
    }

    // property reserved3 has non-zero fixed values
    static u_int8_t reserved3[38] = {
        0x00, 0x00, 
        0x00, 0x01, 0x00, 0x00, 
        0x00, 0x00, 0x00, 0x00, 
        0x00, 0x00, 0x00, 0x00, 
        0x00, 0x00, 0x00, 0x00, 
        0x00, 0x01, 0x00, 0x00, 
        0x00, 0x00, 0x00, 0x00, 
        0x00, 0x00, 0x00, 0x00, 
        0x00, 0x00, 0x00, 0x00, 
        0x40, 0x00, 0x00, 0x00, 
    };
    m_pProperties[9]->SetReadOnly(false);
    ((MP4BytesProperty*)m_pProperties[9])->
        SetValue(reserved3, sizeof(reserved3));
    m_pProperties[9]->SetReadOnly(true);
}
Exemplo n.º 15
0
nsresult
RDFContentSinkImpl::OpenProperty(const PRUnichar* aName, const PRUnichar** aAttributes)
{
    nsresult rv;

    // an "object" non-terminal is either a "description", a "typed
    // node", or a "container", so this change the content sink's
    // state appropriately.
    nsCOMPtr<nsIAtom> localName;
    const nsDependentSubstring& nameSpaceURI =
        SplitExpatName(aName, getter_AddRefs(localName));

    const char* attrName;
    localName->GetUTF8String(&attrName);

    NS_ConvertUTF16toUTF8 propertyStr(nameSpaceURI);
    propertyStr.Append(attrName);

    nsCOMPtr<nsIRDFResource> property;
    rv = gRDFService->GetResource(propertyStr, getter_AddRefs(property));
    if (NS_FAILED(rv)) return rv;

    // See if they've specified a 'resource' attribute, in which case
    // they mean *that* to be the object of this property.
    nsCOMPtr<nsIRDFResource> target;
    GetResourceAttribute(aAttributes, getter_AddRefs(target));

    PRBool isAnonymous = PR_FALSE;

    if (! target) {
        // See if an 'ID' attribute has been specified, in which case
        // this corresponds to the fourth form of [6.12].

        // XXX strictly speaking, we should reject the RDF/XML as
        // invalid if they've specified both an 'ID' and a 'resource'
        // attribute. Bah.

        // XXX strictly speaking, 'about=' isn't allowed here, but
        // what the hell.
        GetIdAboutAttribute(aAttributes, getter_AddRefs(target), &isAnonymous);
    }

    if (target) {
        // They specified an inline resource for the value of this
        // property. Create an RDF resource for the inline resource
        // URI, add the properties to it, and attach the inline
        // resource to its parent.
        PRInt32 count;
        rv = AddProperties(aAttributes, target, &count);
        NS_ASSERTION(NS_SUCCEEDED(rv), "problem adding properties");
        if (NS_FAILED(rv)) return rv;

        if (count || !isAnonymous) {
            // If the resource was "anonymous" (i.e., they hadn't
            // explicitly set an ID or resource attribute), then we'll
            // only assert this property from the context element *if*
            // there were properties specified on the anonymous
            // resource.
            rv = mDataSource->Assert(GetContextElement(0), property, target, PR_TRUE);
            if (NS_FAILED(rv)) return rv;
        }

        // XXX Technically, we should _not_ fall through here and push
        // the element onto the stack: this is supposed to be a closed
        // node. But right now I'm lazy and the code will just Do The
        // Right Thing so long as the RDF is well-formed.
    }

    // Push the element onto the context stack and change state.
    PushContext(property, mState, mParseMode);
    mState = eRDFContentSinkState_InPropertyElement;
    SetParseMode(aAttributes);

    return NS_OK;
}
Exemplo n.º 16
0
nsresult
RDFContentSinkImpl::OpenObject(const PRUnichar* aName, 
                               const PRUnichar** aAttributes)
{
    // an "object" non-terminal is either a "description", a "typed
    // node", or a "container", so this change the content sink's
    // state appropriately.
    nsCOMPtr<nsIAtom> localName;
    const nsDependentSubstring& nameSpaceURI =
        SplitExpatName(aName, getter_AddRefs(localName));

    // Figure out the URI of this object, and create an RDF node for it.
    nsCOMPtr<nsIRDFResource> source;
    GetIdAboutAttribute(aAttributes, getter_AddRefs(source));

    // If there is no `ID' or `about', then there's not much we can do.
    if (! source)
        return NS_ERROR_FAILURE;

    // Push the element onto the context stack
    PushContext(source, mState, mParseMode);

    // Now figure out what kind of state transition we need to
    // make. We'll either be going into a mode where we parse a
    // description or a container.
    PRBool isaTypedNode = PR_TRUE;

    if (nameSpaceURI.EqualsLiteral(RDF_NAMESPACE_URI)) {
        isaTypedNode = PR_FALSE;

        if (localName == kDescriptionAtom) {
            // it's a description
            mState = eRDFContentSinkState_InDescriptionElement;
        }
        else if (localName == kBagAtom) {
            // it's a bag container
            InitContainer(kRDF_Bag, source);
            mState = eRDFContentSinkState_InContainerElement;
        }
        else if (localName == kSeqAtom) {
            // it's a seq container
            InitContainer(kRDF_Seq, source);
            mState = eRDFContentSinkState_InContainerElement;
        }
        else if (localName == kAltAtom) {
            // it's an alt container
            InitContainer(kRDF_Alt, source);
            mState = eRDFContentSinkState_InContainerElement;
        }
        else {
            // heh, that's not *in* the RDF namespace: just treat it
            // like a typed node
            isaTypedNode = PR_TRUE;
        }
    }

    if (isaTypedNode) {
        const char* attrName;
        localName->GetUTF8String(&attrName);

        NS_ConvertUTF16toUTF8 typeStr(nameSpaceURI);
        typeStr.Append(attrName);

        nsCOMPtr<nsIRDFResource> type;
        nsresult rv = gRDFService->GetResource(typeStr, getter_AddRefs(type));
        if (NS_FAILED(rv)) return rv;

        rv = mDataSource->Assert(source, kRDF_type, type, PR_TRUE);
        if (NS_FAILED(rv)) return rv;

        mState = eRDFContentSinkState_InDescriptionElement;
    }

    AddProperties(aAttributes, source);
    return NS_OK;
}