mirror of
https://git.mirrors.martin98.com/https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-20 03:49:09 +08:00
FIX: [STUDIO-2234] wxMediaCtrl2 Stop twice on macOS
Change-Id: I645ada1b00a6d43e29a743b8f83f39fa75481a63
This commit is contained in:
parent
bb53da59e7
commit
6a33848a6d
@ -41,6 +41,8 @@ protected:
|
|||||||
|
|
||||||
static void bambu_log(void const * ctx, int level, char const * msg);
|
static void bambu_log(void const * ctx, int level, char const * msg);
|
||||||
|
|
||||||
|
void NotifyStopped();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void create_player();
|
void create_player();
|
||||||
void * m_player = nullptr;
|
void * m_player = nullptr;
|
||||||
|
@ -33,7 +33,7 @@ void wxMediaCtrl2::bambu_log(void const * ctx, int level, char const * msg)
|
|||||||
}
|
}
|
||||||
} else if (level < 0) {
|
} else if (level < 0) {
|
||||||
wxMediaCtrl2 * ctrl = (wxMediaCtrl2 *) ctx;
|
wxMediaCtrl2 * ctrl = (wxMediaCtrl2 *) ctx;
|
||||||
ctrl->Stop();
|
ctrl->NotifyStopped();
|
||||||
}
|
}
|
||||||
BOOST_LOG_TRIVIAL(info) << msg;
|
BOOST_LOG_TRIVIAL(info) << msg;
|
||||||
}
|
}
|
||||||
@ -129,6 +129,11 @@ void wxMediaCtrl2::Stop()
|
|||||||
}
|
}
|
||||||
BambuPlayer * player2 = (BambuPlayer *) m_player;
|
BambuPlayer * player2 = (BambuPlayer *) m_player;
|
||||||
[player2 close];
|
[player2 close];
|
||||||
|
NotifyStopped();
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxMediaCtrl2::NotifyStopped()
|
||||||
|
{
|
||||||
if (m_state != wxMEDIASTATE_STOPPED) {
|
if (m_state != wxMEDIASTATE_STOPPED) {
|
||||||
m_state = wxMEDIASTATE_STOPPED;
|
m_state = wxMEDIASTATE_STOPPED;
|
||||||
wxMediaEvent event(wxEVT_MEDIA_STATECHANGED);
|
wxMediaEvent event(wxEVT_MEDIA_STATECHANGED);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user