*
*/
-#include "utils/StdString.h"
#include "cores/AudioEngine/Interfaces/AESound.h"
#include "cores/AudioEngine/Engines/ActiveAE/ActiveAEResample.h"
#include "filesystem/File.h"
#include <list>
#include <map>
+#include <vector>
#include "system.h"
#include "threads/CriticalSection.h"
#include "AESinkALSA.h"
#include "cores/AudioEngine/Utils/AEUtil.h"
#include "cores/AudioEngine/Utils/AEELDParser.h"
-#include "utils/StdString.h"
#include "utils/log.h"
#include "utils/MathUtils.h"
#include "utils/SystemInfo.h"
};
// implemented in AESinkWASAPI.cpp
-extern CStdStringA localWideToUtf(LPCWSTR wstr);
+extern std::string localWideToUtf(LPCWSTR wstr);
static BOOL CALLBACK DSEnumCallback(LPGUID lpGuid, LPCTSTR lpcstrDescription, LPCTSTR lpcstrModule, LPVOID lpContext)
{
std::list<DSDevice> &enumerator = *static_cast<std::list<DSDevice>*>(lpContext);
int bufSize = MultiByteToWideChar(CP_ACP, 0, lpcstrDescription, -1, NULL, 0);
- CStdStringW strW (L"", bufSize);
- if ( bufSize == 0 || MultiByteToWideChar(CP_ACP, 0, lpcstrDescription, -1, strW.GetBuf(bufSize), bufSize) != bufSize )
- strW.clear();
- strW.RelBuf();
+ wchar_t *strW = new wchar_t[bufSize+1];
+ if ( bufSize == 0 || MultiByteToWideChar(CP_ACP, 0, lpcstrDescription, -1, strW, bufSize) != bufSize )
+ strW[0] = 0;
+ else
+ strW[bufSize] = 0;
dev.name = localWideToUtf(strW);
+ delete[] strW;
dev.lpGuid = lpGuid;
#include <limits.h>
#include "cores/AudioEngine/Utils/AEUtil.h"
-#include "utils/StdString.h"
#include "utils/log.h"
#include "threads/SingleLock.h"
#include <sstream>
#include "cores/AudioEngine/Sinks/AESinkProfiler.h"
#include "cores/AudioEngine/Utils/AEUtil.h"
-#include "utils/StdString.h"
#include "utils/log.h"
#include "utils/TimeUtils.h"
#include "cores/AudioEngine/Utils/AEUtil.h"
#include "settings/AdvancedSettings.h"
-#include "utils/StdString.h"
#include "utils/log.h"
#include "utils/TimeUtils.h"
#include "threads/SingleLock.h"
return mask;
}
-CStdStringA localWideToUtf(LPCWSTR wstr)
+std::string localWideToUtf(LPCWSTR wstr)
{
if (wstr == NULL)
return "";
int bufSize = WideCharToMultiByte(CP_UTF8, 0, wstr, -1, NULL, 0, NULL, NULL);
- CStdStringA strA ("", bufSize);
- if ( bufSize == 0 || WideCharToMultiByte(CP_UTF8, 0, wstr, -1, strA.GetBuf(bufSize), bufSize, NULL, NULL) != bufSize )
+ std::string strA ("", bufSize);
+ strA.resize(bufSize);
+ if ( bufSize == 0 || WideCharToMultiByte(CP_UTF8, 0, wstr, -1, &strA[0], bufSize, NULL, NULL) != bufSize )
strA.clear();
- strA.RelBuf();
return strA;
}
#include "CoreAudioHelpers.h"
#include "utils/log.h"
-#include "utils/StdString.h"
CCoreAudioStream::CCoreAudioStream() :
m_StreamId (0 )
// hardware physical format has changed.
if (AudioObjectGetPropertyData(ca_stream->m_StreamId, &inAddresses[i], 0, NULL, &propertySize, &actualFormat) == noErr)
{
- CStdString formatString;
+ std::string formatString;
CLog::Log(LOGINFO, "CCoreAudioStream::HardwareStreamListener: "
"Hardware physical format changed to %s", StreamDescriptionToString(actualFormat, formatString));
ca_stream->m_physical_format_event.Set();
UInt32 propertySize = sizeof(AudioStreamBasicDescription);
if (AudioObjectGetPropertyData(ca_stream->m_StreamId, &inAddresses[i], 0, NULL, &propertySize, &actualFormat) == noErr)
{
- CStdString formatString;
+ std::string formatString;
CLog::Log(LOGINFO, "CCoreAudioStream::HardwareStreamListener: "
"Hardware virtual format changed to %s", StreamDescriptionToString(actualFormat, formatString));
ca_stream->m_virtual_format_event.Set();
*/
#include "AEBuffer.h"
-#include "utils/StdString.h" /* needed for ASSERT */
#include <algorithm>
CAEBuffer::CAEBuffer() :
*/
#include "system.h"
-
-#ifdef _DEBUG
-#include "utils/StdString.h" /* needed for ASSERT */
-#endif
+#include <assert.h>
/**
* This class wraps a block of 16 byte aligned memory for simple buffer
inline void Write(const void *src, const size_t size)
{
#ifdef _DEBUG
- ASSERT(src);
- ASSERT(size <= m_bufferSize);
+ assert(src);
+ assert(size <= m_bufferSize);
#endif
memcpy(m_buffer, src, size);
m_bufferPos = 0;
inline void Push(const void *src, const size_t size)
{
#ifdef _DEBUG
- ASSERT(src);
- ASSERT(size <= m_bufferSize - m_bufferPos);
+ assert(src);
+ assert(size <= m_bufferSize - m_bufferPos);
#endif
memcpy(m_buffer + m_bufferPos, src, size);
m_bufferPos += size;
inline void UnShift(const void *src, const size_t size)
{
#ifdef _DEBUG
- ASSERT(src);
- ASSERT(size < m_bufferSize - m_bufferPos);
+ assert(src);
+ assert(size < m_bufferSize - m_bufferPos);
#endif
memmove(m_buffer + size, m_buffer, m_bufferSize - size);
memcpy (m_buffer, src, size);
inline void* Take(const size_t size)
{
#ifdef _DEBUG
- ASSERT(size <= m_bufferSize - m_bufferPos);
+ assert(size <= m_bufferSize - m_bufferPos);
#endif
void* ret = m_buffer + m_bufferPos;
inline void* Raw(const size_t size)
{
#ifdef _DEBUG
- ASSERT(size <= m_bufferSize);
+ assert(size <= m_bufferSize);
#endif
return m_buffer;
}
inline void Read(void *dst, const size_t size)
{
#ifdef _DEBUG
- ASSERT(size <= m_bufferSize);
- ASSERT(dst);
+ assert(size <= m_bufferSize);
+ assert(dst);
#endif
memcpy(dst, m_buffer, size);
}
inline void Pop(void *dst, const size_t size)
{
#ifdef _DEBUG
- ASSERT(size <= m_bufferPos);
+ assert(size <= m_bufferPos);
#endif
m_bufferPos -= size;
if (dst)
inline void Shift(void *dst, const size_t size)
{
#ifdef _DEBUG
- ASSERT(size <= m_bufferPos);
+ assert(size <= m_bufferPos);
#endif
if (dst)
memcpy(dst, m_buffer, size);
inline void CursorSeek (const size_t pos )
{
#ifdef _DEBUG
- ASSERT(pos <= m_bufferSize);
+ assert(pos <= m_bufferSize);
#endif
m_cursorPos = pos;
}
inline void* CursorRead(const size_t size)
{
#ifdef _DEBUG
- ASSERT(m_cursorPos + size <= m_bufferPos);
+ assert(m_cursorPos + size <= m_bufferPos);
#endif
uint8_t* out = m_buffer + m_cursorPos;
m_cursorPos += size;
#include "AEChannelInfo.h"
#include <limits>
#include <string.h>
+#include <assert.h>
CAEChannelInfo::CAEChannelInfo()
{
}
/* the last entry should be NULL, if not we were passed a non null terminated list */
- ASSERT(rhs[m_channelCount] == AE_CH_NULL);
+ assert(rhs[m_channelCount] == AE_CH_NULL);
return *this;
}
CAEChannelInfo& CAEChannelInfo::operator=(const enum AEStdChLayout rhs)
{
- ASSERT(rhs > AE_CH_LAYOUT_INVALID && rhs < AE_CH_LAYOUT_MAX);
+ assert(rhs > AE_CH_LAYOUT_INVALID && rhs < AE_CH_LAYOUT_MAX);
static enum AEChannel layouts[AE_CH_LAYOUT_MAX][9] = {
{AE_CH_FC, AE_CH_NULL},
CAEChannelInfo& CAEChannelInfo::operator+=(const enum AEChannel& rhs)
{
- ASSERT(m_channelCount < AE_CH_MAX);
- ASSERT(rhs > AE_CH_NULL && rhs < AE_CH_MAX);
+ assert(m_channelCount < AE_CH_MAX);
+ assert(rhs > AE_CH_NULL && rhs < AE_CH_MAX);
m_channels[m_channelCount++] = rhs;
return *this;
CAEChannelInfo& CAEChannelInfo::operator-=(const enum AEChannel& rhs)
{
- ASSERT(rhs > AE_CH_NULL && rhs < AE_CH_MAX);
+ assert(rhs > AE_CH_NULL && rhs < AE_CH_MAX);
unsigned int i = 0;
while(i < m_channelCount && m_channels[i] != rhs)
const enum AEChannel CAEChannelInfo::operator[](unsigned int i) const
{
- ASSERT(i < m_channelCount);
+ assert(i < m_channelCount);
return m_channels[i];
}
const char* CAEChannelInfo::GetChName(const enum AEChannel ch)
{
- ASSERT(ch >= 0 && ch < AE_CH_MAX);
+ assert(ch >= 0 && ch < AE_CH_MAX);
static const char* channels[AE_CH_MAX] =
{
for (unsigned int i = 0; i < rhs.Count(); i++)
if (!HasChannel(rhs[i]))
*this += rhs[i];
-}
\ No newline at end of file
+}
#include <stdint.h>
#include <vector>
-#include "utils/StdString.h"
+#include <string>
/**
* The possible channels
#include "AEDeviceInfo.h"
#include "utils/EndianSwap.h"
#include <string.h>
+#include <algorithm>
#include <stdio.h>
#define __STDC_LIMIT_MACROS
#endif
-#include "utils/StdString.h"
#include "AEUtil.h"
#include "utils/log.h"
#include "utils/TimeUtils.h"
const float factor = delta / (float)INT32_MAX;
/* cant return sseresult if we are not using SSE intrinsics */
- ASSERT(result && !sseresult);
+ assert(result && !sseresult);
result[0] = ((float)(m_seed = (214013 * m_seed + 2531011)) * factor) - delta;
result[1] = ((float)(m_seed = (214013 * m_seed + 2531011)) * factor) - delta;
*/
#include "AEAudioFormat.h"
-#include "utils/StdString.h"
#include "PlatformDefs.h"
#include <math.h>