mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 03:40:05 +00:00 
			
		
		
		
	Move media objects to dedicated thread to avoid main thread delays
This commit is contained in:
		
							parent
							
								
									38d36d37f6
								
							
						
					
					
						commit
						4ed1fda1ae
					
				
					 2 changed files with 84 additions and 44 deletions
				
			
		|  | @ -4,24 +4,21 @@ | |||
| 
 | ||||
| #include <memory> | ||||
| 
 | ||||
| #include <QObject> | ||||
| 
 | ||||
| namespace scwx | ||||
| { | ||||
| namespace qt | ||||
| { | ||||
| namespace manager | ||||
| namespace scwx::qt::manager | ||||
| { | ||||
| 
 | ||||
| class MediaManager : public QObject | ||||
| class MediaManager | ||||
| { | ||||
|    Q_OBJECT | ||||
|    Q_DISABLE_COPY_MOVE(MediaManager) | ||||
| 
 | ||||
| public: | ||||
|    explicit MediaManager(); | ||||
|    ~MediaManager(); | ||||
| 
 | ||||
|    MediaManager(const MediaManager&)            = delete; | ||||
|    MediaManager& operator=(const MediaManager&) = delete; | ||||
| 
 | ||||
|    MediaManager(MediaManager&&) noexcept; | ||||
|    MediaManager& operator=(MediaManager&&) noexcept; | ||||
| 
 | ||||
|    void Play(types::AudioFile media); | ||||
|    void Play(const std::string& mediaPath); | ||||
|    void Stop(); | ||||
|  | @ -33,6 +30,4 @@ private: | |||
|    std::unique_ptr<Impl> p; | ||||
| }; | ||||
| 
 | ||||
| } // namespace manager
 | ||||
| } // namespace qt
 | ||||
| } // namespace scwx
 | ||||
| } // namespace scwx::qt::manager
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat