Compare commits

...

5 Commits

Author SHA1 Message Date
Squall Leonhart d7e9d78d0d
Merge 999400dc53 into c6da07feb3 2024-12-22 13:17:44 +11:00
Rafael Kitover c6da07feb3
build: link avrt for OpenAL on WIN32
For static builds for Windows, link `avrt`, a system library that is now
required by OpenAL.

Also remove our version of `FindOpenAL.cmake` in favor of the
system-provided version.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-12-16 13:47:48 +00:00
Rafael Kitover 94979eff97
build: initialize GTest submodule in CMake
Try to initialize the GTest Git submodule from the CMake code if it has
not been.

If that fails, turn off `BUILD_TESTING`.

We do not want to require recursive clones or initializing submodules
for users by default.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-12-16 13:09:02 +00:00
Rafael Kitover e8494b56d1
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-12-13 05:08:59 +00:00
Squall Leonhart 999400dc53
dynamically set nb_samples by samplerate 2024-11-03 21:58:15 +11:00
5 changed files with 39 additions and 131 deletions

View File

@ -92,8 +92,20 @@ endif()
if(BUILD_TESTING)
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
set(INSTALL_GTEST OFF CACHE BOOL "" FORCE)
add_subdirectory(./third_party/googletest)
include(GoogleTest)
if(NOT EXISTS third_party/googletest/CMakeLists.txt)
execute_process(
COMMAND git submodule update --init --recursive -- third_party/googletest
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
endif()
if(EXISTS third_party/googletest/CMakeLists.txt)
add_subdirectory(./third_party/googletest)
include(GoogleTest)
else()
set(BUILD_TESTING OFF)
endif()
endif()
if(NOT CMAKE_PREFIX_PATH AND (NOT ("$ENV{CMAKE_PREFIX_PATH}" STREQUAL "")))

View File

@ -1,110 +0,0 @@
#.rst:
# FindOpenAL
# ----------
#
#
#
# Locate OpenAL This module defines OPENAL_LIBRARY OPENAL_FOUND, if
# false, do not try to link to OpenAL OPENAL_INCLUDE_DIR, where to find
# the headers
#
# $OPENALDIR is an environment variable that would correspond to the
# ./configure --prefix=$OPENALDIR used in building OpenAL.
#
# Created by Eric Wing. This was influenced by the FindSDL.cmake
# module.
#=============================================================================
# Copyright 2005-2009 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# This makes the presumption that you are include al.h like
# #include "al.h"
# and not
# #include <AL/al.h>
# The reason for this is that the latter is not entirely portable.
# Windows/Creative Labs does not by default put their headers in AL/ and
# OS X uses the convention <OpenAL/al.h>.
#
# For Windows, Creative Labs seems to have added a registry key for their
# OpenAL 1.1 installer. I have added that key to the list of search paths,
# however, the key looks like it could be a little fragile depending on
# if they decide to change the 1.00.0000 number for bug fix releases.
# Also, they seem to have laid down groundwork for multiple library platforms
# which puts the library in an extra subdirectory. Currently there is only
# Win32 and I have hardcoded that here. This may need to be adjusted as
# platforms are introduced.
# The OpenAL 1.0 installer doesn't seem to have a useful key I can use.
# I do not know if the Nvidia OpenAL SDK has a registry key.
#
# For OS X, remember that OpenAL was added by Apple in 10.4 (Tiger).
# To support the framework, I originally wrote special framework detection
# code in this module which I have now removed with CMake's introduction
# of native support for frameworks.
# In addition, OpenAL is open source, and it is possible to compile on Panther.
# Furthermore, due to bugs in the initial OpenAL release, and the
# transition to OpenAL 1.1, it is common to need to override the built-in
# framework.
# Per my request, CMake should search for frameworks first in
# the following order:
# ~/Library/Frameworks/OpenAL.framework/Headers
# /Library/Frameworks/OpenAL.framework/Headers
# /System/Library/Frameworks/OpenAL.framework/Headers
#
# On OS X, this will prefer the Framework version (if found) over others.
# People will have to manually change the cache values of
# OPENAL_LIBRARY to override this selection or set the CMake environment
# CMAKE_INCLUDE_PATH to modify the search paths.
find_path(OPENAL_INCLUDE_DIR al.h
HINTS
ENV OPENALDIR
PATH_SUFFIXES AL OpenAL
PATHS
~/Library/Frameworks
/Library/Frameworks
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Creative\ Labs\\OpenAL\ 1.1\ Software\ Development\ Kit\\1.00.0000;InstallDir]
)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_OpenAL_ARCH_DIR libs/Win64)
else()
set(_OpenAL_ARCH_DIR libs/Win32)
endif()
find_library(OPENAL_LIBRARY
NAMES OpenAL al openal OpenAL32
HINTS
ENV OPENALDIR
PATH_SUFFIXES lib64 lib libs64 libs ${_OpenAL_ARCH_DIR}
PATHS
~/Library/Frameworks
/Library/Frameworks
/sw
/opt/local
/opt/csw
/opt
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Creative\ Labs\\OpenAL\ 1.1\ Software\ Development\ Kit\\1.00.0000;InstallDir]
)
unset(_OpenAL_ARCH_DIR)
# handle the QUIETLY and REQUIRED arguments and set OPENAL_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenAL DEFAULT_MSG OPENAL_LIBRARY OPENAL_INCLUDE_DIR)
mark_as_advanced(OPENAL_LIBRARY OPENAL_INCLUDE_DIR)

