| 
									
										
										
										
											2013-04-21 02:17:03 -04:00
										 |  |  | // Copyright 2013 Dolphin Emulator Project
 | 
					
						
							|  |  |  | // Licensed under GPLv2
 | 
					
						
							|  |  |  | // Refer to the license.txt file included.
 | 
					
						
							| 
									
										
										
										
											2012-12-17 15:01:52 -06:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-02-10 13:54:46 -05:00
										 |  |  | #pragma once
 | 
					
						
							| 
									
										
										
										
											2012-12-26 12:12:26 -06:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-08-14 01:14:35 -04:00
										 |  |  | #include <thread>
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-02-17 05:18:15 -05:00
										 |  |  | #include "AudioCommon/SoundStream.h"
 | 
					
						
							| 
									
										
										
										
											2014-04-14 01:15:23 +02:00
										 |  |  | #include "Common/Event.h"
 | 
					
						
							| 
									
										
										
										
											2012-12-17 15:01:52 -06:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-03-18 10:37:45 -04:00
										 |  |  | class OpenSLESStream final : public SoundStream | 
					
						
							| 
									
										
										
										
											2012-12-17 15:01:52 -06:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2013-02-26 13:49:00 -06:00
										 |  |  | #ifdef ANDROID
 | 
					
						
							|  |  |  | public: | 
					
						
							| 
									
										
										
										
											2014-09-06 01:42:56 -04:00
										 |  |  | 	OpenSLESStream(CMixer *mixer) | 
					
						
							| 
									
										
										
										
											2013-02-26 13:49:00 -06:00
										 |  |  | 		: SoundStream(mixer) | 
					
						
							| 
									
										
										
										
											2014-09-06 01:42:56 -04:00
										 |  |  | 	{ | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2013-02-26 13:49:00 -06:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-09-06 01:42:56 -04:00
										 |  |  | 	virtual ~OpenSLESStream() | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2013-02-26 13:49:00 -06:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	virtual bool Start(); | 
					
						
							|  |  |  | 	virtual void Stop(); | 
					
						
							|  |  |  | 	static bool isValid() { return true; } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-12-17 15:01:52 -06:00
										 |  |  | private: | 
					
						
							| 
									
										
										
										
											2013-02-26 13:49:00 -06:00
										 |  |  | 	std::thread thread; | 
					
						
							|  |  |  | 	Common::Event soundSyncEvent; | 
					
						
							|  |  |  | #else
 | 
					
						
							| 
									
										
										
										
											2012-12-17 15:01:52 -06:00
										 |  |  | public: | 
					
						
							| 
									
										
										
										
											2014-09-06 01:42:56 -04:00
										 |  |  | 	OpenSLESStream(CMixer *mixer) | 
					
						
							|  |  |  | 		: SoundStream(mixer) | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2013-02-26 13:49:00 -06:00
										 |  |  | #endif // HAVE_OPENSL
 | 
					
						
							| 
									
										
										
										
											2012-12-17 15:01:52 -06:00
										 |  |  | }; |