new NANA_ENABLE_AUDIO to enable PCM playback
This commit is contained in:
@@ -2,6 +2,9 @@
|
|||||||
#define NANA_AUDIO_DETAIL_AUDIO_DEVICE_HPP
|
#define NANA_AUDIO_DETAIL_AUDIO_DEVICE_HPP
|
||||||
|
|
||||||
#include <nana/deploy.hpp>
|
#include <nana/deploy.hpp>
|
||||||
|
|
||||||
|
#ifdef NANA_ENABLE_AUDIO
|
||||||
|
|
||||||
#include <nana/audio/detail/buffer_preparation.hpp>
|
#include <nana/audio/detail/buffer_preparation.hpp>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#if defined(NANA_WINDOWS)
|
#if defined(NANA_WINDOWS)
|
||||||
@@ -50,4 +53,5 @@ namespace nana{ namespace audio
|
|||||||
}//end namespace audio
|
}//end namespace audio
|
||||||
}//end namespace nana
|
}//end namespace nana
|
||||||
|
|
||||||
|
#endif //NANA_ENABLE_AUDIO
|
||||||
#endif
|
#endif
|
||||||
@@ -1,8 +1,12 @@
|
|||||||
#ifndef NANA_AUDIO_DETAIL_AUDIO_STREAM_HPP
|
#ifndef NANA_AUDIO_DETAIL_AUDIO_STREAM_HPP
|
||||||
#define NANA_AUDIO_DETAIL_AUDIO_STREAM_HPP
|
#define NANA_AUDIO_DETAIL_AUDIO_STREAM_HPP
|
||||||
#include <fstream>
|
|
||||||
#include <nana/deploy.hpp>
|
#include <nana/deploy.hpp>
|
||||||
|
|
||||||
|
#ifdef NANA_ENABLE_AUDIO
|
||||||
|
|
||||||
|
#include <fstream>
|
||||||
|
|
||||||
namespace nana{ namespace audio{
|
namespace nana{ namespace audio{
|
||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
@@ -78,4 +82,5 @@ namespace nana{ namespace audio{
|
|||||||
}
|
}
|
||||||
}//end namespace audio
|
}//end namespace audio
|
||||||
}//end namespace nana
|
}//end namespace nana
|
||||||
|
#endif //NANA_ENABLE_AUDIO
|
||||||
#endif
|
#endif
|
||||||
@@ -1,6 +1,9 @@
|
|||||||
#ifndef NANA_AUDIO_DETAIL_BUFFER_PREPARATION_HPP
|
#ifndef NANA_AUDIO_DETAIL_BUFFER_PREPARATION_HPP
|
||||||
#define NANA_AUDIO_DETAIL_BUFFER_PREPARATION_HPP
|
#define NANA_AUDIO_DETAIL_BUFFER_PREPARATION_HPP
|
||||||
#include <nana/deploy.hpp>
|
#include <nana/deploy.hpp>
|
||||||
|
|
||||||
|
#ifdef NANA_ENABLE_AUDIO
|
||||||
|
|
||||||
#include <nana/audio/detail/audio_stream.hpp>
|
#include <nana/audio/detail/audio_stream.hpp>
|
||||||
|
|
||||||
#if defined(STD_THREAD_NOT_SUPPORTED)
|
#if defined(STD_THREAD_NOT_SUPPORTED)
|
||||||
@@ -62,4 +65,5 @@ namespace nana{ namespace audio
|
|||||||
}//end namespace detail
|
}//end namespace detail
|
||||||
}//end namespace audio
|
}//end namespace audio
|
||||||
}//end namespace nana
|
}//end namespace nana
|
||||||
|
#endif //NANA_ENABLE_AUDIO
|
||||||
#endif
|
#endif
|
||||||
@@ -1,8 +1,12 @@
|
|||||||
#ifndef NANA_AUDIO_PLAYER_HPP
|
#ifndef NANA_AUDIO_PLAYER_HPP
|
||||||
#define NANA_AUDIO_PLAYER_HPP
|
#define NANA_AUDIO_PLAYER_HPP
|
||||||
#include <nana/traits.hpp>
|
|
||||||
#include <nana/deploy.hpp>
|
#include <nana/deploy.hpp>
|
||||||
|
|
||||||
|
#ifdef NANA_ENABLE_AUDIO
|
||||||
|
|
||||||
|
#include <nana/traits.hpp>
|
||||||
|
|
||||||
namespace nana{ namespace audio
|
namespace nana{ namespace audio
|
||||||
{ /// class player
|
{ /// class player
|
||||||
/// \brief play an audio file in PCM Windows WAV format
|
/// \brief play an audio file in PCM Windows WAV format
|
||||||
@@ -25,4 +29,6 @@ namespace nana{ namespace audio
|
|||||||
};
|
};
|
||||||
}//end namespace audio
|
}//end namespace audio
|
||||||
}//end namespace nana
|
}//end namespace nana
|
||||||
|
|
||||||
|
#endif //NANA_ENABLE_AUDIO
|
||||||
#endif
|
#endif
|
||||||
@@ -31,6 +31,11 @@
|
|||||||
//https://github.com/meganz/mingw-std-threads
|
//https://github.com/meganz/mingw-std-threads
|
||||||
//#define NANA_ENABLE_MINGW_STD_THREADS_WITH_MEGANZ
|
//#define NANA_ENABLE_MINGW_STD_THREADS_WITH_MEGANZ
|
||||||
|
|
||||||
|
///////////////////
|
||||||
|
//Support of PCM playback
|
||||||
|
//
|
||||||
|
//#define NANA_ENABLE_AUDIO
|
||||||
|
|
||||||
///////////////////
|
///////////////////
|
||||||
//Support for PNG
|
//Support for PNG
|
||||||
// Define the NANA_ENABLE_PNG to enable the support of PNG.
|
// Define the NANA_ENABLE_PNG to enable the support of PNG.
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
|
|
||||||
#include <nana/audio/detail/audio_device.hpp>
|
#include <nana/audio/detail/audio_device.hpp>
|
||||||
|
|
||||||
|
#ifdef NANA_ENABLE_AUDIO
|
||||||
|
|
||||||
#include <nana/system/platform.hpp>
|
#include <nana/system/platform.hpp>
|
||||||
|
|
||||||
#if defined(NANA_LINUX)
|
#if defined(NANA_LINUX)
|
||||||
@@ -235,3 +239,5 @@ namespace nana{namespace audio
|
|||||||
}//end namespace detail
|
}//end namespace detail
|
||||||
}//end namespace audio
|
}//end namespace audio
|
||||||
}//end namespace nana
|
}//end namespace nana
|
||||||
|
|
||||||
|
#endif //NANA_ENABLE_AUDIO
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
#include <nana/audio/detail/audio_stream.hpp>
|
#include <nana/audio/detail/audio_stream.hpp>
|
||||||
|
#ifdef NANA_ENABLE_AUDIO
|
||||||
|
|
||||||
#include <nana/charset.hpp>
|
#include <nana/charset.hpp>
|
||||||
|
|
||||||
namespace nana{ namespace audio
|
namespace nana{ namespace audio
|
||||||
@@ -92,3 +94,4 @@ namespace nana{ namespace audio
|
|||||||
|
|
||||||
}//end namespace audio
|
}//end namespace audio
|
||||||
}//end namespace nana
|
}//end namespace nana
|
||||||
|
#endif //NANA_ENABLE_AUDIO
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
#include <nana/audio/detail/buffer_preparation.hpp>
|
#include <nana/audio/detail/buffer_preparation.hpp>
|
||||||
|
|
||||||
|
#ifdef NANA_ENABLE_AUDIO
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
namespace nana{ namespace audio
|
namespace nana{ namespace audio
|
||||||
@@ -159,3 +162,5 @@ namespace nana{ namespace audio
|
|||||||
}//end namespace detail
|
}//end namespace detail
|
||||||
}//end namespace audio
|
}//end namespace audio
|
||||||
}//end namespace nana
|
}//end namespace nana
|
||||||
|
|
||||||
|
#endif //NANA_ENABLE_AUDIO
|
||||||
@@ -1,4 +1,7 @@
|
|||||||
#include <nana/audio/player.hpp>
|
#include <nana/audio/player.hpp>
|
||||||
|
|
||||||
|
#ifdef NANA_ENABLE_AUDIO
|
||||||
|
|
||||||
#include <nana/audio/detail/audio_stream.hpp>
|
#include <nana/audio/detail/audio_stream.hpp>
|
||||||
#include <nana/audio/detail/audio_device.hpp>
|
#include <nana/audio/detail/audio_device.hpp>
|
||||||
#include <nana/audio/detail/buffer_preparation.hpp>
|
#include <nana/audio/detail/buffer_preparation.hpp>
|
||||||
@@ -63,3 +66,5 @@ namespace nana{ namespace audio
|
|||||||
}
|
}
|
||||||
}//end namespace audio
|
}//end namespace audio
|
||||||
}//end namespace nana
|
}//end namespace nana
|
||||||
|
|
||||||
|
#endif //NANA_ENABLE_AUDIO
|
||||||
@@ -315,7 +315,7 @@ namespace nana{ namespace paint
|
|||||||
if(ifs)
|
if(ifs)
|
||||||
{
|
{
|
||||||
ifs.seekg(0, std::ios::end);
|
ifs.seekg(0, std::ios::end);
|
||||||
auto size = ifs.tellg();
|
auto size = static_cast<std::size_t>(ifs.tellg());
|
||||||
ifs.seekg(0, std::ios::beg);
|
ifs.seekg(0, std::ios::beg);
|
||||||
|
|
||||||
if(size <= static_cast<int>(sizeof(bitmap_file_header)))
|
if(size <= static_cast<int>(sizeof(bitmap_file_header)))
|
||||||
|
|||||||
Reference in New Issue
Block a user