mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-17 02:22:17 +00:00
Add the full source of BambuStudio
using version 1.0.10
This commit is contained in:
56
src/slic3r/GUI/wxMediaCtrl2.cpp
Normal file
56
src/slic3r/GUI/wxMediaCtrl2.cpp
Normal file
@@ -0,0 +1,56 @@
|
||||
#include "wxMediaCtrl2.h"
|
||||
|
||||
wxMediaCtrl2::wxMediaCtrl2(wxWindow *parent)
|
||||
: wxMediaCtrl(parent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxMEDIACTRLPLAYERCONTROLS_NONE)
|
||||
{
|
||||
}
|
||||
|
||||
void wxMediaCtrl2::Load(wxURI url)
|
||||
{
|
||||
#ifdef __WIN32__
|
||||
url = wxURI(url.BuildURI().append("&hwnd=").append(
|
||||
boost::lexical_cast<std::string>(GetHandle())));
|
||||
#endif
|
||||
m_error = 0;
|
||||
wxMediaCtrl::Load(url);
|
||||
}
|
||||
|
||||
void wxMediaCtrl2::Play() { wxMediaCtrl::Play(); }
|
||||
|
||||
void wxMediaCtrl2::Stop() { wxMediaCtrl::Stop(); }
|
||||
|
||||
wxSize wxMediaCtrl2::GetVideoSize() const
|
||||
{
|
||||
return m_imp->GetVideoSize();
|
||||
}
|
||||
|
||||
wxSize wxMediaCtrl2::DoGetBestSize() const
|
||||
{
|
||||
return {-1, -1};
|
||||
}
|
||||
|
||||
#ifdef __WIN32__
|
||||
|
||||
WXLRESULT wxMediaCtrl2::MSWWindowProc(WXUINT nMsg,
|
||||
WXWPARAM wParam,
|
||||
WXLPARAM lParam)
|
||||
{
|
||||
if (nMsg == WM_USER + 1000) {
|
||||
wxString msg((wchar_t const *) lParam);
|
||||
if (wParam == 1) {
|
||||
if (msg.EndsWith("]")) {
|
||||
int n = msg.find_last_of('[');
|
||||
if (n != wxString::npos) {
|
||||
long val = 0;
|
||||
if (msg.SubString(n + 1, msg.Length() - 2).ToLong(&val))
|
||||
m_error = (int) val;
|
||||
}
|
||||
}
|
||||
}
|
||||
BOOST_LOG_TRIVIAL(info) << msg.ToUTF8().data();
|
||||
return 0;
|
||||
}
|
||||
return wxMediaCtrl::MSWWindowProc(nMsg, wParam, lParam);
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user