Skip to content

Commit

Permalink
v4.20
Browse files Browse the repository at this point in the history
  • Loading branch information
fooDayuyu@gmail.com committed Sep 20, 2023
1 parent c0f8e97 commit f048db5
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 35 deletions.
2 changes: 1 addition & 1 deletion src/foo_scheduler/action_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ ActionList* ActionList::Clone() const
std::unique_ptr<ActionList> ActionList::Duplicate(const std::wstring &newName) const
{
std::unique_ptr<ActionList> result(new ActionList(*this));
result->SetName(newName);
result->SetName(newName);
result->CreateGUID();
return result;
}
Expand Down
2 changes: 1 addition & 1 deletion src/foo_scheduler/event_s11n_block.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ struct EventS11nBlock : public S11nBlocks::Block<EventS11nBlock>
{
ar.RegisterFields(enabled)(actionListGUID)(protoGUID)(dateTimeEvent)(playerEvent)(menuItemEvent)(eventGUID);
}
};
};
Binary file modified src/foo_scheduler/foo_scheduler_mod.rc
Binary file not shown.
2 changes: 1 addition & 1 deletion src/foo_scheduler/foo_scheduler_mod_ver.rc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ BLOCK "StringFileInfo"
BEGIN
BLOCK "000904b0"
BEGIN
VALUE "CompanyName", "Andrew Smolko"
VALUE "CompanyName", "da yuyu"
VALUE "FileDescription", "Scheduler plugin for foobar2000"
VALUE "FileVersion", DLL_VERSION_STRING "\0"
VALUE "InternalName", COMPONENT_NAME
Expand Down
6 changes: 3 additions & 3 deletions src/foo_scheduler/foobar_services.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ void PluginConfiguration::set_data_raw(stream_reader* p_stream, t_size p_sizehin
readFailed = true;
}

