Пример #1
0
STDMETHODIMP CLX3DViewer::replaceWorld(ILX3DScene *scene)
{
	ATLASSERT(0);
	return E_NOTIMPL;
#if 0
	m_viewpointStack.RemoveAll();
	m_navigationinfoStack.RemoveAll();

	if (m_scene)
	{
		m_scene->Release();
		m_scene = NULL;
	}

	m_scene = static_cast<CComObject<CLSAIScene>*>(scene);

	if (m_scene)
	{
		InitStacks();
	}

	FireViewChange();
#endif

	return S_OK;
}
Пример #2
0
wxStatusBarBase::wxStatusBarBase()
{
    m_nFields = 0;

    InitWidths();
    InitStacks();
    InitStyles();
}
Пример #3
0
STDMETHODIMP CLX3DViewer::put_src(/*[in]*/ BSTR newVal)
{
	HRESULT hr;

	m_src = newVal;

	CComPtr<IServiceProvider> sp;
	hr = m_spClientSite->QueryInterface(IID_IServiceProvider, (void**)&sp);
	if (SUCCEEDED(hr))
	{
		CComPtr<IBindHost> bindHost;
		hr = sp->QueryService(SID_SBindHost, &bindHost);
		if (SUCCEEDED(hr))
		{
			CComPtr<IMoniker> imkName;

			CComPtr<IBindCtx> ctx;
			hr = CreateBindCtx(0/*reserved*/, &ctx);
			if (SUCCEEDED(hr))
			{
				hr = bindHost->CreateMoniker(m_src, NULL, &imkName, 0);
				if (SUCCEEDED(hr))
				{
					hr = m_filterGraph.CoCreateInstance(CLSID_LFilterGraph);
					if (SUCCEEDED(hr))
					{
						hr = m_filterGraph->AddSourceFilterForMoniker(imkName, ctx, L"", NULL);

						if (SUCCEEDED(hr))
						{
							CComQIPtr<ILMediaSeeking> seeking = m_filterGraph;
							LONGLONG duration;
							seeking->GetDuration(&duration);
							m_duration = duration / 100000.0;

							if (m_duration > 0)
							{
								m_slider.Enable(TRUE);
								m_slider.SetMaxPos(m_duration);
							}
							else
							{
								m_slider.Enable(FALSE);
							}

						// find the renderer filter
							CComPtr<ILBasicVideo> basicVideo;
							m_filterGraph->QueryFilterInterface(IID_ILBasicVideo, (IUnknown**)&basicVideo);
							if (basicVideo)
							{
								m_basicVideo = basicVideo;
							}
						}
					}
				}
			}
		}
	}

	return hr;

#if 0
#if 0
	m_viewpointStack.RemoveAll();
	m_navigationinfoStack.RemoveAll();
#endif

	if (m_scene)
	{
		m_scene->Release();
		m_scene = NULL;
	}

	CComBSTR m_src = newVal;

	CComQIPtr<IServiceProvider> sp = m_spClientSite;
	if (sp)
	{
		CComPtr<IMoniker> imkName;

		CComPtr<IBindHost> bindHost;
		if (SUCCEEDED(sp->QueryService(SID_SBindHost, &bindHost)))
		{
			bindHost->CreateMoniker(m_src, NULL, &imkName, 0);
		}
		else
		{
			CreateURLMoniker(NULL, m_src, &imkName);
		}

		if (imkName)
		{
			CComPtr<IBindCtx> bctx;
			if (SUCCEEDED(CreateBindCtx(0/*reserved*/, &bctx)))
			{
				CComPtr<IStream> stream;
				imkName->BindToStorage(bctx, NULL, IID_IStream, (void**)&stream);
				if (stream)
				{
					LPOLESTR szDisplayName;
					imkName->GetDisplayName(bctx, NULL, &szDisplayName);
					_bstr_t url = szDisplayName;
					CoTaskMemFree(szDisplayName);

					LPTSTR ext = PathFindExtension(url);
					if (ext && !strcmp(ext, ".mp4"))
					{
						m_file.CoCreateInstance(L"LMPEG4.MP4File");
						if (m_file)
						{
							//CComPtr<ILX3DScene> scene;

							CComPtr<IUnknown> unk;
							m_file->OpenStream(stream);
							
							//m_scene = static_cast<CComObject<CLSAIScene>*>(scene.p);
							//scene.Detach();

							CComQIPtr<ILBaseFilter> baseFilter = m_file;
							if (baseFilter)
							{
								CComPtr<ILPin> outputpin;
								baseFilter->GetPin(0, &outputpin);

								CComObject<CMoviePlayerFilter>::CreateInstance(&m_pFilter);
								m_pFilter->AddRef();
								m_pFilter->m_pMoviePlayer = this;

								// TODO, don't have it like this
								CComPtr<ILReferenceClock> clock;
								clock.CoCreateInstance(L"LMedia.LSystemClock");
								m_pFilter->m_clock = clock.Detach();
								m_pFilter->m_tStart = 0;

								outputpin->Connect(m_pFilter->m_pInput, NULL/*pMediaType*/);

								if (TRUE)
								{
									baseFilter->Run(0);
								}
							}
							else
							{
								::MessageBox(NULL, "Error opening file", "LViewer", MB_OK);
							}
						}
					}
					else
					{
						CComObject<CLSAIScene>::CreateInstance(&m_scene);
						if (m_scene)
						{
							m_scene->AddRef();

							m_scene->m_url = (BSTR)url;
							CoTaskMemFree(szDisplayName);

							m_scene->readStream(stream);

#if 0
							InitStacks();
#endif
						}
					}
				}
			}
		}
	}
#endif

	return S_OK;
}