Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
170a515
shutdown
inigomonyota Mar 16, 2025
06daa0f
reimplement MuteVideo check
inigomonyota Mar 16, 2025
eb38bed
tag reading
inigomonyota Mar 16, 2025
781099f
more tags
inigomonyota Mar 16, 2025
e0ebbee
m3u loading, musicPlayer.m3uplaylist
inigomonyota Mar 16, 2025
9e03d63
controls
inigomonyota Mar 16, 2025
a36c8b9
trackInfo reloadableText
inigomonyota Mar 16, 2025
29b63d2
increase volume change step
inigomonyota Mar 16, 2025
1da8863
add ability to extract album art, not yet in use
inigomonyota Mar 16, 2025
c107cb0
in settings.conf
inigomonyota Mar 16, 2025
78089e8
logarithmic volume change
inigomonyota Mar 17, 2025
c08097f
volume fade in/out on next/prev track and pause/resume
inigomonyota Mar 17, 2025
494ee3f
prevent setting volume if currently fading
inigomonyota Mar 17, 2025
21f4e5d
prevent next/prev track and pause/resume if currently fading
inigomonyota Mar 17, 2025
92326c0
controls adjustment
inigomonyota Mar 17, 2025
ebf64e1
initial musicplayercomponent
inigomonyota Mar 18, 2025
1ee833f
initial albumart
inigomonyota Mar 19, 2025
20b4f84
underscore member variables
inigomonyota Mar 19, 2025
45c0f84
initial volbar
inigomonyota Mar 20, 2025
72335cf
volbar fade
inigomonyota Mar 20, 2025
083459f
fixups
inigomonyota Mar 20, 2025
d6b0110
initial progress bar
inigomonyota Mar 20, 2025
95a2c3d
cstring include and cmakelists.txt
inigomonyota Mar 21, 2025
43f8926
initial vumeter
inigomonyota Mar 22, 2025
210b5aa
initial commit
inigomonyota Mar 24, 2025
2831e0e
logarithmic volume
inigomonyota Mar 24, 2025
5861baf
reuse text components
inigomonyota Mar 24, 2025
c06beb9
attractmodelaunch termination safeguards
inigomonyota Mar 25, 2025
fa33c81
silence linux warnings
inigomonyota Mar 25, 2025
af6e810
reset attract mode on musicplayer interaction
inigomonyota Mar 25, 2025
e80a029
logical volume adjustment
inigomonyota Mar 25, 2025
1253c15
logical volume adjustment #2
inigomonyota Mar 25, 2025
2f9fd77
fix exception when shutting down
inigomonyota Mar 26, 2025
12c92de
include algorithm for linux
inigomonyota Mar 26, 2025
8bfd1bb
better state handling
inigomonyota Mar 27, 2025
023c834
move album art i/o operations into update from draw
inigomonyota Mar 28, 2025
e17b6ba
set imagewidth/height for default album art
inigomonyota Mar 28, 2025
008c857
prevent MusicPlayerComponent from showing any components until MusicP…
inigomonyota Mar 29, 2025
7ea721a
musicPlayer.volumeDelay controls how quickly a button press can chang…
inigomonyota Mar 29, 2025
990e072
use SDL_GetTicks64 to seed random number generator just for consistency
inigomonyota Mar 29, 2025
7809559
Merge branch 'master' into musicplayer2
aidenjbass Apr 2, 2025
4533589
correct albumart refresh if statement
inigomonyota Apr 3, 2025
c341d16
Mix_Init with MP3 flag, logs success/failure
inigomonyota Apr 4, 2025
b3b42ef
volume bar png segment detection
inigomonyota Apr 5, 2025
7e458ee
set baseViewInfo.ImageWidth/Height on volbar and use it when drawing
inigomonyota Apr 5, 2025
7dc928a
adjusted alpha threshold in segment detection function
inigomonyota Apr 5, 2025
6ccc3e6
some refactorings/cleanups
inigomonyota Apr 5, 2025
4300bb3
put loadAlbumArt() call inside currentTrack/albumArtTrack check
inigomonyota Apr 6, 2025
034438f
Merge branch 'master' into musicplayer2
aidenjbass Apr 6, 2025
df89342
initialize hasVisualizer_ to false
inigomonyota Apr 10, 2025
1a9a76a
render vumeter to a target texture
inigomonyota Apr 10, 2025
a77b121
use loadedComponent_ only
inigomonyota Apr 10, 2025
1e27c47
Merge branch 'master' into musicplayer2
aidenjbass Apr 12, 2025
d725785
Update project.pbxproj
aidenjbass Apr 12, 2025
2164b64
Don't call SDL methods from update(dt)
inigomonyota Apr 12, 2025
cfef57f
extractalbumart internal logging, also better exception handling
inigomonyota Apr 12, 2025
f95f5fc
Merge branch 'master' into musicplayer2
aidenjbass Apr 13, 2025
f09fd7b
Merge branch 'master' into musicplayer2
aidenjbass Apr 13, 2025
7c48453
Update RetroFE.cpp
aidenjbass Apr 13, 2025
e1c27f3
add_dependencies(retrofe GenerateVersioningHeader)
inigomonyota Apr 14, 2025
cffdfb0
Merge branch 'master' into musicplayer2
aidenjbass Apr 14, 2025
5af75a7
Add SDL2 include discrepancy to MusicPlayer.h
aidenjbass Apr 14, 2025
c5042a8
Merge branch 'master' into musicplayer2
aidenjbass Apr 14, 2025
b5e5812
Update RetroFE.cpp
aidenjbass Apr 14, 2025
282dfca
musicPlayer.vuMeter.topColor
inigomonyota Apr 15, 2025
d3e09b4
isProgressBar_ bool
inigomonyota Apr 16, 2025
42188f0
VideoPool simplification, removed redundant error handling in VideoCo…
inigomonyota Apr 19, 2025
caec6b8
Merge branch 'musicplayer2' of https://github.com/CoinOPS-Official/Re…
inigomonyota Apr 19, 2025
7c8f2dd
intermediate paused state and check before ready in unload
inigomonyota Apr 26, 2025
bc05b30
experiment
inigomonyota Apr 26, 2025
facf9f5
rely only on message handler for loop handling
inigomonyota Apr 27, 2025
86d0ef9
disconnect attractmode if idleTime <=0
inigomonyota Apr 27, 2025
2e5099d
linux fix
inigomonyota Apr 27, 2025
48c0b8a
remove this warning, spams hard
inigomonyota May 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions RetroFE/Source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ set(RETROFE_HEADERS
"${RETROFE_DIR}/Source/Graphics/Component/Component.h"
"${RETROFE_DIR}/Source/Graphics/Component/Image.h"
"${RETROFE_DIR}/Source/Graphics/Component/ImageBuilder.h"
"${RETROFE_DIR}/Source/Graphics/Component/MusicPlayerComponent.h"
"${RETROFE_DIR}/Source/Graphics/Component/ReloadableHiscores.h"
"${RETROFE_DIR}/Source/Graphics/Component/ReloadableMedia.h"
"${RETROFE_DIR}/Source/Graphics/Component/ReloadableText.h"
Expand All @@ -231,6 +232,7 @@ set(RETROFE_HEADERS
"${RETROFE_DIR}/Source/Graphics/ThreadPool.h"
"${RETROFE_DIR}/Source/Menu/Menu.h"
"${RETROFE_DIR}/Source/Sound/Sound.h"
"${RETROFE_DIR}/Source/Sound/MusicPlayer.h"
"${RETROFE_DIR}/Source/Utility/Log.h"
"${RETROFE_DIR}/Source/Utility/Utils.h"
"${RETROFE_DIR}/Source/Video/IVideo.h"
Expand Down Expand Up @@ -278,6 +280,7 @@ set(RETROFE_SOURCES
"${RETROFE_DIR}/Source/Graphics/Component/Component.cpp"
"${RETROFE_DIR}/Source/Graphics/Component/Image.cpp"
"${RETROFE_DIR}/Source/Graphics/Component/ImageBuilder.cpp"
"${RETROFE_DIR}/Source/Graphics/Component/MusicPlayerComponent.cpp"
"${RETROFE_DIR}/Source/Graphics/Component/ReloadableHiscores.cpp"
"${RETROFE_DIR}/Source/Graphics/Component/Text.cpp"
"${RETROFE_DIR}/Source/Graphics/Component/ReloadableMedia.cpp"
Expand All @@ -288,6 +291,7 @@ set(RETROFE_SOURCES
"${RETROFE_DIR}/Source/Graphics/Component/VideoComponent.cpp"
"${RETROFE_DIR}/Source/Menu/Menu.cpp"
"${RETROFE_DIR}/Source/Sound/Sound.cpp"
"${RETROFE_DIR}/Source/Sound/MusicPlayer.cpp"
"${RETROFE_DIR}/Source/Utility/Log.cpp"
"${RETROFE_DIR}/Source/Utility/Utils.cpp"
"${RETROFE_DIR}/Source/Video/GStreamerVideo.cpp"
Expand Down
5 changes: 5 additions & 0 deletions RetroFE/Source/Control/UserInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ bool UserInput::initialize()
MapKey("toggleBuildInfo", KeyCodeToggleBuildInfo, false);
MapKey("settings", KeyCodeSettings, false);
MapKey("quickPlaylist", KeyCodeQuickList, false);
MapKey("musicPlayer.playPause", KeyCodeMusicPlayPause, false);
MapKey("musicPlayer.next", KeyCodeMusicNext, false);
MapKey("musicPlayer.prev", KeyCodeMusicPrev, false);
MapKey("musicPlayer.volUp", KeyCodeMusicVolumeUp, false);
MapKey("musicPlayer.volDown", KeyCodeMusicVolumeDown, false);

std::string jbKey;
if(config_.getProperty(OPTION_JUKEBOX, jbKey)) {
Expand Down
7 changes: 7 additions & 0 deletions RetroFE/Source/Control/UserInput.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@ class UserInput
KeyCodeToggleBuildInfo,
KeyCodeSettings,
KeyCodeQuickList,
KeyCodeMusicPlayPause,
KeyCodeMusicNext,
KeyCodeMusicPrev,
KeyCodeMusicVolumeUp,
KeyCodeMusicVolumeDown,
KeyCodeMusicToggleShuffle,
KeyCodeMusicToggleLoop,
// leave KeyCodeMax at the end
KeyCodeMax,
};
Expand Down
19 changes: 19 additions & 0 deletions RetroFE/Source/Database/Configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,25 @@ bool Configuration::getProperty(const std::string& key, int& value)
return retVal;
}

bool Configuration::getProperty(const std::string& key, float& value)
{
std::string strValue;
bool retVal = getProperty(key, strValue);

if (retVal) {
try {
value = std::stof(strValue);
}
catch (const std::invalid_argument&) {
LOG_WARNING("RetroFE", "Invalid float format for key: " + key);
}
catch (const std::out_of_range&) {
LOG_WARNING("RetroFE", "Float out of range for key: " + key);
}
}
return retVal;
}


bool Configuration::getProperty(const std::string& key, bool& value)
{
Expand Down
1 change: 1 addition & 0 deletions RetroFE/Source/Database/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class Configuration
bool import(const std::string& collection, const std::string& keyPrefix, const std::string& file, bool mustExist = true);
bool getProperty(const std::string& key, std::string &value);
bool getProperty(const std::string& key, int &value);
bool getProperty(const std::string& key, float& value);
bool getProperty(const std::string& key, bool &value);
void childKeyCrumbs(const std::string& parent, std::vector<std::string> &children);
void setProperty(const std::string& key, const std::string& value);
Expand Down
7 changes: 7 additions & 0 deletions RetroFE/Source/Execute/AttractMode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ AttractMode::AttractMode()
}

void AttractMode::reset(bool set) {
if (idleTime <= 0)
return;

elapsedTime_ = 0;
isActive_ = false;
isSet_ = set;
Expand All @@ -78,6 +81,10 @@ void AttractMode::reset(bool set) {
}

int AttractMode::update(float dt, Page& page) {

if (idleTime <= 0)
return 0;

// Track total time for state management
float currentTime = elapsedTime_ + dt;

Expand Down
53 changes: 49 additions & 4 deletions RetroFE/Source/Execute/Launcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <thread>
#include <atomic>
#include <filesystem>
#include <set>
#ifdef WIN32
#include <Windows.h>
#pragma comment(lib, "Xinput.lib")
Expand All @@ -41,6 +42,7 @@
#include "PacDrive.h"
#include "StdAfx.h"
#include <tlhelp32.h>
#include <Psapi.h>
#endif
#if defined(__linux__) || defined(__APPLE__)
#include <libusb-1.0/libusb.h>
Expand Down Expand Up @@ -419,7 +421,47 @@ std::string replaceVariables(std::string str,

#ifdef WIN32
// Utility function to terminate a process and all its child processes
void TerminateProcessAndChildren(DWORD processId) {
void TerminateProcessAndChildren(DWORD processId, const std::string& originalExeName = "", std::set<DWORD>& processedIds = std::set<DWORD>()) {
// Check if we've already processed this process ID to avoid infinite recursion
if (processedIds.find(processId) != processedIds.end()) {
LOG_DEBUG("Launcher", "Process ID: " + std::to_string(processId) + " already processed, skipping.");
return;
}

// Add this process to the set of processed IDs
processedIds.insert(processId);

// Verify this is the expected process if we have an original name
bool shouldTerminate = true;
if (!originalExeName.empty()) {
HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, processId);
if (hProcess != nullptr) {
char processName[MAX_PATH] = { 0 };
if (GetModuleFileNameExA(hProcess, nullptr, processName, MAX_PATH) > 0) {
std::string currentName = processName;
std::string baseName = currentName.substr(currentName.find_last_of("\\/") + 1);

// Case-insensitive comparison for Windows filenames
std::string lowerBaseName = baseName;
std::string lowerOriginalName = originalExeName;
std::transform(lowerBaseName.begin(), lowerBaseName.end(), lowerBaseName.begin(), ::tolower);
std::transform(lowerOriginalName.begin(), lowerOriginalName.end(), lowerOriginalName.begin(), ::tolower);

if (lowerBaseName != lowerOriginalName) {
LOG_WARNING("Launcher", "Process ID " + std::to_string(processId) +
" is " + baseName + ", not " + originalExeName +
". Skipping termination.");
shouldTerminate = false;
}
}
CloseHandle(hProcess);
}
}

if (!shouldTerminate) {
return;
}

LOG_INFO("Launcher", "Terminating process ID: " + std::to_string(processId));

HANDLE hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
Expand All @@ -436,6 +478,7 @@ void TerminateProcessAndChildren(DWORD processId) {
if (Process32First(hSnap, &pe32)) {
do {
if (pe32.th32ParentProcessID == processId) {
// For child processes, we don't verify the name
childPids.push_back(pe32.th32ProcessID);
}
} while (Process32Next(hSnap, &pe32));
Expand All @@ -445,10 +488,10 @@ void TerminateProcessAndChildren(DWORD processId) {

// Terminate children first
for (DWORD childPid : childPids) {
TerminateProcessAndChildren(childPid);
TerminateProcessAndChildren(childPid, "", processedIds);
}

// Now terminate the main process
// Now terminate the main process if it passed our verification
HANDLE hProcess = OpenProcess(PROCESS_TERMINATE | SYNCHRONIZE, FALSE, processId);
if (hProcess != nullptr) {
if (TerminateProcess(hProcess, 1)) {
Expand Down Expand Up @@ -1157,7 +1200,9 @@ bool Launcher::execute(std::string executable, std::string args, std::string cur
// Timer elapsed case (process still running)
DWORD processId = GetProcessId(hLaunchedProcess);
if (processId != 0) {
TerminateProcessAndChildren(processId);
// Extract the executable base name to ensure we terminate the right process
std::string exeName = exePathStr.substr(exePathStr.find_last_of("\\/") + 1);
TerminateProcessAndChildren(processId, exeName);
}
else {
LOG_WARNING("Launcher", "Could not get process ID for termination");
Expand Down
Loading