Fixed compile on OSX.

This commit is contained in:
Casey Langen 2016-06-03 08:21:33 -07:00
parent c418305b30
commit be34186303
5 changed files with 20 additions and 9 deletions

View File

@ -1,6 +1,7 @@
set (BOX_SRCS
./Main.cpp
./stdafx.cpp
./app/layout/BrowseLayout.cpp
./app/layout/ConsoleLayout.cpp
./app/layout/LibraryLayout.cpp
./app/layout/NowPlayingLayout.cpp
@ -39,10 +40,10 @@ set (BOX_SRCS
set (BOX_HEADERS
./stdafx.h
./app/layout/LibraryLayout.h
./app/layout/MainLayout.h
./app/layout/ConsoleLayout.h
./app/query/CategoryListViewQuery.h
./app/query/SingleTrackQuery.h
./app/query/TrackListViewQuery.h
./app/query/TrackListQueryBase.h
./app/service/PlaybackService.h
./app/util/GlobalHotkeys.h
./app/util/SystemInfo.h

View File

@ -18,11 +18,10 @@ using namespace musik::box;
using namespace cursespp;
BrowseLayout::BrowseLayout(
PlaybackService& playback,
PlaybackService& playback,
LibraryPtr library)
: LayoutBase()
, playback(playback)
, parent(parent) {
, playback(playback) {
this->library = library;
this->InitializeWindows();
}

View File

@ -14,7 +14,13 @@
namespace musik {
namespace box {
class BrowseLayout : public cursespp::LayoutBase, public sigslot::has_slots<> {
class BrowseLayout :
public cursespp::LayoutBase,
#if (__clang_major__ == 7 && __clang_minor__ == 3)
public std::enable_shared_from_this<BrowseLayout>,
#endif
public sigslot::has_slots<>
{
public:
BrowseLayout(
PlaybackService& playback,
@ -43,7 +49,6 @@ namespace musik {
std::shared_ptr<CategoryListView> categoryList;
std::shared_ptr<TrackListView> trackList;
cursespp::IWindowPtr focused;
cursespp::IWindowPtr parent;
};
}
}

View File

@ -114,7 +114,7 @@ IWindowPtr LibraryLayout::GetFocus() {
}
bool LibraryLayout::KeyPress(const std::string& key) {
if (key == "^[") { /* escape switches between browse/now playing */
if (key == "^[" || key == "M-n") { /* escape switches between browse/now playing */
(this->visibleLayout == this->nowPlayingLayout)
? this->ShowBrowse() : this->ShowNowPlaying();
}

View File

@ -14,7 +14,13 @@
namespace musik {
namespace box {
class NowPlayingLayout : public cursespp::LayoutBase, public sigslot::has_slots<> {
class NowPlayingLayout :
public cursespp::LayoutBase,
#if (__clang_major__ == 7 && __clang_minor__ == 3)
public std::enable_shared_from_this<NowPlayingLayout>,
#endif
public sigslot::has_slots<>
{
public:
NowPlayingLayout(
PlaybackService& playback,