summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMole Shang2023-05-12 23:12:54 +0800
committerMole Shang2023-05-12 23:25:29 +0800
commit66d1364e14aa10b39357bc4f9c1dc8e8e01377e8 (patch)
treeb78a07f8e3981c3cbc6076ce0a6ee7d4776a1c7d
parentf215dfcc3c009caa687729e031e38ab43552eff4 (diff)
downloadaur-66d1364e14aa10b39357bc4f9c1dc8e8e01377e8.tar.gz
1.4.0-5
- Sync to latest git commit since no new tags have been created for so long. This introduces many new features and fixes (e.g. 11dffaf `fix conflict with c++ 20 format`), which requires quite a lot of effort to get the fixes backported. So instead of struggling with backporting, let's go with the shiny git version :D
-rw-r--r--.SRCINFO6
-rw-r--r--0002-explicitly-declare-format-function-signature.patch613
-rw-r--r--PKGBUILD7
3 files changed, 4 insertions, 622 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 6910f1a6a756..a9280110b0b8 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = implay
pkgdesc = Desktop media player built on top of mpv and imgui
pkgver = 1.4.0
- pkgrel = 4
+ pkgrel = 5
url = https://github.com/tsl0922/ImPlay
arch = x86_64
license = GPL3
@@ -11,11 +11,9 @@ pkgbase = implay
depends = mpv
depends = glfw
depends = xdg-desktop-portal
- source = implay::git+https://github.com/tsl0922/ImPlay.git?tag=${pkgver}
+ source = implay::git+https://github.com/tsl0922/ImPlay.git?commit=28a5fa84442cf5f21854526ef56ab86ba7156bda
source = 0001-disable-unneeded-imgui-demo-window.patch
- source = 0002-explicitly-declare-format-function-signature.patch
sha256sums = SKIP
sha256sums = ee4836cdde04b7e9a1fe6e27b2d9fc0751aea66066836b61dc0968cae402ca60
- sha256sums = eaaa2cb6763646012e82c7d3e9c3befc416b7b9cb5a8c3b0d8dc3e79ab603a21
pkgname = implay
diff --git a/0002-explicitly-declare-format-function-signature.patch b/0002-explicitly-declare-format-function-signature.patch
deleted file mode 100644
index 7ee46a1e169f..000000000000
--- a/0002-explicitly-declare-format-function-signature.patch
+++ /dev/null
@@ -1,613 +0,0 @@
-From 9a7fb92521d4aa06bf79b4eb04dca19556ae1b2a Mon Sep 17 00:00:00 2001
-From: Mole Shang <135e2@135e2.dev>
-Date: Fri, 5 May 2023 20:32:17 +0800
-Subject: [PATCH 2/2] explicitly declare `format()` function signature
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-With the newly arrived implementation of the experimental C++20 support for std::format in upstream `gcc (GCC) 13.1.1 20230429`, a naming conflict emerged in `source/helpers/utils.cpp`, resulting in the following error:
-
-> implay/source/helpers/utils.cpp:77:23: error: call of overloaded ‘format(const char [14], std::string&)’ is ambiguous
-> implay/src/implay/include/helpers/utils.h:71:20: note: candidate: ‘std::string ImPlay::format(std::string_view, T ...) [with T = {std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >}; std::string = std::__cxx11::basic_string<char>; std::string_view = std::basic_string_view<char>]’
-> 71 | inline std::string format(std::string_view format, T... args) {
-> | ^~~~~~
-> /usr/include/c++/13.1.1/format:3713:5: note: candidate: ‘std::string std::format(format_string<_Args ...>, _Args&& ...) [with _Args = {__cxx11::basic_string<char, char_traits<char>, allocator<char> >&, __cxx11::basic_string<char, char_traits<char>, allocator<char> >&}; string = __cxx11::basic_string<char>; format_string<_Args ...> = basic_format_string<char, __cxx11::basic_string<char, char_traits<char>, allocator<char> >&, __cxx11::basic_string<char, char_traits<char>, allocator<char> >&>]’
-> 3713 | format(format_string<_Args...> __fmt, _Args&&... __args)
-> | ^~~~~~
-
-Specify the `format()` function signature explicitly to fix the
-ambiguous naming problem.
-
-Ref: https://www.gnu.org/software/gcc/gcc-13/changes.html => Runtime Library (libstdc++)
----
- include/player.h | 8 +++---
- source/config.cpp | 24 +++++++++---------
- source/helpers/utils.cpp | 12 ++++-----
- source/player.cpp | 8 +++---
- source/views/command_palette.cpp | 10 ++++----
- source/views/context_menu.cpp | 20 +++++++--------
- source/views/debug.cpp | 34 +++++++++++++-------------
- source/views/quickview.cpp | 42 ++++++++++++++++----------------
- source/window.cpp | 4 +--
- 9 files changed, 81 insertions(+), 81 deletions(-)
-
-diff --git a/include/player.h b/include/player.h
-index 9fa2c4e..9de25b6 100644
---- a/include/player.h
-+++ b/include/player.h
-@@ -141,12 +141,12 @@ class Player {
- "ttxt", "txt", "ssa", "smi", "mks"};
-
- const std::vector<std::pair<std::string, std::string>> mediaFilters = {
-- {"Videos Files", format("{}", join(videoTypes, ","))},
-- {"Audio Files", format("{}", join(audioTypes, ","))},
-- {"Image Files", format("{}", join(imageTypes, ","))},
-+ {"Videos Files", ImPlay::format("{}", join(videoTypes, ","))},
-+ {"Audio Files", ImPlay::format("{}", join(audioTypes, ","))},
-+ {"Image Files", ImPlay::format("{}", join(imageTypes, ","))},
- };
- const std::vector<std::pair<std::string, std::string>> subtitleFilters = {
-- {"Subtitle Files", format("{}", join(subtitleTypes, ","))},
-+ {"Subtitle Files", ImPlay::format("{}", join(subtitleTypes, ","))},
- };
- const std::vector<std::pair<std::string, std::string>> isoFilters = {
- {"ISO Image Files", "iso"},
-diff --git a/source/config.cpp b/source/config.cpp
-index 10578fe..e685289 100644
---- a/source/config.cpp
-+++ b/source/config.cpp
-@@ -61,19 +61,19 @@ void Config::save() {
-
- ini.sections["interface"]["lang"] = Data.Interface.Lang;
- ini.sections["interface"]["theme"] = Data.Interface.Theme;
-- ini.sections["interface"]["scale"] = format("{}", Data.Interface.Scale);
-- ini.sections["interface"]["fps"] = format("{}", Data.Interface.Fps);
-- ini.sections["interface"]["docking"] = format("{}", Data.Interface.Docking);
-- ini.sections["interface"]["viewports"] = format("{}", Data.Interface.Viewports);
-+ ini.sections["interface"]["scale"] = ImPlay::format("{}", Data.Interface.Scale);
-+ ini.sections["interface"]["fps"] = ImPlay::format("{}", Data.Interface.Fps);
-+ ini.sections["interface"]["docking"] = ImPlay::format("{}", Data.Interface.Docking);
-+ ini.sections["interface"]["viewports"] = ImPlay::format("{}", Data.Interface.Viewports);
- ini.sections["font"]["path"] = Data.Font.Path;
- ini.sections["font"]["size"] = std::to_string(Data.Font.Size);
- ini.sections["font"]["glyph-range"] = std::to_string(Data.Font.GlyphRange);
-- ini.sections["mpv"]["config"] = format("{}", Data.Mpv.UseConfig);
-- ini.sections["mpv"]["wid"] = format("{}", Data.Mpv.UseWid);
-- ini.sections["mpv"]["watch-later"] = format("{}", Data.Mpv.WatchLater);
-+ ini.sections["mpv"]["config"] = ImPlay::format("{}", Data.Mpv.UseConfig);
-+ ini.sections["mpv"]["wid"] = ImPlay::format("{}", Data.Mpv.UseWid);
-+ ini.sections["mpv"]["watch-later"] = ImPlay::format("{}", Data.Mpv.WatchLater);
- ini.sections["mpv"]["volume"] = std::to_string(Data.Mpv.Volume);
-- ini.sections["window"]["save"] = format("{}", Data.Window.Save);
-- ini.sections["window"]["single"] = format("{}", Data.Window.Single);
-+ ini.sections["window"]["save"] = ImPlay::format("{}", Data.Window.Save);
-+ ini.sections["window"]["single"] = ImPlay::format("{}", Data.Window.Single);
- ini.sections["window"]["x"] = std::to_string(Data.Window.X);
- ini.sections["window"]["y"] = std::to_string(Data.Window.Y);
- ini.sections["window"]["w"] = std::to_string(Data.Window.W);
-@@ -81,12 +81,12 @@ void Config::save() {
- ini.sections["debug"]["log-level"] = Data.Debug.LogLevel;
- ini.sections["debug"]["log-limit"] = std::to_string(Data.Debug.LogLimit);
- ini.sections["recent"]["limit"] = std::to_string(Data.Recent.Limit);
-- ini.sections["recent"]["space-to-play-last"] = format("{}", Data.Recent.SpaceToPlayLast);
-+ ini.sections["recent"]["space-to-play-last"] = ImPlay::format("{}", Data.Recent.SpaceToPlayLast);
-
- int index = 0;
- for (auto& file : recentFiles) {
-- ini.sections["recent"][format("file-{}", index++)] =
-- file.path == file.title ? file.path : format("{}|{}", file.path, file.title);
-+ ini.sections["recent"][ImPlay::format("file-{}", index++)] =
-+ file.path == file.title ? file.path : ImPlay::format("{}|{}", file.path, file.title);
- }
-
- std::ofstream file(configFile);
-diff --git a/source/helpers/utils.cpp b/source/helpers/utils.cpp
-index 2c00f3f..64dee40 100644
---- a/source/helpers/utils.cpp
-+++ b/source/helpers/utils.cpp
-@@ -69,12 +69,12 @@ bool fileExists(std::string path) {
-
- int openUrl(std::string url) {
- #ifdef __APPLE__
-- return system(format("open '{}'", url).c_str());
-+ return system(ImPlay::format("open '{}'", url).c_str());
- #elif defined(_WIN32) || defined(__CYGWIN__)
- return ShellExecuteW(0, 0, UTF8ToWide(url).c_str(), 0, 0, SW_SHOW) > (HINSTANCE)32 ? 0 : 1;
- #else
- char command[256];
-- return system(format("xdg-open '{}'", url).c_str());
-+ return system(ImPlay::format("xdg-open '{}'", url).c_str());
- #endif
- }
-
-@@ -82,14 +82,14 @@ void revealInFolder(std::string path) {
- auto fp = std::filesystem::path(reinterpret_cast<char8_t*>(path.data()));
- if (!std::filesystem::exists(fp)) return;
- #ifdef __APPLE__
-- system(format("open -R '{}'", path).c_str());
-+ system(ImPlay::format("open -R '{}'", path).c_str());
- #elif defined(_WIN32) || defined(__CYGWIN__)
-- std::string arg = format("/select,\"{}\"", path);
-+ std::string arg = ImPlay::format("/select,\"{}\"", path);
- ShellExecuteW(0, 0, L"explorer", UTF8ToWide(arg).c_str(), 0, SW_SHOW);
- #else
- auto status = std::filesystem::status(fp);
- auto target = std::filesystem::is_directory(status) ? path : fp.parent_path().string();
-- system(format("xdg-open '{}'", target).c_str());
-+ system(ImPlay::format("xdg-open '{}'", target).c_str());
- #endif
- }
-
-@@ -123,7 +123,7 @@ std::filesystem::path dataPath() {
- if (xdg_dir != nullptr)
- dataDir = xdg_dir;
- else if (home != nullptr)
-- dataDir = format("{}/.config", home);
-+ dataDir = ImPlay::format("{}/.config", home);
- #endif
- return std::filesystem::path(dataDir) / "implay";
- }
-diff --git a/source/player.cpp b/source/player.cpp
-index 5776a73..8da7ddf 100644
---- a/source/player.cpp
-+++ b/source/player.cpp
-@@ -486,7 +486,7 @@ void Player::execute(int n_args, const char **args_) {
- try {
- if (it != commands.end()) it->second(n_args - 1, args_ + 1);
- } catch (const std::exception &e) {
-- messageBox("Error", format("{}: {}", cmd, e.what()));
-+ messageBox("Error", ImPlay::format("{}: {}", cmd, e.what()));
- }
- }
-
-@@ -549,13 +549,13 @@ void Player::playlistSort(bool reverse) {
- }
- std::vector<std::string> playlist = {"#EXTM3U"};
- for (auto &item : items) {
-- if (item.title != "") playlist.push_back(format("#EXTINF:-1,{}", item.title));
-+ if (item.title != "") playlist.push_back(ImPlay::format("#EXTINF:-1,{}", item.title));
- playlist.push_back(item.path.string());
- }
- mpv->property<int64_t, MPV_FORMAT_INT64>("playlist-start", pos);
-- mpv->property("start", format("+{}", timePos).c_str());
-+ mpv->property("start", ImPlay::format("+{}", timePos).c_str());
- if (!mpv->playing()) mpv->command("playlist-clear");
-- mpv->commandv("loadlist", format("memory://{}", join(playlist, "\n")).c_str(), mpv->playing() ? "replace" : "append",
-+ mpv->commandv("loadlist", ImPlay::format("memory://{}", join(playlist, "\n")).c_str(), mpv->playing() ? "replace" : "append",
- nullptr);
- }
-
-diff --git a/source/views/command_palette.cpp b/source/views/command_palette.cpp
-index 124efea..7ff6164 100644
---- a/source/views/command_palette.cpp
-+++ b/source/views/command_palette.cpp
-@@ -20,8 +20,8 @@ CommandPalette::CommandPalette(Config* config, Mpv* mpv) : View(config, mpv) {
- };
- providers["chapters"] = [=, this](const char*) {
- for (auto& item : mpv->chapters) {
-- auto title = item.title.empty() ? format("Chapter {}", item.id + 1) : item.title;
-- auto time = format("{:%H:%M:%S}", std::chrono::duration<int>((int)item.time));
-+ auto title = item.title.empty() ? ImPlay::format("Chapter {}", item.id + 1) : item.title;
-+ auto time = ImPlay::format("{:%H:%M:%S}", std::chrono::duration<int>((int)item.time));
- items.push_back({
- title,
- "",
-@@ -34,7 +34,7 @@ CommandPalette::CommandPalette(Config* config, Mpv* mpv) : View(config, mpv) {
- for (auto& item : mpv->playlist) {
- std::string title = item.title;
- if (title.empty() && !item.filename().empty()) title = item.filename();
-- if (title.empty()) title = format("Item {}", item.id + 1);
-+ if (title.empty()) title = ImPlay::format("Item {}", item.id + 1);
- items.push_back({
- title,
- item.path.string(),
-@@ -46,8 +46,8 @@ CommandPalette::CommandPalette(Config* config, Mpv* mpv) : View(config, mpv) {
- providers["tracks"] = [=, this](const char* type) {
- for (auto& item : mpv->tracks) {
- if (type != nullptr && item.type != type) continue;
-- auto title = item.title.empty() ? format("Track {}", item.id) : item.title;
-- if (!item.lang.empty()) title += format(" [{}]", item.lang);
-+ auto title = item.title.empty() ? ImPlay::format("Track {}", item.id) : item.title;
-+ if (!item.lang.empty()) title += ImPlay::format(" [{}]", item.lang);
- items.push_back({
- title,
- "",
-diff --git a/source/views/context_menu.cpp b/source/views/context_menu.cpp
-index be0d587..d418d7b 100644
---- a/source/views/context_menu.cpp
-+++ b/source/views/context_menu.cpp
-@@ -268,13 +268,13 @@ void ContextMenu::drawPlaylist(std::vector<Mpv::PlayItem> items) {
- if (i == 10) break;
- std::string title = item.title;
- if (title.empty() && !item.filename().empty()) title = item.filename();
-- if (title.empty()) title = format("menu.playlist.item"_i18n, item.id + 1);
-+ if (title.empty()) title = ImPlay::format("menu.playlist.item"_i18n, item.id + 1);
- if (ImGui::MenuItemEx(title.c_str(), nullptr, nullptr, item.id == pos))
- mpv->commandv("playlist-play-index", std::to_string(item.id).c_str(), nullptr);
- i++;
- }
- if (items.size() > 10) {
-- if (ImGui::MenuItem(format("{} ({})", "menu.playlist.all"_i18n, items.size()).c_str()))
-+ if (ImGui::MenuItem(ImPlay::format("{} ({})", "menu.playlist.all"_i18n, items.size()).c_str()))
- mpv->command("script-message-to implay command-palette playlist");
- }
- }
-@@ -288,15 +288,15 @@ void ContextMenu::drawChapterlist(std::vector<Mpv::ChapterItem> items) {
- ImGui::Separator();
- for (auto &chapter : items) {
- if (i == 10) break;
-- auto title = chapter.title.empty() ? format("Chapter {}", chapter.id + 1) : chapter.title;
-- title = format("{} [{:%H:%M:%S}]", title, std::chrono::duration<int>((int)chapter.time));
-+ auto title = chapter.title.empty() ? ImPlay::format("Chapter {}", chapter.id + 1) : chapter.title;
-+ title = ImPlay::format("{} [{:%H:%M:%S}]", title, std::chrono::duration<int>((int)chapter.time));
- if (ImGui::MenuItem(title.c_str(), nullptr, chapter.id == pos)) {
- mpv->commandv("seek", std::to_string(chapter.time).c_str(), "absolute", nullptr);
- }
- i++;
- }
- if (items.size() > 10) {
-- if (ImGui::MenuItem(format("{} ({})", "menu.chapters.all"_i18n, items.size()).c_str()))
-+ if (ImGui::MenuItem(ImPlay::format("{} ({})", "menu.chapters.all"_i18n, items.size()).c_str()))
- mpv->command("script-message-to implay command-palette chapters");
- }
- }
-@@ -307,8 +307,8 @@ void ContextMenu::drawTracklist(const char *type, const char *prop, std::string
- mpv->commandv("cycle-values", prop, "no", "auto", nullptr);
- for (auto &track : mpv->tracks) {
- if (track.type != type) continue;
-- auto title = track.title.empty() ? format("menu.tracks.item"_i18n, track.id) : track.title;
-- if (!track.lang.empty()) title += format(" [{}]", track.lang);
-+ auto title = track.title.empty() ? ImPlay::format("menu.tracks.item"_i18n, track.id) : track.title;
-+ if (!track.lang.empty()) title += ImPlay::format(" [{}]", track.lang);
- if (ImGui::MenuItem(title.c_str(), nullptr, track.selected))
- mpv->property<int64_t, MPV_FORMAT_INT64>(prop, track.id);
- }
-@@ -320,7 +320,7 @@ void ContextMenu::drawAudioDeviceList() {
- auto devices = mpv->audioDevices;
- if (ImGui::BeginMenuEx("menu.audio.devices"_i18n, ICON_FA_AUDIO_DESCRIPTION, !devices.empty())) {
- for (auto &device : devices) {
-- auto title = format("[{}] {}", device.description, device.name);
-+ auto title = ImPlay::format("[{}] {}", device.description, device.name);
- if (ImGui::MenuItem(title.c_str(), nullptr, device.name == mpv->audioDevice))
- mpv->property("audio-device", device.name.c_str());
- }
-@@ -347,7 +347,7 @@ void ContextMenu::drawProfilelist() {
- if (ImGui::BeginMenuEx("menu.tools.profiles"_i18n, ICON_FA_USER_COG)) {
- for (auto &profile : mpv->profiles) {
- if (ImGui::MenuItem(profile.c_str()))
-- mpv->command(format("show-text {}; apply-profile {}", profile, profile).c_str());
-+ mpv->command(ImPlay::format("show-text {}; apply-profile {}", profile, profile).c_str());
- }
- ImGui::EndMenu();
- }
-@@ -366,7 +366,7 @@ void ContextMenu::drawRecentFiles() {
- i++;
- }
- if (files.size() > 10) {
-- if (ImGui::MenuItem(format("{} ({})", "menu.open.recent.all"_i18n, files.size()).c_str()))
-+ if (ImGui::MenuItem(ImPlay::format("{} ({})", "menu.open.recent.all"_i18n, files.size()).c_str()))
- mpv->command("script-message-to implay command-palette history");
- }
- if (ImGui::MenuItem("menu.open.recent.clear"_i18n)) config->clearRecentFiles();
-diff --git a/source/views/debug.cpp b/source/views/debug.cpp
-index a338644..0bc2833 100644
---- a/source/views/debug.cpp
-+++ b/source/views/debug.cpp
-@@ -42,8 +42,8 @@ void Debug::drawHeader() {
- ImGuiIO& io = ImGui::GetIO();
- auto style = ImGuiStyle();
- ImGui::Text("%s", version.c_str());
-- auto vSize = ImGui::CalcTextSize(format("ImGui {}", ImGui::GetVersion()).c_str());
-- auto mSize = ImGui::CalcTextSize(format("FPS: %.2f", io.Framerate).c_str());
-+ auto vSize = ImGui::CalcTextSize(ImPlay::format("ImGui {}", ImGui::GetVersion()).c_str());
-+ auto mSize = ImGui::CalcTextSize(ImPlay::format("FPS: %.2f", io.Framerate).c_str());
- ImGui::SameLine(ImGui::GetContentRegionAvail().x - (vSize.x + mSize.x + 2 * style.FramePadding.x));
- ImGui::Text("ImGui %s", ImGui::GetVersion());
- if (ImGui::IsItemClicked(ImGuiMouseButton_Left)) m_demo = !m_demo;
-@@ -67,7 +67,7 @@ void Debug::drawConsole() {
- void Debug::drawBindings() {
- auto bindings = mpv->bindings;
- if (m_node != "Bindings") ImGui::SetNextItemOpen(false, ImGuiCond_Always);
-- if (!ImGui::CollapsingHeader(format("views.debug.bindings"_i18n, bindings.size()).c_str())) return;
-+ if (!ImGui::CollapsingHeader(ImPlay::format("views.debug.bindings"_i18n, bindings.size()).c_str())) return;
- m_node = "Bindings";
-
- if (ImGui::BeginListBox("input-bindings", ImVec2(-FLT_MIN, -FLT_MIN))) {
-@@ -115,7 +115,7 @@ static void formatCommands(mpv_node& node, std::vector<std::pair<std::string, st
- if (strcmp(k, "name") == 0) name_ = v.u.string;
- if (strcmp(k, "optional") == 0) optional_ = v.u.flag;
- }
-- args.push_back(optional_ ? format("<{}>", name_) : name_);
-+ args.push_back(optional_ ? ImPlay::format("<{}>", name_) : name_);
- }
- }
- if (strcmp(key, "vararg") == 0) vararg = value.u.flag;
-@@ -123,7 +123,7 @@ static void formatCommands(mpv_node& node, std::vector<std::pair<std::string, st
- if (name == nullptr) continue;
- std::string args_str;
- if (!args.empty()) {
-- args_str = format("{}", join(args, " "));
-+ args_str = ImPlay::format("{}", join(args, " "));
- if (vararg) args_str += " ...";
- }
- commands.push_back({name, args_str});
-@@ -153,7 +153,7 @@ void Debug::initData() {
-
- void Debug::drawCommands() {
- if (m_node != "Commands") ImGui::SetNextItemOpen(false, ImGuiCond_Always);
-- if (!ImGui::CollapsingHeader(format("views.debug.commands"_i18n, commands.size()).c_str())) return;
-+ if (!ImGui::CollapsingHeader(ImPlay::format("views.debug.commands"_i18n, commands.size()).c_str())) return;
- m_node = "Commands";
-
- static char buf[256] = "";
-@@ -181,7 +181,7 @@ void Debug::drawCommands() {
-
- void Debug::drawProperties(const char* title, std::vector<std::string>& props) {
- if (m_node != title) ImGui::SetNextItemOpen(false, ImGuiCond_Always);
-- if (!ImGui::CollapsingHeader(format("{} [{}]", title, props.size()).c_str())) {
-+ if (!ImGui::CollapsingHeader(ImPlay::format("{} [{}]", title, props.size()).c_str())) {
- return;
- }
- m_node = title;
-@@ -252,22 +252,22 @@ void Debug::drawPropNode(const char* name, mpv_node& node, int depth) {
- value = prop.u.flag ? "yes" : "no";
- break;
- case MPV_FORMAT_INT64:
-- value = format("{}", prop.u.int64);
-+ value = ImPlay::format("{}", prop.u.int64);
- break;
- case MPV_FORMAT_DOUBLE:
-- value = format("{}", prop.u.double_);
-+ value = ImPlay::format("{}", prop.u.double_);
- break;
- default:
-- value = format("Unknown format: {}", (int)prop.format);
-+ value = ImPlay::format("Unknown format: {}", (int)prop.format);
- color = style.Colors[ImGuiCol_TextDisabled];
- break;
- }
- ImGui::PushID(&prop);
- ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0, ImGui::GetStyle().ItemSpacing.y));
- ImGui::Selectable("", false);
-- if (ImGui::BeginPopupContextItem(format("##menu_{}", title).c_str())) {
-+ if (ImGui::BeginPopupContextItem(ImPlay::format("##menu_{}", title).c_str())) {
- if (ImGui::MenuItem("views.debug.properties.menu.copy"_i18n))
-- ImGui::SetClipboardText(format("{}={}", title, value).c_str());
-+ ImGui::SetClipboardText(ImPlay::format("{}={}", title, value).c_str());
- if (ImGui::MenuItem("views.debug.properties.menu.copy_name"_i18n)) ImGui::SetClipboardText(title);
- if (ImGui::MenuItem("views.debug.properties.menu.copy_value"_i18n)) ImGui::SetClipboardText(value.c_str());
- ImGui::EndPopup();
-@@ -291,15 +291,15 @@ void Debug::drawPropNode(const char* name, mpv_node& node, int depth) {
- drawSimple(name, node);
- break;
- case MPV_FORMAT_NODE_ARRAY:
-- if (ImGui::TreeNode(format("{} [{}]", name, node.u.list->num).c_str())) {
-+ if (ImGui::TreeNode(ImPlay::format("{} [{}]", name, node.u.list->num).c_str())) {
- for (int i = 0; i < node.u.list->num; i++)
-- drawPropNode(format("#{}", i).c_str(), node.u.list->values[i], depth + 1);
-+ drawPropNode(ImPlay::format("#{}", i).c_str(), node.u.list->values[i], depth + 1);
- ImGui::TreePop();
- }
- break;
- case MPV_FORMAT_NODE_MAP:
- if (depth > 0) ImGui::SetNextItemOpen(true, ImGuiCond_Once);
-- if (ImGui::TreeNode(format("{} ({})", name, node.u.list->num).c_str())) {
-+ if (ImGui::TreeNode(ImPlay::format("{} ({})", name, node.u.list->num).c_str())) {
- for (int i = 0; i < node.u.list->num; i++) drawPropNode(node.u.list->keys[i], node.u.list->values[i]);
- ImGui::TreePop();
- }
-@@ -390,7 +390,7 @@ void Debug::Console::draw() {
- ImGui::EndPopup();
- }
-
-- Filter.Draw(format("{}##log", "views.debug.console.log.filter"_i18n).c_str(), scaled(8));
-+ Filter.Draw(ImPlay::format("{}##log", "views.debug.console.log.filter"_i18n).c_str(), scaled(8));
- ImGui::SameLine();
- ImGui::SetNextItemWidth(scaled(3));
- ImGui::InputInt("views.debug.console.log.limit"_i18n, &LogLimit, 0);
-@@ -577,7 +577,7 @@ int Debug::Console::TextEditCallback(ImGuiInputTextCallbackData* data) {
- AddLog("info", "Possible matches:\n");
- std::string s;
- for (int i = 0; i < candidates.Size; i++) {
-- s += format("{:<32}", candidates[i]);
-+ s += ImPlay::format("{:<32}", candidates[i]);
- if (i != 0 && (i + 1) % 4 == 0) {
- AddLog("info", "%s\n", s.c_str());
- s.clear();
-diff --git a/source/views/quickview.cpp b/source/views/quickview.cpp
-index 083f3b3..ac7bdd9 100644
---- a/source/views/quickview.cpp
-+++ b/source/views/quickview.cpp
-@@ -71,7 +71,7 @@ void Quickview::alignRight(const char *label) {
-
- bool Quickview::iconButton(const char *icon, const char *cmd, const char *tooltip, bool sameline) {
- if (sameline) ImGui::SameLine();
-- bool ret = ImGui::Button(format("{}##{}", icon, cmd).c_str());
-+ bool ret = ImGui::Button(ImPlay::format("{}##{}", icon, cmd).c_str());
- if (ret) mpv->command(cmd);
- if (tooltip && ImGui::IsItemHovered(ImGuiHoveredFlags_DelayNormal)) ImGui::SetTooltip("%s", tooltip);
- return ret;
-@@ -79,7 +79,7 @@ bool Quickview::iconButton(const char *icon, const char *cmd, const char *toolti
-
- bool Quickview::toggleButton(const char *label, bool toggle, const char *tooltip, ImGuiCol col) {
- ImGui::PushStyleColor(col, ImGui::GetStyleColorVec4(toggle ? ImGuiCol_CheckMark : col));
-- bool ret = ImGui::Button(format("{}##{}", label, tooltip ? tooltip : "").c_str());
-+ bool ret = ImGui::Button(ImPlay::format("{}##{}", label, tooltip ? tooltip : "").c_str());
- if (tooltip && ImGui::IsItemHovered(ImGuiHoveredFlags_DelayNormal)) ImGui::SetTooltip("%s", tooltip);
- ImGui::PopStyleColor();
- return ret;
-@@ -88,7 +88,7 @@ bool Quickview::toggleButton(const char *label, bool toggle, const char *tooltip
- bool Quickview::toggleButton(bool toggle, const char *tooltip, const char *id) {
- ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0));
- const char *label = toggle ? ICON_FA_TOGGLE_ON : ICON_FA_TOGGLE_OFF;
-- bool ret = toggleButton(format("{}##{}", label, id ? id : "").c_str(), toggle, tooltip, ImGuiCol_Text);
-+ bool ret = toggleButton(ImPlay::format("{}##{}", label, id ? id : "").c_str(), toggle, tooltip, ImGuiCol_Text);
- ImGui::PopStyleColor();
- return ret;
- }
-@@ -108,12 +108,12 @@ void Quickview::drawTracks(const char *title, const char *type, const char *prop
- if (toggleButton(toggle, "views.quickview.tracks.toggle"_i18n, prop)) {
- if (strstr(prop, "sid") != nullptr) {
- const char *prefix = strstr(prop, "secondary") != nullptr ? "secondary-" : "";
-- mpv->commandv("set", format("{}sub-visibility", prefix).c_str(), toggle ? "no" : "yes", nullptr);
-+ mpv->commandv("set", ImPlay::format("{}sub-visibility", prefix).c_str(), toggle ? "no" : "yes", nullptr);
- } else {
- mpv->commandv("cycle-values", prop, "no", "auto", nullptr);
- }
- }
-- if (ImGui::BeginListBox(format("##tracks-{}", prop).c_str(),
-+ if (ImGui::BeginListBox(ImPlay::format("##tracks-{}", prop).c_str(),
- ImVec2(-FLT_MIN, 3 * ImGui::GetFrameHeightWithSpacing()))) {
- auto items = mpv->tracks;
- if (items.empty())
-@@ -123,8 +123,8 @@ void Quickview::drawTracks(const char *title, const char *type, const char *prop
- for (auto &item : items) {
- if (item.type != type) continue;
- bool selected = item.id == 0 ? pos == "no" : pos == std::to_string(item.id);
-- auto title = item.title.empty() ? format("views.quickview.tracks.item"_i18n, item.id) : item.title;
-- if (!item.lang.empty()) title += format(" [{}]", item.lang);
-+ auto title = item.title.empty() ? ImPlay::format("views.quickview.tracks.item"_i18n, item.id) : item.title;
-+ if (!item.lang.empty()) title += ImPlay::format(" [{}]", item.lang);
- ImGui::PushID(item.id);
- if (ImGui::Selectable("", selected)) mpv->property(prop, std::to_string(item.id).c_str());
- ImGui::SameLine();
-@@ -172,7 +172,7 @@ void Quickview::drawPlaylistTabContent() {
- for (auto &item : items) {
- std::string title = item.title;
- if (title.empty() && !item.filename().empty()) title = item.filename();
-- if (title.empty()) title = format("views.quickview.playlist.item"_i18n, item.id + 1);
-+ if (title.empty()) title = ImPlay::format("views.quickview.playlist.item"_i18n, item.id + 1);
- ImGui::PushID(item.id);
- if (ImGui::Selectable("", selected == item.id)) selected = item.id;
- if (ImGui::IsItemHovered() && ImGui::IsMouseDoubleClicked(0))
-@@ -198,7 +198,7 @@ void Quickview::drawPlaylistTabContent() {
- iconButton(ICON_FA_SYNC, "cycle-values loop-playlist inf no", "views.quickview.playlist.loop"_i18n);
- iconButton(ICON_FA_RANDOM, "playlist-shuffle", "views.quickview.playlist.shuffle"_i18n);
- if (iconButton(sort ? ICON_FA_SORT_ALPHA_DOWN : ICON_FA_SORT_ALPHA_UP,
-- format("script-message-to implay playlist-sort {}", sort).c_str(),
-+ ImPlay::format("script-message-to implay playlist-sort {}", sort).c_str(),
- "views.quickview.playlist.sort"_i18n))
- sort = !sort;
- ImGui::SameLine(ImGui::GetContentRegionAvail().x -
-@@ -216,8 +216,8 @@ void Quickview::drawChaptersTabContent() {
- if (ImGui::BeginListBox("##chapters", ImVec2(-FLT_MIN, -FLT_MIN))) {
- if (items.empty()) emptyLabel();
- for (auto &item : items) {
-- auto title = item.title.empty() ? format("Chapter {}", item.id + 1) : item.title;
-- auto time = format("{:%H:%M:%S}", std::chrono::duration<int>((int)item.time));
-+ auto title = item.title.empty() ? ImPlay::format("Chapter {}", item.id + 1) : item.title;
-+ auto time = ImPlay::format("{:%H:%M:%S}", std::chrono::duration<int>((int)item.time));
- auto color = ImGui::GetStyleColorVec4(item.id == pos ? ImGuiCol_CheckMark : ImGuiCol_Text);
- ImGui::PushID(item.id);
- if (ImGui::Selectable("", item.id == pos))
-@@ -239,7 +239,7 @@ void Quickview::drawVideoTabContent() {
- ImGui::TextUnformatted("views.quickview.video.rotate"_i18n);
- const char *rotates[] = {"0", "90", "180", "270"};
- for (auto rotate : rotates) {
-- if (ImGui::Button(format("{}°", rotate).c_str())) mpv->commandv("set", "video-rotate", rotate, nullptr);
-+ if (ImGui::Button(ImPlay::format("{}°", rotate).c_str())) mpv->commandv("set", "video-rotate", rotate, nullptr);
- ImGui::SameLine();
- }
- iconButton(ICON_FA_UNDO, "add video-rotate -1", "views.quickview.video.rotate_left"_i18n, false);
-@@ -251,7 +251,7 @@ void Quickview::drawVideoTabContent() {
- ImGui::HelpMarker("views.quickview.video.scale.help"_i18n);
- const float scales[] = {0.25f, 0.5f, 0.75f, 1.0f, 1.5f, 2.0f};
- for (auto scale : scales) {
-- if (ImGui::Button(format("{}%", (int)(scale * 100)).c_str()))
-+ if (ImGui::Button(ImPlay::format("{}%", (int)(scale * 100)).c_str()))
- mpv->commandv("set", "window-scale", std::to_string(scale).c_str(), nullptr);
- ImGui::SameLine();
- }
-@@ -317,7 +317,7 @@ void Quickview::drawVideoTabContent() {
- ImGui::SetCursorPosX(ImGui::GetCursorPosX() + scaled(1));
- ImGui::BeginGroup();
- for (int i = 0; i < IM_ARRAYSIZE(equalizer); i++) {
-- if (ImGui::Button(format("{}##{}", ICON_FA_UNDO, eq[i]).c_str())) {
-+ if (ImGui::Button(ImPlay::format("{}##{}", ICON_FA_UNDO, eq[i]).c_str())) {
- equalizer[i] = 0;
- mpv->commandv("set", eq[i], "0", nullptr);
- }
-@@ -343,7 +343,7 @@ void Quickview::drawAudioTabContent() {
- ImGui::TextUnformatted("views.quickview.audio.delay"_i18n);
- static float delay = (float)mpv->property<double, MPV_FORMAT_DOUBLE>("audio-delay");
- if (ImGui::SliderFloat("##Delay", &delay, -10, 10, "%.1fs"))
-- mpv->commandv("set", "audio-delay", format("{:.1f}", delay).c_str(), nullptr);
-+ mpv->commandv("set", "audio-delay", ImPlay::format("{:.1f}", delay).c_str(), nullptr);
- if (iconButton(ICON_FA_UNDO, "set audio-delay 0", "views.quickview.audio.delay.reset"_i18n)) delay = 0;
- ImGui::NewLine();
- ImGui::Separator();
-@@ -369,14 +369,14 @@ void Quickview::drawSubtitleTabContent() {
- ImGui::TextUnformatted("views.quickview.subtitle.scale"_i18n);
- static float scale = (float)mpv->property<double, MPV_FORMAT_DOUBLE>("sub-scale");
- if (ImGui::SliderFloat("##Scale", &scale, 0, 4, "%.1f"))
-- mpv->commandv("set", "sub-scale", format("{:.1f}", scale).c_str(), nullptr);
-+ mpv->commandv("set", "sub-scale", ImPlay::format("{:.1f}", scale).c_str(), nullptr);
- if (iconButton(ICON_FA_UNDO, "set sub-scale 1", "views.quickview.subtitle.scale.reset"_i18n)) scale = 1;
- ImGui::NewLine();
-
- ImGui::TextUnformatted("views.quickview.subtitle.delay"_i18n);
- static float delay = (float)mpv->property<double, MPV_FORMAT_DOUBLE>("sub-delay");
- if (ImGui::SliderFloat("##Delay", &delay, -10, 10, "%.1fs"))
-- mpv->commandv("set", "sub-delay", format("{:.1f}", delay).c_str(), nullptr);
-+ mpv->commandv("set", "sub-delay", ImPlay::format("{:.1f}", delay).c_str(), nullptr);
- if (iconButton(ICON_FA_UNDO, "set sub-delay 0", "views.quickview.subtitle.delay.reset"_i18n)) delay = 0;
- }
-
-@@ -417,7 +417,7 @@ void Quickview::drawAudioEq() {
- ImVec2 size = ImVec2(scaled(0.8f), scaled(10));
- float start = ImGui::GetCursorPosX();
- for (int i = 0; i < FREQ_COUNT; i++) {
-- std::string label = format("##{}", audioEqFreqs[i]);
-+ std::string label = ImPlay::format("##{}", audioEqFreqs[i]);
- if (ImGui::VSliderFloat(label.c_str(), size, &gain[i], -12, 12, "")) setAudioEqValue(i, gain[i]);
- if (ImGui::IsItemHovered()) ImGui::SetTooltip("%.1fdB", gain[i]);
- if (i < FREQ_COUNT - 1) ImGui::SameLine(0, spacing);
-@@ -439,7 +439,7 @@ void Quickview::applyAudioEq(bool osd) {
- if (audioEqIndex < 0) return;
- auto equalizer = audioEqPresets[audioEqIndex];
- mpv->commandv("af", "add", equalizer.toFilter("@aeq", audioEqChannels).c_str(), nullptr);
-- message = format("views.quickview.audio.equalizer.msg"_i18n, equalizer.name);
-+ message = ImPlay::format("views.quickview.audio.equalizer.msg"_i18n, equalizer.name);
- }
- if (osd) mpv->commandv("show-text", message.c_str(), nullptr);
- }
-@@ -481,10 +481,10 @@ std::string Quickview::AudioEqItem::toFilter(const char *name, int channels) {
- for (int ch = 0; ch < channels; ch++) {
- for (int f = 0; f < FREQ_COUNT; f++) {
- double v = (double)values[f] / 12;
-- s += format("c{} f={} w={} g={}|", ch, freq, 1000, v);
-+ s += ImPlay::format("c{} f={} w={} g={}|", ch, freq, 1000, v);
- freq *= 2;
- }
- }
-- return format("{}:lavfi=[anequalizer={}]", name, s);
-+ return ImPlay::format("{}:lavfi=[anequalizer={}]", name, s);
- }
- } // namespace ImPlay::Views
-\ No newline at end of file
-diff --git a/source/window.cpp b/source/window.cpp
-index be57b20..1934ac7 100644
---- a/source/window.cpp
-+++ b/source/window.cpp
-@@ -237,7 +237,7 @@ void Window::handleKey(int key, int action, int mods) {
- std::vector<std::string> keys;
- translateMod(keys, mods);
- keys.push_back(name);
-- sendKeyEvent(format("{}", join(keys, "+")), action);
-+ sendKeyEvent(ImPlay::format("{}", join(keys, "+")), action);
- }
-
- void Window::handleMouse(int button, int action, int mods) {
-@@ -246,7 +246,7 @@ void Window::handleMouse(int button, int action, int mods) {
- auto s = mbtnMappings.find(button);
- if (s == mbtnMappings.end()) return;
- keys.push_back(s->second);
-- sendKeyEvent(format("{}", join(keys, "+")), action);
-+ sendKeyEvent(ImPlay::format("{}", join(keys, "+")), action);
- }
-
- void Window::sendKeyEvent(std::string key, bool action) {
---
-2.40.1
-
diff --git a/PKGBUILD b/PKGBUILD
index cc2efbbdd6c6..78185cabdbbc 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,7 +1,7 @@
# Maintainer: Mole Shang <135e2@135e2.dev>
pkgname=implay
pkgver=1.4.0
-pkgrel=4
+pkgrel=5
pkgdesc="Desktop media player built on top of mpv and imgui"
arch=('x86_64')
url="https://github.com/tsl0922/ImPlay"
@@ -18,19 +18,16 @@ makedepends=(
)
optdepends=()
source=(
- 'implay::git+https://github.com/tsl0922/ImPlay.git?tag=${pkgver}'
+ 'implay::git+https://github.com/tsl0922/ImPlay.git?commit=28a5fa84442cf5f21854526ef56ab86ba7156bda'
'0001-disable-unneeded-imgui-demo-window.patch'
- '0002-explicitly-declare-format-function-signature.patch'
)
sha256sums=(
'SKIP'
'ee4836cdde04b7e9a1fe6e27b2d9fc0751aea66066836b61dc0968cae402ca60'
- 'eaaa2cb6763646012e82c7d3e9c3befc416b7b9cb5a8c3b0d8dc3e79ab603a21'
)
prepare() {
patch -d "${pkgname}" -Np1 -i "${srcdir}/0001-disable-unneeded-imgui-demo-window.patch"
- patch -d "${pkgname}" -Np1 -i "${srcdir}/0002-explicitly-declare-format-function-signature.patch"
}
build() {