View File

@ -15,6 +15,7 @@
# javidg96, 2015
# jorge perez <theghostxxaz@gmail.com>, 2021
# Jose Castillo <josecastillo.prz85@gmail.com>, 2021
# José Montoro, 2024
# Manu 3L <comokaka777@gmail.com>, 2021
# Marco123V <MarcoVillalejos@hotmail.com>, 2015
# Marco Yurazeck <luthias@gmail.com>, 2020
@ -29,7 +30,7 @@ msgstr ""
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-07-05 20:00+0000\n"
"PO-Revision-Date: 2011-12-03 19:42+0000\n"
"Last-Translator: Dani Quiroz, 2022\n"
"Last-Translator: José Montoro, 2024\n"
"Language-Team: Spanish (http://app.transifex.com/bgk/vba-m/language/es/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -39,7 +40,7 @@ msgstr ""
#: audio/internal/openal.cpp:188
msgid "OpenAL: Failed to open audio device"
msgstr ""
msgstr "OpenAL: Fallo al abrir el dispositivo de audio"
#: audio/internal/openal.cpp:386 audio/internal/faudio.cpp:492
#: audio/internal/xaudio2.cpp:577
@ -52,7 +53,7 @@ msgid ""
"(*.agb;*.gba;*.bin;*.elf;*.mb;*.zip;*.7z;*.rar)|*.agb;*.gba;*.bin;*.elf;*.mb;*.agb.gz;*.gba.gz;*.bin.gz;*.elf.gz;*.mb.gz;*.agb.z;*.gba.z;*.bin.z;*.elf.z;*.mb.z;*.zip;*.7z;*.rar|Game"
" Boy Files "
"(*.dmg;*.gb;*.gbc;*.cgb;*.sgb;*.zip;*.7z;*.rar)|*.dmg;*.gb;*.gbc;*.cgb;*.sgb;*.dmg.gz;*.gb.gz;*.gbc.gz;*.cgb.gz;*.sgb.gz;*.dmg.z;*.gb.z;*.gbc.z;*.cgb.z;*.sgb.z;*.zip;*.7z;*.rar|"
msgstr ""
msgstr "Archivos de Game boy Advance (*.agb;*.gba;*.bin;*.elf;*.mb;*.zip;*.7z;*.rar)|*.agb;*.gba;*.bin;*.elf;*.mb;*.agb.gz;*.gba.gz;*.bin.gz;*.elf.gz;*.mb.gz;*.agb.z;*.gba.z;*.bin.z;*.elf.z;*.mb.z;*.zip;*.7z;*.rar|Game Boy Files (*.dmg;*.gb;*.gbc;*.cgb;*.sgb;*.zip;*.7z;*.rar)|*.dmg;*.gb;*.gbc;*.cgb;*.sgb;*.dmg.gz;*.gb.gz;*.gbc.gz;*.cgb.gz;*.sgb.gz;*.dmg.z;*.gb.z;*.gbc.z;*.cgb.z;*.sgb.z;*.zip;*.7z;*.rar|"
#: cmdevents.cpp:144
msgid "Open ROM file"
@ -62,7 +63,7 @@ msgstr "Abrir archivo ROM"
msgid ""
"Game Boy Files "
"(*.dmg;*.gb;*.gbc;*.cgb;*.sgb;*.zip;*.7z;*.rar)|*.dmg;*.gb;*.gbc;*.cgb;*.sgb;*.dmg.gz;*.gb.gz;*.gbc.gz;*.cgb.gz;*.sgb.gz;*.dmg.z;*.gb.z;*.gbc.z;*.cgb.z;*.sgb.z;*.zip;*.7z;*.rar|"
msgstr ""
msgstr "Archivos de Game Boy (*.dmg;*.gb;*.gbc;*.cgb;*.sgb;*.zip;*.7z;*.rar)|*.dmg;*.gb;*.gbc;*.cgb;*.sgb;*.dmg.gz;*.gb.gz;*.gbc.gz;*.cgb.gz;*.sgb.gz;*.dmg.z;*.gb.z;*.gbc.z;*.cgb.z;*.sgb.z;*.zip;*.7z;*.rar|"
#: cmdevents.cpp:171
msgid "Open GB ROM file"
@ -98,7 +99,7 @@ msgstr "Archivo de batería (*.sav) | *.sav | Guardado Flash (*.dat) | *.dat"
msgid ""
"Importing a battery file will erase any saved games (permanently after the "
"next write). Do you want to continue?"
msgstr ""
msgstr "Importar un archivo de guardado borrará cualquier partida guardada (permanente después del siguiente guardado). ¿Quieres continuar?"
#: cmdevents.cpp:416 cmdevents.cpp:444 cmdevents.cpp:564
msgid "Confirm import"
@ -130,7 +131,7 @@ msgstr ""
msgid ""
"Importing a code file will replace any loaded cheats. Do you want to "
"continue?"
msgstr ""
msgstr "Importar un archivo de códigos reemplazará cualquier cheat cargado. ¿Quieres continuar?"
#: cmdevents.cpp:460
#, c-format
@ -170,7 +171,7 @@ msgstr ""
msgid ""
"Importing a snapshot file will erase any saved games (permanently after the "
"next write). Do you want to continue?"
msgstr ""
msgstr "Importar una snapshot borrará cualquier partida guardada (permanente una vez se sobrescriba) ¿Quieres continuar?"
#: cmdevents.cpp:588
#, c-format
@ -202,7 +203,7 @@ msgstr ""
#: cmdevents.cpp:644
msgid "Exported from Visual Boy Advance-M"
msgstr ""
msgstr "Exportado desde Visual Boy Advance-M"
#: cmdevents.cpp:656
#, c-format
@ -293,15 +294,15 @@ msgid ""
"YOUR CONFIGURATION WILL BE DELETED!\n"
"\n"
"Are you sure?"
msgstr ""
msgstr "¡SE BORRARÁ TU CONFIGURACIÓN!\n\n¿Estás seguro?"
#: cmdevents.cpp:2201
msgid "FACTORY RESET"
msgstr ""
msgstr "RESETEO DE FÁBRICA"
#: cmdevents.cpp:2236
msgid "Nintendo Game Boy / Color / Advance emulator."
msgstr ""
msgstr "Emulador de Nintendo Game Boy / Color / Advance"
#: cmdevents.cpp:2237
msgid ""
@ -324,11 +325,11 @@ msgid ""
"\n"
"You should have received a copy of the GNU General Public License\n"
"along with this program. If not, see http://www.gnu.org/licenses ."
msgstr ""
msgstr "Este programa es un software gratis: puedes redistribuirlo / o modificarlo bajo los terminos de la Licencia Pública General GNU.\npublicada por\nla Free Software Foundation, ya sea la versión 2 de la Licencia, o\n(a su elección) cualquier versión posterior.\n\nEste programa se distribuye con la esperanza de que sea útil,\npero SIN NINGUNA GARANTÍA; sin siquiera la garantía implícita de\nCOMERCIABILIDAD o IDONEIDAD PARA UN PROPÓSITO PARTICULAR. Ver el\nLicencia pública general GNU para obtener más detalles.\n\nDebería haber recibido una copia de la Licencia Pública General GNU\njunto con este programa. Si no, consulte http://www.gnu.org/licenses."
#: cmdevents.cpp:2424
msgid "Cannot use Game Boy BIOS when Colorizer Hack is enabled."
msgstr ""
msgstr "No puedes usar la BIOS de la Game Boy cuando el Hack Colorizer está habilitado."
#: cmdevents.cpp:2490
msgid "LAN link is already active. Disable link mode to disconnect."

