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
				
			
		| 
						 | 
					@ -40,6 +40,8 @@ protected:
 | 
				
			||||||
    void DoSetSize(int x, int y, int width, int height, int sizeFlags) override;
 | 
					    void DoSetSize(int x, int y, int width, int height, int sizeFlags) override;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    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();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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…
	
	Add table
		Add a link
		
	
		Reference in a new issue