mirror of
https://github.com/clangen/musikcube.git
synced 2024-12-27 03:14:30 +00:00
Moved some sources out of "musikbox" and into a new "glue" directory. This
is for non-UI code that doesn't necessarily belong in core, but can be reused across clients.
This commit is contained in:
parent
45bac55dc3
commit
0d7dfce805
@ -71,6 +71,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||
endif (CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||
|
||||
add_subdirectory(src/core)
|
||||
add_subdirectory(src/glue)
|
||||
add_subdirectory(src/musikbox)
|
||||
add_subdirectory(src/contrib/taglib_plugin)
|
||||
add_subdirectory(src/contrib/m4adecoder)
|
||||
|
@ -60,6 +60,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "musikwin", "src\musikwin\mu
|
||||
{7CD00EC4-D090-48BE-9388-FA4857AC332C} = {7CD00EC4-D090-48BE-9388-FA4857AC332C}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "glue", "src\glue\glue.vcxproj", "{01869283-4CC3-4DA4-A06C-3DF6A0DE98CC}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
@ -160,6 +162,12 @@ Global
|
||||
{C0039E74-6E03-4FEE-8701-74CA6B90B380}.Release|Win32.Build.0 = Release|Win32
|
||||
{C0039E74-6E03-4FEE-8701-74CA6B90B380}.Release|x64.ActiveCfg = Release|x64
|
||||
{C0039E74-6E03-4FEE-8701-74CA6B90B380}.Release|x64.Build.0 = Release|x64
|
||||
{01869283-4CC3-4DA4-A06C-3DF6A0DE98CC}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{01869283-4CC3-4DA4-A06C-3DF6A0DE98CC}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{01869283-4CC3-4DA4-A06C-3DF6A0DE98CC}.Debug|x64.ActiveCfg = Debug|Win32
|
||||
{01869283-4CC3-4DA4-A06C-3DF6A0DE98CC}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{01869283-4CC3-4DA4-A06C-3DF6A0DE98CC}.Release|Win32.Build.0 = Release|Win32
|
||||
{01869283-4CC3-4DA4-A06C-3DF6A0DE98CC}.Release|x64.ActiveCfg = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
16
src/glue/CMakeLists.txt
Normal file
16
src/glue/CMakeLists.txt
Normal file
@ -0,0 +1,16 @@
|
||||
set(GLUE_SOURCES
|
||||
./audio/MasterTransport.cpp
|
||||
./audio/PlaybackService.cpp
|
||||
./model/TrackList.cpp
|
||||
./util/Duration.cpp
|
||||
./util/Playback.cpp
|
||||
)
|
||||
|
||||
include_directories(
|
||||
.
|
||||
..
|
||||
../3rdparty/include
|
||||
)
|
||||
|
||||
add_library(musikglue STATIC ${GLUE_SOURCES})
|
||||
target_link_libraries(musikglue ${musikbox_LINK_LIBS})
|
@ -32,7 +32,7 @@
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <stdafx.h>
|
||||
#include <pch.hpp>
|
||||
|
||||
#include "MasterTransport.h"
|
||||
|
||||
@ -41,12 +41,13 @@
|
||||
#include <core/support/Preferences.h>
|
||||
#include <core/support/PreferenceKeys.h>
|
||||
|
||||
using namespace musik::box::audio;
|
||||
using namespace musik::core::audio;
|
||||
using namespace musik::core;
|
||||
using namespace musik::core::prefs;
|
||||
using namespace musik::core::sdk;
|
||||
|
||||
using namespace musik::glue::audio;
|
||||
|
||||
MasterTransport::MasterTransport()
|
||||
: prefs(Preferences::ForComponent(components::Playback)) {
|
||||
this->type = (Type) this->prefs->GetInt(keys::Transport, Gapless);
|
@ -37,7 +37,7 @@
|
||||
#include <core/audio/ITransport.h>
|
||||
#include <core/support/Preferences.h>
|
||||
|
||||
namespace musik { namespace box { namespace audio {
|
||||
namespace musik { namespace glue { namespace audio {
|
||||
class MasterTransport :
|
||||
public sigslot::has_slots<>,
|
||||
public musik::core::audio::ITransport
|
@ -32,10 +32,11 @@
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <stdafx.h>
|
||||
#include <pch.hpp>
|
||||
|
||||
#include "PlaybackService.h"
|
||||
|
||||
#include <app/util/Playback.h>
|
||||
#include <glue/util/Playback.h>
|
||||
|
||||
#include <core/audio/ITransport.h>
|
||||
#include <core/library/LocalLibraryConstants.h>
|
||||
@ -56,7 +57,8 @@ using namespace musik::core;
|
||||
using namespace musik::core::prefs;
|
||||
using namespace musik::core::sdk;
|
||||
using namespace musik::core::runtime;
|
||||
using namespace musik::box;
|
||||
using namespace musik::glue;
|
||||
using namespace musik::glue::audio;
|
||||
|
||||
#define NO_POSITION (size_t) -1
|
||||
|
124
src/glue/audio/PlaybackService.h
Executable file
124
src/glue/audio/PlaybackService.h
Executable file
@ -0,0 +1,124 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (c) 2007-2016 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 <sigslot/sigslot.h>
|
||||
|
||||
#include <glue/model/TrackList.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/IMessageQueue.h>
|
||||
|
||||
#include <mutex>
|
||||
|
||||
namespace musik { namespace glue { namespace audio {
|
||||
class PlaybackService :
|
||||
public musik::core::sdk::IPlaybackService,
|
||||
public musik::core::runtime::IMessageTarget,
|
||||
public sigslot::has_slots<>
|
||||
{
|
||||
public:
|
||||
sigslot::signal2<size_t, musik::core::TrackPtr> TrackChanged;
|
||||
sigslot::signal0<> ModeChanged;
|
||||
sigslot::signal1<bool> Shuffled;
|
||||
|
||||
PlaybackService(
|
||||
musik::core::runtime::IMessageQueue& messageQueue,
|
||||
musik::core::LibraryPtr library,
|
||||
musik::core::audio::ITransport& transport);
|
||||
|
||||
~PlaybackService();
|
||||
|
||||
/* IMessageTarget */
|
||||
virtual void ProcessMessage(musik::core::runtime::IMessage &message);
|
||||
|
||||
/* IPlaybackService */
|
||||
virtual void Play(size_t index);
|
||||
virtual bool Next();
|
||||
virtual bool Previous();
|
||||
virtual void Stop() { transport.Stop(); }
|
||||
virtual musik::core::sdk::RepeatMode GetRepeatMode() { return this->repeatMode; }
|
||||
virtual void SetRepeatMode(musik::core::sdk::RepeatMode mode);
|
||||
virtual void ToggleRepeatMode();
|
||||
virtual musik::core::sdk::PlaybackState GetPlaybackState();
|
||||
virtual bool IsShuffled();
|
||||
virtual void ToggleShuffle();
|
||||
virtual size_t GetIndex();
|
||||
virtual size_t Count();
|
||||
virtual double GetVolume();
|
||||
virtual void SetVolume(double vol);
|
||||
virtual void PauseOrResume();
|
||||
virtual bool IsMuted();
|
||||
virtual void ToggleMute();
|
||||
virtual double GetPosition();
|
||||
virtual void SetPosition(double seconds);
|
||||
virtual double GetDuration();
|
||||
virtual musik::core::sdk::IRetainedTrack* GetTrack(size_t index);
|
||||
|
||||
/* app-specific implementation */
|
||||
musik::core::audio::ITransport& GetTransport() { return this->transport; }
|
||||
void Play(musik::glue::TrackList& tracks, size_t index);
|
||||
void CopyTo(musik::glue::TrackList& target);
|
||||
musik::core::TrackPtr GetTrackAtIndex(size_t index);
|
||||
|
||||
private:
|
||||
void OnStreamEvent(int eventType, std::string uri);
|
||||
void OnPlaybackEvent(int eventType);
|
||||
void OnTrackChanged(size_t pos, musik::core::TrackPtr track);
|
||||
void OnVolumeChanged();
|
||||
void PrepareNextTrack();
|
||||
void InitRemotes();
|
||||
void ResetRemotes();
|
||||
|
||||
musik::glue::TrackList playlist;
|
||||
musik::glue::TrackList unshuffled;
|
||||
std::recursive_mutex playlistMutex;
|
||||
|
||||
std::vector<std::shared_ptr<musik::core::sdk::IPlaybackRemote > > remotes;
|
||||
std::shared_ptr<musik::core::Preferences> prefs;
|
||||
|
||||
musik::core::LibraryPtr library;
|
||||
musik::core::audio::ITransport& transport;
|
||||
size_t index, nextIndex;
|
||||
musik::core::sdk::RepeatMode repeatMode;
|
||||
|
||||
musik::core::runtime::IMessageQueue& messageQueue;
|
||||
};
|
||||
} } }
|
20
src/glue/glue.sln
Normal file
20
src/glue/glue.sln
Normal file
@ -0,0 +1,20 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 9.00
|
||||
# Visual Studio 2005
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "glue", "glue.vcproj", "{01869283-4cc3-4da4-a06c-3df6a0de98cc}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{01869283-4cc3-4da4-a06c-3df6a0de98cc}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{01869283-4cc3-4da4-a06c-3df6a0de98cc}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{01869283-4cc3-4da4-a06c-3df6a0de98cc}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{01869283-4cc3-4da4-a06c-3df6a0de98cc}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
115
src/glue/glue.vcxproj
Normal file
115
src/glue/glue.vcxproj
Normal file
@ -0,0 +1,115 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{01869283-4cc3-4da4-a06c-3df6a0de98cc}</ProjectGuid>
|
||||
<RootNamespace>glue</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)\bin\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">obj/$(Configuration)\</IntDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)\bin\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">obj/$(Configuration)\</IntDir>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>./;../;../3rdparty/include/;../3rdparty/win32_include;../../../boost_1_60_0;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE;XML_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.hpp</PrecompiledHeaderFile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
<AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
|
||||
<ObjectFileName>$(IntDir)</ObjectFileName>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(ProjectName).pdb</ProgramDataBaseFileName>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<InlineFunctionExpansion>Default</InlineFunctionExpansion>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
||||
<AdditionalIncludeDirectories>./;../;../3rdparty/include/;../3rdparty/win32_include;../../../boost_1_60_0;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_CRT_SECURE_NO_DEPRECATE;XML_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.hpp</PrecompiledHeaderFile>
|
||||
<AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
|
||||
<ObjectFileName>$(IntDir)</ObjectFileName>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(ProjectName).pdb</ProgramDataBaseFileName>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\3rdparty\3rdparty.vcxproj">
|
||||
<Project>{b2165720-b4b2-4f4b-8888-8c390c3cb4db}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="audio\MasterTransport.h" />
|
||||
<ClInclude Include="audio\PlaybackService.h" />
|
||||
<ClInclude Include="model\TrackList.h" />
|
||||
<ClInclude Include="pch.hpp" />
|
||||
<ClInclude Include="util\Duration.h" />
|
||||
<ClInclude Include="util\Playback.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="audio\MasterTransport.cpp" />
|
||||
<ClCompile Include="audio\PlaybackService.cpp" />
|
||||
<ClCompile Include="model\TrackList.cpp" />
|
||||
<ClCompile Include="pch.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="util\Duration.cpp" />
|
||||
<ClCompile Include="util\Playback.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
57
src/glue/glue.vcxproj.filters
Normal file
57
src/glue/glue.vcxproj.filters
Normal file
@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="src">
|
||||
<UniqueIdentifier>{43832bfe-7403-43a4-8a7a-6f0c3aaf69f4}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="src\audio">
|
||||
<UniqueIdentifier>{df549fdf-a398-4ade-94b5-89aca3719470}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="src\model">
|
||||
<UniqueIdentifier>{7fd41124-442f-4e74-82a9-470f68b65cd0}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="src\util">
|
||||
<UniqueIdentifier>{bbbddc84-ecce-43e4-baa1-c93978765231}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="pch.hpp">
|
||||
<Filter>src</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="audio\MasterTransport.h">
|
||||
<Filter>src\audio</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="audio\PlaybackService.h">
|
||||
<Filter>src\audio</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="model\TrackList.h">
|
||||
<Filter>src\model</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="util\Playback.h">
|
||||
<Filter>src\util</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="util\Duration.h">
|
||||
<Filter>src\util</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="pch.cpp">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="audio\MasterTransport.cpp">
|
||||
<Filter>src\audio</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="audio\PlaybackService.cpp">
|
||||
<Filter>src\audio</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="model\TrackList.cpp">
|
||||
<Filter>src\model</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="util\Playback.cpp">
|
||||
<Filter>src\util</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="util\Duration.cpp">
|
||||
<Filter>src\util</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -32,7 +32,7 @@
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "pch.hpp"
|
||||
#include "TrackList.h"
|
||||
|
||||
#include <core/library/query/QueryBase.h>
|
||||
@ -55,7 +55,8 @@ using musik::core::ILibrary;
|
||||
using namespace musik::core::db;
|
||||
using namespace musik::core::query;
|
||||
using namespace musik::core::library::constants;
|
||||
using namespace musik::box;
|
||||
|
||||
using namespace musik::glue;
|
||||
|
||||
class TrackMetadataQuery : public QueryBase {
|
||||
public:
|
@ -41,7 +41,7 @@
|
||||
#include <list>
|
||||
|
||||
namespace musik {
|
||||
namespace box {
|
||||
namespace glue {
|
||||
class TrackList {
|
||||
public:
|
||||
TrackList(musik::core::LibraryPtr library);
|
35
src/glue/pch.cpp
Normal file
35
src/glue/pch.cpp
Normal file
@ -0,0 +1,35 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (c) 2007-2016 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 "pch.hpp"
|
38
src/glue/pch.hpp
Normal file
38
src/glue/pch.hpp
Normal file
@ -0,0 +1,38 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (c) 2007-2016 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 <core/config.h>
|
||||
#include <algorithm>
|
@ -32,33 +32,31 @@
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "pch.hpp"
|
||||
#include "Duration.h"
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
||||
namespace musik {
|
||||
namespace box {
|
||||
namespace duration {
|
||||
std::string Duration(int seconds) {
|
||||
int mins = (seconds / 60);
|
||||
int secs = seconds - (mins * 60);
|
||||
char buffer[12];
|
||||
snprintf(buffer, sizeof(buffer), "%d:%02d", mins, secs);
|
||||
return std::string(buffer);
|
||||
}
|
||||
namespace musik { namespace glue { namespace duration {
|
||||
|
||||
std::string Duration(double seconds) {
|
||||
return Duration((int) round(seconds));
|
||||
}
|
||||
|
||||
std::string Duration(const std::string& str) {
|
||||
if (str.size()) {
|
||||
int seconds = boost::lexical_cast<int>(str);
|
||||
return Duration(seconds);
|
||||
}
|
||||
|
||||
return "0:00";
|
||||
}
|
||||
}
|
||||
std::string Duration(int seconds) {
|
||||
int mins = (seconds / 60);
|
||||
int secs = seconds - (mins * 60);
|
||||
char buffer[12];
|
||||
snprintf(buffer, sizeof(buffer), "%d:%02d", mins, secs);
|
||||
return std::string(buffer);
|
||||
}
|
||||
}
|
||||
|
||||
std::string Duration(double seconds) {
|
||||
return Duration((int) round(seconds));
|
||||
}
|
||||
|
||||
std::string Duration(const std::string& str) {
|
||||
if (str.size()) {
|
||||
int seconds = boost::lexical_cast<int>(str);
|
||||
return Duration(seconds);
|
||||
}
|
||||
|
||||
return "0:00";
|
||||
}
|
||||
|
||||
} } }
|
@ -34,14 +34,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "stdafx.h"
|
||||
namespace musik { namespace glue { namespace duration {
|
||||
|
||||
namespace musik {
|
||||
namespace box {
|
||||
namespace duration {
|
||||
std::string Duration(const std::string& str);
|
||||
std::string Duration(int seconds);
|
||||
std::string Duration(double seconds);
|
||||
}
|
||||
}
|
||||
}
|
||||
std::string Duration(const std::string& str);
|
||||
std::string Duration(int seconds);
|
||||
std::string Duration(double seconds);
|
||||
|
||||
} } }
|
72
src/glue/util/Playback.cpp
Normal file
72
src/glue/util/Playback.cpp
Normal file
@ -0,0 +1,72 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (c) 2007-2016 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 "pch.hpp"
|
||||
#include "Playback.h"
|
||||
#include <core/sdk/constants.h>
|
||||
|
||||
using namespace musik::core::audio;
|
||||
using namespace musik::core::sdk;
|
||||
|
||||
namespace musik {
|
||||
namespace glue {
|
||||
namespace playback {
|
||||
void PauseOrResume(ITransport& transport) {
|
||||
int state = transport.GetPlaybackState();
|
||||
if (state == PlaybackPaused) {
|
||||
transport.Resume();
|
||||
}
|
||||
else if (state == PlaybackPlaying) {
|
||||
transport.Pause();
|
||||
}
|
||||
}
|
||||
|
||||
void VolumeUp(ITransport& transport) {
|
||||
transport.SetVolume(transport.Volume() + 0.05);
|
||||
}
|
||||
|
||||
void VolumeDown(ITransport& transport) {
|
||||
transport.SetVolume(transport.Volume() - 0.05);
|
||||
}
|
||||
|
||||
void SeekForward(ITransport& transport) {
|
||||
transport.SetPosition(transport.Position() + 10.0f);
|
||||
}
|
||||
|
||||
void SeekBack(ITransport& transport) {
|
||||
transport.SetPosition(transport.Position() - 10.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
49
src/glue/util/Playback.h
Normal file
49
src/glue/util/Playback.h
Normal file
@ -0,0 +1,49 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (c) 2007-2016 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 <core/audio/ITransport.h>
|
||||
|
||||
namespace musik {
|
||||
namespace glue {
|
||||
namespace playback {
|
||||
void VolumeUp(musik::core::audio::ITransport& transport);
|
||||
void VolumeDown(musik::core::audio::ITransport& transport);
|
||||
void SeekForward(musik::core::audio::ITransport& transport);
|
||||
void SeekBack(musik::core::audio::ITransport& transport);
|
||||
void PauseOrResume(musik::core::audio::ITransport& transport);
|
||||
}
|
||||
}
|
||||
}
|
@ -46,8 +46,9 @@
|
||||
#include <app/util/GlobalHotkeys.h>
|
||||
#include <app/util/Hotkeys.h>
|
||||
#include <app/util/PreferenceKeys.h>
|
||||
#include <app/service/PlaybackService.h>
|
||||
#include <app/audio/MasterTransport.h>
|
||||
#include <glue/audio/PlaybackService.h>
|
||||
|
||||
#include <glue/audio/MasterTransport.h>
|
||||
|
||||
#include <core/library/LibraryFactory.h>
|
||||
#include <core/support/PreferenceKeys.h>
|
||||
@ -63,7 +64,8 @@
|
||||
#undef MOUSE_MOVED
|
||||
#endif
|
||||
|
||||
using namespace musik::box::audio;
|
||||
using namespace musik::glue;
|
||||
using namespace musik::glue::audio;
|
||||
using namespace musik::core;
|
||||
using namespace musik::core::audio;
|
||||
using namespace musik::box;
|
||||
|
@ -76,7 +76,7 @@ static std::map <std::string, std::string> FIELD_TO_TITLE{
|
||||
this->categoryTitle->SetText(CATEGORY_TITLE(key), text::AlignCenter);
|
||||
|
||||
BrowseLayout::BrowseLayout(
|
||||
PlaybackService& playback,
|
||||
musik::glue::audio::PlaybackService& playback,
|
||||
LibraryPtr library)
|
||||
: LayoutBase()
|
||||
, playback(playback) {
|
||||
|
@ -40,7 +40,7 @@
|
||||
#include <app/window/CategoryListView.h>
|
||||
#include <app/window/TrackListView.h>
|
||||
#include <app/window/TransportWindow.h>
|
||||
#include <app/service/PlaybackService.h>
|
||||
#include <glue/audio/PlaybackService.h>
|
||||
|
||||
#include <core/library/ILibrary.h>
|
||||
|
||||
@ -57,7 +57,7 @@ namespace musik {
|
||||
{
|
||||
public:
|
||||
BrowseLayout(
|
||||
PlaybackService& playback,
|
||||
musik::glue::audio::PlaybackService& playback,
|
||||
musik::core::LibraryPtr library);
|
||||
|
||||
virtual ~BrowseLayout();
|
||||
@ -83,7 +83,7 @@ namespace musik {
|
||||
void OnCategoryViewInvalidated(
|
||||
cursespp::ListWindow *view, size_t selectedIndex);
|
||||
|
||||
PlaybackService& playback;
|
||||
musik::glue::audio::PlaybackService& playback;
|
||||
musik::core::LibraryPtr library;
|
||||
std::shared_ptr<CategoryListView> categoryList;
|
||||
std::shared_ptr<TrackListView> trackList;
|
||||
|
@ -41,7 +41,7 @@
|
||||
|
||||
#include <app/query/CategoryTrackListQuery.h>
|
||||
#include <app/util/Hotkeys.h>
|
||||
#include <app/util/Playback.h>
|
||||
#include <glue/util/Playback.h>
|
||||
|
||||
#include "LibraryLayout.h"
|
||||
|
||||
@ -60,7 +60,7 @@ using namespace musik::box;
|
||||
using namespace musik::core::runtime;
|
||||
using namespace cursespp;
|
||||
|
||||
LibraryLayout::LibraryLayout(PlaybackService& playback, LibraryPtr library)
|
||||
LibraryLayout::LibraryLayout(musik::glue::audio::PlaybackService& playback, LibraryPtr library)
|
||||
: LayoutBase()
|
||||
, playback(playback)
|
||||
, shortcuts(nullptr)
|
||||
@ -297,7 +297,7 @@ bool LibraryLayout::KeyPress(const std::string& key) {
|
||||
return true;
|
||||
}
|
||||
else if (key == " " || key == "M- ") {
|
||||
playback::PauseOrResume(this->transport);
|
||||
musik::glue::playback::PauseOrResume(this->transport);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@
|
||||
#include <app/layout/SearchLayout.h>
|
||||
#include <app/layout/TrackSearchLayout.h>
|
||||
#include <app/window/TransportWindow.h>
|
||||
#include <app/service/PlaybackService.h>
|
||||
#include <glue/audio/PlaybackService.h>
|
||||
|
||||
#include <core/library/ILibrary.h>
|
||||
|
||||
@ -59,7 +59,7 @@ namespace musik {
|
||||
{
|
||||
public:
|
||||
LibraryLayout(
|
||||
PlaybackService& playback,
|
||||
musik::glue::audio::PlaybackService& playback,
|
||||
musik::core::LibraryPtr library);
|
||||
|
||||
virtual ~LibraryLayout();
|
||||
@ -97,7 +97,7 @@ namespace musik {
|
||||
void OnLayoutChanged();
|
||||
void UpdateShortcutsWindow();
|
||||
|
||||
PlaybackService& playback;
|
||||
musik::glue::audio::PlaybackService& playback;
|
||||
musik::core::audio::ITransport& transport;
|
||||
musik::core::LibraryPtr library;
|
||||
std::shared_ptr<BrowseLayout> browseLayout;
|
||||
|
@ -39,7 +39,7 @@
|
||||
#include <cursespp/Text.h>
|
||||
#include <core/library/LocalLibraryConstants.h>
|
||||
#include <app/query/NowPlayingTrackListQuery.h>
|
||||
#include <app/util/Duration.h>
|
||||
#include <glue/util/Duration.h>
|
||||
#include "NowPlayingLayout.h"
|
||||
|
||||
#include <boost/format.hpp>
|
||||
@ -50,12 +50,13 @@ using namespace musik::core;
|
||||
using namespace musik::core::audio;
|
||||
using namespace musik::core::library;
|
||||
using namespace musik::box;
|
||||
using namespace musik::glue;
|
||||
using namespace cursespp;
|
||||
|
||||
static std::string formatWithAlbum(TrackPtr track, size_t width);
|
||||
|
||||
NowPlayingLayout::NowPlayingLayout(
|
||||
PlaybackService& playback,
|
||||
musik::glue::audio::PlaybackService& playback,
|
||||
musik::core::LibraryPtr library)
|
||||
: LayoutBase()
|
||||
, playback(playback)
|
||||
|
@ -39,7 +39,7 @@
|
||||
#include <app/window/CategoryListView.h>
|
||||
#include <app/window/TrackListView.h>
|
||||
#include <app/window/TransportWindow.h>
|
||||
#include <app/service/PlaybackService.h>
|
||||
#include <glue/audio/PlaybackService.h>
|
||||
|
||||
#include <core/library/ILibrary.h>
|
||||
|
||||
@ -56,7 +56,7 @@ namespace musik {
|
||||
{
|
||||
public:
|
||||
NowPlayingLayout(
|
||||
PlaybackService& playback,
|
||||
musik::glue::audio::PlaybackService& playback,
|
||||
musik::core::LibraryPtr library);
|
||||
|
||||
virtual ~NowPlayingLayout();
|
||||
@ -73,7 +73,7 @@ namespace musik {
|
||||
void InitializeWindows();
|
||||
void RequeryTrackList();
|
||||
|
||||
PlaybackService& playback;
|
||||
musik::glue::audio::PlaybackService& playback;
|
||||
musik::core::LibraryPtr library;
|
||||
std::shared_ptr<TrackListView> trackList;
|
||||
};
|
||||
|
@ -57,7 +57,7 @@ using namespace cursespp;
|
||||
x == this->artists || \
|
||||
x == this->genres
|
||||
|
||||
SearchLayout::SearchLayout(PlaybackService& playback, LibraryPtr library)
|
||||
SearchLayout::SearchLayout(musik::glue::audio::PlaybackService& playback, LibraryPtr library)
|
||||
: LayoutBase() {
|
||||
this->library = library;
|
||||
this->InitializeWindows(playback);
|
||||
@ -102,7 +102,7 @@ void SearchLayout::OnLayout() {
|
||||
view->SetText(value, cursespp::text::AlignCenter); \
|
||||
this->AddWindow(view);
|
||||
|
||||
void SearchLayout::InitializeWindows(PlaybackService& playback) {
|
||||
void SearchLayout::InitializeWindows(musik::glue::audio::PlaybackService& playback) {
|
||||
this->input.reset(new cursespp::TextInput());
|
||||
this->input->TextChanged.connect(this, &SearchLayout::OnInputChanged);
|
||||
this->input->EnterPressed.connect(this, &SearchLayout::OnEnterPressed);
|
||||
|
@ -41,7 +41,7 @@
|
||||
#include <app/window/CategoryListView.h>
|
||||
#include <app/window/TrackListView.h>
|
||||
#include <app/window/TransportWindow.h>
|
||||
#include <app/service/PlaybackService.h>
|
||||
#include <glue/audio/PlaybackService.h>
|
||||
|
||||
#include <core/library/ILibrary.h>
|
||||
|
||||
@ -60,7 +60,7 @@ namespace musik {
|
||||
sigslot::signal3<SearchLayout*, std::string, DBID> SearchResultSelected;
|
||||
|
||||
SearchLayout(
|
||||
PlaybackService& playback,
|
||||
musik::glue::audio::PlaybackService& playback,
|
||||
musik::core::LibraryPtr library);
|
||||
|
||||
virtual ~SearchLayout();
|
||||
@ -74,7 +74,7 @@ namespace musik {
|
||||
virtual void OnLayout();
|
||||
|
||||
private:
|
||||
void InitializeWindows(PlaybackService& playback);
|
||||
void InitializeWindows(musik::glue::audio::PlaybackService& playback);
|
||||
void Requery();
|
||||
|
||||
void OnEnterPressed(cursespp::TextInput* sender);
|
||||
|
@ -60,7 +60,7 @@ using namespace musik::core::audio;
|
||||
using namespace musik::core::library::constants;
|
||||
using namespace musik::core::sdk;
|
||||
using namespace musik::box;
|
||||
using namespace musik::box::audio;
|
||||
using namespace musik::glue::audio;
|
||||
using namespace cursespp;
|
||||
using namespace std::placeholders;
|
||||
|
||||
@ -85,7 +85,7 @@ static bool showDotfiles = false;
|
||||
|
||||
SettingsLayout::SettingsLayout(
|
||||
musik::core::LibraryPtr library,
|
||||
musik::box::audio::MasterTransport& transport)
|
||||
musik::glue::audio::MasterTransport& transport)
|
||||
: LayoutBase()
|
||||
, library(library)
|
||||
, indexer(library->Indexer())
|
||||
|
@ -44,9 +44,10 @@
|
||||
#include <cursespp/DialogOverlay.h>
|
||||
|
||||
#include <app/window/TrackListView.h>
|
||||
#include <app/service/PlaybackService.h>
|
||||
#include <glue/audio/PlaybackService.h>
|
||||
#include <app/model/DirectoryAdapter.h>
|
||||
#include <app/audio/MasterTransport.h>
|
||||
|
||||
#include <glue/audio/MasterTransport.h>
|
||||
|
||||
#include <core/library/ILibrary.h>
|
||||
#include <core/support/Preferences.h>
|
||||
@ -68,7 +69,7 @@ namespace musik {
|
||||
public:
|
||||
SettingsLayout(
|
||||
musik::core::LibraryPtr library,
|
||||
musik::box::audio::MasterTransport& transport);
|
||||
musik::glue::audio::MasterTransport& transport);
|
||||
|
||||
virtual ~SettingsLayout();
|
||||
|
||||
@ -104,7 +105,7 @@ namespace musik {
|
||||
|
||||
musik::core::LibraryPtr library;
|
||||
musik::core::IIndexer* indexer;
|
||||
musik::box::audio::MasterTransport& transport;
|
||||
musik::glue::audio::MasterTransport& transport;
|
||||
|
||||
std::shared_ptr<musik::core::Preferences> libraryPrefs;
|
||||
std::shared_ptr<musik::core::Preferences> playbackPrefs;
|
||||
|
@ -62,7 +62,7 @@ using namespace cursespp;
|
||||
this->PostMessage(REQUERY_TRACKLIST, 0, 0, x);
|
||||
|
||||
TrackSearchLayout::TrackSearchLayout(
|
||||
PlaybackService& playback,
|
||||
musik::glue::audio::PlaybackService& playback,
|
||||
musik::core::LibraryPtr library)
|
||||
: LayoutBase()
|
||||
, playback(playback)
|
||||
|
@ -38,7 +38,7 @@
|
||||
#include <cursespp/TextInput.h>
|
||||
|
||||
#include <app/window/TrackListView.h>
|
||||
#include <app/service/PlaybackService.h>
|
||||
#include <glue/audio/PlaybackService.h>
|
||||
|
||||
#include <core/library/ILibrary.h>
|
||||
|
||||
@ -55,7 +55,7 @@ namespace musik {
|
||||
{
|
||||
public:
|
||||
TrackSearchLayout(
|
||||
PlaybackService& playback,
|
||||
musik::glue::audio::PlaybackService& playback,
|
||||
musik::core::LibraryPtr library);
|
||||
|
||||
virtual ~TrackSearchLayout();
|
||||
@ -79,7 +79,7 @@ namespace musik {
|
||||
|
||||
void OnEnterPressed(cursespp::TextInput* sender);
|
||||
|
||||
PlaybackService& playback;
|
||||
musik::glue::audio::PlaybackService& playback;
|
||||
musik::core::LibraryPtr library;
|
||||
std::shared_ptr<TrackListView> trackList;
|
||||
std::shared_ptr<cursespp::TextInput> input;
|
||||
|
@ -46,7 +46,7 @@
|
||||
#include <vector>
|
||||
|
||||
using namespace musik::box;
|
||||
using namespace musik::box::audio;
|
||||
using namespace musik::glue::audio;
|
||||
using namespace musik::core::audio;
|
||||
using namespace musik::core::sdk;
|
||||
using namespace cursespp;
|
||||
|
@ -35,18 +35,18 @@
|
||||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
#include <app/audio/MasterTransport.h>
|
||||
#include <glue/audio/MasterTransport.h>
|
||||
|
||||
namespace musik {
|
||||
namespace box {
|
||||
class PlaybackOverlays {
|
||||
public:
|
||||
static void ShowOutputOverlay(
|
||||
musik::box::audio::MasterTransport::Type transportType,
|
||||
musik::glue::audio::MasterTransport::Type transportType,
|
||||
std::function<void()> callback);
|
||||
|
||||
static void ShowTransportOverlay(
|
||||
musik::box::audio::MasterTransport::Type transportType,
|
||||
musik::glue::audio::MasterTransport::Type transportType,
|
||||
std::function<void(int)> callback);
|
||||
|
||||
private:
|
||||
|
@ -62,7 +62,7 @@ static std::map<std::string, std::string> FIELD_TO_FOREIGN_KEY =
|
||||
CategoryTrackListQuery::CategoryTrackListQuery(LibraryPtr library, const std::string& column, DBID id) {
|
||||
this->library = library;
|
||||
this->id = id;
|
||||
this->result.reset(new TrackList(library));
|
||||
this->result.reset(new musik::glue::TrackList(library));
|
||||
this->headers.reset(new std::set<size_t>());
|
||||
this->hash = 0;
|
||||
|
||||
@ -98,7 +98,7 @@ size_t CategoryTrackListQuery::GetQueryHash() {
|
||||
|
||||
bool CategoryTrackListQuery::OnRun(Connection& db) {
|
||||
if (result) {
|
||||
result.reset(new TrackList(this->library));
|
||||
result.reset(new musik::glue::TrackList(this->library));
|
||||
headers.reset(new std::set<size_t>());
|
||||
}
|
||||
|
||||
|
@ -50,10 +50,10 @@ using namespace musik::core::library::constants;
|
||||
using namespace musik::box;
|
||||
|
||||
NowPlayingTrackListQuery::NowPlayingTrackListQuery(
|
||||
LibraryPtr library, PlaybackService& playback)
|
||||
LibraryPtr library, musik::glue::audio::PlaybackService& playback)
|
||||
: library(library)
|
||||
, playback(playback) {
|
||||
this->result.reset(new TrackList(library));
|
||||
this->result.reset(new musik::glue::TrackList(library));
|
||||
this->headers.reset(new std::set<size_t>());
|
||||
this->hash = 0;
|
||||
}
|
||||
@ -80,7 +80,7 @@ size_t NowPlayingTrackListQuery::GetQueryHash() {
|
||||
|
||||
bool NowPlayingTrackListQuery::OnRun(Connection& db) {
|
||||
if (result) {
|
||||
result.reset(new TrackList(this->library));
|
||||
result.reset(new musik::glue::TrackList(this->library));
|
||||
headers.reset(new std::set<size_t>());
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@
|
||||
|
||||
#include <core/library/query/QueryBase.h>
|
||||
#include "TrackListQueryBase.h"
|
||||
#include <app/service/PlaybackService.h>
|
||||
#include <glue/audio/PlaybackService.h>
|
||||
|
||||
namespace musik {
|
||||
namespace box {
|
||||
@ -44,7 +44,7 @@ namespace musik {
|
||||
public:
|
||||
NowPlayingTrackListQuery(
|
||||
musik::core::LibraryPtr library,
|
||||
PlaybackService& playback);
|
||||
musik::glue::audio::PlaybackService& playback);
|
||||
|
||||
virtual ~NowPlayingTrackListQuery();
|
||||
|
||||
@ -58,7 +58,7 @@ namespace musik {
|
||||
|
||||
private:
|
||||
musik::core::LibraryPtr library;
|
||||
PlaybackService& playback;
|
||||
musik::glue::audio::PlaybackService& playback;
|
||||
Result result;
|
||||
Headers headers;
|
||||
size_t hash;
|
||||
|
@ -60,7 +60,7 @@ SearchTrackListQuery::SearchTrackListQuery(LibraryPtr library, const std::string
|
||||
this->filter = "%" + trim_copy(to_lower_copy(filter)) + "%";
|
||||
}
|
||||
|
||||
this->result.reset(new TrackList(library));
|
||||
this->result.reset(new musik::glue::TrackList(library));
|
||||
this->headers.reset(new std::set<size_t>());
|
||||
this->hash = 0;
|
||||
}
|
||||
@ -83,7 +83,7 @@ size_t SearchTrackListQuery::GetQueryHash() {
|
||||
|
||||
bool SearchTrackListQuery::OnRun(Connection& db) {
|
||||
if (result) {
|
||||
result.reset(new TrackList(this->library));
|
||||
result.reset(new musik::glue::TrackList(this->library));
|
||||
headers.reset(new std::set<size_t>());
|
||||
}
|
||||
|
||||
|
@ -37,14 +37,14 @@
|
||||
#include <core/library/query/QueryBase.h>
|
||||
#include <core/db/Connection.h>
|
||||
#include <core/library/track/Track.h>
|
||||
#include <app/model/TrackList.h>
|
||||
#include <glue/model/TrackList.h>
|
||||
#include "CategoryListViewQuery.h"
|
||||
|
||||
namespace musik {
|
||||
namespace box {
|
||||
class TrackListQueryBase : public musik::core::query::QueryBase {
|
||||
public:
|
||||
typedef std::shared_ptr<TrackList> Result;
|
||||
typedef std::shared_ptr<musik::glue::TrackList> Result;
|
||||
typedef std::shared_ptr<std::set<size_t> > Headers;
|
||||
|
||||
virtual ~TrackListQueryBase() { };
|
||||
|
@ -1,126 +0,0 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (c) 2007-2016 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 <sigslot/sigslot.h>
|
||||
|
||||
#include <app/model/TrackList.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/IMessageQueue.h>
|
||||
|
||||
#include <mutex>
|
||||
|
||||
namespace musik {
|
||||
namespace box {
|
||||
class PlaybackService :
|
||||
public musik::core::sdk::IPlaybackService,
|
||||
public musik::core::runtime::IMessageTarget,
|
||||
public sigslot::has_slots<>
|
||||
{
|
||||
public:
|
||||
sigslot::signal2<size_t, musik::core::TrackPtr> TrackChanged;
|
||||
sigslot::signal0<> ModeChanged;
|
||||
sigslot::signal1<bool> Shuffled;
|
||||
|
||||
PlaybackService(
|
||||
musik::core::runtime::IMessageQueue& messageQueue,
|
||||
musik::core::LibraryPtr library,
|
||||
musik::core::audio::ITransport& transport);
|
||||
|
||||
~PlaybackService();
|
||||
|
||||
/* IMessageTarget */
|
||||
virtual void ProcessMessage(musik::core::runtime::IMessage &message);
|
||||
|
||||
/* IPlaybackService */
|
||||
virtual void Play(size_t index);
|
||||
virtual bool Next();
|
||||
virtual bool Previous();
|
||||
virtual void Stop() { transport.Stop(); }
|
||||
virtual musik::core::sdk::RepeatMode GetRepeatMode() { return this->repeatMode; }
|
||||
virtual void SetRepeatMode(musik::core::sdk::RepeatMode mode);
|
||||
virtual void ToggleRepeatMode();
|
||||
virtual musik::core::sdk::PlaybackState GetPlaybackState();
|
||||
virtual bool IsShuffled();
|
||||
virtual void ToggleShuffle();
|
||||
virtual size_t GetIndex();
|
||||
virtual size_t Count();
|
||||
virtual double GetVolume();
|
||||
virtual void SetVolume(double vol);
|
||||
virtual void PauseOrResume();
|
||||
virtual bool IsMuted();
|
||||
virtual void ToggleMute();
|
||||
virtual double GetPosition();
|
||||
virtual void SetPosition(double seconds);
|
||||
virtual double GetDuration();
|
||||
virtual musik::core::sdk::IRetainedTrack* GetTrack(size_t index);
|
||||
|
||||
/* app-specific implementation */
|
||||
musik::core::audio::ITransport& GetTransport() { return this->transport; }
|
||||
void Play(TrackList& tracks, size_t index);
|
||||
void CopyTo(TrackList& target);
|
||||
musik::core::TrackPtr GetTrackAtIndex(size_t index);
|
||||
|
||||
private:
|
||||
void OnStreamEvent(int eventType, std::string uri);
|
||||
void OnPlaybackEvent(int eventType);
|
||||
void OnTrackChanged(size_t pos, musik::core::TrackPtr track);
|
||||
void OnVolumeChanged();
|
||||
void PrepareNextTrack();
|
||||
void InitRemotes();
|
||||
void ResetRemotes();
|
||||
|
||||
TrackList playlist;
|
||||
TrackList unshuffled;
|
||||
std::recursive_mutex playlistMutex;
|
||||
|
||||
std::vector<std::shared_ptr<musik::core::sdk::IPlaybackRemote > > remotes;
|
||||
std::shared_ptr<musik::core::Preferences> prefs;
|
||||
|
||||
musik::core::LibraryPtr library;
|
||||
musik::core::audio::ITransport& transport;
|
||||
size_t index, nextIndex;
|
||||
musik::core::sdk::RepeatMode repeatMode;
|
||||
|
||||
musik::core::runtime::IMessageQueue& messageQueue;
|
||||
};
|
||||
}
|
||||
}
|
@ -41,13 +41,15 @@
|
||||
|
||||
#include <core/audio/Visualizer.h>
|
||||
|
||||
#include <glue/util/Playback.h>
|
||||
|
||||
using musik::core::LibraryPtr;
|
||||
using musik::core::audio::ITransport;
|
||||
using namespace musik::core::audio;
|
||||
using namespace musik::core::sdk;
|
||||
using namespace musik::box;
|
||||
|
||||
GlobalHotkeys::GlobalHotkeys(PlaybackService& playback, LibraryPtr library)
|
||||
GlobalHotkeys::GlobalHotkeys(musik::glue::audio::PlaybackService& playback, LibraryPtr library)
|
||||
: playback(playback)
|
||||
, transport(playback.GetTransport()) {
|
||||
this->library = library;
|
||||
@ -63,15 +65,15 @@ bool GlobalHotkeys::Handle(const std::string& kn) {
|
||||
return true;
|
||||
}
|
||||
else if (Hotkeys::Is(Hotkeys::TogglePause, kn)) {
|
||||
playback::PauseOrResume(this->transport);
|
||||
musik::glue::playback::PauseOrResume(this->transport);
|
||||
return true;
|
||||
}
|
||||
else if (Hotkeys::Is(Hotkeys::VolumeUp, kn)) {
|
||||
playback::VolumeUp(this->transport);
|
||||
musik::glue::playback::VolumeUp(this->transport);
|
||||
return true;
|
||||
}
|
||||
else if (Hotkeys::Is(Hotkeys::VolumeDown, kn)) {
|
||||
playback::VolumeDown(this->transport);
|
||||
musik::glue::playback::VolumeDown(this->transport);
|
||||
return true;
|
||||
}
|
||||
else if (Hotkeys::Is(Hotkeys::Previous, kn)) {
|
||||
@ -83,11 +85,11 @@ bool GlobalHotkeys::Handle(const std::string& kn) {
|
||||
return true;
|
||||
}
|
||||
else if (Hotkeys::Is(Hotkeys::SeekBack, kn)) {
|
||||
playback::SeekBack(this->transport);
|
||||
musik::glue::playback::SeekBack(this->transport);
|
||||
return true;
|
||||
}
|
||||
else if (Hotkeys::Is(Hotkeys::SeekForward, kn)) {
|
||||
playback::SeekForward(this->transport);
|
||||
musik::glue::playback::SeekForward(this->transport);
|
||||
return true;
|
||||
}
|
||||
else if (Hotkeys::Is(Hotkeys::ToggleRepeat, kn)) {
|
||||
|
@ -36,7 +36,7 @@
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#include <app/service/PlaybackService.h>
|
||||
#include <glue/audio/PlaybackService.h>
|
||||
#include <core/library/ILibrary.h>
|
||||
|
||||
namespace musik {
|
||||
@ -44,7 +44,7 @@ namespace musik {
|
||||
class GlobalHotkeys {
|
||||
public:
|
||||
GlobalHotkeys(
|
||||
PlaybackService& playback,
|
||||
musik::glue::audio::PlaybackService& playback,
|
||||
musik::core::LibraryPtr library);
|
||||
|
||||
~GlobalHotkeys(); /* non-virtual; do not use as a base class */
|
||||
@ -52,7 +52,7 @@ namespace musik {
|
||||
bool Handle(const std::string& kn);
|
||||
|
||||
private:
|
||||
PlaybackService& playback;
|
||||
musik::glue::audio::PlaybackService& playback;
|
||||
musik::core::audio::ITransport& transport;
|
||||
musik::core::LibraryPtr library;
|
||||
};
|
||||
|
@ -36,7 +36,6 @@
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#include <app/service/PlaybackService.h>
|
||||
#include <core/library/ILibrary.h>
|
||||
|
||||
namespace musik {
|
||||
|
@ -44,7 +44,7 @@ namespace musik {
|
||||
namespace playback {
|
||||
void Play(
|
||||
std::shared_ptr<musik::box::TrackListView> trackList,
|
||||
musik::box::PlaybackService& playback,
|
||||
musik::glue::audio::PlaybackService& playback,
|
||||
cursespp::IWindowPtr focused)
|
||||
{
|
||||
auto tracks = trackList->GetTrackList();
|
||||
@ -56,32 +56,6 @@ namespace musik {
|
||||
playback.Play(*tracks, index);
|
||||
}
|
||||
}
|
||||
|
||||
void PauseOrResume(ITransport& transport) {
|
||||
int state = transport.GetPlaybackState();
|
||||
if (state == PlaybackPaused) {
|
||||
transport.Resume();
|
||||
}
|
||||
else if (state == PlaybackPlaying) {
|
||||
transport.Pause();
|
||||
}
|
||||
}
|
||||
|
||||
void VolumeUp(ITransport& transport) {
|
||||
transport.SetVolume(transport.Volume() + 0.05);
|
||||
}
|
||||
|
||||
void VolumeDown(ITransport& transport) {
|
||||
transport.SetVolume(transport.Volume() - 0.05);
|
||||
}
|
||||
|
||||
void SeekForward(ITransport& transport) {
|
||||
transport.SetPosition(transport.Position() + 10.0f);
|
||||
}
|
||||
|
||||
void SeekBack(ITransport& transport) {
|
||||
transport.SetPosition(transport.Position() - 10.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -36,7 +36,7 @@
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#include <app/service/PlaybackService.h>
|
||||
#include <glue/audio/PlaybackService.h>
|
||||
#include <app/window/TrackListView.h>
|
||||
|
||||
namespace musik {
|
||||
@ -44,15 +44,8 @@ namespace musik {
|
||||
namespace playback {
|
||||
void Play(
|
||||
std::shared_ptr<musik::box::TrackListView> trackList,
|
||||
musik::box::PlaybackService& playback,
|
||||
musik::glue::audio::PlaybackService& playback,
|
||||
cursespp::IWindowPtr focused);
|
||||
|
||||
void VolumeUp(musik::core::audio::ITransport& transport);
|
||||
void VolumeDown(musik::core::audio::ITransport& transport);
|
||||
void SeekForward(musik::core::audio::ITransport& transport);
|
||||
void SeekBack(musik::core::audio::ITransport& transport);
|
||||
|
||||
void PauseOrResume(musik::core::audio::ITransport& transport);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ using namespace cursespp;
|
||||
#define WINDOW_MESSAGE_QUERY_COMPLETED 1002
|
||||
|
||||
CategoryListView::CategoryListView(
|
||||
PlaybackService& playback,
|
||||
musik::glue::audio::PlaybackService& playback,
|
||||
LibraryPtr library,
|
||||
const std::string& fieldName)
|
||||
: ListWindow(NULL)
|
||||
|
@ -40,7 +40,7 @@
|
||||
#include <cursespp/ScrollAdapterBase.h>
|
||||
|
||||
#include <app/query/CategoryListViewQuery.h>
|
||||
#include <app/service/PlaybackService.h>
|
||||
#include <glue/audio/PlaybackService.h>
|
||||
|
||||
#include <core/library/IQuery.h>
|
||||
#include <core/library/ILibrary.h>
|
||||
@ -59,7 +59,7 @@ namespace musik {
|
||||
{
|
||||
public:
|
||||
CategoryListView(
|
||||
PlaybackService& playback,
|
||||
musik::glue::audio::PlaybackService& playback,
|
||||
musik::core::LibraryPtr library,
|
||||
const std::string& fieldName);
|
||||
|
||||
@ -106,7 +106,7 @@ namespace musik {
|
||||
void OnTrackChanged(size_t index, musik::core::TrackPtr track);
|
||||
void ScrollToPlaying();
|
||||
|
||||
PlaybackService& playback;
|
||||
musik::glue::audio::PlaybackService& playback;
|
||||
Adapter *adapter;
|
||||
|
||||
std::mutex queryMutex;
|
||||
|
@ -41,8 +41,9 @@
|
||||
|
||||
#include <core/library/LocalLibraryConstants.h>
|
||||
|
||||
#include <glue/util/Duration.h>
|
||||
|
||||
#include <app/util/Hotkeys.h>
|
||||
#include <app/util/Duration.h>
|
||||
#include <app/window/EntryWithHeader.h>
|
||||
|
||||
#include <boost/format.hpp>
|
||||
@ -55,6 +56,8 @@ using namespace musik::core::audio;
|
||||
using namespace musik::core::library;
|
||||
using namespace musik::core::runtime;
|
||||
using namespace musik::box;
|
||||
using namespace musik::glue;
|
||||
using namespace musik::glue::audio;
|
||||
using namespace cursespp;
|
||||
|
||||
using namespace std::chrono;
|
||||
@ -216,7 +219,7 @@ static std::string formatWithoutAlbum(TrackPtr track, size_t width) {
|
||||
TRACK_COL_WIDTH);
|
||||
|
||||
std::string duration = text::Align(
|
||||
musik::box::duration::Duration(track->GetValue(constants::Track::DURATION)),
|
||||
musik::glue::duration::Duration(track->GetValue(constants::Track::DURATION)),
|
||||
text::AlignRight,
|
||||
DURATION_COL_WIDTH);
|
||||
|
||||
|
@ -40,7 +40,7 @@
|
||||
#include <cursespp/ListWindow.h>
|
||||
|
||||
#include <app/query/TrackListQueryBase.h>
|
||||
#include <app/service/PlaybackService.h>
|
||||
#include <glue/audio/PlaybackService.h>
|
||||
|
||||
#include <core/runtime/IMessage.h>
|
||||
#include <core/library/ILibrary.h>
|
||||
@ -63,7 +63,7 @@ namespace musik {
|
||||
typedef std::shared_ptr<std::set<size_t> > Headers;
|
||||
|
||||
TrackListView(
|
||||
PlaybackService& playback,
|
||||
musik::glue::audio::PlaybackService& playback,
|
||||
musik::core::LibraryPtr library,
|
||||
RowFormatter formatter = RowFormatter());
|
||||
|
||||
@ -72,7 +72,7 @@ namespace musik {
|
||||
virtual void ProcessMessage(musik::core::runtime::IMessage &message);
|
||||
virtual bool KeyPress(const std::string& key);
|
||||
|
||||
std::shared_ptr<TrackList> GetTrackList();
|
||||
std::shared_ptr<musik::glue::TrackList> GetTrackList();
|
||||
void Clear();
|
||||
|
||||
void Requery(std::shared_ptr<TrackListQueryBase> query);
|
||||
@ -99,10 +99,10 @@ namespace musik {
|
||||
void ScrollToPlaying();
|
||||
|
||||
std::shared_ptr<TrackListQueryBase> query;
|
||||
std::shared_ptr<TrackList> metadata;
|
||||
std::shared_ptr<musik::glue::TrackList> metadata;
|
||||
Headers headers;
|
||||
Adapter* adapter;
|
||||
PlaybackService& playback;
|
||||
musik::glue::audio::PlaybackService& playback;
|
||||
musik::core::TrackPtr playing;
|
||||
musik::core::LibraryPtr library;
|
||||
size_t lastQueryHash;
|
||||
|
@ -39,8 +39,8 @@
|
||||
#include <cursespp/Colors.h>
|
||||
#include <cursespp/Text.h>
|
||||
|
||||
#include <app/util/Duration.h>
|
||||
#include <app/util/Playback.h>
|
||||
#include <glue/util/Duration.h>
|
||||
#include <glue/util/Playback.h>
|
||||
|
||||
#include <core/debug.h>
|
||||
#include <core/library/LocalLibraryConstants.h>
|
||||
@ -63,6 +63,7 @@ using namespace musik::core::db;
|
||||
using namespace musik::core::sdk;
|
||||
using namespace musik::core::runtime;
|
||||
using namespace musik::box;
|
||||
using namespace musik::glue;
|
||||
using namespace std::chrono;
|
||||
using namespace cursespp;
|
||||
|
||||
@ -188,7 +189,7 @@ struct musik::box::TransportDisplayCache {
|
||||
}
|
||||
}
|
||||
|
||||
totalTime = musik::box::duration::Duration(secondsTotal);
|
||||
totalTime = musik::glue::duration::Duration(secondsTotal);
|
||||
totalTimeCols = u8cols(totalTime);
|
||||
}
|
||||
}
|
||||
@ -275,7 +276,7 @@ static inline bool dec(const std::string& kn) {
|
||||
return (/*kn == "KEY_DOWN" ||*/ kn == "KEY_LEFT");
|
||||
}
|
||||
|
||||
TransportWindow::TransportWindow(musik::box::PlaybackService& playback)
|
||||
TransportWindow::TransportWindow(musik::glue::audio::PlaybackService& playback)
|
||||
: Window(nullptr)
|
||||
, displayCache(new TransportDisplayCache())
|
||||
, playback(playback)
|
||||
@ -544,7 +545,7 @@ void TransportWindow::Update(TimeMode timeMode) {
|
||||
secondsCurrent = (int) round(this->lastTime);
|
||||
}
|
||||
|
||||
const std::string currentTime = duration::Duration(
|
||||
const std::string currentTime = musik::glue::duration::Duration(
|
||||
std::min(secondsCurrent, displayCache->secondsTotal));
|
||||
|
||||
int bottomRowControlsWidth =
|
||||
|
@ -38,7 +38,7 @@
|
||||
#include <cursespp/IKeyHandler.h>
|
||||
#include <core/library/track/Track.h>
|
||||
#include <core/runtime/IMessage.h>
|
||||
#include <app/service/PlaybackService.h>
|
||||
#include <glue/audio/PlaybackService.h>
|
||||
#include <sigslot/sigslot.h>
|
||||
#include "OutputWindow.h"
|
||||
|
||||
@ -61,7 +61,7 @@ namespace musik {
|
||||
FocusTime = 2
|
||||
};
|
||||
|
||||
TransportWindow(musik::box::PlaybackService& playback);
|
||||
TransportWindow(musik::glue::audio::PlaybackService& playback);
|
||||
virtual ~TransportWindow();
|
||||
|
||||
virtual void ProcessMessage(musik::core::runtime::IMessage &message);
|
||||
@ -94,7 +94,7 @@ namespace musik {
|
||||
|
||||
bool paused;
|
||||
musik::core::audio::ITransport& transport;
|
||||
musik::box::PlaybackService& playback;
|
||||
musik::glue::audio::PlaybackService& playback;
|
||||
musik::core::TrackPtr currentTrack;
|
||||
FocusTarget focus, lastFocus;
|
||||
std::unique_ptr<TransportDisplayCache> displayCache;
|
||||
|
@ -122,7 +122,6 @@
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="app\audio\MasterTransport.cpp" />
|
||||
<ClCompile Include="app\layout\BrowseLayout.cpp" />
|
||||
<ClCompile Include="app\layout\LibraryLayout.cpp" />
|
||||
<ClCompile Include="app\layout\ConsoleLayout.cpp" />
|
||||
@ -132,15 +131,12 @@
|
||||
<ClCompile Include="app\layout\SettingsLayout.cpp" />
|
||||
<ClCompile Include="app\layout\TrackSearchLayout.cpp" />
|
||||
<ClCompile Include="app\model\DirectoryAdapter.cpp" />
|
||||
<ClCompile Include="app\model\TrackList.cpp" />
|
||||
<ClCompile Include="app\overlay\PlaybackOverlays.cpp" />
|
||||
<ClCompile Include="app\overlay\VisualizerOverlay.cpp" />
|
||||
<ClCompile Include="app\query\CategoryListViewQuery.cpp" />
|
||||
<ClCompile Include="app\query\NowPlayingTrackListQuery.cpp" />
|
||||
<ClCompile Include="app\query\CategoryTrackListQuery.cpp" />
|
||||
<ClCompile Include="app\query\SearchTrackListQuery.cpp" />
|
||||
<ClCompile Include="app\service\PlaybackService.cpp" />
|
||||
<ClCompile Include="app\util\Duration.cpp" />
|
||||
<ClCompile Include="app\util\GlobalHotkeys.cpp" />
|
||||
<ClCompile Include="app\util\Hotkeys.cpp" />
|
||||
<ClCompile Include="app\util\Playback.cpp" />
|
||||
@ -178,7 +174,6 @@
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="app\audio\MasterTransport.h" />
|
||||
<ClInclude Include="app\layout\BrowseLayout.h" />
|
||||
<ClInclude Include="app\layout\ITopLevelLayout.h" />
|
||||
<ClInclude Include="app\layout\LibraryLayout.h" />
|
||||
@ -189,7 +184,6 @@
|
||||
<ClInclude Include="app\layout\SettingsLayout.h" />
|
||||
<ClInclude Include="app\layout\TrackSearchLayout.h" />
|
||||
<ClInclude Include="app\model\DirectoryAdapter.h" />
|
||||
<ClInclude Include="app\model\TrackList.h" />
|
||||
<ClInclude Include="app\overlay\PlaybackOverlays.h" />
|
||||
<ClInclude Include="app\overlay\VisualizerOverlay.h" />
|
||||
<ClInclude Include="app\query\CategoryListViewQuery.h" />
|
||||
@ -197,8 +191,6 @@
|
||||
<ClInclude Include="app\query\SearchTrackListQuery.h" />
|
||||
<ClInclude Include="app\query\TrackListQueryBase.h" />
|
||||
<ClInclude Include="app\query\CategoryTrackListQuery.h" />
|
||||
<ClInclude Include="app\service\PlaybackService.h" />
|
||||
<ClInclude Include="app\util\Duration.h" />
|
||||
<ClInclude Include="app\util\GlobalHotkeys.h" />
|
||||
<ClInclude Include="app\util\Hotkeys.h" />
|
||||
<ClInclude Include="app\util\Playback.h" />
|
||||
@ -254,6 +246,9 @@
|
||||
<Project>{b2165720-b4b2-4f4b-9634-8c390c3cb4db}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\glue\glue.vcxproj">
|
||||
<Project>{01869283-4cc3-4da4-a06c-3df6a0de98cc}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
|
@ -54,9 +54,6 @@
|
||||
<ClCompile Include="app\util\GlobalHotkeys.cpp">
|
||||
<Filter>app\util</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="app\service\PlaybackService.cpp">
|
||||
<Filter>app\service</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="app\window\EntryWithHeader.cpp">
|
||||
<Filter>app\window</Filter>
|
||||
</ClCompile>
|
||||
@ -90,12 +87,6 @@
|
||||
<ClCompile Include="cursespp\Text.cpp">
|
||||
<Filter>cursespp</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="app\util\Duration.cpp">
|
||||
<Filter>app\util</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="app\model\TrackList.cpp">
|
||||
<Filter>app\model</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="app\util\Playback.cpp">
|
||||
<Filter>app\util</Filter>
|
||||
</ClCompile>
|
||||
@ -147,9 +138,6 @@
|
||||
<ClCompile Include="app\util\Win32Util.cpp">
|
||||
<Filter>app\util</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="app\audio\MasterTransport.cpp">
|
||||
<Filter>app\audio</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="stdafx.h" />
|
||||
@ -237,9 +225,6 @@
|
||||
<ClInclude Include="cursespp\IOrderable.h">
|
||||
<Filter>cursespp</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="app\service\PlaybackService.h">
|
||||
<Filter>app\service</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="app\window\EntryWithHeader.h">
|
||||
<Filter>app\window</Filter>
|
||||
</ClInclude>
|
||||
@ -273,12 +258,6 @@
|
||||
<ClInclude Include="cursespp\Text.h">
|
||||
<Filter>cursespp</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="app\util\Duration.h">
|
||||
<Filter>app\util</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="app\model\TrackList.h">
|
||||
<Filter>app\model</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="app\util\Playback.h">
|
||||
<Filter>app\util</Filter>
|
||||
</ClInclude>
|
||||
@ -345,9 +324,6 @@
|
||||
<ClInclude Include="app\util\Win32Util.h">
|
||||
<Filter>app\util</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="app\audio\MasterTransport.h">
|
||||
<Filter>app\audio</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Filter Include="cursespp">
|
||||
@ -368,17 +344,11 @@
|
||||
<Filter Include="app\query">
|
||||
<UniqueIdentifier>{5c751253-4250-4a81-8b5f-ca6244954d64}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="app\service">
|
||||
<UniqueIdentifier>{f2315c14-fb1b-4928-ab47-462d1dc65c77}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="app\model">
|
||||
<UniqueIdentifier>{b6720351-dd55-4b14-936a-09df56193c15}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="app\overlay">
|
||||
<UniqueIdentifier>{a84f242d-d70b-49e9-975e-63fc73954a2b}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="app\audio">
|
||||
<UniqueIdentifier>{b1b3ddc5-b30f-4668-8267-c32cdf3e4da0}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -4,15 +4,15 @@
|
||||
#include <win32cpp/TopLevelWindow.hpp>
|
||||
|
||||
#include <core/library/LibraryFactory.h>
|
||||
#include <core/audio/GaplessTransport.h>
|
||||
#include <glue/audio/MasterTransport.h>
|
||||
|
||||
using namespace musik::core;
|
||||
using namespace musik::core::audio;
|
||||
using namespace musik::glue::audio;
|
||||
using namespace win32cpp;
|
||||
|
||||
int APIENTRY _tWinMain(HINSTANCE instance, HINSTANCE previousInstance, LPTSTR commandLine, int showCommand) {
|
||||
LibraryPtr library = LibraryFactory::Libraries().at(0);
|
||||
GaplessTransport transport;
|
||||
MasterTransport transport;
|
||||
|
||||
transport.Start("c:\\test.ogg");
|
||||
|
||||
|
@ -256,6 +256,9 @@
|
||||
<ProjectReference Include="..\core\core.vcxproj">
|
||||
<Project>{b2165720-b4b2-4f4b-9634-8c390c3cb4db}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\glue\glue.vcxproj">
|
||||
<Project>{01869283-4cc3-4da4-a06c-3df6a0de98cc}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
|
Loading…
Reference in New Issue
Block a user