mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-16 03:07:55 -06:00
Add the full source of BambuStudio
using version 1.0.10
This commit is contained in:
parent
30bcadab3e
commit
1555904bef
3771 changed files with 1251328 additions and 0 deletions
78
src/slic3r/GUI/MediaPlayCtrl.h
Normal file
78
src/slic3r/GUI/MediaPlayCtrl.h
Normal file
|
@ -0,0 +1,78 @@
|
|||
//
|
||||
// MediaPlayCtrl.h
|
||||
// libslic3r_gui
|
||||
//
|
||||
// Created by cmguo on 2021/12/7.
|
||||
//
|
||||
|
||||
#ifndef MediaPlayCtrl_h
|
||||
#define MediaPlayCtrl_h
|
||||
|
||||
#include "wxMediaCtrl2.h"
|
||||
|
||||
#include <wx/panel.h>
|
||||
|
||||
#include <boost/thread.hpp>
|
||||
#include <boost/thread/condition_variable.hpp>
|
||||
|
||||
#include <deque>
|
||||
|
||||
class Button;
|
||||
class Label;
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
class MachineObject;
|
||||
|
||||
namespace GUI {
|
||||
|
||||
class MediaPlayCtrl : public wxPanel
|
||||
{
|
||||
public:
|
||||
MediaPlayCtrl(wxWindow *parent, wxMediaCtrl2 *media_ctrl, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize);
|
||||
|
||||
~MediaPlayCtrl();
|
||||
|
||||
void SetMachineObject(MachineObject * obj);
|
||||
|
||||
protected:
|
||||
void onStateChanged(wxMediaEvent & event);
|
||||
|
||||
void Play();
|
||||
|
||||
void Stop();
|
||||
|
||||
void TogglePlay();
|
||||
|
||||
void SetStatus(wxString const & msg);
|
||||
|
||||
private:
|
||||
void media_proc();
|
||||
|
||||
private:
|
||||
static constexpr wxMediaState MEDIASTATE_IDLE = (wxMediaState) 3;
|
||||
static constexpr wxMediaState MEDIASTATE_INITIALIZING = (wxMediaState) 4;
|
||||
static constexpr wxMediaState MEDIASTATE_LOADING = (wxMediaState) 5;
|
||||
static constexpr wxMediaState MEDIASTATE_BUFFERING = (wxMediaState) 6;
|
||||
|
||||
wxMediaCtrl2 * m_media_ctrl;
|
||||
wxMediaState m_last_state = MEDIASTATE_IDLE;
|
||||
std::string m_machine;
|
||||
wxString m_url;
|
||||
|
||||
std::deque<wxString> m_tasks;
|
||||
boost::mutex m_mutex;
|
||||
boost::condition_variable m_cond;
|
||||
boost::thread m_thread;
|
||||
|
||||
int m_failed_retry = 0;
|
||||
int m_failed_code = 0;
|
||||
wxDateTime m_next_retry;
|
||||
|
||||
::Button * m_button_play;
|
||||
::Label * m_label_status;
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
#endif /* MediaPlayCtrl_h */
|
Loading…
Add table
Add a link
Reference in a new issue