diff --git a/include/nana/audio/detail/audio_device.hpp b/include/nana/audio/detail/audio_device.hpp index 375d1595..ef3b9934 100644 --- a/include/nana/audio/detail/audio_device.hpp +++ b/include/nana/audio/detail/audio_device.hpp @@ -2,6 +2,9 @@ #define NANA_AUDIO_DETAIL_AUDIO_DEVICE_HPP #include + +#ifdef NANA_ENABLE_AUDIO + #include #include #if defined(NANA_WINDOWS) @@ -50,4 +53,5 @@ namespace nana{ namespace audio }//end namespace audio }//end namespace nana -#endif +#endif //NANA_ENABLE_AUDIO +#endif \ No newline at end of file diff --git a/include/nana/audio/detail/audio_stream.hpp b/include/nana/audio/detail/audio_stream.hpp index d148f98f..72734ec9 100644 --- a/include/nana/audio/detail/audio_stream.hpp +++ b/include/nana/audio/detail/audio_stream.hpp @@ -1,8 +1,12 @@ #ifndef NANA_AUDIO_DETAIL_AUDIO_STREAM_HPP #define NANA_AUDIO_DETAIL_AUDIO_STREAM_HPP -#include + #include +#ifdef NANA_ENABLE_AUDIO + +#include + namespace nana{ namespace audio{ namespace detail { @@ -78,4 +82,5 @@ namespace nana{ namespace audio{ } }//end namespace audio }//end namespace nana -#endif +#endif //NANA_ENABLE_AUDIO +#endif \ No newline at end of file diff --git a/include/nana/audio/detail/buffer_preparation.hpp b/include/nana/audio/detail/buffer_preparation.hpp index c3e03d71..501b8736 100644 --- a/include/nana/audio/detail/buffer_preparation.hpp +++ b/include/nana/audio/detail/buffer_preparation.hpp @@ -1,6 +1,9 @@ #ifndef NANA_AUDIO_DETAIL_BUFFER_PREPARATION_HPP #define NANA_AUDIO_DETAIL_BUFFER_PREPARATION_HPP #include + +#ifdef NANA_ENABLE_AUDIO + #include #if defined(STD_THREAD_NOT_SUPPORTED) @@ -62,4 +65,5 @@ namespace nana{ namespace audio }//end namespace detail }//end namespace audio }//end namespace nana -#endif +#endif //NANA_ENABLE_AUDIO +#endif \ No newline at end of file diff --git a/include/nana/audio/player.hpp b/include/nana/audio/player.hpp index 3fc1acca..c4fc3d87 100644 --- a/include/nana/audio/player.hpp +++ b/include/nana/audio/player.hpp @@ -1,8 +1,12 @@ #ifndef NANA_AUDIO_PLAYER_HPP #define NANA_AUDIO_PLAYER_HPP -#include + #include +#ifdef NANA_ENABLE_AUDIO + +#include + namespace nana{ namespace audio { /// class player /// \brief play an audio file in PCM Windows WAV format @@ -25,4 +29,6 @@ namespace nana{ namespace audio }; }//end namespace audio }//end namespace nana + +#endif //NANA_ENABLE_AUDIO #endif \ No newline at end of file diff --git a/include/nana/config.hpp b/include/nana/config.hpp index 1e6b7db7..27b1a087 100644 --- a/include/nana/config.hpp +++ b/include/nana/config.hpp @@ -31,6 +31,11 @@ //https://github.com/meganz/mingw-std-threads //#define NANA_ENABLE_MINGW_STD_THREADS_WITH_MEGANZ +/////////////////// +//Support of PCM playback +// +//#define NANA_ENABLE_AUDIO + /////////////////// //Support for PNG // Define the NANA_ENABLE_PNG to enable the support of PNG. diff --git a/source/audio/detail/audio_device.cpp b/source/audio/detail/audio_device.cpp index c2b1f72d..6ae40f2c 100644 --- a/source/audio/detail/audio_device.cpp +++ b/source/audio/detail/audio_device.cpp @@ -1,4 +1,8 @@ + #include + +#ifdef NANA_ENABLE_AUDIO + #include #if defined(NANA_LINUX) @@ -235,3 +239,5 @@ namespace nana{namespace audio }//end namespace detail }//end namespace audio }//end namespace nana + +#endif //NANA_ENABLE_AUDIO \ No newline at end of file diff --git a/source/audio/detail/audio_stream.cpp b/source/audio/detail/audio_stream.cpp index 3446ac04..bcf3a1f9 100644 --- a/source/audio/detail/audio_stream.cpp +++ b/source/audio/detail/audio_stream.cpp @@ -1,4 +1,6 @@ #include +#ifdef NANA_ENABLE_AUDIO + #include namespace nana{ namespace audio @@ -92,3 +94,4 @@ namespace nana{ namespace audio }//end namespace audio }//end namespace nana +#endif //NANA_ENABLE_AUDIO diff --git a/source/audio/detail/buffer_preparation.cpp b/source/audio/detail/buffer_preparation.cpp index 7c340949..f9f830ff 100644 --- a/source/audio/detail/buffer_preparation.cpp +++ b/source/audio/detail/buffer_preparation.cpp @@ -1,4 +1,7 @@ #include + +#ifdef NANA_ENABLE_AUDIO + #include namespace nana{ namespace audio @@ -159,3 +162,5 @@ namespace nana{ namespace audio }//end namespace detail }//end namespace audio }//end namespace nana + +#endif //NANA_ENABLE_AUDIO \ No newline at end of file diff --git a/source/audio/player.cpp b/source/audio/player.cpp index 013b331e..e86f1798 100644 --- a/source/audio/player.cpp +++ b/source/audio/player.cpp @@ -1,4 +1,7 @@ #include + +#ifdef NANA_ENABLE_AUDIO + #include #include #include @@ -62,4 +65,6 @@ namespace nana{ namespace audio impl_->stream.close(); } }//end namespace audio -}//end namespace nana \ No newline at end of file +}//end namespace nana + +#endif //NANA_ENABLE_AUDIO \ No newline at end of file diff --git a/source/paint/detail/image_bmp.hpp b/source/paint/detail/image_bmp.hpp index b84e0e56..f868ce8d 100644 --- a/source/paint/detail/image_bmp.hpp +++ b/source/paint/detail/image_bmp.hpp @@ -315,7 +315,7 @@ namespace nana{ namespace paint if(ifs) { ifs.seekg(0, std::ios::end); - auto size = ifs.tellg(); + auto size = static_cast(ifs.tellg()); ifs.seekg(0, std::ios::beg); if(size <= static_cast(sizeof(bitmap_file_header)))