mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-11-02 20:51:23 -07:00 
			
		
		
		
	FIX: [STUDIO-2234] wxMediaCtrl2 Stop twice on macOS
Change-Id: I645ada1b00a6d43e29a743b8f83f39fa75481a63
This commit is contained in:
		
							parent
							
								
									bb53da59e7
								
							
						
					
					
						commit
						6a33848a6d
					
				
					 2 changed files with 8 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -41,6 +41,8 @@ protected:
 | 
			
		|||
 | 
			
		||||
    static void bambu_log(void const * ctx, int level, char const * msg);
 | 
			
		||||
    
 | 
			
		||||
    void NotifyStopped();
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
    void create_player();
 | 
			
		||||
    void * m_player = nullptr;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -33,7 +33,7 @@ void wxMediaCtrl2::bambu_log(void const * ctx, int level, char const * msg)
 | 
			
		|||
        }
 | 
			
		||||
    } else if (level < 0) {
 | 
			
		||||
        wxMediaCtrl2 * ctrl = (wxMediaCtrl2 *) ctx;
 | 
			
		||||
        ctrl->Stop();
 | 
			
		||||
        ctrl->NotifyStopped();
 | 
			
		||||
    }
 | 
			
		||||
    BOOST_LOG_TRIVIAL(info) << msg;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -129,6 +129,11 @@ void wxMediaCtrl2::Stop()
 | 
			
		|||
	}
 | 
			
		||||
    BambuPlayer * player2 = (BambuPlayer *) m_player;
 | 
			
		||||
    [player2 close];
 | 
			
		||||
    NotifyStopped();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void wxMediaCtrl2::NotifyStopped()
 | 
			
		||||
{
 | 
			
		||||
    if (m_state != wxMEDIASTATE_STOPPED) {
 | 
			
		||||
        m_state = wxMEDIASTATE_STOPPED;
 | 
			
		||||
        wxMediaEvent event(wxEVT_MEDIA_STATECHANGED);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue