Commit Graph

37009 Commits

Author SHA1 Message Date
Sergio Perez Fernandez c96034f605 added braces to if statement in CreateDir 2025-06-12 00:58:09 -07:00
Sergio Perez Fernandez 551356e8f2 do not try to create a directory when it exists 2025-06-12 00:58:09 -07:00
sukibaby 93b65a441b DirectSound: initialize all DSoundBuf member variables in an initializer list 2025-06-11 07:37:36 -07:00
sukibaby 4d6ffc27da DSoundHelpers: use a constant in prefetch size comparison 2025-06-11 07:36:45 -07:00
sukibaby 8f2076eea1 DSoundHelpers: use sizeof(DSBUFFERDESC) rather than sizeof(variable)
Microsoft documentation and samples always use sizeof(DSBUFFERDESC), not sizeof(variable).
2025-06-11 07:36:13 -07:00
sukibaby b933347374 DirectSound: dynamically calculate block alignment to ensure correctness with various bit depths 2025-06-11 07:35:46 -07:00
sukibaby 6eb58bbd66 DirectSound: keep the main buffer active.
This was actually already considered in the surrounding code. I just had to uncomment it. This recommendation has remained consistent in the Microsoft documentation since this code was written. It's safe to uncomment it to ensure our main buffer stays active, since shutdown of the mixer engine is unwanted.
2025-06-11 07:33:08 -07:00
sukibaby 8c6c2524bb Remove implicit conversion operator from RString to const char* (Win32)
follows up on 6a29f651c7 and ecfcb11a00
2025-06-11 07:32:24 -07:00
sukibaby d65140c6fd Static cast the buffer size 2025-06-04 18:26:04 -07:00
sukibaby 94d1bb9e99 Use constexpr for MovieTexture_FFMpeg constants 2025-06-04 18:26:04 -07:00
Patrik Nilsson 8f13335c72 Add 180hz refresh rate
Add 180hz refresh rate
2025-06-04 08:17:54 -07:00
Sergio Perez Fernandez 33095cdb64 set DisableUploadDir preference default value to 1 2025-06-01 16:25:15 -07:00
teejusb 86a26cb7cb Add missing includes for DSoundHelpers 2025-06-01 08:47:10 -07:00
Patrik Nilsson 039bede4d1 Remove one trailing whitespace 2025-06-01 08:37:19 -07:00
Patrik Nilsson 7d398919a0 Address review feedback and improve code style
- Moved end-of-line comments to preceding lines for better readability and to avoid potential line length issues across various files modified in previous commits.
- In the RageSoundReader_Chain constructor: Removed redundant initialization of m_iPreferredSampleRate. Replaced hardcoded 44100 with kFallbackSampleRate. Removed an unnecessary comment.
- Added braces consistently to single-statement if/else blocks across all recently modified sound system files. This enhances code clarity and maintainability by explicitly defining block scopes.
2025-06-01 08:37:19 -07:00
Patrik Nilsson 72c7316671 Centralize fallback sample rate with kFallbackSampleRate
Replaces hardcoded 44100Hz values (used as fallbacks or for the "Default" sample rate preference) with a new constant `constexpr int kFallbackSampleRate = 44100;` defined in RageSound.h.

This constant is now used in:
- RageSoundReader_Silence
- RageSoundManager (for unloaded driver scenarios)
- All sound drivers' initialization logic for the "Default (0)" preference (DSound, WaveOut, AU, PulseAudio, OSS, WDMKS, Null)
- DSound primary buffer setup.
2025-06-01 08:37:19 -07:00
Patrik Nilsson c42501ba65 Add "Audio Sample Rate" option with translations
The English display name for the option has been updated to "Audio Sample Rate" for better clarity. Translations for this new option title have been added for Spanish, French, German, Japanese, Korean, Dutch, Polish, Slovak, and Traditional Chinese.
2025-06-01 08:37:19 -07:00
Patrik Nilsson 2e18b57da0 Implement configurable Sample Rate in options
Key changes:
- Added "Sample Rate" to `ScreenOptionsGraphicsSound` with choices:
    - "Default" (resolves to 44100 Hz for now)
    - "44100 Hz"
    - "48000 Hz"
- Created a new ConfOption "PreferredSampleRate" in `ScreenOptionsMasterPrefs.cpp` mapping UI choices to the integer values (0, 44100, 48000) for the existing `m_iSoundPreferredSampleRate` preference.
- Updated relevant sound drivers:
    - DirectSound (RageSoundDriver_DSound_Software): Primary buffer now attempts to use the preferred rate. Secondary buffers already handled it correctly.
    - WaveOut (RageSoundDriver_WaveOut): Already handled 0 as 44.1kHz correctly.
    - PulseAudio (RageSoundDriver_PulseAudio): Ensured m_InitStream uses the constructor-initialized rate based on preference.
    - AudioUnit (RageSoundDriver_AU): Already handled 0 as 44.1kHz and attempts to set hardware rate.
    - OSS (RageSoundDriver_OSS): Updated to read and apply the preferred sample rate.
    - WDMKS (RageSoundDriver_WDMKS): Updated to pass the resolved preferred rate to its stream opening logic.
    - Null (RageSoundDriver_Null): Already handled 0 as 44.1kHz correctly.
- Updated `RageSoundReader_Chain` constructor to use the preferred system sample rate for its internal default.
- Added English localization for the new option title and explanation.

