diff --git a/src/musikcube/CMakeLists.txt b/src/musikcube/CMakeLists.txt index a3aa2d257..2db0cc7b3 100644 --- a/src/musikcube/CMakeLists.txt +++ b/src/musikcube/CMakeLists.txt @@ -7,6 +7,7 @@ set (CUBE_SRCS ./app/layout/HotkeysLayout.cpp ./app/layout/SettingsLayout.cpp ./app/layout/LibraryLayout.cpp + ./app/layout/LibraryNotConnectedLayout.cpp ./app/layout/LyricsLayout.cpp ./app/layout/MainLayout.cpp ./app/layout/NowPlayingLayout.cpp diff --git a/src/musikcube/app/layout/LibraryNotConnectedLayout.cpp b/src/musikcube/app/layout/LibraryNotConnectedLayout.cpp new file mode 100644 index 000000000..1de269ea0 --- /dev/null +++ b/src/musikcube/app/layout/LibraryNotConnectedLayout.cpp @@ -0,0 +1,72 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (c) 2004-2019 musikcube team +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// * Neither the name of the author nor the names of other contributors may +// be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace musik::cube; +using namespace musik::core; +using namespace musik::core::runtime; +using namespace cursespp; + +LibraryNotConnectedLayout::LibraryNotConnectedLayout(ILibraryPtr library) +: LayoutBase() +, library(library) { +} + +void LibraryNotConnectedLayout::OnLayout() { + LayoutBase::OnLayout(); +} + +void LibraryNotConnectedLayout::OnVisibilityChanged(bool visible) { + LayoutBase::OnVisibilityChanged(visible); +} + +bool LibraryNotConnectedLayout::KeyPress(const std::string& kn) { + return LayoutBase::KeyPress(kn); +} + +void LibraryNotConnectedLayout::OnLibraryStateChanged(ILibrary::ConnectionState state) { + +} + +void LibraryNotConnectedLayout::SetShortcutsWindow(cursespp::ShortcutsWindow* w) { + +} diff --git a/src/musikcube/app/layout/LibraryNotConnectedLayout.h b/src/musikcube/app/layout/LibraryNotConnectedLayout.h new file mode 100644 index 000000000..a70c13ec7 --- /dev/null +++ b/src/musikcube/app/layout/LibraryNotConnectedLayout.h @@ -0,0 +1,63 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (c) 2004-2019 musikcube team +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// * Neither the name of the author nor the names of other contributors may +// be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include +#include +#include + +namespace musik { namespace cube { + + class LibraryNotConnectedLayout: + public cursespp::LayoutBase, + public cursespp::ITopLevelLayout, + public sigslot::has_slots<> + { + public: + LibraryNotConnectedLayout(musik::core::ILibraryPtr library); + + virtual void OnLayout() override; + virtual bool KeyPress(const std::string& kn) override; + virtual void SetShortcutsWindow(cursespp::ShortcutsWindow* w) override; + + protected: + void OnVisibilityChanged(bool visible) override; + void OnLibraryStateChanged(musik::core::ILibrary::ConnectionState state); + + private: + musik::core::ILibraryPtr library; + }; + +} } \ No newline at end of file diff --git a/src/musikcube/musikcube.vcxproj b/src/musikcube/musikcube.vcxproj index 93fed2743..7372c5c3d 100755 --- a/src/musikcube/musikcube.vcxproj +++ b/src/musikcube/musikcube.vcxproj @@ -790,6 +790,7 @@ xcopy "$(SolutionDir)src\3rdparty\bin\win\font\*.ttf" "$(TargetDir)fonts\" /Y /e + @@ -872,6 +873,7 @@ xcopy "$(SolutionDir)src\3rdparty\bin\win\font\*.ttf" "$(TargetDir)fonts\" /Y /e + diff --git a/src/musikcube/musikcube.vcxproj.filters b/src/musikcube/musikcube.vcxproj.filters index f33e37c76..b56a56563 100755 --- a/src/musikcube/musikcube.vcxproj.filters +++ b/src/musikcube/musikcube.vcxproj.filters @@ -195,6 +195,9 @@ app\util + + app\layout + @@ -445,6 +448,9 @@ app\util + + app\layout +