├── .appveyor.yml
├── .github
└── FUNDING.yml
├── .gitignore
├── .gitmodules
├── .reapack-index.conf
├── ABOUT.md
├── CMakeLists.txt
├── COPYING
├── COPYING.LESSER
├── Extensions
└── ReaPack.ext
├── README.md
├── cmake
├── FindMiniZip.cmake
├── FindPHP.cmake
├── FindSWELL.cmake
├── FindWDL.cmake
├── brew-llvm.cmake
├── linux-cross.cmake
└── vcpkg-triplets
│ ├── arch-env.cmake
│ └── arm64ec-windows-static.cmake
├── index.xml
├── prepare.rb
├── src
├── CMakeLists.txt
├── about.cpp
├── about.hpp
├── action.cpp
├── action.hpp
├── api.cpp
├── api.hpp
├── api_helper.hpp
├── api_misc.cpp
├── api_package.cpp
├── api_repo.cpp
├── archive.cpp
├── archive.hpp
├── archive_tasks.cpp
├── browser.cpp
├── browser.hpp
├── browser_entry.cpp
├── browser_entry.hpp
├── buildinfo.hpp.in
├── buildinfo.rc
├── config.cpp
├── config.hpp
├── control.cpp
├── control.hpp
├── database.cpp
├── database.hpp
├── dialog.cpp
├── dialog.hpp
├── dialog.mm
├── dllimport.hpp
├── download.cpp
├── download.hpp
├── errors.hpp
├── event.cpp
├── event.hpp
├── filedialog.cpp
├── filedialog.hpp
├── filesystem.cpp
├── filesystem.hpp
├── filter.cpp
├── filter.hpp
├── hash.cpp
├── hash.hpp
├── iconlist.cpp
├── iconlist.hpp
├── import.cpp
├── import.hpp
├── index.cpp
├── index.hpp
├── index_v1.cpp
├── install.cpp
├── listview.cpp
├── listview.hpp
├── main.cpp
├── manager.cpp
├── manager.hpp
├── menu.cpp
├── menu.hpp
├── metadata.cpp
├── metadata.hpp
├── obsquery.cpp
├── obsquery.hpp
├── package.cpp
├── package.hpp
├── path.cpp
├── path.hpp
├── platform.cpp
├── platform.hpp
├── progress.cpp
├── progress.hpp
├── reapack.cpp
├── reapack.hpp
├── receipt.cpp
├── receipt.hpp
├── registry.cpp
├── registry.hpp
├── remote.cpp
├── remote.hpp
├── report.cpp
├── report.hpp
├── resource.hpp
├── resource.rc
├── richedit-generic.cpp
├── richedit-win32.cpp
├── richedit.hpp
├── richedit.mm
├── serializer.cpp
├── serializer.hpp
├── source.cpp
├── source.hpp
├── string.cpp
├── string.hpp
├── synchronize.cpp
├── tabbar.cpp
├── tabbar.hpp
├── task.cpp
├── task.hpp
├── thread.cpp
├── thread.hpp
├── time.cpp
├── time.hpp
├── transaction.cpp
├── transaction.hpp
├── version.cpp
├── version.hpp
├── win32.cpp
├── win32.hpp
├── xml.hpp
├── xml_libxml2.cpp
└── xml_tinyxml2.cpp
├── test
├── CMakeLists.txt
├── action.cpp
├── api.cpp
├── database.cpp
├── event.cpp
├── filesystem.cpp
├── filter.cpp
├── hash.cpp
├── helper.cpp
├── helper.hpp
├── index.cpp
├── index_v1.cpp
├── indexes
│ ├── ReaPack
│ │ └── cache
│ │ │ ├── broken.xml
│ │ │ ├── future_version.xml
│ │ │ ├── invalid_version.xml
│ │ │ ├── wrong_root.xml
│ │ │ └── Новая папка.xml
│ └── v1
│ │ └── ReaPack
│ │ └── cache
│ │ ├── author.xml
│ │ ├── changelog.xml
│ │ ├── explicit_sections.xml
│ │ ├── metadata.xml
│ │ ├── missing_platform.xml
│ │ ├── missing_source_file.xml
│ │ ├── missing_source_url.xml
│ │ ├── missing_type.xml
│ │ ├── missing_version.xml
│ │ ├── pkg_desc.xml
│ │ ├── pkg_metadata.xml
│ │ ├── src_platform.xml
│ │ ├── src_type.xml
│ │ ├── time.xml
│ │ ├── unnamed_category.xml
│ │ ├── unnamed_package.xml
│ │ ├── unsupported_type.xml
│ │ ├── valid_index.xml
│ │ ├── wrong_category_tag.xml
│ │ ├── wrong_package_tag.xml
│ │ └── wrong_version_tag.xml
├── metadata.cpp
├── package.cpp
├── path.cpp
├── platform.cpp
├── receipt.cpp
├── registry.cpp
├── remote.cpp
├── serializer.cpp
├── source.cpp
├── string.cpp
├── time.cpp
├── version.cpp
├── win32.cpp
└── xml.cpp
├── vcpkg.json
└── vendor
└── reaper_plugin_secrets.h
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | github: 'cfillion'
2 | custom:
3 | - "https://reapack.com/donate"
4 | - "https://paypal.me/cfillion"
5 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /build/
2 | /vendor
3 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "vendor/WDL"]
2 | path = vendor/WDL
3 | url = https://github.com/justinfrankel/WDL.git
4 | [submodule "vendor/reaper-sdk"]
5 | path = vendor/reaper-sdk
6 | url = https://github.com/justinfrankel/reaper-sdk.git
7 |
--------------------------------------------------------------------------------
/.reapack-index.conf:
--------------------------------------------------------------------------------
1 | --about ABOUT.md
2 | --ignore src
3 | --ignore test
4 | --ignore vendor
5 | --strict
6 |
--------------------------------------------------------------------------------
/ABOUT.md:
--------------------------------------------------------------------------------
1 | # ReaPack: Package Manager for REAPER
2 |
3 | This is **ReaPack v[[REAPACK_VERSION]]** [[REAPACK_REVISION]] built on [[REAPACK_BUILDTIME]]
4 |
5 | ```
6 | Copyright (C) 2015-2025 Christian Fillion
7 |
8 | This program is free software: you can redistribute it and/or modify
9 | it under the terms of the GNU Lesser General Public License as published by
10 | the Free Software Foundation, either version 3 of the License, or
11 | (at your option) any later version.
12 |
13 | This program is distributed in the hope that it will be useful,
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | GNU Lesser General Public License for more details.
17 |
18 | Visit to get a copy of the
19 | GNU Lesser General Public License.
20 | ```
21 |
--------------------------------------------------------------------------------
/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.15)
2 |
3 | option(RUNTIME_OPENSSL
4 | "Load OpenSSL at runtime instead of linking against a specific version" OFF)
5 |
6 | if(DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE)
7 | set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
8 | CACHE STRING "")
9 | endif()
10 |
11 | if(DEFINED ENV{VCPKG_DEFAULT_TRIPLET} AND NOT DEFINED VCPKG_TARGET_TRIPLET)
12 | set(VCPKG_TARGET_TRIPLET "$ENV{VCPKG_DEFAULT_TRIPLET}" CACHE STRING "")
13 | endif()
14 |
15 | project(reapack LANGUAGES C CXX)
16 |
17 | list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
18 |
19 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
20 | if(WIN32)
21 | set(USER_CONFIG_DIR "$ENV{APPDATA}")
22 | elseif(APPLE)
23 | set(USER_CONFIG_DIR "~/Library/Application Support")
24 | else()
25 | set(USER_CONFIG_DIR "~/.config")
26 | endif()
27 |
28 | set(CMAKE_INSTALL_PREFIX "${USER_CONFIG_DIR}/REAPER" CACHE PATH
29 | "REAPER resource path where to install ReaPack" FORCE)
30 | endif()
31 |
32 | if(CMAKE_OSX_ARCHITECTURES)
33 | list(JOIN CMAKE_OSX_ARCHITECTURES "-" ARCH_NAME)
34 | elseif(MSVC_CXX_ARCHITECTURE_ID)
35 | set(ARCH_NAME ${MSVC_CXX_ARCHITECTURE_ID})
36 | else()
37 | set(ARCH_NAME ${CMAKE_SYSTEM_PROCESSOR})
38 | endif()
39 |
40 | STRING(TOLOWER "${ARCH_NAME}" ARCH_NAME)
41 |
42 | set(CMAKE_CXX_EXTENSIONS OFF)
43 | set(CMAKE_CXX_STANDARD_REQUIRED ON)
44 | set(CMAKE_CXX_VISIBILITY_PRESET "hidden")
45 | set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>")
46 | set(CMAKE_POSITION_INDEPENDENT_CODE ON)
47 |
48 | set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_MINSIZEREL ON)
49 | set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE ON)
50 | set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO ON)
51 |
52 | if(VCPKG_TOOLCHAIN)
53 | set(CMAKE_MAP_IMPORTED_CONFIG_MINSIZEREL Release)
54 | set(CMAKE_MAP_IMPORTED_CONFIG_RELWITHDEBINFO Release)
55 | endif()
56 |
57 | if(WIN32)
58 | foreach(arg
59 | CMAKE_C_FLAGS_DEBUG CMAKE_CXX_FLAGS_DEBUG
60 | CMAKE_C_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELEASE
61 | CMAKE_C_FLAGS_RELWITHDEBINFO CMAKE_CXX_FLAGS_RELWITHDEBINFO
62 | CMAKE_C_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_MINSIZEREL
63 | )
64 | # Embed debug information in the object files
65 | string(REGEX REPLACE "/Z[iI]" "/Z7" ${arg} "${${arg}}")
66 | endforeach()
67 |
68 | add_compile_options(
69 | # Exception handling model
70 | /EHsc
71 |
72 | # Enhance optimized debugging
73 | $<$>:/Zo>
74 |
75 | # Eliminate duplicate strings
76 | $<$>:/GF>
77 |
78 | # Enable function-level linking
79 | $<$>:/Gy>
80 |
81 | # Remove unreferenced COMDAT
82 | $<$>:/Zc:inline>
83 | )
84 |
85 | add_link_options(
86 | # Remove unreferenced code
87 | $<$>:/OPT:REF>
88 |
89 | # Remove duplicate sections
90 | $<$>:/OPT:ICF>
91 |
92 | # Use relative path to the PDB file to avoid exposing the full path
93 | /PDBALTPATH:%_PDB%
94 | )
95 | else()
96 | add_compile_options(-fsigned-char -fstack-protector-strong -fdiagnostics-color)
97 | endif()
98 |
99 | find_package(Ruby)
100 | if(RUBY_FOUND)
101 | add_custom_target(prepare
102 | COMMAND ruby prepare.rb src/*.{{h,c}pp,mm}
103 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
104 | )
105 | endif()
106 |
107 | add_library(reaper_reapack SHARED)
108 | set_target_properties(reaper_reapack PROPERTIES
109 | PREFIX "" # disable the "lib" prefix
110 | OUTPUT_NAME "reaper_reapack-${ARCH_NAME}"
111 | )
112 | add_subdirectory(src)
113 | target_link_libraries(reaper_reapack reapack)
114 |
115 | add_subdirectory(test)
116 | add_custom_target(test
117 | COMMAND $
118 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
119 | USES_TERMINAL
120 | )
121 | add_dependencies(test tests)
122 |
123 | set(REAPER_USER_PLUGINS "UserPlugins")
124 | install(TARGETS reaper_reapack
125 | COMPONENT ReaPack
126 | RUNTIME DESTINATION "${REAPER_USER_PLUGINS}" # Windows .dll
127 | LIBRARY DESTINATION "${REAPER_USER_PLUGINS}" # Linux .so/macOS .dylib
128 | )
129 |
--------------------------------------------------------------------------------
/Extensions/ReaPack.ext:
--------------------------------------------------------------------------------
1 | @description ReaPack: Package manager for REAPER
2 | @version 1.2.5.1
3 | @author cfillion
4 | @donation https://reapack.com/donate
5 | @provides
6 | [darwin32 ] reaper_reapack-i386.dylib https://github.com/cfillion/reapack/releases/download/v$version/$path
7 | [darwin64 ] reaper_reapack-x86_64.dylib https://github.com/cfillion/reapack/releases/download/v$version/$path
8 | [darwin-arm64 ] reaper_reapack-arm64.dylib https://github.com/cfillion/reapack/releases/download/v$version/$path
9 | [linux32 ] reaper_reapack-i686.so https://github.com/cfillion/reapack/releases/download/v$version/$path
10 | [linux64 ] reaper_reapack-x86_64.so https://github.com/cfillion/reapack/releases/download/v$version/$path
11 | [linux-armv7l ] reaper_reapack-armv7l.so https://github.com/cfillion/reapack/releases/download/v$version/$path
12 | [linux-aarch64 ] reaper_reapack-aarch64.so https://github.com/cfillion/reapack/releases/download/v$version/$path
13 | [win32 ] reaper_reapack-x86.dll https://github.com/cfillion/reapack/releases/download/v$version/$path
14 | [win64 ] reaper_reapack-x64.dll https://github.com/cfillion/reapack/releases/download/v$version/$path
15 | [windows-arm64ec] reaper_reapack-arm64ec.dll https://github.com/cfillion/reapack/releases/download/v$version/$path
16 | @changelog
17 | • Check SSL certificate revocation servers on a best-efforts basis instead of strictly failing downloads on Windows [#90]
18 | • Lift 4096 character limit from user input when importing repositories
19 | • Propose to automatically download files from reapack.com for users impacted by GitHub's updated rate limits (error 429)
20 |
--------------------------------------------------------------------------------
/cmake/FindMiniZip.cmake:
--------------------------------------------------------------------------------
1 | if(MiniZip_FOUND)
2 | return()
3 | endif()
4 |
5 | find_package(WDL REQUIRED)
6 | find_path(MiniZip_INCLUDE_DIR
7 | NAMES unzip.h
8 | PATHS ${WDL_DIR}
9 | PATH_SUFFIXES zlib
10 | NO_DEFAULT_PATH
11 | )
12 | mark_as_advanced(MiniZip_INCLUDE_DIR)
13 |
14 | include(FindPackageHandleStandardArgs)
15 | find_package_handle_standard_args(MiniZip REQUIRED_VARS MiniZip_INCLUDE_DIR)
16 |
17 | add_library(minizip
18 | ${MiniZip_INCLUDE_DIR}/ioapi.c
19 | ${MiniZip_INCLUDE_DIR}/unzip.c
20 | ${MiniZip_INCLUDE_DIR}/zip.c
21 | )
22 |
23 | target_include_directories(minizip INTERFACE ${MiniZip_INCLUDE_DIR})
24 |
25 | find_package(ZLIB REQUIRED)
26 | target_link_libraries(minizip ZLIB::ZLIB)
27 |
28 | add_library(MiniZip::MiniZip ALIAS minizip)
29 |
--------------------------------------------------------------------------------
/cmake/FindPHP.cmake:
--------------------------------------------------------------------------------
1 | find_program(PHP_EXECUTABLE php)
2 | mark_as_advanced(PHP_EXECUTABLE)
3 |
4 | execute_process(
5 | COMMAND ${PHP_EXECUTABLE} -v
6 | OUTPUT_VARIABLE PHP_VERSION_OUTPUT
7 | ERROR_QUIET
8 | OUTPUT_STRIP_TRAILING_WHITESPACE
9 | )
10 |
11 | if(PHP_VERSION_OUTPUT MATCHES "PHP ([^ ]+) ")
12 | set(PHP_VERSION "${CMAKE_MATCH_1}")
13 | endif()
14 |
15 | include(FindPackageHandleStandardArgs)
16 | find_package_handle_standard_args(PHP
17 | REQUIRED_VARS PHP_EXECUTABLE
18 | VERSION_VAR PHP_VERSION
19 | )
20 |
--------------------------------------------------------------------------------
/cmake/FindSWELL.cmake:
--------------------------------------------------------------------------------
1 | if(SWELL_FOUND)
2 | return()
3 | endif()
4 |
5 | find_package(WDL REQUIRED)
6 |
7 | find_path(SWELL_INCLUDE_DIR
8 | NAMES swell/swell.h
9 | PATHS ${WDL_DIR}
10 | NO_DEFAULT_PATH
11 | )
12 | mark_as_advanced(SWELL_INCLUDE_DIR)
13 |
14 | set(SWELL_DIR "${SWELL_INCLUDE_DIR}/swell")
15 | set(SWELL_RESGEN "${SWELL_DIR}/swell_resgen.php")
16 |
17 | include(FindPackageHandleStandardArgs)
18 | find_package_handle_standard_args(SWELL REQUIRED_VARS SWELL_DIR)
19 |
20 | add_library(swell ${SWELL_DIR}/swell-modstub$,.mm,-generic.cpp>)
21 |
22 | if(APPLE)
23 | find_library(APPKIT AppKit)
24 | mark_as_advanced(APPKIT)
25 | target_link_libraries(swell PUBLIC ${APPKIT})
26 | endif()
27 |
28 | target_compile_definitions(swell PUBLIC SWELL_PROVIDED_BY_APP)
29 | target_include_directories(swell INTERFACE ${SWELL_INCLUDE_DIR})
30 |
31 | add_library(SWELL::swell ALIAS swell)
32 |
--------------------------------------------------------------------------------
/cmake/FindWDL.cmake:
--------------------------------------------------------------------------------
1 | if(WDL_FOUND)
2 | return()
3 | endif()
4 |
5 | find_path(WDL_INCLUDE_DIR
6 | NAMES WDL/wdltypes.h
7 | PATHS ${CMAKE_SOURCE_DIR}/vendor/WDL
8 | NO_DEFAULT_PATH
9 | )
10 | mark_as_advanced(WDL_INCLUDE_DIR)
11 |
12 | set(WDL_DIR "${WDL_INCLUDE_DIR}/WDL")
13 |
14 | include(FindPackageHandleStandardArgs)
15 | find_package_handle_standard_args(WDL REQUIRED_VARS WDL_DIR WDL_INCLUDE_DIR)
16 |
17 | add_library(wdl ${WDL_DIR}/wingui/wndsize.cpp)
18 |
19 | target_compile_definitions(wdl INTERFACE WDL_NO_DEFINE_MINMAX)
20 | target_include_directories(wdl INTERFACE ${WDL_INCLUDE_DIR})
21 |
22 | if(NOT WIN32)
23 | find_package(SWELL REQUIRED)
24 | target_link_libraries(wdl SWELL::swell)
25 | endif()
26 |
27 | add_library(WDL::WDL ALIAS wdl)
28 |
--------------------------------------------------------------------------------
/cmake/brew-llvm.cmake:
--------------------------------------------------------------------------------
1 | set(CMAKE_C_COMPILER /usr/local/opt/llvm/bin/clang)
2 | set(CMAKE_CXX_COMPILER /usr/local/opt/llvm/bin/clang++)
3 | set(CMAKE_PREFIX_PATH /usr/local/opt/llvm)
4 |
--------------------------------------------------------------------------------
/cmake/linux-cross.cmake:
--------------------------------------------------------------------------------
1 | if(NOT DEFINED ENV{ARCH})
2 | message(FATAL_ERROR "The ARCH environment variable is not set.")
3 | endif()
4 |
5 | set(CMAKE_SYSTEM_NAME Linux)
6 | set(CMAKE_SYSTEM_PROCESSOR $ENV{ARCH})
7 |
8 | if($ENV{ARCH} STREQUAL "i686")
9 | set(CMAKE_C_FLAGS -m32)
10 | set(CMAKE_CXX_FLAGS -m32)
11 | elseif(NOT DEFINED ENV{TOOLCHAIN_PREFIX})
12 | message(FATAL_ERROR "The TOOLCHAIN_PREFIX environment variable is not set.")
13 | else()
14 | set(CMAKE_C_COMPILER $ENV{TOOLCHAIN_PREFIX}-gcc)
15 | set(CMAKE_CXX_COMPILER $ENV{TOOLCHAIN_PREFIX}-g++)
16 | endif()
17 |
18 | if(DEFINED ENV{TOOLCHAIN_PREFIX})
19 | set(CMAKE_FIND_ROOT_PATH /usr/$ENV{TOOLCHAIN_PREFIX})
20 | set(CMAKE_LIBRARY_PATH /usr/lib/$ENV{TOOLCHAIN_PREFIX})
21 | set(CMAKE_INCLUDE_PATH /usr/include/$ENV{TOOLCHAIN_PREFIX})
22 | endif()
23 |
--------------------------------------------------------------------------------
/cmake/vcpkg-triplets/arch-env.cmake:
--------------------------------------------------------------------------------
1 | if(NOT DEFINED ENV{ARCH})
2 | message(FATAL_ERROR "The ARCH environment variable is not set.")
3 | endif()
4 |
5 | if($ENV{ARCH} STREQUAL "x86_64")
6 | set(VCPKG_TARGET_ARCHITECTURE x64)
7 | elseif($ENV{ARCH} MATCHES "^i[36]86$")
8 | set(VCPKG_TARGET_ARCHITECTURE x86)
9 | elseif($ENV{ARCH} STREQUAL "armv7l")
10 | set(VCPKG_TARGET_ARCHITECTURE arm)
11 | elseif($ENV{ARCH} STREQUAL "aarch64")
12 | set(VCPKG_TARGET_ARCHITECTURE arm64)
13 | else()
14 | set(VCPKG_TARGET_ARCHITECTURE $ENV{ARCH})
15 | endif()
16 | set(VCPKG_BUILD_TYPE release)
17 | set(VCPKG_CRT_LINKAGE dynamic)
18 | set(VCPKG_LIBRARY_LINKAGE static)
19 |
20 | set(VCPKG_CMAKE_SYSTEM_NAME ${CMAKE_HOST_SYSTEM_NAME})
21 | set(VCPKG_OSX_ARCHITECTURES $ENV{ARCH})
22 | set(VCPKG_OSX_DEPLOYMENT_TARGET $ENV{DEPLOY_TARGET})
23 |
--------------------------------------------------------------------------------
/cmake/vcpkg-triplets/arm64ec-windows-static.cmake:
--------------------------------------------------------------------------------
1 | set(VCPKG_TARGET_ARCHITECTURE arm64ec)
2 | set(VCPKG_CRT_LINKAGE static)
3 | set(VCPKG_LIBRARY_LINKAGE static)
4 |
--------------------------------------------------------------------------------
/prepare.rb:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 |
3 | Signal.trap('INT') { abort }
4 |
5 | REGEX = /\A\/\*.+?\*\/\n/m.freeze
6 | PREAMBLE = DATA.read.freeze
7 |
8 | def process(input)
9 | if input.start_with? '/'
10 | before = input.hash
11 | input.sub! REGEX, PREAMBLE
12 | input if input.hash != before
13 | else
14 | input.prepend "#{PREAMBLE}\n"
15 | end
16 | end
17 |
18 | ARGV.each do |path|
19 | File.open path, 'r+t' do |file|
20 | output = process file.read
21 | next unless output
22 |
23 | file.rewind
24 | file.write output
25 | file.truncate file.pos
26 | end
27 | end
28 |
29 | __END__
30 | /* ReaPack: Package manager for REAPER
31 | * Copyright (C) 2015-2025 Christian Fillion
32 | *
33 | * This program is free software: you can redistribute it and/or modify
34 | * it under the terms of the GNU Lesser General Public License as published by
35 | * the Free Software Foundation, either version 3 of the License, or
36 | * (at your option) any later version.
37 | *
38 | * This program is distributed in the hope that it will be useful,
39 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
40 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
41 | * GNU Lesser General Public License for more details.
42 | *
43 | * You should have received a copy of the GNU Lesser General Public License
44 | * along with this program. If not, see .
45 | */
46 |
--------------------------------------------------------------------------------
/src/action.cpp:
--------------------------------------------------------------------------------
1 | /* ReaPack: Package manager for REAPER
2 | * Copyright (C) 2015-2025 Christian Fillion
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Lesser General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | #include "action.hpp"
19 |
20 | #include
21 |
22 | Action::Action(const char *name, const char *desc, const Callback &callback)
23 | : m_name(name), m_reg{}, m_callback(callback)
24 | {
25 | m_reg.accel.cmd = plugin_register("command_id", const_cast(m_name));
26 | m_reg.desc = desc;
27 |
28 | plugin_register("gaccel", &m_reg);
29 | }
30 |
31 | Action::~Action()
32 | {
33 | plugin_register("-gaccel", &m_reg);
34 | plugin_register("-command_id", const_cast(m_name));
35 | }
36 |
37 | Action *ActionList::find(const Action::CommandID id) const
38 | {
39 | const auto it = m_list.find(id);
40 | return it != m_list.end() ? it->second.get() : nullptr;
41 | }
42 |
43 | bool ActionList::run(const Action::CommandID id) const
44 | {
45 | if(Action *action = find(id)) {
46 | action->run();
47 | return true;
48 | }
49 |
50 | return false;
51 | }
52 |
--------------------------------------------------------------------------------
/src/action.hpp:
--------------------------------------------------------------------------------
1 | /* ReaPack: Package manager for REAPER
2 | * Copyright (C) 2015-2025 Christian Fillion
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Lesser General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | #ifndef REAPACK_ACTION_HPP
19 |
20 | #include
21 | #include