View File

@ -143,19 +143,20 @@ recording::MediaRet recording::MediaRecorder::setup_audio_stream()
aenc->channel_layout = AV_CH_LAYOUT_STEREO;
aenc->channels = 2;
#endif
aenc->time_base = { 1, aenc->sample_rate };
ast->time_base = { 1, STREAM_FRAME_RATE };
// open and use codec on stream
aenc->time_base = (AVRational){1, aenc->sample_rate};
ast->time_base = (AVRational){1, STREAM_FRAME_RATE};
// Open and use codec on stream
int nb_samples;
if (avcodec_open2(aenc, acodec, NULL) < 0)
return MRET_ERR_NOCODEC;
if (avcodec_parameters_from_context(ast->codecpar, aenc) < 0)
return MRET_ERR_BUFSIZE;
// number of samples per frame
// Calculate number of samples per frame based on sample rate
if (aenc->codec->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE)
{
//nb_samples = 10000; // can be any value, but we use our aud buffer size
nb_samples = 1470;
nb_samples = (int)(aenc->sample_rate / STREAM_FRAME_RATE);
}
else
nb_samples = aenc->frame_size;

View File

@ -255,6 +255,10 @@ function(configure_wx_target target)
# OpenAL.
if(OPENAL_STATIC)
_add_compile_definitions(AL_LIBTYPE_STATIC)
if(WIN32)
list(APPEND OPENAL_LIBRARY avrt)
endif()
endif()
_add_include_directories(${OPENAL_INCLUDE_DIR})
_add_link_libraries(${OPENAL_LIBRARY})