Ajouts de musique et irrKlang.
This commit is contained in:
		
							
								
								
									
										42
									
								
								SQCSim2021/external/irrKlang-1.6.0/plugins/ikpMP3/CIrrKlangAudioStreamLoaderMP3.cpp
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										42
									
								
								SQCSim2021/external/irrKlang-1.6.0/plugins/ikpMP3/CIrrKlangAudioStreamLoaderMP3.cpp
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,42 @@ | ||||
| // Copyright (C) 2002-2007 Nikolaus Gebhardt | ||||
| // This file is part of the "irrKlang" library. | ||||
| // For conditions of distribution and use, see copyright notice in irrKlang.h | ||||
|  | ||||
| #include "CIrrKlangAudioStreamLoaderMP3.h" | ||||
| #include "CIrrKlangAudioStreamMP3.h" | ||||
| #include <string.h> | ||||
|  | ||||
|  | ||||
| namespace irrklang | ||||
| { | ||||
|  | ||||
|  | ||||
| CIrrKlangAudioStreamLoaderMP3::CIrrKlangAudioStreamLoaderMP3() | ||||
| { | ||||
| } | ||||
|  | ||||
|  | ||||
| //! Returns true if the file maybe is able to be loaded by this class. | ||||
| bool CIrrKlangAudioStreamLoaderMP3::isALoadableFileExtension(const ik_c8* fileName) | ||||
| { | ||||
| 	return strstr(fileName, ".mp3") != 0; | ||||
| } | ||||
|  | ||||
|  | ||||
| //! Creates an audio file input stream from a file | ||||
| IAudioStream* CIrrKlangAudioStreamLoaderMP3::createAudioStream(irrklang::IFileReader* file) | ||||
| { | ||||
| 	CIrrKlangAudioStreamMP3* stream = new CIrrKlangAudioStreamMP3(file); | ||||
|  | ||||
| 	if (stream && !stream->isOK()) | ||||
| 	{ | ||||
| 		stream->drop(); | ||||
| 		stream = 0; | ||||
| 	} | ||||
|  | ||||
| 	return stream; | ||||
| } | ||||
|  | ||||
|  | ||||
| } // end namespace irrklang | ||||
|  | ||||
		Reference in New Issue
	
	Block a user