mirror of
https://github.com/clangen/musikcube.git
synced 2024-12-29 18:14:16 +00:00
- Added SettingsView/Controller classes for the Settings page.
- Removed the transporter in the TransportView. PlaybackQueue is used instead.
This commit is contained in:
parent
516f3b2c28
commit
08e007949f
65
src/cube/SettingsController.cpp
Normal file
65
src/cube/SettingsController.cpp
Normal file
@ -0,0 +1,65 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// License Agreement:
|
||||
//
|
||||
// The following are Copyright © 2007, mC2 Team
|
||||
//
|
||||
// Sources and Binaries of: mC2, win32cpp
|
||||
//
|
||||
// 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 <pch.hpp>
|
||||
#include <cube/SettingsController.hpp>
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
using namespace musik::cube;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*ctor*/ SettingsController::SettingsController(SettingsView& settingsView)
|
||||
: settingsView(settingsView)
|
||||
{
|
||||
this->settingsView.Created.connect(
|
||||
this, &SettingsController::OnViewCreated);
|
||||
|
||||
this->settingsView.Resized.connect(
|
||||
this, &SettingsController::OnViewResized);
|
||||
}
|
||||
|
||||
void SettingsController::OnViewCreated()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void SettingsController::OnViewResized(Size size)
|
||||
{
|
||||
}
|
66
src/cube/SettingsController.hpp
Normal file
66
src/cube/SettingsController.hpp
Normal file
@ -0,0 +1,66 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// License Agreement:
|
||||
//
|
||||
// The following are Copyright © 2007, mC2 Team
|
||||
//
|
||||
// Sources and Binaries of: mC2, win32cpp
|
||||
//
|
||||
// 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 <cube/SettingsView.hpp>
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
using namespace win32cpp;
|
||||
|
||||
namespace musik { namespace cube {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class SettingsController : public EventHandler
|
||||
{
|
||||
public: /*ctor*/ SettingsController(SettingsView& settingsView);
|
||||
|
||||
protected: void OnViewCreated();
|
||||
protected: void OnViewResized(Size size);
|
||||
|
||||
protected: SettingsView& settingsView;
|
||||
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
} } // musik::cube
|
54
src/cube/SettingsView.cpp
Normal file
54
src/cube/SettingsView.cpp
Normal file
@ -0,0 +1,54 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// License Agreement:
|
||||
//
|
||||
// The following are Copyright © 2007, mC2 Team
|
||||
//
|
||||
// Sources and Binaries of: mC2, win32cpp
|
||||
//
|
||||
// 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 <pch.hpp>
|
||||
#include <cube/SettingsView.hpp>
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
using namespace musik::cube;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*ctor*/ SettingsView::SettingsView()
|
||||
{
|
||||
}
|
||||
|
||||
void SettingsView::OnCreated()
|
||||
{
|
||||
}
|
64
src/cube/SettingsView.hpp
Normal file
64
src/cube/SettingsView.hpp
Normal file
@ -0,0 +1,64 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// License Agreement:
|
||||
//
|
||||
// The following are Copyright © 2007, mC2 Team
|
||||
//
|
||||
// Sources and Binaries of: mC2, win32cpp
|
||||
//
|
||||
// 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 <win32cpp/Frame.hpp>
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
using namespace win32cpp;
|
||||
|
||||
namespace musik { namespace cube {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class SettingsView: public Frame
|
||||
{
|
||||
|
||||
public: /*ctor*/ SettingsView();
|
||||
protected: virtual void OnCreated();
|
||||
|
||||
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
} } // musik::cube
|
||||
|
@ -135,6 +135,37 @@ private: TracklistView view;
|
||||
private: TracklistController controller;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
#include <cube/SettingsView.hpp>
|
||||
#include <cube/SettingsController.hpp>
|
||||
|
||||
class SettingsItem: public SourcesItem
|
||||
{
|
||||
private: /*ctor*/ SettingsItem()
|
||||
: controller(view)
|
||||
{
|
||||
}
|
||||
|
||||
public: /*dtor*/ ~SettingsItem()
|
||||
{
|
||||
}
|
||||
|
||||
public: static SourcesItemRef Create()
|
||||
{
|
||||
return SourcesItemRef(new SettingsItem());
|
||||
}
|
||||
|
||||
public: virtual uistring Caption() { return _T("Settings"); }
|
||||
public: virtual Window* View()
|
||||
{
|
||||
return &this->view;
|
||||
}
|
||||
|
||||
private: SettingsView view;
|
||||
private: SettingsController controller;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
typedef SourcesListModel::Category Category;
|
||||
@ -149,7 +180,7 @@ void SourcesModel::Load()
|
||||
CategoryRef viewCategory(new Category(_T("View")));
|
||||
viewCategory->Add(BrowseItem::Create());
|
||||
viewCategory->Add(NowPlayingItem::Create());
|
||||
viewCategory->Add(DummyItem::Create(_T("Settings")));
|
||||
viewCategory->Add(SettingsItem::Create());
|
||||
this->AddCategory(viewCategory);
|
||||
|
||||
CategoryRef playlistCategory(new Category(_T("Playlists")));
|
||||
|
@ -59,7 +59,6 @@ protected: void OnViewCreated();
|
||||
protected: void OnViewResized(Size size);
|
||||
|
||||
protected: TransportView& transportView;
|
||||
protected: musik::core::audio::Transport transport;
|
||||
|
||||
protected: void OnPlayPressed();
|
||||
protected: void OnStopPressed();
|
||||
|
@ -386,6 +386,26 @@
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="SettingsView"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\SettingsController.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\SettingsController.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\SettingsView.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\SettingsView.hpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<File
|
||||
RelativePath=".\main.cpp"
|
||||
|
Loading…
Reference in New Issue
Block a user