mirror of
https://github.com/clangen/musikcube.git
synced 2025-01-30 15:32:37 +00:00
Move version.h
into musikcore/sdk/
and use it for built-in plugins.
This commit is contained in:
parent
4a823deecb
commit
0d4f3b0f27
@ -10,11 +10,12 @@ if [ -z "$MAJOR" ] || [ -z "$MINOR" ] || [ -z "$PATCH" ]; then
|
|||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sed -Ei.bak "s/(\s*)(#define VERSION_MAJOR )(.*)/\1\2${MAJOR}/g" src/musikcore/version.h
|
sed -Ei.bak "s/(\s*)(#define MUSIKCUBE_VERSION_MAJOR )(.*)/\1\2${MAJOR}/g" src/musikcore/sdk/version.h
|
||||||
sed -Ei.bak "s/(\s*)(#define VERSION_MINOR )(.*)/\1\2${MINOR}/g" src/musikcore/version.h
|
sed -Ei.bak "s/(\s*)(#define MUSIKCUBE_VERSION_MINOR )(.*)/\1\2${MINOR}/g" src/musikcore/sdk/version.h
|
||||||
sed -Ei.bak "s/(\s*)(#define VERSION_PATCH )(.*)/\1\2${PATCH}/g" src/musikcore/version.h
|
sed -Ei.bak "s/(\s*)(#define MUSIKCUBE_VERSION_PATCH )(.*)/\1\2${PATCH}/g" src/musikcore/sdk/version.h
|
||||||
sed -Ei.bak "s/(\s*)(#define VERSION_COMMIT_HASH )(.*)/\1\2\"${COMMIT_HASH}\"/g" src/musikcore/version.h
|
sed -Ei.bak "s/(\s*)(#define MUSIKCUBE_VERSION_COMMIT_HASH )(.*)/\1\2\"${COMMIT_HASH}\"/g" src/musikcore/sdk/version.h
|
||||||
sed -Ei.bak "s/(\s*)(#define VERSION )(.*)/\1\2\"${MAJOR}.${MINOR}.${PATCH}\"/g" src/musikcore/version.h
|
sed -Ei.bak "s/(\s*)(#define MUSIKCUBE_VERSION )(.*)/\1\2\"${MAJOR}.${MINOR}.${PATCH}\"/g" src/musikcore/sdk/version.h
|
||||||
|
sed -Ei.bak "s/(\s*)(#define MUSIKCUBE_VERSION_WITH_COMMIT_HASH )(.*)/\1\2\"${MAJOR}.${MINOR}.${PATCH}-${COMMIT_HASH}\"/g" src/musikcore/sdk/version.h
|
||||||
|
|
||||||
# visual studio resource files are utf16-le, so sed can't operate on them
|
# visual studio resource files are utf16-le, so sed can't operate on them
|
||||||
# directly. convert to utf8, process, then back to utf16-le
|
# directly. convert to utf8, process, then back to utf16-le
|
||||||
@ -35,6 +36,6 @@ sed -Ei.bak "s/(\s*)(%define version )(.*)/\1\2${MAJOR}.${MINOR}.${PATCH}/g" mus
|
|||||||
|
|
||||||
# ugh. there's a way to tell sed not to backup, but it's different on gnu and
|
# ugh. there's a way to tell sed not to backup, but it's different on gnu and
|
||||||
# bsd sed variants. this is easier than trying to switch the args dynamically.
|
# bsd sed variants. this is easier than trying to switch the args dynamically.
|
||||||
rm src/musikcore/version.h.bak
|
rm src/musikcore/sdk/version.h.bak
|
||||||
rm CMakeLists.txt.bak
|
rm CMakeLists.txt.bak
|
||||||
rm musikcube.spec.bak
|
rm musikcube.spec.bak
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
#include <musikcore/net/PiggyWebSocketClient.h>
|
#include <musikcore/net/PiggyWebSocketClient.h>
|
||||||
#include <musikcore/support/Common.h>
|
#include <musikcore/support/Common.h>
|
||||||
#include <musikcore/runtime/Message.h>
|
#include <musikcore/runtime/Message.h>
|
||||||
#include <musikcore/version.h>
|
#include <musikcore/sdk/version.h>
|
||||||
|
|
||||||
using namespace musik::core;
|
using namespace musik::core;
|
||||||
using namespace musik::core::net;
|
using namespace musik::core::net;
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
#include <musikcore/support/PreferenceKeys.h>
|
#include <musikcore/support/PreferenceKeys.h>
|
||||||
#include <musikcore/support/Preferences.h>
|
#include <musikcore/support/Preferences.h>
|
||||||
#include <musikcore/runtime/Message.h>
|
#include <musikcore/runtime/Message.h>
|
||||||
#include <musikcore/version.h>
|
#include <musikcore/sdk/version.h>
|
||||||
|
|
||||||
#pragma warning(push, 0)
|
#pragma warning(push, 0)
|
||||||
#include <nlohmann/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
@ -116,8 +116,8 @@ static inline bool isVersionCompatible(const std::string& str) {
|
|||||||
auto parts = str::Split(str, ".");
|
auto parts = str::Split(str, ".");
|
||||||
return
|
return
|
||||||
parts.size() == 3 &&
|
parts.size() == 3 &&
|
||||||
parts[0] == std::to_string(VERSION_MAJOR) &&
|
parts[0] == std::to_string(MUSIKCUBE_VERSION_MAJOR) &&
|
||||||
parts[1] == std::to_string(VERSION_MINOR);
|
parts[1] == std::to_string(MUSIKCUBE_VERSION_MINOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
WebSocketClient::WebSocketClient(IMessageQueue* messageQueue, Listener* listener)
|
WebSocketClient::WebSocketClient(IMessageQueue* messageQueue, Listener* listener)
|
||||||
|
@ -179,4 +179,4 @@
|
|||||||
#include <musikcore/support/PreferenceKeys.h>
|
#include <musikcore/support/PreferenceKeys.h>
|
||||||
#include <musikcore/support/Preferences.h>
|
#include <musikcore/support/Preferences.h>
|
||||||
#include <musikcore/utfutil.h>
|
#include <musikcore/utfutil.h>
|
||||||
#include <musikcore/version.h>
|
#include <musikcore/sdk/version.h>
|
@ -37,7 +37,7 @@
|
|||||||
#include "PluginFactory.h"
|
#include "PluginFactory.h"
|
||||||
|
|
||||||
#include <musikcore/debug.h>
|
#include <musikcore/debug.h>
|
||||||
#include <musikcore/version.h>
|
#include <musikcore/sdk/version.h>
|
||||||
#include <musikcore/support/Common.h>
|
#include <musikcore/support/Common.h>
|
||||||
#include <musikcore/support/Preferences.h>
|
#include <musikcore/support/Preferences.h>
|
||||||
#include <musikcore/io/DataStreamFactory.h>
|
#include <musikcore/io/DataStreamFactory.h>
|
||||||
@ -353,7 +353,7 @@ static class Environment: public IEnvironment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const char* GetAppVersion() override {
|
const char* GetAppVersion() override {
|
||||||
return VERSION;
|
return MUSIKCUBE_VERSION;
|
||||||
}
|
}
|
||||||
|
|
||||||
} environment;
|
} environment;
|
||||||
|
@ -34,6 +34,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "version.h"
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
|
@ -36,11 +36,12 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#define VERSION_MAJOR 0
|
#define MUSIKCUBE_VERSION_MAJOR 0
|
||||||
#define VERSION_MINOR 99
|
#define MUSIKCUBE_VERSION_MINOR 99
|
||||||
#define VERSION_PATCH 5
|
#define MUSIKCUBE_VERSION_PATCH 5
|
||||||
#define VERSION_COMMIT_HASH "#0ead12be"
|
#define MUSIKCUBE_VERSION "0.99.5"
|
||||||
#define VERSION "0.99.5"
|
#define MUSIKCUBE_VERSION_COMMIT_HASH "#4a823dee"
|
||||||
|
#define MUSIKCUBE_VERSION_WITH_COMMIT_HASH "0.99.5-#4a823dee"
|
||||||
|
|
||||||
namespace musik {
|
namespace musik {
|
||||||
namespace cube {
|
namespace cube {
|
||||||
@ -60,9 +61,9 @@ namespace musik {
|
|||||||
#endif
|
#endif
|
||||||
return
|
return
|
||||||
"musikcube " +
|
"musikcube " +
|
||||||
std::to_string(VERSION_MAJOR) + "." +
|
std::to_string(MUSIKCUBE_VERSION_MAJOR) + "." +
|
||||||
std::to_string(VERSION_MINOR) + "." +
|
std::to_string(MUSIKCUBE_VERSION_MINOR) + "." +
|
||||||
std::to_string(VERSION_PATCH) +
|
std::to_string(MUSIKCUBE_VERSION_PATCH) +
|
||||||
"(" + PLATFORM + ")";
|
"(" + PLATFORM + ")";
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -35,7 +35,7 @@
|
|||||||
#include <stdafx.h>
|
#include <stdafx.h>
|
||||||
#include <app/layout/ConsoleLayout.h>
|
#include <app/layout/ConsoleLayout.h>
|
||||||
#include <musikcore/i18n/Locale.h>
|
#include <musikcore/i18n/Locale.h>
|
||||||
#include <musikcore/version.h>
|
#include <musikcore/sdk/version.h>
|
||||||
#include <cursespp/App.h>
|
#include <cursespp/App.h>
|
||||||
#include <cursespp/Screen.h>
|
#include <cursespp/Screen.h>
|
||||||
#include <cursespp/ToastOverlay.h>
|
#include <cursespp/ToastOverlay.h>
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
#include <musikcore/runtime/Message.h>
|
#include <musikcore/runtime/Message.h>
|
||||||
#include <musikcore/support/Auddio.h>
|
#include <musikcore/support/Auddio.h>
|
||||||
#include <musikcore/library/RemoteLibrary.h>
|
#include <musikcore/library/RemoteLibrary.h>
|
||||||
#include <musikcore/version.h>
|
#include <musikcore/sdk/version.h>
|
||||||
|
|
||||||
#include <app/util/Messages.h>
|
#include <app/util/Messages.h>
|
||||||
#include <app/util/PreferenceKeys.h>
|
#include <app/util/PreferenceKeys.h>
|
||||||
@ -198,7 +198,7 @@ bool MainLayout::KeyPress(const std::string& key) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (key == "M-`") {
|
else if (key == "M-`") {
|
||||||
std::string version = u8fmt("%s %s", VERSION, VERSION_COMMIT_HASH);
|
std::string version = u8fmt("%s %s", MUSIKCUBE_VERSION, MUSIKCUBE_VERSION_COMMIT_HASH);
|
||||||
ToastOverlay::Show(u8fmt(_TSTR("console_version"), version.c_str()), -1);
|
ToastOverlay::Show(u8fmt(_TSTR("console_version"), version.c_str()), -1);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
#include <musikcore/audio/Outputs.h>
|
#include <musikcore/audio/Outputs.h>
|
||||||
#include <musikcore/support/Messages.h>
|
#include <musikcore/support/Messages.h>
|
||||||
#include <musikcore/sdk/ISchema.h>
|
#include <musikcore/sdk/ISchema.h>
|
||||||
#include <musikcore/version.h>
|
#include <musikcore/sdk/version.h>
|
||||||
|
|
||||||
#include <app/util/Hotkeys.h>
|
#include <app/util/Hotkeys.h>
|
||||||
#include <app/util/Messages.h>
|
#include <app/util/Messages.h>
|
||||||
@ -662,7 +662,7 @@ void SettingsLayout::LoadPreferences() {
|
|||||||
piggyStatus = " (..)";
|
piggyStatus = " (..)";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
std::string version = u8fmt("%s %s%s", VERSION, VERSION_COMMIT_HASH, piggyStatus.c_str());
|
std::string version = u8fmt("%s %s%s", MUSIKCUBE_VERSION, MUSIKCUBE_VERSION_COMMIT_HASH, piggyStatus.c_str());
|
||||||
this->appVersion->SetText(u8fmt(_TSTR("console_version"), version.c_str()));
|
this->appVersion->SetText(u8fmt(_TSTR("console_version"), version.c_str()));
|
||||||
|
|
||||||
this->Layout();
|
this->Layout();
|
||||||
|
@ -66,6 +66,7 @@ static const std::string checked = "[x]";
|
|||||||
struct PluginInfo {
|
struct PluginInfo {
|
||||||
IPlugin* plugin;
|
IPlugin* plugin;
|
||||||
std::string fn;
|
std::string fn;
|
||||||
|
std::string version;
|
||||||
bool enabled;
|
bool enabled;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -143,7 +144,7 @@ class PluginListAdapter : public ScrollAdapterBase {
|
|||||||
std::string display =
|
std::string display =
|
||||||
" " +
|
" " +
|
||||||
(info->enabled ? checked : unchecked) + " " +
|
(info->enabled ? checked : unchecked) + " " +
|
||||||
info->plugin->Name() + " (" + info->fn + ")";
|
info->plugin->Name() + " (" + info->fn + ") [v" + info->version + "]";
|
||||||
|
|
||||||
SinglePtr result = SinglePtr(new SingleLineEntry(text::Ellipsize(display, this->GetWidth())));
|
SinglePtr result = SinglePtr(new SingleLineEntry(text::Ellipsize(display, this->GetWidth())));
|
||||||
|
|
||||||
@ -177,6 +178,7 @@ class PluginListAdapter : public ScrollAdapterBase {
|
|||||||
PluginInfoPtr info(new PluginInfo());
|
PluginInfoPtr info(new PluginInfo());
|
||||||
info->plugin = raw;
|
info->plugin = raw;
|
||||||
info->fn = std::fs::path(std::fs::u8path(fn)).filename().u8string();
|
info->fn = std::fs::path(std::fs::u8path(fn)).filename().u8string();
|
||||||
|
info->version = plugin->Version();
|
||||||
info->enabled = prefs->GetBool(info->fn, true);
|
info->enabled = prefs->GetBool(info->fn, true);
|
||||||
plugins.push_back(info);
|
plugins.push_back(info);
|
||||||
});
|
});
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
|
|
||||||
#include <musikcore/runtime/Message.h>
|
#include <musikcore/runtime/Message.h>
|
||||||
#include <musikcore/support/Common.h>
|
#include <musikcore/support/Common.h>
|
||||||
#include <musikcore/version.h>
|
#include <musikcore/sdk/version.h>
|
||||||
|
|
||||||
#include <app/util/Messages.h>
|
#include <app/util/Messages.h>
|
||||||
#include <app/util/PreferenceKeys.h>
|
#include <app/util/PreferenceKeys.h>
|
||||||
@ -88,7 +88,7 @@ static inline std::string formattedVersion(short major, short minor, short patch
|
|||||||
|
|
||||||
static inline std::string getUserAgent() {
|
static inline std::string getUserAgent() {
|
||||||
return u8fmt("musikcube %s (%s)",
|
return u8fmt("musikcube %s (%s)",
|
||||||
formattedVersion(VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH).c_str(),
|
formattedVersion(MUSIKCUBE_VERSION_MAJOR, MUSIKCUBE_VERSION_MINOR, MUSIKCUBE_VERSION_PATCH).c_str(),
|
||||||
PLATFORM.c_str());
|
PLATFORM.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -127,7 +127,7 @@ bool UpdateCheck::Run(Callback callback) {
|
|||||||
this->updateUrl = platform[URL].get<std::string>();
|
this->updateUrl = platform[URL].get<std::string>();
|
||||||
this->latestVersion = formattedVersion(major, minor, patch);
|
this->latestVersion = formattedVersion(major, minor, patch);
|
||||||
|
|
||||||
const int64_t current = versionCode(VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH);
|
const int64_t current = versionCode(MUSIKCUBE_VERSION_MAJOR, MUSIKCUBE_VERSION_MINOR, MUSIKCUBE_VERSION_PATCH);
|
||||||
const int64_t latest = versionCode(major, minor, patch);
|
const int64_t latest = versionCode(major, minor, patch);
|
||||||
needsUpdate = latest > current;
|
needsUpdate = latest > current;
|
||||||
}
|
}
|
||||||
|
@ -203,7 +203,7 @@ asio's streambuf. include it up front so work around this */
|
|||||||
#include <musikcore/support/PreferenceKeys.h>
|
#include <musikcore/support/PreferenceKeys.h>
|
||||||
#include <musikcore/support/Preferences.h>
|
#include <musikcore/support/Preferences.h>
|
||||||
#include <musikcore/utfutil.h>
|
#include <musikcore/utfutil.h>
|
||||||
#include <musikcore/version.h>
|
#include <musikcore/sdk/version.h>
|
||||||
|
|
||||||
#include <cursespp/cursespp/App.h>
|
#include <cursespp/cursespp/App.h>
|
||||||
#include <cursespp/cursespp/AppLayout.h>
|
#include <cursespp/cursespp/AppLayout.h>
|
||||||
|
@ -129,7 +129,7 @@ static void handleCommandLine(int argc, char** argv) {
|
|||||||
stopDaemon();
|
stopDaemon();
|
||||||
}
|
}
|
||||||
else if (command == "--version") {
|
else if (command == "--version") {
|
||||||
std::cout << "\n musikcubed version: " << VERSION << " " << VERSION_COMMIT_HASH << "\n\n";
|
std::cout << "\n musikcubed version: " << MUSIKCUBE_VERSION << " " << MUSIKCUBE_VERSION_COMMIT_HASH << "\n\n";
|
||||||
}
|
}
|
||||||
else if (command == "--running") {
|
else if (command == "--running") {
|
||||||
pid_t pid = getDaemonPid();
|
pid_t pid = getDaemonPid();
|
||||||
|
@ -42,15 +42,15 @@
|
|||||||
|
|
||||||
class AlsaPlugin : public musik::core::sdk::IPlugin {
|
class AlsaPlugin : public musik::core::sdk::IPlugin {
|
||||||
public:
|
public:
|
||||||
virtual void Release() override { delete this; }
|
void Release() override { delete this; }
|
||||||
virtual const char* Name() override { return "AlsaOut IOutput"; }
|
const char* Name() override { return "AlsaOut IOutput"; }
|
||||||
virtual const char* Version() override { return "0.5.0"; }
|
const char* Version() override { return MUSIKCUBE_VERSION_WITH_COMMIT_HASH; }
|
||||||
virtual const char* Author() override { return "Julian Cromarty, clangen"; }
|
const char* Author() override { return "Julian Cromarty, clangen"; }
|
||||||
virtual const char* Guid() override { return "668a75e6-1816-4c75-a361-a9d48906f23f"; }
|
const char* Guid() override { return "668a75e6-1816-4c75-a361-a9d48906f23f"; }
|
||||||
virtual bool Configurable() override { return false; }
|
bool Configurable() override { return false; }
|
||||||
virtual void Configure() override { }
|
void Configure() override { }
|
||||||
virtual void Reload() override { }
|
void Reload() override { }
|
||||||
virtual int SdkVersion() override { return musik::core::sdk::SdkVersion; }
|
int SdkVersion() override { return musik::core::sdk::SdkVersion; }
|
||||||
};
|
};
|
||||||
|
|
||||||
extern "C" musik::core::sdk::IPlugin* GetPlugin() {
|
extern "C" musik::core::sdk::IPlugin* GetPlugin() {
|
||||||
|
@ -52,7 +52,7 @@ BOOL APIENTRY DllMain(HMODULE module, DWORD reason, LPVOID reserved) {
|
|||||||
class CddaDecoderPlugin : public musik::core::sdk::IPlugin {
|
class CddaDecoderPlugin : public musik::core::sdk::IPlugin {
|
||||||
void Release() noexcept override { delete this; };
|
void Release() noexcept override { delete this; };
|
||||||
const char* Name() override { return PLUGIN_NAME; }
|
const char* Name() override { return PLUGIN_NAME; }
|
||||||
const char* Version() override { return "0.5.0"; }
|
const char* Version() override { return MUSIKCUBE_VERSION_WITH_COMMIT_HASH; }
|
||||||
const char* Author() override { return "Björn Olievier, clangen"; }
|
const char* Author() override { return "Björn Olievier, clangen"; }
|
||||||
const char* Guid() override { return "0862b76d-67cd-4e54-b5d1-6a2c8e5101a4"; }
|
const char* Guid() override { return "0862b76d-67cd-4e54-b5d1-6a2c8e5101a4"; }
|
||||||
bool Configurable() noexcept override { return false; }
|
bool Configurable() noexcept override { return false; }
|
||||||
|
@ -40,15 +40,15 @@
|
|||||||
|
|
||||||
class CoreAudioPlugin : public musik::core::sdk::IPlugin {
|
class CoreAudioPlugin : public musik::core::sdk::IPlugin {
|
||||||
public:
|
public:
|
||||||
virtual void Release() override { delete this; }
|
void Release() override { delete this; }
|
||||||
virtual const char* Name() override { return "CoreAudio IOutput"; }
|
const char* Name() override { return "CoreAudio IOutput"; }
|
||||||
virtual const char* Version() override { return "0.5.0"; }
|
const char* Version() override { return MUSIKCUBE_VERSION_WITH_COMMIT_HASH; }
|
||||||
virtual const char* Author() override { return "clangen"; }
|
const char* Author() override { return "clangen"; }
|
||||||
virtual const char* Guid() override { return "7277a19f-a5f7-4123-ac2d-c36273097b72"; }
|
const char* Guid() override { return "7277a19f-a5f7-4123-ac2d-c36273097b72"; }
|
||||||
virtual bool Configurable() override { return false; }
|
bool Configurable() override { return false; }
|
||||||
virtual void Configure() override { }
|
void Configure() override { }
|
||||||
virtual void Reload() override { }
|
void Reload() override { }
|
||||||
virtual int SdkVersion() override { return musik::core::sdk::SdkVersion; }
|
int SdkVersion() override { return musik::core::sdk::SdkVersion; }
|
||||||
};
|
};
|
||||||
|
|
||||||
extern "C" musik::core::sdk::IPlugin* GetPlugin() {
|
extern "C" musik::core::sdk::IPlugin* GetPlugin() {
|
||||||
|
@ -39,15 +39,15 @@
|
|||||||
|
|
||||||
class DirectSoundPlugin : public musik::core::sdk::IPlugin {
|
class DirectSoundPlugin : public musik::core::sdk::IPlugin {
|
||||||
public:
|
public:
|
||||||
virtual void Release() { delete this; }
|
void Release() override { delete this; }
|
||||||
virtual const char* Name() { return "DirectSound IOutput"; };
|
const char* Name() override { return "DirectSound IOutput"; };
|
||||||
virtual const char* Version() { return "0.5.0"; }
|
const char* Version() override { return MUSIKCUBE_VERSION_WITH_COMMIT_HASH; }
|
||||||
virtual const char* Author() { return "clangen"; };
|
const char* Author() override { return "clangen"; };
|
||||||
virtual const char* Guid() { return "731ad687-c52d-47b0-90b4-5483399640b5"; }
|
const char* Guid() override { return "731ad687-c52d-47b0-90b4-5483399640b5"; }
|
||||||
virtual bool Configurable() { return false; }
|
bool Configurable() override { return false; }
|
||||||
virtual void Configure() { }
|
void Configure() override { }
|
||||||
virtual void Reload() { }
|
void Reload() override { }
|
||||||
virtual int SdkVersion() { return musik::core::sdk::SdkVersion; }
|
int SdkVersion() override { return musik::core::sdk::SdkVersion; }
|
||||||
};
|
};
|
||||||
|
|
||||||
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) {
|
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) {
|
||||||
|
@ -67,15 +67,15 @@ extern "C" {
|
|||||||
class FfmpegPlugin : public musik::core::sdk::IPlugin {
|
class FfmpegPlugin : public musik::core::sdk::IPlugin {
|
||||||
public:
|
public:
|
||||||
FfmpegPlugin() { }
|
FfmpegPlugin() { }
|
||||||
virtual void Release() { };
|
void Release() override { };
|
||||||
virtual const char* Name() { return "ffmpeg IDecoder"; }
|
const char* Name() override { return "ffmpeg IDecoder"; }
|
||||||
virtual const char* Version() { return "0.7.0"; }
|
const char* Version() override { return MUSIKCUBE_VERSION_WITH_COMMIT_HASH; }
|
||||||
virtual const char* Author() { return "clangen"; }
|
const char* Author() override { return "clangen"; }
|
||||||
virtual const char* Guid() { return "f993ec34-ab43-4c6a-9a0a-6462b4ae1a1c"; }
|
const char* Guid() override { return "f993ec34-ab43-4c6a-9a0a-6462b4ae1a1c"; }
|
||||||
virtual bool Configurable() { return false; }
|
bool Configurable() override { return false; }
|
||||||
virtual void Configure() { }
|
void Configure() override { }
|
||||||
virtual void Reload() { }
|
void Reload() override { }
|
||||||
virtual int SdkVersion() { return musik::core::sdk::SdkVersion; }
|
int SdkVersion() override { return musik::core::sdk::SdkVersion; }
|
||||||
} plugin;
|
} plugin;
|
||||||
|
|
||||||
class FfmpegDecoderFactory : public musik::core::sdk::IDecoderFactory {
|
class FfmpegDecoderFactory : public musik::core::sdk::IDecoderFactory {
|
||||||
@ -128,14 +128,14 @@ class FfmpegDecoderFactory : public musik::core::sdk::IDecoderFactory {
|
|||||||
~FfmpegDecoderFactory() {
|
~FfmpegDecoderFactory() {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void Release() {
|
void Release() override {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual musik::core::sdk::IDecoder* CreateDecoder() {
|
musik::core::sdk::IDecoder* CreateDecoder() override {
|
||||||
return new FfmpegDecoder();
|
return new FfmpegDecoder();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool CanHandle(const char* type) const {
|
bool CanHandle(const char* type) const override {
|
||||||
std::string str(type);
|
std::string str(type);
|
||||||
std::transform(str.begin(), str.end(), str.begin(), tolower);
|
std::transform(str.begin(), str.end(), str.begin(), tolower);
|
||||||
|
|
||||||
|
@ -59,28 +59,28 @@ IPreferences* prefs = nullptr;
|
|||||||
|
|
||||||
class GmePlugin: public IPlugin {
|
class GmePlugin: public IPlugin {
|
||||||
public:
|
public:
|
||||||
virtual void Release() { delete this; };
|
void Release() override { delete this; };
|
||||||
virtual const char* Name() { return PLUGIN_NAME; }
|
const char* Name() override { return PLUGIN_NAME; }
|
||||||
virtual const char* Version() { return "0.1.0"; }
|
const char* Version() override { return MUSIKCUBE_VERSION_WITH_COMMIT_HASH; }
|
||||||
virtual const char* Author() { return "clangen"; }
|
const char* Author() override { return "clangen"; }
|
||||||
virtual const char* Guid() { return "2c4eee19-6585-4984-a631-b52ff7d6d564"; }
|
const char* Guid() override { return "2c4eee19-6585-4984-a631-b52ff7d6d564"; }
|
||||||
virtual bool Configurable() { return false; }
|
bool Configurable() override { return false; }
|
||||||
virtual void Configure() { }
|
void Configure() override { }
|
||||||
virtual void Reload() { }
|
void Reload() override { }
|
||||||
virtual int SdkVersion() { return musik::core::sdk::SdkVersion; }
|
int SdkVersion() override { return musik::core::sdk::SdkVersion; }
|
||||||
};
|
};
|
||||||
|
|
||||||
class GmeDecoderFactory: public IDecoderFactory {
|
class GmeDecoderFactory: public IDecoderFactory {
|
||||||
public:
|
public:
|
||||||
virtual IDecoder* CreateDecoder() override {
|
IDecoder* CreateDecoder() override {
|
||||||
return new GmeDecoder();
|
return new GmeDecoder();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void Release() override {
|
void Release() override {
|
||||||
delete this;
|
delete this;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool CanHandle(const char* type) const override {
|
bool CanHandle(const char* type) const override {
|
||||||
return canHandle(std::string(type));
|
return canHandle(std::string(type));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -89,12 +89,12 @@ class GmeDataStreamFactory: public IDataStreamFactory{
|
|||||||
public:
|
public:
|
||||||
using OpenFlags = musik::core::sdk::OpenFlags;
|
using OpenFlags = musik::core::sdk::OpenFlags;
|
||||||
|
|
||||||
virtual bool CanRead(const char *uri) override {
|
bool CanRead(const char *uri) override {
|
||||||
std::string str = uri;
|
std::string str = uri;
|
||||||
return str.find("gme://") == 0 && canHandle(str);
|
return str.find("gme://") == 0 && canHandle(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual IDataStream* Open(const char *uri, OpenFlags flags) override {
|
IDataStream* Open(const char *uri, OpenFlags flags) override {
|
||||||
auto result = new GmeDataStream();
|
auto result = new GmeDataStream();
|
||||||
if (result->Open(uri, flags)) {
|
if (result->Open(uri, flags)) {
|
||||||
return result;
|
return result;
|
||||||
@ -103,7 +103,7 @@ class GmeDataStreamFactory: public IDataStreamFactory{
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void Release() override {
|
void Release() override {
|
||||||
delete this;
|
delete this;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -51,15 +51,15 @@
|
|||||||
|
|
||||||
static class HttpDataStreamPlugin : public musik::core::sdk::IPlugin {
|
static class HttpDataStreamPlugin : public musik::core::sdk::IPlugin {
|
||||||
public:
|
public:
|
||||||
virtual void Release() { };
|
void Release() override { };
|
||||||
virtual const char* Name() { return "HTTP IDataStream"; }
|
const char* Name() override { return "HTTP IDataStream"; }
|
||||||
virtual const char* Version() { return "0.1.0"; }
|
const char* Version() override { return MUSIKCUBE_VERSION_WITH_COMMIT_HASH; }
|
||||||
virtual const char* Author() { return "clangen"; }
|
const char* Author() override { return "clangen"; }
|
||||||
virtual const char* Guid() { return "b153adad-ee98-4331-ad32-4ff7f34828cd"; }
|
const char* Guid() override { return "b153adad-ee98-4331-ad32-4ff7f34828cd"; }
|
||||||
virtual bool Configurable() { return false; }
|
bool Configurable() override { return false; }
|
||||||
virtual void Configure() { }
|
void Configure() override { }
|
||||||
virtual void Reload() { }
|
void Reload() override { }
|
||||||
virtual int SdkVersion() { return musik::core::sdk::SdkVersion; }
|
int SdkVersion() override { return musik::core::sdk::SdkVersion; }
|
||||||
} plugin;
|
} plugin;
|
||||||
|
|
||||||
extern "C" DLLEXPORT IPlugin* GetPlugin() {
|
extern "C" DLLEXPORT IPlugin* GetPlugin() {
|
||||||
|
@ -64,28 +64,28 @@ IPreferences* prefs = nullptr;
|
|||||||
|
|
||||||
class OpenMptPlugin: public IPlugin {
|
class OpenMptPlugin: public IPlugin {
|
||||||
public:
|
public:
|
||||||
virtual void Release() { delete this; };
|
void Release() override { delete this; };
|
||||||
virtual const char* Name() { return "libopenmpt IDecoder"; }
|
const char* Name() override { return "libopenmpt IDecoder"; }
|
||||||
virtual const char* Version() { return "0.1.0"; }
|
const char* Version() override { return MUSIKCUBE_VERSION_WITH_COMMIT_HASH; }
|
||||||
virtual const char* Author() { return "clangen"; }
|
const char* Author() override { return "clangen"; }
|
||||||
virtual const char* Guid() { return "c367f42f-389a-4378-966c-1f96dad6a66a"; }
|
const char* Guid() override { return "c367f42f-389a-4378-966c-1f96dad6a66a"; }
|
||||||
virtual bool Configurable() { return false; }
|
bool Configurable() override { return false; }
|
||||||
virtual void Configure() { }
|
void Configure() override { }
|
||||||
virtual void Reload() { }
|
void Reload() override { }
|
||||||
virtual int SdkVersion() { return musik::core::sdk::SdkVersion; }
|
int SdkVersion() override { return musik::core::sdk::SdkVersion; }
|
||||||
};
|
};
|
||||||
|
|
||||||
class OpenMptDecoderFactory: public IDecoderFactory {
|
class OpenMptDecoderFactory: public IDecoderFactory {
|
||||||
public:
|
public:
|
||||||
virtual IDecoder* CreateDecoder() override {
|
IDecoder* CreateDecoder() override {
|
||||||
return new OpenMptDecoder();
|
return new OpenMptDecoder();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void Release() override {
|
void Release() override {
|
||||||
delete this;
|
delete this;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool CanHandle(const char* type) const override {
|
bool CanHandle(const char* type) const override {
|
||||||
return isFileTypeSupported(type);
|
return isFileTypeSupported(type);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -94,7 +94,7 @@ class OpenMptDataStreamFactory : public IDataStreamFactory {
|
|||||||
public:
|
public:
|
||||||
using OpenFlags = musik::core::sdk::OpenFlags;
|
using OpenFlags = musik::core::sdk::OpenFlags;
|
||||||
|
|
||||||
virtual bool CanRead(const char *uri) override {
|
bool CanRead(const char *uri) override {
|
||||||
std::string fn;
|
std::string fn;
|
||||||
int track;
|
int track;
|
||||||
if (indexer::parseExternalId(EXTERNAL_ID_PREFIX, std::string(uri), fn, track)) {
|
if (indexer::parseExternalId(EXTERNAL_ID_PREFIX, std::string(uri), fn, track)) {
|
||||||
@ -105,7 +105,7 @@ class OpenMptDataStreamFactory : public IDataStreamFactory {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual IDataStream* Open(const char *uri, OpenFlags flags) override {
|
IDataStream* Open(const char *uri, OpenFlags flags) override {
|
||||||
auto result = new OpenMptDataStream();
|
auto result = new OpenMptDataStream();
|
||||||
if (result->Open(uri, flags)) {
|
if (result->Open(uri, flags)) {
|
||||||
return result;
|
return result;
|
||||||
@ -114,7 +114,7 @@ class OpenMptDataStreamFactory : public IDataStreamFactory {
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void Release() override {
|
void Release() override {
|
||||||
delete this;
|
delete this;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -60,15 +60,15 @@ struct IKeyProcessor {
|
|||||||
|
|
||||||
static class Plugin: public IPlugin {
|
static class Plugin: public IPlugin {
|
||||||
public:
|
public:
|
||||||
virtual void Release() override { }
|
void Release() override { }
|
||||||
virtual const char* Name() override { return "MediaKeys IPlaybackRemote"; }
|
const char* Name() override { return "MediaKeys IPlaybackRemote"; }
|
||||||
virtual const char* Version() override { return "0.1.0"; }
|
const char* Version() override { return MUSIKCUBE_VERSION_WITH_COMMIT_HASH; }
|
||||||
virtual const char* Author() override { return "clangen"; }
|
const char* Author() override { return "clangen"; }
|
||||||
virtual const char* Guid() override { return "e850a2eb-5aaa-4322-b63e-bf1c1593805b"; }
|
const char* Guid() override { return "e850a2eb-5aaa-4322-b63e-bf1c1593805b"; }
|
||||||
virtual bool Configurable() override { return false; }
|
bool Configurable() override { return false; }
|
||||||
virtual void Configure() override { }
|
void Configure() override { }
|
||||||
virtual void Reload() override { }
|
void Reload() override { }
|
||||||
virtual int SdkVersion() override { return musik::core::sdk::SdkVersion; }
|
int SdkVersion() override { return musik::core::sdk::SdkVersion; }
|
||||||
} plugin;
|
} plugin;
|
||||||
|
|
||||||
class PlaybackRemote: public IPlaybackRemote, IKeyProcessor {
|
class PlaybackRemote: public IPlaybackRemote, IKeyProcessor {
|
||||||
@ -85,7 +85,7 @@ class PlaybackRemote: public IPlaybackRemote, IKeyProcessor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void Release() override {
|
void Release() override {
|
||||||
this->Unregister();
|
this->Unregister();
|
||||||
delete this;
|
delete this;
|
||||||
}
|
}
|
||||||
@ -99,12 +99,12 @@ class PlaybackRemote: public IPlaybackRemote, IKeyProcessor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void SetPlaybackService(IPlaybackService* playback) override {
|
void SetPlaybackService(IPlaybackService* playback) override {
|
||||||
std::unique_lock<decltype(mutex)> lock(mutex);
|
std::unique_lock<decltype(mutex)> lock(mutex);
|
||||||
this->playback = playback;
|
this->playback = playback;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void ProcessKeyCode(int keyCode) override {
|
void ProcessKeyCode(int keyCode) override {
|
||||||
std::unique_lock<decltype(mutex)> lock(mutex);
|
std::unique_lock<decltype(mutex)> lock(mutex);
|
||||||
if (this->playback) {
|
if (this->playback) {
|
||||||
switch (keyCode) {
|
switch (keyCode) {
|
||||||
@ -131,12 +131,12 @@ class PlaybackRemote: public IPlaybackRemote, IKeyProcessor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void OnTrackChanged(ITrack* track) override { }
|
void OnTrackChanged(ITrack* track) override { }
|
||||||
virtual void OnPlaybackStateChanged(PlaybackState state) override { }
|
void OnPlaybackStateChanged(PlaybackState state) override { }
|
||||||
virtual void OnPlaybackTimeChanged(double time) override { }
|
void OnPlaybackTimeChanged(double time) override { }
|
||||||
virtual void OnVolumeChanged(double volume) override { }
|
void OnVolumeChanged(double volume) override { }
|
||||||
virtual void OnModeChanged(RepeatMode repeatMode, bool shuffled) override { }
|
void OnModeChanged(RepeatMode repeatMode, bool shuffled) override { }
|
||||||
virtual void OnPlayQueueChanged() override { }
|
void OnPlayQueueChanged() override { }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::mutex mutex;
|
std::mutex mutex;
|
||||||
|
@ -35,16 +35,16 @@ static std::string GetThumbnailPath(ITrack* track)
|
|||||||
|
|
||||||
static class MPRISPlugin : public IPlugin {
|
static class MPRISPlugin : public IPlugin {
|
||||||
public:
|
public:
|
||||||
MPRISPlugin() { }
|
MPRISPlugin() override { }
|
||||||
void Release() { }
|
void Release() override { }
|
||||||
const char* Name() { return "MPRIS interface"; }
|
const char* Name() override { return "MPRIS interface"; }
|
||||||
const char* Version() { return "0.1.0"; }
|
const char* Version() override { return MUSIKCUBE_VERSION_WITH_COMMIT_HASH; }
|
||||||
const char* Author() { return "brunosmmm"; }
|
const char* Author() override { return "brunosmmm"; }
|
||||||
const char* Guid() { return "457df67f-f489-415f-975e-282f470b1c10"; }
|
const char* Guid() override { return "457df67f-f489-415f-975e-282f470b1c10"; }
|
||||||
bool Configurable() { return false; }
|
bool Configurable() override { return false; }
|
||||||
void Configure() { }
|
void Configure() override { }
|
||||||
void Reload() { }
|
void Reload() override { }
|
||||||
int SdkVersion() { return musik::core::sdk::SdkVersion; }
|
int SdkVersion() override { return musik::core::sdk::SdkVersion; }
|
||||||
} plugin;
|
} plugin;
|
||||||
|
|
||||||
extern "C" void SetEnvironment(IEnvironment* environment) {
|
extern "C" void SetEnvironment(IEnvironment* environment) {
|
||||||
|
@ -43,7 +43,7 @@ class NullPlugin : public musik::core::sdk::IPlugin {
|
|||||||
public:
|
public:
|
||||||
void Release() noexcept override { delete this; }
|
void Release() noexcept override { delete this; }
|
||||||
const char* Name() override { return "Null IOutput"; }
|
const char* Name() override { return "Null IOutput"; }
|
||||||
const char* Version() override { return "0.2.0"; }
|
const char* Version() override { return MUSIKCUBE_VERSION_WITH_COMMIT_HASH; }
|
||||||
const char* Author() override { return "clangen"; }
|
const char* Author() override { return "clangen"; }
|
||||||
const char* Guid() override { return "0d45a986-24f1-4253-9fc2-b432353a1eea"; }
|
const char* Guid() override { return "0d45a986-24f1-4253-9fc2-b432353a1eea"; }
|
||||||
bool Configurable() override { return false; }
|
bool Configurable() override { return false; }
|
||||||
|
@ -43,7 +43,7 @@ class PipeWirePlugin : public musik::core::sdk::IPlugin {
|
|||||||
public:
|
public:
|
||||||
void Release() noexcept override { delete this; }
|
void Release() noexcept override { delete this; }
|
||||||
const char* Name() override { return "PipeWire IOutput"; }
|
const char* Name() override { return "PipeWire IOutput"; }
|
||||||
const char* Version() override { return "0.1.0"; }
|
const char* Version() override { return MUSIKCUBE_VERSION_WITH_COMMIT_HASH; }
|
||||||
const char* Author() override { return "clangen"; }
|
const char* Author() override { return "clangen"; }
|
||||||
const char* Guid() override { return "ab79e0f2-53d8-4774-ad00-266a30c50427"; }
|
const char* Guid() override { return "ab79e0f2-53d8-4774-ad00-266a30c50427"; }
|
||||||
bool Configurable() override { return false; }
|
bool Configurable() override { return false; }
|
||||||
|
@ -43,7 +43,7 @@ class PortAudioPlugin : public musik::core::sdk::IPlugin {
|
|||||||
public:
|
public:
|
||||||
void Release() noexcept override { delete this; }
|
void Release() noexcept override { delete this; }
|
||||||
const char* Name() override { return "PortAudio IOutput"; }
|
const char* Name() override { return "PortAudio IOutput"; }
|
||||||
const char* Version() override { return "0.1.0"; }
|
const char* Version() override { return MUSIKCUBE_VERSION_WITH_COMMIT_HASH; }
|
||||||
const char* Author() override { return "clangen"; }
|
const char* Author() override { return "clangen"; }
|
||||||
const char* Guid() override { return "521934a5-2263-41a4-9852-937d0b63f196"; }
|
const char* Guid() override { return "521934a5-2263-41a4-9852-937d0b63f196"; }
|
||||||
bool Configurable() override { return false; }
|
bool Configurable() override { return false; }
|
||||||
|
@ -42,15 +42,15 @@
|
|||||||
|
|
||||||
class PulsePlugin : public musik::core::sdk::IPlugin {
|
class PulsePlugin : public musik::core::sdk::IPlugin {
|
||||||
public:
|
public:
|
||||||
virtual void Release() override { delete this; }
|
void Release() override { delete this; }
|
||||||
virtual const char* Name() override { return "PulseAudio IOutput"; }
|
const char* Name() override { return "PulseAudio IOutput"; }
|
||||||
virtual const char* Version() override { return "0.5.0"; }
|
const char* Version() override { return MUSIKCUBE_VERSION_WITH_COMMIT_HASH; }
|
||||||
virtual const char* Author() override { return "clangen"; }
|
const char* Author() override { return "clangen"; }
|
||||||
virtual const char* Guid() override { return "67c7e90b-5123-41c0-b03a-838ecd6cb8b5"; }
|
const char* Guid() override { return "67c7e90b-5123-41c0-b03a-838ecd6cb8b5"; }
|
||||||
virtual bool Configurable() override { return false; }
|
bool Configurable() override { return false; }
|
||||||
virtual void Configure() override { }
|
void Configure() override { }
|
||||||
virtual void Reload() override { }
|
void Reload() override { }
|
||||||
virtual int SdkVersion() override { return musik::core::sdk::SdkVersion; }
|
int SdkVersion() override { return musik::core::sdk::SdkVersion; }
|
||||||
};
|
};
|
||||||
|
|
||||||
extern "C" musik::core::sdk::IPlugin* GetPlugin() {
|
extern "C" musik::core::sdk::IPlugin* GetPlugin() {
|
||||||
|
@ -151,7 +151,7 @@ static class Plugin : public IPlugin {
|
|||||||
public:
|
public:
|
||||||
virtual void Release() { }
|
virtual void Release() { }
|
||||||
virtual const char* Name() { return "musikcube Server (wss, http)"; }
|
virtual const char* Name() { return "musikcube Server (wss, http)"; }
|
||||||
virtual const char* Version() { return "0.7.0"; }
|
virtual const char* Version() { return MUSIKCUBE_VERSION_WITH_COMMIT_HASH; }
|
||||||
virtual const char* Author() { return "clangen"; }
|
virtual const char* Author() { return "clangen"; }
|
||||||
virtual const char* Guid() { return "9fc897a3-dfd5-4524-a0fc-b02f46aea4a9"; }
|
virtual const char* Guid() { return "9fc897a3-dfd5-4524-a0fc-b02f46aea4a9"; }
|
||||||
virtual bool Configurable() { return false; }
|
virtual bool Configurable() { return false; }
|
||||||
|
@ -38,15 +38,15 @@
|
|||||||
|
|
||||||
class SndioPlugin : public musik::core::sdk::IPlugin {
|
class SndioPlugin : public musik::core::sdk::IPlugin {
|
||||||
public:
|
public:
|
||||||
virtual void Release() { delete this; }
|
void Release() override { delete this; }
|
||||||
virtual const char* Name() { return "Sndio IOutput"; }
|
const char* Name() override { return "Sndio IOutput"; }
|
||||||
virtual const char* Version() { return "0.1.0"; }
|
const char* Version() override { return MUSIKCUBE_VERSION_WITH_COMMIT_HASH; }
|
||||||
virtual const char* Author() { return "clangen"; }
|
const char* Author() override { return "clangen"; }
|
||||||
virtual const char* Guid() { return "13903ab8-b387-4de9-86e3-14ba22057dcd"; }
|
const char* Guid() override { return "13903ab8-b387-4de9-86e3-14ba22057dcd"; }
|
||||||
virtual bool Configurable() { return false; }
|
bool Configurable() override { return false; }
|
||||||
virtual void Configure() { }
|
void Configure() override { }
|
||||||
virtual void Reload() { }
|
void Reload() override { }
|
||||||
virtual int SdkVersion() { return musik::core::sdk::SdkVersion; }
|
int SdkVersion() override { return musik::core::sdk::SdkVersion; }
|
||||||
};
|
};
|
||||||
|
|
||||||
extern "C" musik::core::sdk::IPlugin* GetPlugin() {
|
extern "C" musik::core::sdk::IPlugin* GetPlugin() {
|
||||||
|
@ -80,18 +80,16 @@ static std::set<std::string> supportedFormats = {
|
|||||||
|
|
||||||
static class Plugin : public IPlugin {
|
static class Plugin : public IPlugin {
|
||||||
public:
|
public:
|
||||||
Plugin() {
|
Plugin() { }
|
||||||
}
|
void Release() override { }
|
||||||
|
const char* Name() override { return "Stock Encoders (lame + ffmpeg)"; }
|
||||||
virtual void Release() { }
|
const char* Version() override { return MUSIKCUBE_VERSION_WITH_COMMIT_HASH; }
|
||||||
virtual const char* Name() { return "Stock Encoders (lame + ffmpeg)"; }
|
const char* Author() override { return "clangen"; }
|
||||||
virtual const char* Version() { return "0.7.0"; }
|
const char* Guid() override { return "d4d13803-a285-4481-ad1e-106131e0d523"; }
|
||||||
virtual const char* Author() { return "clangen"; }
|
bool Configurable() override { return false; }
|
||||||
virtual const char* Guid() { return "d4d13803-a285-4481-ad1e-106131e0d523"; }
|
void Configure() override { }
|
||||||
virtual bool Configurable() { return false; }
|
void Reload() override { }
|
||||||
virtual void Configure() { }
|
int SdkVersion() override { return musik::core::sdk::SdkVersion; }
|
||||||
virtual void Reload() { }
|
|
||||||
virtual int SdkVersion() { return musik::core::sdk::SdkVersion; }
|
|
||||||
} plugin;
|
} plugin;
|
||||||
|
|
||||||
static class EncoderFactory: public IEncoderFactory {
|
static class EncoderFactory: public IEncoderFactory {
|
||||||
@ -102,10 +100,10 @@ static class EncoderFactory: public IEncoderFactory {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void Release() override {
|
void Release() override {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual IEncoder* CreateEncoder(const char* type) override {
|
IEncoder* CreateEncoder(const char* type) override {
|
||||||
auto lowerType = toLower(type);
|
auto lowerType = toLower(type);
|
||||||
if (isMp3(lowerType)) {
|
if (isMp3(lowerType)) {
|
||||||
return new LameEncoder();
|
return new LameEncoder();
|
||||||
@ -116,7 +114,7 @@ static class EncoderFactory: public IEncoderFactory {
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool CanHandle(const char* type) const override {
|
bool CanHandle(const char* type) const override {
|
||||||
return supportedFormats.find(toLower(type)) != supportedFormats.end();
|
return supportedFormats.find(toLower(type)) != supportedFormats.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,15 +41,15 @@
|
|||||||
|
|
||||||
class SuperEqPlugin : public musik::core::sdk::IPlugin {
|
class SuperEqPlugin : public musik::core::sdk::IPlugin {
|
||||||
public:
|
public:
|
||||||
virtual void Release() { delete this; }
|
void Release() override { delete this; }
|
||||||
virtual const char* Name() { return "SuperEq IDSP"; }
|
const char* Name() override { return "SuperEq IDSP"; }
|
||||||
virtual const char* Version() { return "0.1.0"; }
|
const char* Version() override { return MUSIKCUBE_VERSION_WITH_COMMIT_HASH; }
|
||||||
virtual const char* Author() { return "Naoki Shibata, Alexey Yakovenko, clangen"; }
|
const char* Author() override { return "Naoki Shibata, Alexey Yakovenko, clangen"; }
|
||||||
virtual const char* Guid() { return "6f0ed53b-0f13-4220-9b0a-ca496b6421cc"; }
|
const char* Guid() override { return "6f0ed53b-0f13-4220-9b0a-ca496b6421cc"; }
|
||||||
virtual bool Configurable() { return false; }
|
bool Configurable() override { return false; }
|
||||||
virtual void Configure() { }
|
void Configure() override { }
|
||||||
virtual void Reload() { SuperEqDsp::NotifyChanged(); }
|
void Reload() override { SuperEqDsp::NotifyChanged(); }
|
||||||
virtual int SdkVersion() { return musik::core::sdk::SdkVersion; }
|
int SdkVersion() override { return musik::core::sdk::SdkVersion; }
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
|
@ -51,15 +51,15 @@
|
|||||||
|
|
||||||
class TaglibPlugin : public musik::core::sdk::IPlugin {
|
class TaglibPlugin : public musik::core::sdk::IPlugin {
|
||||||
public:
|
public:
|
||||||
virtual void Release() { delete this; }
|
void Release() override { delete this; }
|
||||||
virtual const char* Name() { return "Taglib 1.11 ITagReader (+ffmpeg)"; }
|
const char* Name() override { return "Taglib 1.11 ITagReader (+ffmpeg)"; }
|
||||||
virtual const char* Version() { return "0.6.0"; }
|
const char* Version() override { return MUSIKCUBE_VERSION_WITH_COMMIT_HASH; }
|
||||||
virtual const char* Author() { return "Daniel Önnerby, clangen"; }
|
const char* Author() override { return "Daniel Önnerby, clangen"; }
|
||||||
virtual const char* Guid() { return "c77ea7a4-5d57-4f17-8521-aba8eeadeda7"; }
|
const char* Guid() override { return "c77ea7a4-5d57-4f17-8521-aba8eeadeda7"; }
|
||||||
virtual bool Configurable() { return false; }
|
bool Configurable() override { return false; }
|
||||||
virtual void Configure() { }
|
void Configure() override { }
|
||||||
virtual void Reload() { }
|
void Reload() override { }
|
||||||
virtual int SdkVersion() { return musik::core::sdk::SdkVersion; }
|
int SdkVersion() override { return musik::core::sdk::SdkVersion; }
|
||||||
};
|
};
|
||||||
|
|
||||||
extern "C" DLLEXPORT musik::core::sdk::ITagReader* GetTagReader() {
|
extern "C" DLLEXPORT musik::core::sdk::ITagReader* GetTagReader() {
|
||||||
|
@ -40,15 +40,15 @@
|
|||||||
|
|
||||||
class WasapiPlugin : public musik::core::sdk::IPlugin {
|
class WasapiPlugin : public musik::core::sdk::IPlugin {
|
||||||
public:
|
public:
|
||||||
virtual void Release() { delete this; }
|
void Release() override { delete this; }
|
||||||
virtual const char* Name() { return "Wasapi IOutput"; }
|
const char* Name() override { return "Wasapi IOutput"; }
|
||||||
virtual const char* Version() { return "0.5.0"; }
|
const char* Version() override { return MUSIKCUBE_VERSION_WITH_COMMIT_HASH; }
|
||||||
virtual const char* Author() { return "clangen"; }
|
const char* Author() override { return "clangen"; }
|
||||||
virtual const char* Guid() { return "871cb3c2-0002-49cd-9410-5207cb3cfd4a"; }
|
const char* Guid() override { return "871cb3c2-0002-49cd-9410-5207cb3cfd4a"; }
|
||||||
virtual bool Configurable() { return false; }
|
bool Configurable() override { return false; }
|
||||||
virtual void Configure() { }
|
void Configure() override { }
|
||||||
virtual void Reload() { }
|
void Reload() override { }
|
||||||
virtual int SdkVersion() { return musik::core::sdk::SdkVersion; }
|
int SdkVersion() override { return musik::core::sdk::SdkVersion; }
|
||||||
};
|
};
|
||||||
|
|
||||||
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) {
|
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) {
|
||||||
|
@ -39,15 +39,15 @@
|
|||||||
|
|
||||||
class WaveOutPlugin : public musik::core::sdk::IPlugin {
|
class WaveOutPlugin : public musik::core::sdk::IPlugin {
|
||||||
public:
|
public:
|
||||||
virtual void Release() { delete this; }
|
void Release() override { delete this; }
|
||||||
virtual const char* Name() { return "WaveOut IOutput"; }
|
const char* Name() override { return "WaveOut IOutput"; }
|
||||||
virtual const char* Version() { return "0.7.0"; }
|
const char* Version() override { return MUSIKCUBE_VERSION_WITH_COMMIT_HASH; }
|
||||||
virtual const char* Author() { return "Bj\xC3\xB6rn Olievier, clangen"; }
|
const char* Author() override { return "Bj\xC3\xB6rn Olievier, clangen"; }
|
||||||
virtual const char* Guid() { return "bec5bf30-0208-4db0-af0a-2722d9de8421"; }
|
const char* Guid() override { return "bec5bf30-0208-4db0-af0a-2722d9de8421"; }
|
||||||
virtual bool Configurable() { return false; }
|
bool Configurable() override { return false; }
|
||||||
virtual void Configure() { }
|
void Configure() override { }
|
||||||
virtual void Reload() { }
|
void Reload() override { }
|
||||||
virtual int SdkVersion() { return musik::core::sdk::SdkVersion; }
|
int SdkVersion() override { return musik::core::sdk::SdkVersion; }
|
||||||
};
|
};
|
||||||
|
|
||||||
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) {
|
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) {
|
||||||
|
@ -203,29 +203,29 @@ BOOL APIENTRY DllMain(HMODULE hModule, DWORD reason, LPVOID lpReserved) {
|
|||||||
|
|
||||||
class VisualizerPlugin : public musik::core::sdk::IPlugin {
|
class VisualizerPlugin : public musik::core::sdk::IPlugin {
|
||||||
public:
|
public:
|
||||||
virtual void Release() { delete this; }
|
void Release() override { delete this; }
|
||||||
virtual const char* Name() { return "GdiVis"; }
|
const char* Name() override { return "GdiVis"; }
|
||||||
virtual const char* Version() { return "0.2.0"; }
|
const char* Version() override { return MUSIKCUBE_VERSION_WITH_COMMIT_HASH; }
|
||||||
virtual const char* Author() { return "clangen"; }
|
const char* Author() override { return "clangen"; }
|
||||||
virtual const char* Guid() { return "4b0f37f7-96fe-438c-acf2-bbdd53ce1ddf"; }
|
const char* Guid() override { return "4b0f37f7-96fe-438c-acf2-bbdd53ce1ddf"; }
|
||||||
virtual bool Configurable() { return false; }
|
bool Configurable() override { return false; }
|
||||||
virtual void Configure() { }
|
void Configure() override { }
|
||||||
virtual void Reload() { }
|
void Reload() override { }
|
||||||
int SdkVersion() { return musik::core::sdk::SdkVersion; }
|
int SdkVersion() override { return musik::core::sdk::SdkVersion; }
|
||||||
};
|
};
|
||||||
|
|
||||||
class Visualizer : public musik::core::sdk::ISpectrumVisualizer {
|
class Visualizer : public musik::core::sdk::ISpectrumVisualizer {
|
||||||
public:
|
public:
|
||||||
virtual const char* Name() {
|
const char* Name() override {
|
||||||
return "GdiVis";
|
return "GdiVis";
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void Release() {
|
void Release() override {
|
||||||
this->Hide();
|
this->Hide();
|
||||||
delete this;
|
delete this;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void Write(float *spectrum, int size) {
|
void Write(float *spectrum, int size) override {
|
||||||
std::unique_lock<std::mutex> lock(pcmMutex);
|
std::unique_lock<std::mutex> lock(pcmMutex);
|
||||||
|
|
||||||
if (::spectrumSize != size) {
|
if (::spectrumSize != size) {
|
||||||
@ -239,7 +239,7 @@ class Visualizer : public musik::core::sdk::ISpectrumVisualizer {
|
|||||||
memcpy(::spectrumIn, spectrum, size * sizeof(float));
|
memcpy(::spectrumIn, spectrum, size * sizeof(float));
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void Show() {
|
void Show() override {
|
||||||
if (!Visible()) {
|
if (!Visible()) {
|
||||||
quit.store(false);
|
quit.store(false);
|
||||||
thread.store(true);
|
thread.store(true);
|
||||||
@ -248,7 +248,7 @@ class Visualizer : public musik::core::sdk::ISpectrumVisualizer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void Hide() {
|
void Hide() override {
|
||||||
if (Visible()) {
|
if (Visible()) {
|
||||||
quit.store(true);
|
quit.store(true);
|
||||||
|
|
||||||
@ -259,7 +259,7 @@ class Visualizer : public musik::core::sdk::ISpectrumVisualizer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool Visible() {
|
bool Visible() override {
|
||||||
return thread.load();
|
return thread.load();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -158,40 +158,40 @@ class MMShellHook:
|
|||||||
public musik::core::sdk::IPlugin,
|
public musik::core::sdk::IPlugin,
|
||||||
public musik::core::sdk::IPlaybackRemote {
|
public musik::core::sdk::IPlaybackRemote {
|
||||||
public:
|
public:
|
||||||
virtual void Release() {
|
void Release() override {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual const char* Name() {
|
const char* Name() override {
|
||||||
return "win32globalhotkeys";
|
return "win32globalhotkeys";
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual const char* Version() {
|
const char* Version() override {
|
||||||
return "0.3.0";
|
return MUSIKCUBE_VERSION_WITH_COMMIT_HASH;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual const char* Author() {
|
const char* Author() override {
|
||||||
return "clangen";
|
return "clangen";
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual const char* Guid() {
|
const char* Guid() override {
|
||||||
return "e2678930-ecd4-43b8-85e0-e41d634445b2";
|
return "e2678930-ecd4-43b8-85e0-e41d634445b2";
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool Configurable() {
|
bool Configurable() override {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void Configure() {
|
void Configure() override {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void Reload() {
|
void Reload() override {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int SdkVersion() {
|
int SdkVersion() override {
|
||||||
return musik::core::sdk::SdkVersion;
|
return musik::core::sdk::SdkVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void SetPlaybackService(musik::core::sdk::IPlaybackService* playback) {
|
void SetPlaybackService(musik::core::sdk::IPlaybackService* playback) override {
|
||||||
::playback = playback;
|
::playback = playback;
|
||||||
if (playback) {
|
if (playback) {
|
||||||
installHook();
|
installHook();
|
||||||
@ -201,28 +201,22 @@ class MMShellHook:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void OnTrackChanged(musik::core::sdk::ITrack* track) {
|
void OnTrackChanged(musik::core::sdk::ITrack* track) override {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void OnPlaybackStateChanged(musik::core::sdk::PlaybackState state) {
|
void OnPlaybackStateChanged(musik::core::sdk::PlaybackState state) override {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void OnPlaybackTimeChanged(double time) {
|
void OnPlaybackTimeChanged(double time) override {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void OnVolumeChanged(double volume) {
|
void OnVolumeChanged(double volume) override {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void OnModeChanged(musik::core::sdk::RepeatMode repeatMode, bool shuffled) {
|
void OnModeChanged(musik::core::sdk::RepeatMode repeatMode, bool shuffled) override {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void OnPlayQueueChanged() {
|
void OnPlayQueueChanged() override {
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user