The implementation ensures that if the preference is 0 (Default), the system currently defaults to 44100 Hz across all drivers. This lays the groundwork for future dynamic hardware rate detection. A game restart is recommended for the new sample rate to take full effect.
2025-06-01 08:37:19 -07:00
Patrik Nilsson af127ca23b Audio: Update default sample rate to 48kHz to mitigate sync issues 2025-06-01 08:37:19 -07:00
Sergio Perez Fernandez 2517959050 do not write any logs in disk when LogToDisk=0 2025-05-30 13:51:09 -07:00
sukibaby b3c43c9dea link to the simply love repo from the readme 2025-05-30 13:49:03 -07:00
sukibaby 1e667de589 Use a range-based for loop to avoid manual iterator handling 2025-05-28 14:56:29 -07:00
sukibaby 281cd8cb51 Change the video looping log to Info level.
Doesn't need to be written to disk right away every time a video loops.
2025-05-27 22:27:21 -07:00
Scott Brenner 7a3fa88c7a Update src/RageSoundReader_ChannelSplit.cpp 2025-05-25 21:09:54 -07:00
Scott Brenner 6cdf64afc8 Fix for code scanning alert: Multiplication result converted to larger type
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-05-25 21:09:54 -07:00
Scott Brenner 24fce53629 Update src/RageSurfaceUtils.cpp 2025-05-25 21:09:32 -07:00
Scott Brenner 146702430b Fix for code scanning alert: Multiplication result converted to larger type
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-05-25 21:09:32 -07:00
Scott Brenner fc2d5dbf17 Fix for code scanning alert: Multiplication result converted to larger type
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-05-25 21:09:01 -07:00
Scott Brenner 7ff2002bec Update src/RageSurfaceUtils.cpp 2025-05-25 21:08:36 -07:00
Scott Brenner f0908b58ad Fix for code scanning alert no. 479: Multiplication result converted to larger type
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-05-25 21:08:36 -07:00
sukibaby b0acfb362e don't upload VS2022 Code Analysis indicators
Visual Studio filetype; is an empty file.
2025-05-25 10:48:59 -07:00
Scott Brenner 57d54a0c89 Fix for code scanning alert: Multiplication result converted to larger type
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-05-25 00:31:23 -07:00
Scott Brenner 90176a1f1c Fix for code scanning alert: Multiplication result converted to larger type
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-05-25 00:29:25 -07:00
Scott Brenner 72b3590097 Fix for code scanning alert: Multiplication result converted to larger type
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-05-25 00:28:38 -07:00
Scott Brenner f4da59e7e3 Update nightly.yml 2025-05-25 00:27:18 -07:00
Scott Brenner 6e4974f7f1 Update ci.yml 2025-05-25 00:27:18 -07:00
teejusb 44f5d8932a Include <utility> for std::swap 2025-05-23 23:39:55 -05:00
sukibaby 7792a82e7a OS-agnostic log warning for invalid sound driver entry. 2025-05-23 19:49:42 -07:00
teejusb 8edc14febf Update libpng and zlib to fix Mac builds 2025-05-23 19:48:00 -07:00
sukibaby 45925badfd Update Windows build flags
/MP2 limits the build processes to a maximum of 2. Many CPU's nowadays have more than two cores, so the integer specifier is removed so that the build is not artificially constrained to two cores.

/FS allows multiple compiler processes to write to the .pdb file; it should be used in conjunction with /MP to speed up the build.

/permissive- disables certain MSVC-specific extensions and follows the C standard more closely. Using this flag should help to ensure behavior matches gcc & clang a little more closely.

Note, /utf-8 does NOT build the program with Unicode support. It merely indicates to the compiler that the source files are using UTF-8 encoding.
2025-05-23 19:47:21 -07:00
sukibaby 71cb44bde3 Make SetThreadPrecedence return a std::string 2025-05-22 20:08:56 -07:00
sukibaby 6a29f651c7 Remove implicit conversion operator from RString to const char* (macOS)
Tested via CI (don't have a Mac).
2025-05-22 20:08:56 -07:00
Scott Brenner 7405eea171 Remove architecture from artifact name 2025-05-22 18:43:37 -07:00
din 0e00f57e45 sample udev rules to include hidapi 2025-05-22 11:42:50 -07:00
din 69f6a14935 additional HidDevice logging error conditions 2025-05-22 11:42:50 -07:00
Yauhen Artsiukhou 0a08f8175e Run nightly builds only for the beta branch 2025-05-22 11:41:56 -07:00
Yauhen Artsiukhou 36e2dcbce8 Bring LinuxPacDrive back as GenericHID lights driver
This is actually generalized old LinuxPacDrive driver. It kept here for backward
compatibility. So people have time to migrate on better new implementation.

Set LightsDriver to "PacDrive" to test the new driver.

GenericHID uses USB libusb_control_transfer to send data (4 bytes) over the wire where first 2 are
lights state. So any HID-like usb device can read the data and control lights.
2025-05-22 11:40:50 -07:00
Scott Brenner b77a6af416 Set fail-fast: false 2025-05-22 09:07:48 -07:00
Scott Brenner a72bcd867e Note access for nightly builds 2025-05-17 16:59:00 -07:00
teejusb c18e7a68ae Add pack.ini file paths to error messages 2025-05-17 14:08:13 -07:00