mirror of
https://github.com/clangen/musikcube.git
synced 2025-03-29 19:20:28 +00:00
- Moved MessageQueue and friends into the core so it can be reused for
other things like timers and processing threads - Cleaned up Player's listener interface a bit, and removed some more complexity from GaplessTransport
This commit is contained in:
parent
1a00c83c7b
commit
25fa580bde
@ -85,8 +85,7 @@ M4aDecoder::M4aDecoder() {
|
||||
M4aDecoder::~M4aDecoder() {
|
||||
}
|
||||
|
||||
bool M4aDecoder::Open(musik::core::sdk::IDataStream *stream)
|
||||
{
|
||||
bool M4aDecoder::Open(musik::core::sdk::IDataStream *stream) {
|
||||
decoder = NeAACDecOpen();
|
||||
if (!decoder) {
|
||||
return false;
|
||||
|
@ -279,30 +279,17 @@ void GaplessTransport::SetVolume(double volume) {
|
||||
this->output->SetVolume(this->volume);
|
||||
}
|
||||
|
||||
void GaplessTransport::RemoveFromActive(Player* player) {
|
||||
{
|
||||
LockT lock(this->stateMutex);
|
||||
|
||||
if (player == this->activePlayer) {
|
||||
RESET_ACTIVE_PLAYER(this);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
player->Destroy();
|
||||
}
|
||||
|
||||
void GaplessTransport::SetNextCanStart(bool nextCanStart) {
|
||||
LockT lock(this->stateMutex);
|
||||
this->nextCanStart = nextCanStart;
|
||||
}
|
||||
|
||||
void GaplessTransport::OnPlaybackStarted(Player* player) {
|
||||
void GaplessTransport::OnPlayerStarted(Player* player) {
|
||||
this->RaiseStreamEvent(StreamPlaying, player);
|
||||
this->SetPlaybackState(PlaybackPlaying);
|
||||
}
|
||||
|
||||
void GaplessTransport::OnPlaybackAlmostEnded(Player* player) {
|
||||
void GaplessTransport::OnPlayerAlmostEnded(Player* player) {
|
||||
this->SetNextCanStart(true);
|
||||
|
||||
{
|
||||
@ -318,7 +305,7 @@ void GaplessTransport::OnPlaybackAlmostEnded(Player* player) {
|
||||
this->RaiseStreamEvent(StreamAlmostDone, player);
|
||||
}
|
||||
|
||||
void GaplessTransport::OnPlaybackFinished(Player* player) {
|
||||
void GaplessTransport::OnPlayerFinished(Player* player) {
|
||||
this->RaiseStreamEvent(StreamFinished, player);
|
||||
|
||||
bool stopped = false;
|
||||
@ -344,14 +331,20 @@ void GaplessTransport::OnPlaybackFinished(Player* player) {
|
||||
if (stopped) {
|
||||
this->Stop();
|
||||
}
|
||||
|
||||
this->RemoveFromActive(player);
|
||||
}
|
||||
|
||||
void GaplessTransport::OnPlaybackError(Player* player) {
|
||||
void GaplessTransport::OnPlayerError(Player* player) {
|
||||
this->RaiseStreamEvent(StreamError, player);
|
||||
this->SetPlaybackState(PlaybackStopped);
|
||||
this->RemoveFromActive(player);
|
||||
}
|
||||
|
||||
void GaplessTransport::OnPlayerDestroying(Player *player) {
|
||||
LockT lock(this->stateMutex);
|
||||
|
||||
if (player == this->activePlayer) {
|
||||
RESET_ACTIVE_PLAYER(this);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void GaplessTransport::SetPlaybackState(int state) {
|
||||
|
@ -84,15 +84,14 @@ namespace musik { namespace core { namespace audio {
|
||||
|
||||
void SetNextCanStart(bool nextCanStart);
|
||||
|
||||
void RemoveFromActive(Player* player);
|
||||
|
||||
void RaiseStreamEvent(int type, Player* player);
|
||||
void SetPlaybackState(int state);
|
||||
|
||||
virtual void OnPlaybackStarted(Player* player);
|
||||
virtual void OnPlaybackAlmostEnded(Player* player);
|
||||
virtual void OnPlaybackFinished(Player* player);
|
||||
virtual void OnPlaybackError(Player* player);
|
||||
virtual void OnPlayerStarted(Player* player);
|
||||
virtual void OnPlayerAlmostEnded(Player* player);
|
||||
virtual void OnPlayerFinished(Player* player);
|
||||
virtual void OnPlayerError(Player* player);
|
||||
virtual void OnPlayerDestroying(Player* player);
|
||||
|
||||
musik::core::sdk::PlaybackState state;
|
||||
std::recursive_mutex stateMutex;
|
||||
|
@ -294,14 +294,14 @@ void musik::core::audio::playerThreadLoop(Player* player) {
|
||||
/* if the Quit flag isn't set, that means the stream has ended "naturally", i.e.
|
||||
it wasn't stopped by the user. raise the "almost ended" flag. */
|
||||
if (!player->Exited() && player->listener) {
|
||||
player->listener->OnPlaybackAlmostEnded(player);
|
||||
player->listener->OnPlayerAlmostEnded(player);
|
||||
}
|
||||
}
|
||||
|
||||
/* if the stream failed to open... */
|
||||
else {
|
||||
if (!player->Exited() && player->listener) {
|
||||
player->listener->OnPlaybackError(player);
|
||||
player->listener->OnPlayerError(player);
|
||||
}
|
||||
}
|
||||
|
||||
@ -321,11 +321,15 @@ void musik::core::audio::playerThreadLoop(Player* player) {
|
||||
}
|
||||
|
||||
if (!player->Exited() && player->listener) {
|
||||
player->listener->OnPlaybackFinished(player);
|
||||
player->listener->OnPlayerFinished(player);
|
||||
}
|
||||
|
||||
player->state = Player::Quit;
|
||||
|
||||
if (player->listener) {
|
||||
player->listener->OnPlayerDestroying(player);
|
||||
}
|
||||
|
||||
delete player;
|
||||
}
|
||||
|
||||
@ -479,7 +483,7 @@ void Player::OnBufferProcessed(IBuffer *buffer) {
|
||||
output device */
|
||||
if (started) {
|
||||
if (!this->Exited() && this->listener) {
|
||||
this->listener->OnPlaybackStarted(this);
|
||||
this->listener->OnPlayerStarted(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -51,12 +51,12 @@ namespace musik { namespace core { namespace audio {
|
||||
|
||||
class Player : public musik::core::sdk::IBufferProvider {
|
||||
public:
|
||||
class PlayerEventListener {
|
||||
public:
|
||||
virtual void OnPlaybackStarted(Player *player) = 0;
|
||||
virtual void OnPlaybackAlmostEnded(Player *player) = 0;
|
||||
virtual void OnPlaybackFinished(Player *player) = 0;
|
||||
virtual void OnPlaybackError(Player *player) = 0;
|
||||
struct PlayerEventListener {
|
||||
virtual void OnPlayerStarted(Player *player) = 0;
|
||||
virtual void OnPlayerAlmostEnded(Player *player) = 0;
|
||||
virtual void OnPlayerFinished(Player *player) = 0;
|
||||
virtual void OnPlayerError(Player *player) = 0;
|
||||
virtual void OnPlayerDestroying(Player *player) = 0;
|
||||
};
|
||||
|
||||
static Player* Create(
|
||||
|
@ -111,6 +111,8 @@
|
||||
<ClCompile Include="audio\Player.cpp" />
|
||||
<ClCompile Include="audio\Stream.cpp" />
|
||||
<ClCompile Include="plugin\PluginFactory.cpp" />
|
||||
<ClCompile Include="runtime\Message.cpp" />
|
||||
<ClCompile Include="runtime\MessageQueue.cpp" />
|
||||
<ClCompile Include="support\Common.cpp" />
|
||||
<ClCompile Include="support\PreferenceKeys.cpp" />
|
||||
<ClCompile Include="support\Preferences.cpp" />
|
||||
@ -141,6 +143,10 @@
|
||||
<ClInclude Include="pch.hpp" />
|
||||
<ClInclude Include="config.h" />
|
||||
<ClInclude Include="plugin\PluginFactory.h" />
|
||||
<ClInclude Include="runtime\IMessage.h" />
|
||||
<ClInclude Include="runtime\IMessageTarget.h" />
|
||||
<ClInclude Include="runtime\Message.h" />
|
||||
<ClInclude Include="runtime\MessageQueue.h" />
|
||||
<ClInclude Include="sdk\config.h" />
|
||||
<ClInclude Include="sdk\constants.h" />
|
||||
<ClInclude Include="sdk\IAnalyzer.h" />
|
||||
|
@ -35,6 +35,9 @@
|
||||
<Filter Include="src\db">
|
||||
<UniqueIdentifier>{9c63f496-9ae4-4032-8b1d-b1cdcd09a1d2}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="src\runtime">
|
||||
<UniqueIdentifier>{e22e7d2d-a548-4344-bb6e-8463bc1a7157}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="pch.cpp">
|
||||
@ -118,6 +121,12 @@
|
||||
<ClCompile Include="audio\Outputs.cpp">
|
||||
<Filter>src\audio</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="runtime\Message.cpp">
|
||||
<Filter>src\runtime</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="runtime\MessageQueue.cpp">
|
||||
<Filter>src\runtime</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="pch.hpp">
|
||||
@ -288,5 +297,17 @@
|
||||
<ClInclude Include="audio\Outputs.h">
|
||||
<Filter>src\audio</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="runtime\Message.h">
|
||||
<Filter>src\runtime</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="runtime\MessageQueue.h">
|
||||
<Filter>src\runtime</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="runtime\IMessage.h">
|
||||
<Filter>src\runtime</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="runtime\IMessageTarget.h">
|
||||
<Filter>src\runtime</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -34,10 +34,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdafx.h>
|
||||
#include <core/sdk/config.h>
|
||||
#include <memory>
|
||||
|
||||
namespace cursespp {
|
||||
namespace musik { namespace core { namespace runtime {
|
||||
|
||||
class IMessageTarget;
|
||||
|
||||
@ -51,4 +51,5 @@ namespace cursespp {
|
||||
};
|
||||
|
||||
typedef std::shared_ptr<IMessage> IMessagePtr;
|
||||
}
|
||||
|
||||
} } }
|
@ -36,10 +36,10 @@
|
||||
|
||||
#include "IMessage.h"
|
||||
|
||||
namespace cursespp {
|
||||
namespace musik { namespace core { namespace runtime {
|
||||
class IMessageTarget {
|
||||
public:
|
||||
virtual ~IMessageTarget() { }
|
||||
virtual void ProcessMessage(IMessage &message) = 0;
|
||||
};
|
||||
}
|
||||
} } }
|
@ -32,10 +32,10 @@
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <stdafx.h>
|
||||
#include "pch.hpp"
|
||||
#include "Message.h"
|
||||
|
||||
using namespace cursespp;
|
||||
using namespace musik::core::runtime;
|
||||
|
||||
IMessagePtr Message::Create(
|
||||
IMessageTarget* target,
|
@ -36,7 +36,7 @@
|
||||
|
||||
#include "IMessage.h"
|
||||
|
||||
namespace cursespp {
|
||||
namespace musik { namespace core { namespace runtime {
|
||||
class Message : public IMessage {
|
||||
protected:
|
||||
Message(
|
||||
@ -65,4 +65,4 @@ namespace cursespp {
|
||||
int messageType;
|
||||
int64 data1, data2;
|
||||
};
|
||||
}
|
||||
} } }
|
@ -32,12 +32,13 @@
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <stdafx.h>
|
||||
#include <algorithm>
|
||||
#include "pch.hpp"
|
||||
#include "MessageQueue.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
using namespace std::chrono;
|
||||
using namespace cursespp;
|
||||
using namespace musik::core::runtime;
|
||||
|
||||
using LockT = std::unique_lock<std::recursive_mutex>;
|
||||
|
@ -41,7 +41,7 @@
|
||||
#include <condition_variable>
|
||||
#include <chrono>
|
||||
|
||||
namespace cursespp {
|
||||
namespace musik { namespace core { namespace runtime {
|
||||
class MessageQueue {
|
||||
public:
|
||||
MessageQueue();
|
||||
@ -65,4 +65,4 @@ namespace cursespp {
|
||||
|
||||
void Dispatch(IMessagePtr message);
|
||||
};
|
||||
}
|
||||
} } }
|
@ -75,13 +75,13 @@ namespace musik {
|
||||
void InitializeWindows();
|
||||
|
||||
void OnIndexerProgress();
|
||||
void RequeryTrackList(ListWindow *view);
|
||||
void RequeryTrackList(cursespp::ListWindow *view);
|
||||
|
||||
void OnCategoryViewSelectionChanged(
|
||||
ListWindow *view, size_t newIndex, size_t oldIndex);
|
||||
cursespp::ListWindow *view, size_t newIndex, size_t oldIndex);
|
||||
|
||||
void OnCategoryViewInvalidated(
|
||||
ListWindow *view, size_t selectedIndex);
|
||||
cursespp::ListWindow *view, size_t selectedIndex);
|
||||
|
||||
PlaybackService& playback;
|
||||
musik::core::LibraryPtr library;
|
||||
|
@ -37,7 +37,6 @@
|
||||
#include "ConsoleLayout.h"
|
||||
|
||||
#include <cursespp/Screen.h>
|
||||
#include <cursespp/IMessage.h>
|
||||
|
||||
#include <core/sdk/IPlugin.h>
|
||||
#include <core/plugin/PluginFactory.h>
|
||||
|
@ -57,6 +57,7 @@ using namespace musik::core;
|
||||
using namespace musik::core::audio;
|
||||
using namespace musik::core::library;
|
||||
using namespace musik::box;
|
||||
using namespace musik::core::runtime;
|
||||
using namespace cursespp;
|
||||
|
||||
LibraryLayout::LibraryLayout(PlaybackService& playback, LibraryPtr library)
|
||||
|
@ -48,6 +48,8 @@ using namespace musik::core;
|
||||
using namespace musik::core::audio;
|
||||
using namespace musik::core::library;
|
||||
using namespace musik::box;
|
||||
using namespace musik::core::runtime;
|
||||
|
||||
using namespace cursespp;
|
||||
|
||||
#define SEARCH_HEIGHT 3
|
||||
|
@ -66,7 +66,7 @@ namespace musik {
|
||||
void FocusInput();
|
||||
|
||||
protected:
|
||||
virtual void ProcessMessage(cursespp::IMessage &message);
|
||||
virtual void ProcessMessage(musik::core::runtime::IMessage &message);
|
||||
virtual void OnLayout();
|
||||
|
||||
private:
|
||||
|
@ -37,13 +37,12 @@
|
||||
|
||||
#include <app/util/Playback.h>
|
||||
|
||||
#include <cursespp/MessageQueue.h>
|
||||
#include <cursespp/Message.h>
|
||||
|
||||
#include <core/audio/ITransport.h>
|
||||
#include <core/library/LocalLibraryConstants.h>
|
||||
#include <core/library/track/RetainedTrack.h>
|
||||
#include <core/plugin/PluginFactory.h>
|
||||
#include <core/runtime/MessageQueue.h>
|
||||
#include <core/runtime/Message.h>
|
||||
#include <core/support/PreferenceKeys.h>
|
||||
|
||||
#include <boost/lexical_cast.hpp>
|
||||
@ -52,13 +51,11 @@ using musik::core::TrackPtr;
|
||||
using musik::core::LibraryPtr;
|
||||
using musik::core::audio::ITransport;
|
||||
|
||||
using cursespp::IMessageTarget;
|
||||
using cursespp::IMessage;
|
||||
|
||||
using namespace musik::core::library;
|
||||
using namespace musik::core;
|
||||
using namespace musik::core::prefs;
|
||||
using namespace musik::core::sdk;
|
||||
using namespace musik::core::runtime;
|
||||
using namespace musik::box;
|
||||
|
||||
#define NO_POSITION (size_t) -1
|
||||
@ -73,7 +70,7 @@ using namespace musik::box;
|
||||
#define MESSAGE_VOLUME_CHANGED 1003
|
||||
#define MESSAGE_MODE_CHANGED 1004
|
||||
|
||||
class StreamMessage : public cursespp::Message {
|
||||
class StreamMessage : public Message {
|
||||
public:
|
||||
StreamMessage(IMessageTarget* target, int eventType, const std::string& uri)
|
||||
: Message(target, MESSAGE_STREAM_EVENT, eventType, 0) {
|
||||
@ -92,11 +89,11 @@ class StreamMessage : public cursespp::Message {
|
||||
|
||||
#define POST(instance, type, user1, user2) \
|
||||
cursespp::Window::MessageQueue().Post( \
|
||||
cursespp::Message::Create(instance, type, user1, user2));
|
||||
musik::core::runtime::Message::Create(instance, type, user1, user2));
|
||||
|
||||
#define POST_STREAM_MESSAGE(instance, eventType, uri) \
|
||||
cursespp::Window::MessageQueue().Post( \
|
||||
cursespp::IMessagePtr(new StreamMessage(instance, eventType, uri)));
|
||||
musik::core::runtime::IMessagePtr(new StreamMessage(instance, eventType, uri)));
|
||||
|
||||
static inline void loadPreferences(
|
||||
ITransport& transport,
|
||||
|
@ -38,14 +38,13 @@
|
||||
|
||||
#include <app/model/TrackList.h>
|
||||
|
||||
#include <cursespp/IMessageTarget.h>
|
||||
|
||||
#include <core/sdk/IPlaybackService.h>
|
||||
#include <core/sdk/IPlaybackRemote.h>
|
||||
#include <core/library/track/Track.h>
|
||||
#include <core/library/ILibrary.h>
|
||||
#include <core/audio/ITransport.h>
|
||||
#include <core/support/Preferences.h>
|
||||
#include <core/runtime/IMessageTarget.h>
|
||||
|
||||
#include <boost/thread/recursive_mutex.hpp>
|
||||
|
||||
@ -53,7 +52,7 @@ namespace musik {
|
||||
namespace box {
|
||||
class PlaybackService :
|
||||
public musik::core::sdk::IPlaybackService,
|
||||
public cursespp::IMessageTarget,
|
||||
public musik::core::runtime::IMessageTarget,
|
||||
public sigslot::has_slots<>
|
||||
{
|
||||
public:
|
||||
@ -68,7 +67,7 @@ namespace musik {
|
||||
~PlaybackService();
|
||||
|
||||
/* IMessageTarget */
|
||||
virtual void ProcessMessage(cursespp::IMessage &message);
|
||||
virtual void ProcessMessage(musik::core::runtime::IMessage &message);
|
||||
|
||||
/* IPlaybackService */
|
||||
virtual void Play(size_t index);
|
||||
|
@ -37,9 +37,9 @@
|
||||
|
||||
#include <cursespp/SingleLineEntry.h>
|
||||
#include <cursespp/MultiLineEntry.h>
|
||||
#include <cursespp/IMessage.h>
|
||||
#include <cursespp/Text.h>
|
||||
|
||||
#include <core/runtime/IMessage.h>
|
||||
#include <core/library/LocalLibraryConstants.h>
|
||||
|
||||
#include <app/query/CategoryListViewQuery.h>
|
||||
@ -47,12 +47,11 @@
|
||||
|
||||
#include "CategoryListView.h"
|
||||
|
||||
using musik::core::LibraryPtr;
|
||||
using musik::core::audio::ITransport;
|
||||
using musik::core::IQuery;
|
||||
using namespace musik::core;
|
||||
using namespace musik::core::audio;
|
||||
using namespace musik::core::library::constants;
|
||||
using namespace musik::core::runtime;
|
||||
using namespace musik::box;
|
||||
|
||||
using namespace cursespp;
|
||||
|
||||
#define WINDOW_MESSAGE_QUERY_COMPLETED 1002
|
||||
@ -162,7 +161,7 @@ bool CategoryListView::KeyPress(const std::string& key) {
|
||||
return ListWindow::KeyPress(key);
|
||||
}
|
||||
|
||||
void CategoryListView::OnQueryCompleted(IQueryPtr query) {
|
||||
void CategoryListView::OnQueryCompleted(musik::core::IQueryPtr query) {
|
||||
boost::mutex::scoped_lock lock(this->queryMutex);
|
||||
|
||||
auto active = this->activeQuery;
|
||||
|
@ -44,19 +44,12 @@
|
||||
|
||||
#include <core/library/IQuery.h>
|
||||
#include <core/library/ILibrary.h>
|
||||
|
||||
using musik::core::IQueryPtr;
|
||||
using musik::core::LibraryPtr;
|
||||
|
||||
using cursespp::IMessage;
|
||||
using cursespp::ListWindow;
|
||||
using cursespp::IScrollAdapter;
|
||||
using cursespp::ScrollAdapterBase;
|
||||
#include <core/runtime/IMessage.h>
|
||||
|
||||
namespace musik {
|
||||
namespace box {
|
||||
class CategoryListView :
|
||||
public ListWindow,
|
||||
public cursespp::ListWindow,
|
||||
#if (__clang_major__ == 7 && __clang_minor__ == 3)
|
||||
public std::enable_shared_from_this<CategoryListView>,
|
||||
#endif
|
||||
@ -65,7 +58,7 @@ namespace musik {
|
||||
public:
|
||||
CategoryListView(
|
||||
PlaybackService& playback,
|
||||
LibraryPtr library,
|
||||
musik::core::LibraryPtr library,
|
||||
const std::string& fieldName);
|
||||
|
||||
virtual ~CategoryListView();
|
||||
@ -83,26 +76,28 @@ namespace musik {
|
||||
|
||||
void Reset();
|
||||
|
||||
virtual void ProcessMessage(IMessage &message);
|
||||
virtual void ProcessMessage(musik::core::runtime::IMessage &message);
|
||||
|
||||
DBID GetSelectedId();
|
||||
std::string GetFieldName();
|
||||
void SetFieldName(const std::string& fieldName);
|
||||
|
||||
protected:
|
||||
virtual IScrollAdapter& GetScrollAdapter();
|
||||
void OnQueryCompleted(IQueryPtr query);
|
||||
virtual cursespp::IScrollAdapter& GetScrollAdapter();
|
||||
void OnQueryCompleted(musik::core::IQueryPtr query);
|
||||
|
||||
class Adapter : public ScrollAdapterBase {
|
||||
class Adapter : public cursespp::ScrollAdapterBase {
|
||||
public:
|
||||
Adapter(CategoryListView &parent);
|
||||
|
||||
virtual size_t GetEntryCount();
|
||||
virtual EntryPtr GetEntry(cursespp::ScrollableWindow* window, size_t index);
|
||||
|
||||
virtual cursespp::IScrollAdapter::EntryPtr
|
||||
GetEntry(cursespp::ScrollableWindow* window, size_t index);
|
||||
|
||||
private:
|
||||
CategoryListView &parent;
|
||||
IScrollAdapter::ScrollPosition spos;
|
||||
cursespp::IScrollAdapter::ScrollPosition spos;
|
||||
};
|
||||
|
||||
private:
|
||||
@ -110,16 +105,16 @@ namespace musik {
|
||||
void ScrollToPlaying();
|
||||
|
||||
PlaybackService& playback;
|
||||
LibraryPtr library;
|
||||
Adapter *adapter;
|
||||
|
||||
boost::mutex queryMutex;
|
||||
DBID selectAfterQuery;
|
||||
std::shared_ptr<CategoryListViewQuery> activeQuery;
|
||||
|
||||
musik::core::LibraryPtr library;
|
||||
musik::core::TrackPtr playing;
|
||||
|
||||
std::string fieldName;
|
||||
DBID selectAfterQuery;
|
||||
CategoryListViewQuery::ResultList metadata;
|
||||
};
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ void LogWindow::ClearContents() {
|
||||
this->OnAdapterChanged();
|
||||
}
|
||||
|
||||
void LogWindow::ProcessMessage(IMessage &message) {
|
||||
void LogWindow::ProcessMessage(musik::core::runtime::IMessage &message) {
|
||||
if (message.Type() == REFRESH) {
|
||||
this->Update();
|
||||
}
|
||||
|
@ -37,6 +37,7 @@
|
||||
#include <sigslot/sigslot.h>
|
||||
|
||||
#include <core/debug.h>
|
||||
#include <core/runtime/IMessage.h>
|
||||
|
||||
#include <boost/thread/mutex.hpp>
|
||||
|
||||
@ -58,7 +59,7 @@ namespace musik {
|
||||
|
||||
void ClearContents();
|
||||
|
||||
virtual void ProcessMessage(cursespp::IMessage &message);
|
||||
virtual void ProcessMessage(musik::core::runtime::IMessage &message);
|
||||
virtual void OnVisibilityChanged(bool visible);
|
||||
|
||||
protected:
|
||||
|
@ -37,7 +37,6 @@
|
||||
|
||||
#include <cursespp/Colors.h>
|
||||
#include <cursespp/SingleLineEntry.h>
|
||||
#include <cursespp/IMessage.h>
|
||||
#include <cursespp/Text.h>
|
||||
|
||||
#include <core/library/LocalLibraryConstants.h>
|
||||
@ -54,6 +53,7 @@
|
||||
using namespace musik::core;
|
||||
using namespace musik::core::audio;
|
||||
using namespace musik::core::library;
|
||||
using namespace musik::core::runtime;
|
||||
using namespace musik::box;
|
||||
using namespace cursespp;
|
||||
|
||||
|
@ -42,6 +42,7 @@
|
||||
#include <app/query/TrackListQueryBase.h>
|
||||
#include <app/service/PlaybackService.h>
|
||||
|
||||
#include <core/runtime/IMessage.h>
|
||||
#include <core/library/ILibrary.h>
|
||||
|
||||
namespace musik {
|
||||
@ -68,7 +69,7 @@ namespace musik {
|
||||
|
||||
virtual ~TrackListView();
|
||||
|
||||
virtual void ProcessMessage(cursespp::IMessage &message);
|
||||
virtual void ProcessMessage(musik::core::runtime::IMessage &message);
|
||||
virtual bool KeyPress(const std::string& key);
|
||||
|
||||
std::shared_ptr<TrackList> GetTrackList();
|
||||
|
@ -37,7 +37,6 @@
|
||||
|
||||
#include <cursespp/Screen.h>
|
||||
#include <cursespp/Colors.h>
|
||||
#include <cursespp/Message.h>
|
||||
#include <cursespp/Text.h>
|
||||
|
||||
#include <app/util/Duration.h>
|
||||
@ -45,6 +44,7 @@
|
||||
|
||||
#include <core/debug.h>
|
||||
#include <core/library/LocalLibraryConstants.h>
|
||||
#include <core/runtime/Message.h>
|
||||
|
||||
#include <boost/format.hpp>
|
||||
#include <boost/algorithm/string.hpp>
|
||||
@ -60,6 +60,7 @@ using namespace musik::core::audio;
|
||||
using namespace musik::core::library;
|
||||
using namespace musik::core::db;
|
||||
using namespace musik::core::sdk;
|
||||
using namespace musik::core::runtime;
|
||||
using namespace musik::box;
|
||||
using namespace boost::chrono;
|
||||
using namespace cursespp;
|
||||
|
@ -37,6 +37,7 @@
|
||||
#include <cursespp/Window.h>
|
||||
#include <cursespp/IKeyHandler.h>
|
||||
#include <core/library/track/Track.h>
|
||||
#include <core/runtime/IMessage.h>
|
||||
#include <app/service/PlaybackService.h>
|
||||
#include <sigslot/sigslot.h>
|
||||
#include "OutputWindow.h"
|
||||
@ -61,7 +62,7 @@ namespace musik {
|
||||
TransportWindow(musik::box::PlaybackService& playback);
|
||||
virtual ~TransportWindow();
|
||||
|
||||
virtual void ProcessMessage(cursespp::IMessage &message);
|
||||
virtual void ProcessMessage(musik::core::runtime::IMessage &message);
|
||||
virtual void OnFocusChanged(bool focused);
|
||||
virtual void OnRedraw();
|
||||
virtual bool KeyPress(const std::string& key);
|
||||
|
@ -39,7 +39,6 @@
|
||||
#include "ILayout.h"
|
||||
#include "IInput.h"
|
||||
#include "Window.h"
|
||||
#include "MessageQueue.h"
|
||||
#include "Text.h"
|
||||
#include "Screen.h"
|
||||
|
||||
|
@ -36,8 +36,6 @@
|
||||
|
||||
#include <cursespp/Screen.h>
|
||||
#include <cursespp/Colors.h>
|
||||
#include <cursespp/MessageQueue.h>
|
||||
#include <cursespp/Message.h>
|
||||
#include <cursespp/Text.h>
|
||||
|
||||
#include "Checkbox.h"
|
||||
|
@ -37,12 +37,18 @@
|
||||
#include "curses_config.h"
|
||||
#include "IDisplayable.h"
|
||||
#include "IOrderable.h"
|
||||
#include "IMessageTarget.h"
|
||||
|
||||
#include <core/runtime/IMessage.h>
|
||||
#include <core/runtime/IMessageTarget.h>
|
||||
|
||||
namespace cursespp {
|
||||
class IMessage;
|
||||
class musik::core::runtime::IMessage;
|
||||
|
||||
class IWindow : public IOrderable, public IDisplayable, public IMessageTarget {
|
||||
class IWindow :
|
||||
public IOrderable,
|
||||
public IDisplayable,
|
||||
public musik::core::runtime::IMessageTarget
|
||||
{
|
||||
public:
|
||||
virtual ~IWindow() { }
|
||||
virtual void Invalidate() = 0;
|
||||
|
@ -36,8 +36,6 @@
|
||||
|
||||
#include "Screen.h"
|
||||
#include "Colors.h"
|
||||
#include "MessageQueue.h"
|
||||
#include "Message.h"
|
||||
#include "TextInput.h"
|
||||
|
||||
using namespace cursespp;
|
||||
|
@ -36,8 +36,6 @@
|
||||
|
||||
#include <cursespp/Screen.h>
|
||||
#include <cursespp/Colors.h>
|
||||
#include <cursespp/MessageQueue.h>
|
||||
#include <cursespp/Message.h>
|
||||
#include <cursespp/Text.h>
|
||||
|
||||
#include "TextLabel.h"
|
||||
|
@ -36,15 +36,18 @@
|
||||
#include "Window.h"
|
||||
#include "IWindowGroup.h"
|
||||
#include "IInput.h"
|
||||
#include "Message.h"
|
||||
#include "Colors.h"
|
||||
#include "Screen.h"
|
||||
|
||||
#include <core/runtime/Message.h>
|
||||
|
||||
using namespace cursespp;
|
||||
using namespace musik::core::runtime;
|
||||
|
||||
static int NEXT_ID = 0;
|
||||
static bool drawPending = false;
|
||||
static bool freeze = false;
|
||||
|
||||
static MessageQueue messageQueue;
|
||||
|
||||
#define ENABLE_BOUNDS_CHECK 1
|
||||
@ -124,7 +127,7 @@ int Window::GetId() const {
|
||||
return this->id;
|
||||
}
|
||||
|
||||
void Window::ProcessMessage(IMessage &message) {
|
||||
void Window::ProcessMessage(musik::core::runtime::IMessage &message) {
|
||||
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,8 @@
|
||||
|
||||
#include "curses_config.h"
|
||||
#include "IWindow.h"
|
||||
#include "MessageQueue.h"
|
||||
|
||||
#include <core/runtime/MessageQueue.h>
|
||||
|
||||
#ifdef WIN32
|
||||
#define IDLE_TIMEOUT_MS 0
|
||||
@ -84,7 +85,7 @@ namespace cursespp {
|
||||
virtual void BringToTop();
|
||||
virtual void SendToBottom();
|
||||
|
||||
virtual void ProcessMessage(IMessage &message);
|
||||
virtual void ProcessMessage(musik::core::runtime::IMessage &message);
|
||||
|
||||
virtual WINDOW* GetFrame() const;
|
||||
virtual WINDOW* GetContent() const;
|
||||
@ -103,7 +104,8 @@ namespace cursespp {
|
||||
static void InvalidateScreen();
|
||||
static void Freeze();
|
||||
static void Unfreeze();
|
||||
static MessageQueue& MessageQueue();
|
||||
|
||||
static musik::core::runtime::MessageQueue& MessageQueue();
|
||||
|
||||
protected:
|
||||
IWindow* GetParent() const;
|
||||
|
@ -166,8 +166,6 @@
|
||||
<ClCompile Include="cursespp\TextInput.cpp" />
|
||||
<ClCompile Include="cursespp\TextLabel.cpp" />
|
||||
<ClCompile Include="cursespp\Window.cpp" />
|
||||
<ClCompile Include="cursespp\Message.cpp" />
|
||||
<ClCompile Include="cursespp\MessageQueue.cpp" />
|
||||
<ClCompile Include="Main.cpp" />
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
@ -215,7 +213,6 @@
|
||||
<ClInclude Include="cursespp\IInput.h" />
|
||||
<ClInclude Include="cursespp\IKeyHandler.h" />
|
||||
<ClInclude Include="cursespp\ILayout.h" />
|
||||
<ClInclude Include="cursespp\IMessageTarget.h" />
|
||||
<ClInclude Include="cursespp\IOrderable.h" />
|
||||
<ClInclude Include="cursespp\IOverlay.h" />
|
||||
<ClInclude Include="cursespp\IScrollable.h" />
|
||||
@ -223,7 +220,6 @@
|
||||
<ClInclude Include="cursespp\IViewRoot.h" />
|
||||
<ClInclude Include="cursespp\IWindow.h" />
|
||||
<ClInclude Include="cursespp\IWindowGroup.h" />
|
||||
<ClInclude Include="cursespp\IMessage.h" />
|
||||
<ClInclude Include="cursespp\LayoutBase.h" />
|
||||
<ClInclude Include="cursespp\ListOverlay.h" />
|
||||
<ClInclude Include="cursespp\ListWindow.h" />
|
||||
@ -240,8 +236,6 @@
|
||||
<ClInclude Include="cursespp\TextInput.h" />
|
||||
<ClInclude Include="cursespp\TextLabel.h" />
|
||||
<ClInclude Include="cursespp\Window.h" />
|
||||
<ClInclude Include="cursespp\Message.h" />
|
||||
<ClInclude Include="cursespp\MessageQueue.h" />
|
||||
<ClInclude Include="stdafx.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
@ -57,12 +57,6 @@
|
||||
<ClCompile Include="app\service\PlaybackService.cpp">
|
||||
<Filter>app\service</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="cursespp\Message.cpp">
|
||||
<Filter>cursespp</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="cursespp\MessageQueue.cpp">
|
||||
<Filter>cursespp</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="app\window\EntryWithHeader.cpp">
|
||||
<Filter>app\window</Filter>
|
||||
</ClCompile>
|
||||
@ -240,18 +234,6 @@
|
||||
<ClInclude Include="app\service\PlaybackService.h">
|
||||
<Filter>app\service</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="cursespp\IMessage.h">
|
||||
<Filter>cursespp</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="cursespp\Message.h">
|
||||
<Filter>cursespp</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="cursespp\MessageQueue.h">
|
||||
<Filter>cursespp</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="cursespp\IMessageTarget.h">
|
||||
<Filter>cursespp</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="app\window\EntryWithHeader.h">
|
||||
<Filter>app\window</Filter>
|
||||
</ClInclude>
|
||||
|
Loading…
x
Reference in New Issue
Block a user