ENH: show liveview stat
Change-Id: I70d1f458aa2ed379ad7fe07dee76fbe035316420 Jira: none
This commit is contained in:
parent
9319440d74
commit
930109877d
|
@ -41,6 +41,14 @@ MediaPlayCtrl::MediaPlayCtrl(wxWindow *parent, wxMediaCtrl2 *media_ctrl, const w
|
||||||
m_label_status = new Label(this, "");
|
m_label_status = new Label(this, "");
|
||||||
m_label_status->SetForegroundColour(wxColour("#323A3C"));
|
m_label_status->SetForegroundColour(wxColour("#323A3C"));
|
||||||
|
|
||||||
|
m_label_stat = new Label(this, "");
|
||||||
|
m_label_stat->SetForegroundColour(wxColour("#323A3C"));
|
||||||
|
#if !BBL_RELEASE_TO_PUBLIC
|
||||||
|
m_media_ctrl->Bind(EVT_MEDIA_CTRL_STAT, [this](auto & e) {
|
||||||
|
m_label_stat->SetLabel(e.GetString());
|
||||||
|
});
|
||||||
|
#endif
|
||||||
|
|
||||||
m_button_play->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [this](auto &e) { TogglePlay(); });
|
m_button_play->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [this](auto &e) { TogglePlay(); });
|
||||||
m_button_play->Bind(wxEVT_RIGHT_UP, [this](auto & e) { m_media_ctrl->Play(); });
|
m_button_play->Bind(wxEVT_RIGHT_UP, [this](auto & e) { m_media_ctrl->Play(); });
|
||||||
m_label_status->Bind(wxEVT_LEFT_UP, [this](auto &e) {
|
m_label_status->Bind(wxEVT_LEFT_UP, [this](auto &e) {
|
||||||
|
@ -68,6 +76,7 @@ MediaPlayCtrl::MediaPlayCtrl(wxWindow *parent, wxMediaCtrl2 *media_ctrl, const w
|
||||||
|
|
||||||
wxBoxSizer * sizer = new wxBoxSizer(wxHORIZONTAL);
|
wxBoxSizer * sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||||
sizer->Add(m_button_play, 0, wxEXPAND | wxALL, 0);
|
sizer->Add(m_button_play, 0, wxEXPAND | wxALL, 0);
|
||||||
|
sizer->Add(m_label_stat, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(25));
|
||||||
sizer->AddStretchSpacer(1);
|
sizer->AddStretchSpacer(1);
|
||||||
sizer->Add(m_label_status, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, FromDIP(25));
|
sizer->Add(m_label_status, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, FromDIP(25));
|
||||||
SetSizer(sizer);
|
SetSizer(sizer);
|
||||||
|
|
|
@ -103,6 +103,7 @@ private:
|
||||||
wxDateTime m_next_retry;
|
wxDateTime m_next_retry;
|
||||||
|
|
||||||
::Button *m_button_play;
|
::Button *m_button_play;
|
||||||
|
::Label * m_label_stat;
|
||||||
::Label * m_label_status;
|
::Label * m_label_status;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,8 @@ public:
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
wxDEFINE_EVENT(EVT_MEDIA_CTRL_STAT, wxCommandEvent);
|
||||||
|
|
||||||
wxMediaCtrl2::wxMediaCtrl2(wxWindow *parent)
|
wxMediaCtrl2::wxMediaCtrl2(wxWindow *parent)
|
||||||
{
|
{
|
||||||
#ifdef __WIN32__
|
#ifdef __WIN32__
|
||||||
|
@ -233,6 +235,11 @@ WXLRESULT wxMediaCtrl2::MSWWindowProc(WXUINT nMsg,
|
||||||
if (msg.SubString(n + 1, msg.Length() - 2).ToLong(&val))
|
if (msg.SubString(n + 1, msg.Length() - 2).ToLong(&val))
|
||||||
m_error = (int) val;
|
m_error = (int) val;
|
||||||
}
|
}
|
||||||
|
} else if (msg.Contains("stat_log")) {
|
||||||
|
wxCommandEvent evt(EVT_MEDIA_CTRL_STAT);
|
||||||
|
evt.SetEventObject(this);
|
||||||
|
evt.SetString(msg.Mid(msg.Find(' ') + 1));
|
||||||
|
wxPostEvent(this, evt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BOOST_LOG_TRIVIAL(info) << msg.ToUTF8().data();
|
BOOST_LOG_TRIVIAL(info) << msg.ToUTF8().data();
|
||||||
|
|
|
@ -11,6 +11,8 @@
|
||||||
#include "wx/uri.h"
|
#include "wx/uri.h"
|
||||||
#include "wx/mediactrl.h"
|
#include "wx/mediactrl.h"
|
||||||
|
|
||||||
|
wxDECLARE_EVENT(EVT_MEDIA_CTRL_STAT, wxCommandEvent);
|
||||||
|
|
||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
|
|
||||||
class wxMediaCtrl2 : public wxWindow
|
class wxMediaCtrl2 : public wxWindow
|
||||||
|
|
|
@ -16,6 +16,8 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
|
|
||||||
|
wxDEFINE_EVENT(EVT_MEDIA_CTRL_STAT, wxCommandEvent);
|
||||||
|
|
||||||
#define BAMBU_DYNAMIC
|
#define BAMBU_DYNAMIC
|
||||||
|
|
||||||
void wxMediaCtrl2::bambu_log(void const * ctx, int level, char const * msg)
|
void wxMediaCtrl2::bambu_log(void const * ctx, int level, char const * msg)
|
||||||
|
|
Loading…
Reference in New Issue