void
NodeListItem::SetRenderParameters(MediaListItem::Renderer& renderer)
{
	MediaIcons::IconSet* iconSet = &Icons()->videoIcons;
	if (fMediaType == MediaListItem::AUDIO_TYPE)
		iconSet = &Icons()->audioIcons;

	if (fIsDefaultInput)
		renderer.AddIcon(&iconSet->inputIcon);
	if (fIsDefaultOutput)
		renderer.AddIcon(&iconSet->outputIcon);
}
	C4Facet Icon::GetIconFacet(Icons icoIconIndex)
	{
		if (icoIconIndex == Ico_None) return C4Facet();
		C4Facet &rFacet = (icoIconIndex & Ico_Extended) ? ::GraphicsResource.fctIconsEx : ::GraphicsResource.fctIcons;
		icoIconIndex = Icons(icoIconIndex & (Ico_Extended-1));
		int32_t iXMax, iYMax;
		rFacet.GetPhaseNum(iXMax, iYMax);
		if (!iXMax) iXMax = 6;
		return rFacet.GetPhase(icoIconIndex % iXMax, icoIconIndex / iXMax);
	}
	C4Facet Icon::GetIconFacet(Icons icoIconIndex)
	{
		if (icoIconIndex == Ico_None) return C4Facet();
		C4Facet *rFacet;
		switch (icoIconIndex & ~0xff)
		{
		case Ico_Extended:    rFacet = &::GraphicsResource.fctIconsEx; break;
		case Ico_Controller:  rFacet = &::GraphicsResource.fctControllerIcons; break;
		default:              rFacet = &::GraphicsResource.fctIcons;
		}
		icoIconIndex = Icons(icoIconIndex & 0xff);
		int32_t iXMax, iYMax;
		rFacet->GetPhaseNum(iXMax, iYMax);
		if (!iXMax) iXMax = 6;
		return rFacet->GetPhase(icoIconIndex % iXMax, icoIconIndex / iXMax);
	}
Beispiel #4
0
FX_BOOL Document::icons(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
	if (vp.IsSetting()) {
		CJS_Context* pContext = static_cast<CJS_Context*>(cc);
		sError = JSGetStringFromID(pContext, IDS_STRING_JSREADONLY);
		return FALSE;
	}

	if (!m_pIconTree)
	{
		vp.SetNull();
		return TRUE;
	}

	CJS_Array Icons(m_isolate);
	IconElement* pIconElement = NULL;
	int iIconTreeLength = m_pIconTree->GetLength();

	CJS_Context* pContext = (CJS_Context *)cc;
	CJS_Runtime* pRuntime = pContext->GetJSRuntime();

	for (int i = 0; i < iIconTreeLength; i++)
	{
		pIconElement = (*m_pIconTree)[i];

		JSFXObject  pObj = JS_NewFxDynamicObj(*pRuntime, pContext, JS_GetObjDefnID(*pRuntime, L"Icon"));
		if (pObj.IsEmpty()) return FALSE;

		CJS_Icon * pJS_Icon = (CJS_Icon *)JS_GetPrivate(pObj);
		if (!pJS_Icon) return FALSE;

		Icon* pIcon = (Icon*)pJS_Icon->GetEmbedObject();
		if (!pIcon)return FALSE;

		pIcon->SetStream(pIconElement->IconStream->GetStream());
		pIcon->SetIconName(pIconElement->IconName);
		Icons.SetElement(i, CJS_Value(m_isolate,pJS_Icon));
	}

	vp << Icons;
	return TRUE;
}
void
AudioMixerListItem::SetRenderParameters(Renderer& renderer)
{
	renderer.AddIcon(&Icons()->mixerIcon);
}
void
DeviceListItem::SetRenderParameters(Renderer& renderer)
{
	renderer.AddIcon(&Icons()->devicesIcon);
	renderer.UseDoubleInset(false);
}
Beispiel #7
0
void
MidiListItem::SetRenderParameters(Renderer& renderer)
{
	// TODO: Create a nice icon
	renderer.AddIcon(&Icons()->mixerIcon);
}