mirror of
https://github.com/clangen/musikcube.git
synced 2025-01-30 06:32:36 +00:00
Fixed clangen/cmakeosx to compile and run against Windows.
This commit is contained in:
parent
8d3d24c5e6
commit
a64ccf16a6
@ -36,20 +36,37 @@
|
||||
|
||||
#include "TaglibMetadataReader.h"
|
||||
|
||||
#include <taglib/tlist.h>
|
||||
#include <taglib/tfile.h>
|
||||
#include <taglib/tag.h>
|
||||
#include <taglib/fileref.h>
|
||||
#include <taglib/audioproperties.h>
|
||||
#include <taglib/mpegfile.h>
|
||||
#include <taglib/id3v1tag.h>
|
||||
#include <taglib/id3v1genres.h>
|
||||
#include <taglib/id3v2tag.h>
|
||||
#include <taglib/id3v2header.h>
|
||||
#include <taglib/id3v2frame.h>
|
||||
#include <taglib/attachedpictureframe.h>
|
||||
#include <taglib/commentsframe.h>
|
||||
#include <taglib/oggfile.h>
|
||||
#ifdef WIN32
|
||||
#include <taglib/toolkit/tlist.h>
|
||||
#include <taglib/toolkit/tfile.h>
|
||||
#include <taglib/tag.h>
|
||||
#include <taglib/fileref.h>
|
||||
#include <taglib/audioproperties.h>
|
||||
#include <taglib/mpeg/mpegfile.h>
|
||||
#include <taglib/mpeg/id3v1/id3v1tag.h>
|
||||
#include <taglib/mpeg/id3v1/id3v1genres.h>
|
||||
#include <taglib/mpeg/id3v2/id3v2tag.h>
|
||||
#include <taglib/mpeg/id3v2/id3v2header.h>
|
||||
#include <taglib/mpeg/id3v2/id3v2frame.h>
|
||||
#include <taglib/mpeg/id3v2/frames/attachedpictureframe.h>
|
||||
#include <taglib/mpeg/id3v2/frames/commentsframe.h>
|
||||
#include <taglib/ogg/oggfile.h>
|
||||
#else
|
||||
#include <taglib/tlist.h>
|
||||
#include <taglib/tfile.h>
|
||||
#include <taglib/tag.h>
|
||||
#include <taglib/fileref.h>
|
||||
#include <taglib/audioproperties.h>
|
||||
#include <taglib/mpegfile.h>
|
||||
#include <taglib/id3v1tag.h>
|
||||
#include <taglib/id3v1genres.h>
|
||||
#include <taglib/id3v2tag.h>
|
||||
#include <taglib/id3v2header.h>
|
||||
#include <taglib/id3v2frame.h>
|
||||
#include <taglib/attachedpictureframe.h>
|
||||
#include <taglib/commentsframe.h>
|
||||
#include <taglib/oggfile.h>
|
||||
#endif
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
@ -38,21 +38,21 @@
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#ifndef _HAVE_TAGLIB
|
||||
#include <taglib/tlist.h>
|
||||
#include <taglib/tfile.h>
|
||||
#include <taglib/tag.h>
|
||||
#include <taglib/fileref.h>
|
||||
#include <taglib/audioproperties.h>
|
||||
#include <taglib/id3v2tag.h>
|
||||
#else //_HAVE_TAGLIB
|
||||
#include <taglib/tlist.h>
|
||||
#include <taglib/tfile.h>
|
||||
#include <taglib/tag.h>
|
||||
#include <taglib/fileref.h>
|
||||
#include <taglib/audioproperties.h>
|
||||
#include <taglib/id3v2tag.h>
|
||||
#endif //_HAVE_TAGLIB
|
||||
#ifdef WIN32
|
||||
#include <taglib/toolkit/tlist.h>
|
||||
#include <taglib/toolkit/tfile.h>
|
||||
#include <taglib/tag.h>
|
||||
#include <taglib/fileref.h>
|
||||
#include <taglib/audioproperties.h>
|
||||
#include <taglib/mpeg/id3v2/id3v2tag.h>
|
||||
#else
|
||||
#include <taglib/tlist.h>
|
||||
#include <taglib/tfile.h>
|
||||
#include <taglib/tag.h>
|
||||
#include <taglib/fileref.h>
|
||||
#include <taglib/audioproperties.h>
|
||||
#include <taglib/id3v2tag.h>
|
||||
#endif
|
||||
|
||||
#include <set>
|
||||
#include <core/sdk/IMetadataReader.h>
|
||||
|
@ -40,6 +40,7 @@
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#define WINVER 0x0501
|
||||
#define _WIN32_WINNT 0x0501
|
||||
#define NOMINMAX
|
||||
|
||||
#include <windows.h>
|
||||
#include <tchar.h>
|
||||
|
@ -40,7 +40,10 @@
|
||||
#include <utf8/utf8.h>
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include <mach-o/dyld.h>
|
||||
#endif
|
||||
|
||||
std::string musik::core::GetPluginDirectory() {
|
||||
std::string path(GetApplicationDirectory());
|
||||
|
@ -139,7 +139,7 @@ double WindowsSystemInfo::GetCpuUsage() {
|
||||
(double) (user.QuadPart - lastUserCpu.QuadPart);
|
||||
|
||||
ULONGLONG diff = now.QuadPart - lastCpu.QuadPart;
|
||||
diff = max(1, diff);
|
||||
diff = std::max((ULONGLONG) 1, diff);
|
||||
|
||||
percent /= diff;
|
||||
percent /= processorCount;
|
||||
|
@ -20,9 +20,9 @@ namespace musik {
|
||||
}
|
||||
catch (...) {
|
||||
/* invalid encoding, just treat as a single char */
|
||||
++it;
|
||||
}
|
||||
|
||||
++it;
|
||||
++c;
|
||||
}
|
||||
|
||||
|
@ -73,7 +73,7 @@ void removeUtf8Char(std::string& value) {
|
||||
}
|
||||
|
||||
void CommandWindow::Write(const std::string& key) {
|
||||
if (key == "KEY_BACKSPACE" || key == "^?") { /* backspace */
|
||||
if (key == "^H" || key == "^?") { /* backspace */
|
||||
removeUtf8Char(this->buffer);
|
||||
}
|
||||
else if (key == "^J") { /* return */
|
||||
|
@ -25,7 +25,7 @@ void ListWindow::ScrollToTop() {
|
||||
|
||||
void ListWindow::ScrollToBottom() {
|
||||
IScrollAdapter& adapter = this->GetScrollAdapter();
|
||||
this->SetSelectedIndex(std::max(0UL, adapter.GetEntryCount() - 1));
|
||||
this->SetSelectedIndex(std::max((size_t) 0, adapter.GetEntryCount() - 1));
|
||||
adapter.DrawPage(this->GetContent(), selectedIndex, &scrollPosition);
|
||||
this->Repaint();
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ MultiLineEntry::MultiLineEntry(const std::string& value, int64 attrs) {
|
||||
}
|
||||
|
||||
size_t MultiLineEntry::GetLineCount() {
|
||||
return std::max(1UL, this->lines.size());
|
||||
return std::max((size_t) 1, this->lines.size());
|
||||
}
|
||||
|
||||
std::string MultiLineEntry::GetLine(size_t n) {
|
||||
|
@ -59,7 +59,7 @@
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>./;../;../3rdparty/include;../../../boost_1_60_0;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>./;../;../3rdparty/include;../3rdparty/win32_include;../../../boost_1_60_0;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
@ -88,7 +88,7 @@
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>./;../;../3rdparty/include;../../../boost_1_60_0;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>./;../;../3rdparty/include;../3rdparty/win32_include;../../../boost_1_60_0;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
|
Loading…
x
Reference in New Issue
Block a user