if (readFailed || cfgVersion != PLUGIN_CFG_GLOBAL_VERSION)
if (readFailed || cfgVersion < PLUGIN_CFG_GLOBAL_V4_19)
{
console::info(PLUGIN_FILENAME " : the configuration format is of version 3.x. Upgrade is not supported. "
console::info(COMPONENT_NAME " : the configuration format is of version 3.x. Upgrade is not supported. "
"Resetting configuration.");
return;
}
Expand Down Expand Up @@ -192,7 +192,7 @@ namespace MainMenuItems

t_uint32 SchedulerActionListsCommands::get_command_count()
{
return ServiceManager::Instance().GetMenuItemEventsManager().GetNumEvents();
return static_cast<t_uint32>(ServiceManager::Instance().GetMenuItemEventsManager().GetNumEvents());
}

GUID SchedulerActionListsCommands::get_command(t_uint32 p_index)
Expand Down
2 changes: 2 additions & 0 deletions src/foo_scheduler/foobar_services.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once

using namespace cfg_var_legacy;

class PluginInitQuit : public initquit
{
public:
Expand Down
12 changes: 6 additions & 6 deletions src/foo_scheduler/menu_item_event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ GUID MenuItemEvent::GetGUID() const

std::unique_ptr<MenuItemEvent> MenuItemEvent::Duplicate(const std::wstring &newMenuItemName) const
{
std::unique_ptr<MenuItemEvent> result(new MenuItemEvent(*this));
std::unique_ptr<MenuItemEvent> result(new MenuItemEvent(*this));
result->NewEventGUID(); //event instance
result->SetMenuItemName(newMenuItemName);
result->GenerateMenuItemGUID(); //ui
return result;
result->SetMenuItemName(newMenuItemName);
result->GenerateMenuItemGUID(); //ui
return result;
}

void MenuItemEvent::OnSignal()
Expand Down Expand Up @@ -166,10 +166,10 @@ int MenuItemEvent::GetPriority() const

std::unique_ptr<Event> MenuItemEvent::CreateFromPrototype() const
{
std::unique_ptr<MenuItemEvent> pClone(new MenuItemEvent(*this));
std::unique_ptr<MenuItemEvent> pClone(new MenuItemEvent(*this));
pClone->NewEventGUID();
// It's important to change uuid, otherwise there may be problems with keyboard shortcuts.
pClone->GenerateMenuItemGUID();
pClone->GenerateMenuItemGUID();

return pClone;
}
Expand Down
19 changes: 10 additions & 9 deletions src/foo_scheduler/pch.h
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
#pragma once

#include "../helpers/foobar2000+atl.h"

// Modify the following defines if you have to target a platform prior to the ones specified below.
// Refer to MSDN for the latest info on corresponding values for different platforms.
#ifndef WINVER // Allow use of features specific to Vista or later.
#define WINVER 0x600 // Change this to the appropriate value to target other versions of Windows.
#ifndef WINVER
#define WINVER 0x601
#endif
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x600 // Vista or later#include <helpers/foobar2000+atl.h>
#define _WIN32_WINNT 0x601
#endif
#ifndef _WIN32_IE
#define _WIN32_IE 0x0600
#ifndef _WIN32_WINDOWS
#define _WIN32_WINDOWS 0x601
#endif

#include <winsdkver.h>

#include "../helpers/foobar2000+atl.h"

#pragma warning(disable: 4996)

#include <CommCtrl.h>
Expand All @@ -23,6 +23,7 @@
#include <atlctrls.h>

#include "../SDK/foobar2000.h"
#include "../SDK/cfg_var_legacy.h"
#include "../SDK/filesystem_helper.h"
#include "../SDK/album_art.h"

Expand Down
48 changes: 34 additions & 14 deletions src/foo_scheduler/version.h
Original file line number Diff line number Diff line change
@@ -1,39 +1,55 @@
#pragma once

#define PLUGIN_NAME "Scheduler Mod"
#define PLUGIN_NAME "Scheduler mod"

#define COMPONENT_VERSION_MAJOR 4
#define COMPONENT_VERSION_MINOR 19
#define COMPONENT_VERSION_PATCH 5
#define COMPONENT_VERSION_MINOR 20
#define COMPONENT_VERSION_PATCH 0
#define COMPONENT_VERSION_SUB_PATCH 0

#define MAKE_STRING(text) #text

//#define FIX_VER

#ifdef FIX_VER
#define MAKE_COMPONENT_VERSION(major,minor,patch) MAKE_STRING(major) "." MAKE_STRING(minor) "." MAKE_STRING(patch)
#define FOO_SCHEDULER_VERSION MAKE_COMPONENT_VERSION(COMPONENT_VERSION_MAJOR,COMPONENT_VERSION_MINOR,COMPONENT_VERSION_PATCH)
#define MAKE_DLL_VERSION(major,minor,patch,subpatch) MAKE_STRING(major) "." MAKE_STRING(minor) "." MAKE_STRING(patch) "." MAKE_STRING(subpatch)
#define MAKE_API_SDK_VERSION(sdk_ver, sdk_target) MAKE_STRING(sdk_ver) " " MAKE_STRING(sdk_target)
#else
#define MAKE_COMPONENT_VERSION(major,minor) MAKE_STRING(major) "." MAKE_STRING(minor)
#define FOO_SCHEDULER_VERSION MAKE_COMPONENT_VERSION(COMPONENT_VERSION_MAJOR,COMPONENT_VERSION_MINOR)
#define MAKE_DLL_VERSION(major,minor) MAKE_STRING(major) "." MAKE_STRING(minor)
#endif

//"0.1.2"
#define FOO_SCHEDULER_VERSION MAKE_COMPONENT_VERSION(COMPONENT_VERSION_MAJOR,COMPONENT_VERSION_MINOR,COMPONENT_VERSION_PATCH)
#define MAKE_API_SDK_VERSION(sdk_ver, sdk_target) MAKE_STRING(sdk_ver) " " MAKE_STRING(sdk_target)

//0.1.2.3 & "0.1.2.3"
#ifdef FIX_VER
#define DLL_VERSION_NUMERIC COMPONENT_VERSION_MAJOR, COMPONENT_VERSION_MINOR, COMPONENT_VERSION_PATCH, COMPONENT_VERSION_SUB_PATCH
#define DLL_VERSION_STRING MAKE_DLL_VERSION(COMPONENT_VERSION_MAJOR,COMPONENT_VERSION_MINOR,COMPONENT_VERSION_PATCH,COMPONENT_VERSION_SUB_PATCH)
#else
#define DLL_VERSION_NUMERIC COMPONENT_VERSION_MAJOR, COMPONENT_VERSION_MINOR
#define DLL_VERSION_STRING MAKE_DLL_VERSION(COMPONENT_VERSION_MAJOR,COMPONENT_VERSION_MINOR)
#endif

//fb2k ver
#define PLUGIN_FB2K_SDK MAKE_API_SDK_VERSION(FOOBAR2000_SDK_VERSION, FOOBAR2000_TARGET_VERSION)

#define COMPONENT_NAME "foo_scheduler_mod"
#define COMPONENT_YEAR "2023"

#define PLUGIN_FILENAME COMPONENT_NAME
#define PLUGIN_DLLFILENAME PLUGIN_FILENAME ".dll"
#define PLUGIN_DLLFILENAME COMPONENT_NAME ".dll"
#define PLUGIN_VERSION FOO_SCHEDULER_VERSION

// To support correct upgrade from the 3rd version of the plugin.
#define PLUGIN_CFG_GLOBAL_VERSION 0x0040
#define PLUGIN_CFG_GLOBAL_V4_19 0x0040
#define PLUGIN_CFG_GLOBAL_V4_19_FLDS 6
#define PLUGIN_CFG_GLOBAL_VERSION 0x0041
#define PLUGIN_CFG_GLOBAL_VERSION_FLDS 7

#define PLUGIN_ABOUT \
PLUGIN_NAME"\n\n" \
"Component modded by DaYuyu.\n" \
"Plugin for scheduling actions like play, stop, system shutdown/wake up and many more." \
" The schedule for triggering actions can be based on time/date events, player events or user-defined menu items.\n\n" \
"Author: da yuyu.\n" \
"Version: "FOO_SCHEDULER_VERSION"\n" \
"Compiled: "__DATE__ "\n" \
"fb2k SDK: "PLUGIN_FB2K_SDK"\n" \
Expand All @@ -46,9 +62,13 @@ PLUGIN_NAME"\n\n" \
"Thanks to Andrew Smolko for developing the foo_scheduler project (up to version 4.19).\n" \
"\n" \
"Changelog:\n" \
"\n" \
"= 4.20\n" \
"* Fixed empty event list running File > Scheduler mod > Preferences.\n" \
"* Added 'Playlist from saved state' option to 'Change playlist' action.\n" \
"\n" \
"= 4.19.5\n" \
"* Fixed preferences page default font and low-res layout.\n" \
"* Fixed preferences page font and layout.\n" \
"\n" \
"= 4.19.4\n" \
"* Fixed single track playlists 'Wait until 1 track played'.\n" \
Expand All @@ -65,7 +85,7 @@ PLUGIN_NAME"\n\n" \
"* Added new option 'Active playlist' to 'Change playlist' action.\n" \
"\n" \
"= 4.19.1\n" \
"* Component renamed 'Scheduler Mod'.\n" \
"* Component renamed 'Scheduler mod'.\n" \
"* New 32/64bit installer.\n" \
"* Event list drag & drop.\n" \
"* Added date/time event context menu (timer initializer).\n" \
Expand Down

0 comments on commit f048db5

Please sign in to comment.