mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-28 09:59:32 -06:00
Config: Rename MAIN_WII_SPEAK_CONNECTED to MAIN_WII_SPEAK_MUTED
This commit is contained in:
@ -244,11 +244,11 @@ enum class BooleanSetting(
|
|||||||
"EmulateWiiSpeak",
|
"EmulateWiiSpeak",
|
||||||
false
|
false
|
||||||
),
|
),
|
||||||
MAIN_WII_SPEAK_CONNECTED(
|
MAIN_WII_SPEAK_MUTED(
|
||||||
Settings.FILE_DOLPHIN,
|
Settings.FILE_DOLPHIN,
|
||||||
Settings.SECTION_EMULATED_USB_DEVICES,
|
Settings.SECTION_EMULATED_USB_DEVICES,
|
||||||
"WiiSpeakConnected",
|
"WiiSpeakMuted",
|
||||||
false
|
true
|
||||||
),
|
),
|
||||||
MAIN_SHOW_GAME_TITLES(
|
MAIN_SHOW_GAME_TITLES(
|
||||||
Settings.FILE_DOLPHIN,
|
Settings.FILE_DOLPHIN,
|
||||||
|
@ -905,10 +905,10 @@ class SettingsFragmentPresenter(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
sl.add(
|
sl.add(
|
||||||
InvertedSwitchSetting(
|
SwitchSetting(
|
||||||
context,
|
context,
|
||||||
BooleanSetting.MAIN_WII_SPEAK_CONNECTED,
|
BooleanSetting.MAIN_WII_SPEAK_MUTED,
|
||||||
R.string.disconnect_wii_speak,
|
R.string.mute_wii_speak,
|
||||||
0
|
0
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@ -945,7 +945,7 @@ It can efficiently compress both junk data and encrypted Wii data.
|
|||||||
<string name="select_compatible_figure">Please select a compatible figure file</string>
|
<string name="select_compatible_figure">Please select a compatible figure file</string>
|
||||||
|
|
||||||
<string name="emulate_wii_speak">Wii Speak</string>
|
<string name="emulate_wii_speak">Wii Speak</string>
|
||||||
<string name="disconnect_wii_speak">Mute Wii Speak</string>
|
<string name="mute_wii_speak">Mute Wii Speak</string>
|
||||||
<string name="wii_speak_permission_warning">Missing Microphone Permission</string>
|
<string name="wii_speak_permission_warning">Missing Microphone Permission</string>
|
||||||
<string name="wii_speak_permission_warning_description">Wii Speak emulation requires microphone permission. You might need to restart the game for the permission to be effective.</string>
|
<string name="wii_speak_permission_warning_description">Wii Speak emulation requires microphone permission. You might need to restart the game for the permission to be effective.</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -600,8 +600,7 @@ const Info<bool> MAIN_EMULATE_WII_SPEAK{{System::Main, "EmulatedUSBDevices", "Em
|
|||||||
const Info<std::string> MAIN_WII_SPEAK_MICROPHONE{
|
const Info<std::string> MAIN_WII_SPEAK_MICROPHONE{
|
||||||
{System::Main, "EmulatedUSBDevices", "WiiSpeakMicrophone"}, ""};
|
{System::Main, "EmulatedUSBDevices", "WiiSpeakMicrophone"}, ""};
|
||||||
|
|
||||||
const Info<bool> MAIN_WII_SPEAK_CONNECTED{{System::Main, "EmulatedUSBDevices", "WiiSpeakConnected"},
|
const Info<bool> MAIN_WII_SPEAK_MUTED{{System::Main, "EmulatedUSBDevices", "WiiSpeakMuted"}, true};
|
||||||
false};
|
|
||||||
|
|
||||||
// The reason we need this function is because some memory card code
|
// The reason we need this function is because some memory card code
|
||||||
// expects to get a non-NTSC-K region even if we're emulating an NTSC-K Wii.
|
// expects to get a non-NTSC-K region even if we're emulating an NTSC-K Wii.
|
||||||
|
@ -364,7 +364,7 @@ extern const Info<bool> MAIN_EMULATE_SKYLANDER_PORTAL;
|
|||||||
extern const Info<bool> MAIN_EMULATE_INFINITY_BASE;
|
extern const Info<bool> MAIN_EMULATE_INFINITY_BASE;
|
||||||
extern const Info<bool> MAIN_EMULATE_WII_SPEAK;
|
extern const Info<bool> MAIN_EMULATE_WII_SPEAK;
|
||||||
extern const Info<std::string> MAIN_WII_SPEAK_MICROPHONE;
|
extern const Info<std::string> MAIN_WII_SPEAK_MICROPHONE;
|
||||||
extern const Info<bool> MAIN_WII_SPEAK_CONNECTED;
|
extern const Info<bool> MAIN_WII_SPEAK_MUTED;
|
||||||
|
|
||||||
// GameCube path utility functions
|
// GameCube path utility functions
|
||||||
|
|
||||||
|
@ -152,9 +152,9 @@ long Microphone::CubebDataCallback(cubeb_stream* stream, void* user_data, const
|
|||||||
if (Core::GetState(Core::System::GetInstance()) != Core::State::Running)
|
if (Core::GetState(Core::System::GetInstance()) != Core::State::Running)
|
||||||
return nframes;
|
return nframes;
|
||||||
|
|
||||||
// Skip data when HLE Wii Speak is not connected
|
// Skip data when HLE Wii Speak is muted
|
||||||
// TODO: Update cubeb and use cubeb_stream_set_input_mute
|
// TODO: Update cubeb and use cubeb_stream_set_input_mute
|
||||||
if (!Config::Get(Config::MAIN_WII_SPEAK_CONNECTED))
|
if (Config::Get(Config::MAIN_WII_SPEAK_MUTED))
|
||||||
return nframes;
|
return nframes;
|
||||||
|
|
||||||
auto* mic = static_cast<Microphone*>(user_data);
|
auto* mic = static_cast<Microphone*>(user_data);
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
#include "Core/Config/MainSettings.h"
|
|
||||||
#include "Core/HW/Memmap.h"
|
#include "Core/HW/Memmap.h"
|
||||||
#include "Core/System.h"
|
#include "Core/System.h"
|
||||||
|
|
||||||
@ -95,12 +94,6 @@ int WiiSpeak::SubmitTransfer(std::unique_ptr<CtrlMessage> cmd)
|
|||||||
m_vid, m_pid, m_active_interface, cmd->request_type, cmd->request, cmd->value,
|
m_vid, m_pid, m_active_interface, cmd->request_type, cmd->request, cmd->value,
|
||||||
cmd->index, cmd->length);
|
cmd->index, cmd->length);
|
||||||
|
|
||||||
// Without a proper way to reconnect the emulated Wii Speak,
|
|
||||||
// this error after being raised prevents some games to use the microphone later.
|
|
||||||
//
|
|
||||||
// if (!IsMicrophoneConnected())
|
|
||||||
// return IPC_ENOENT;
|
|
||||||
|
|
||||||
switch (cmd->request_type << 8 | cmd->request)
|
switch (cmd->request_type << 8 | cmd->request)
|
||||||
{
|
{
|
||||||
case USBHDR(DIR_DEVICE2HOST, TYPE_STANDARD, REC_INTERFACE, REQUEST_GET_INTERFACE):
|
case USBHDR(DIR_DEVICE2HOST, TYPE_STANDARD, REC_INTERFACE, REQUEST_GET_INTERFACE):
|
||||||
@ -163,9 +156,6 @@ int WiiSpeak::SubmitTransfer(std::unique_ptr<IntrMessage> cmd)
|
|||||||
|
|
||||||
int WiiSpeak::SubmitTransfer(std::unique_ptr<IsoMessage> cmd)
|
int WiiSpeak::SubmitTransfer(std::unique_ptr<IsoMessage> cmd)
|
||||||
{
|
{
|
||||||
// if (!IsMicrophoneConnected())
|
|
||||||
// return IPC_ENOENT;
|
|
||||||
|
|
||||||
auto& system = cmd->GetEmulationKernel().GetSystem();
|
auto& system = cmd->GetEmulationKernel().GetSystem();
|
||||||
auto& memory = system.GetMemory();
|
auto& memory = system.GetMemory();
|
||||||
|
|
||||||
@ -409,9 +399,4 @@ void WiiSpeak::GetRegister(const std::unique_ptr<CtrlMessage>& cmd) const
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WiiSpeak::IsMicrophoneConnected() const
|
|
||||||
{
|
|
||||||
return Config::Get(Config::MAIN_WII_SPEAK_CONNECTED);
|
|
||||||
}
|
|
||||||
} // namespace IOS::HLE::USB
|
} // namespace IOS::HLE::USB
|
||||||
|
@ -76,7 +76,6 @@ private:
|
|||||||
|
|
||||||
void GetRegister(const std::unique_ptr<CtrlMessage>& cmd) const;
|
void GetRegister(const std::unique_ptr<CtrlMessage>& cmd) const;
|
||||||
void SetRegister(const std::unique_ptr<CtrlMessage>& cmd);
|
void SetRegister(const std::unique_ptr<CtrlMessage>& cmd);
|
||||||
bool IsMicrophoneConnected() const;
|
|
||||||
|
|
||||||
const u16 m_vid = 0x057E;
|
const u16 m_vid = 0x057E;
|
||||||
const u16 m_pid = 0x0308;
|
const u16 m_pid = 0x0308;
|
||||||
|
@ -57,11 +57,10 @@ void WiiSpeakWindow::CreateMainWindow()
|
|||||||
auto* config_group = new QGroupBox(tr("Microphone Configuration"));
|
auto* config_group = new QGroupBox(tr("Microphone Configuration"));
|
||||||
auto* config_layout = new QHBoxLayout();
|
auto* config_layout = new QHBoxLayout();
|
||||||
|
|
||||||
auto checkbox_mic_connected = new QCheckBox(tr("Connect"), this);
|
auto checkbox_mic_muted = new QCheckBox(tr("Mute"), this);
|
||||||
checkbox_mic_connected->setChecked(Config::Get(Config::MAIN_WII_SPEAK_CONNECTED));
|
checkbox_mic_muted->setChecked(Config::Get(Config::MAIN_WII_SPEAK_MUTED));
|
||||||
connect(checkbox_mic_connected, &QCheckBox::toggled, this,
|
connect(checkbox_mic_muted, &QCheckBox::toggled, this, &WiiSpeakWindow::SetWiiSpeakMuted);
|
||||||
&WiiSpeakWindow::SetWiiSpeakConnectionState);
|
config_layout->addWidget(checkbox_mic_muted);
|
||||||
config_layout->addWidget(checkbox_mic_connected);
|
|
||||||
|
|
||||||
m_combobox_microphones = new QComboBox();
|
m_combobox_microphones = new QComboBox();
|
||||||
#ifndef HAVE_CUBEB
|
#ifndef HAVE_CUBEB
|
||||||
@ -94,9 +93,9 @@ void WiiSpeakWindow::EmulateWiiSpeak(bool emulate)
|
|||||||
Config::SetBaseOrCurrent(Config::MAIN_EMULATE_WII_SPEAK, emulate);
|
Config::SetBaseOrCurrent(Config::MAIN_EMULATE_WII_SPEAK, emulate);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WiiSpeakWindow::SetWiiSpeakConnectionState(bool connected)
|
void WiiSpeakWindow::SetWiiSpeakMuted(bool muted)
|
||||||
{
|
{
|
||||||
Config::SetBaseOrCurrent(Config::MAIN_WII_SPEAK_CONNECTED, connected);
|
Config::SetBaseOrCurrent(Config::MAIN_WII_SPEAK_MUTED, muted);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WiiSpeakWindow::OnEmulationStateChanged(Core::State state)
|
void WiiSpeakWindow::OnEmulationStateChanged(Core::State state)
|
||||||
|
@ -21,7 +21,7 @@ private:
|
|||||||
void CreateMainWindow();
|
void CreateMainWindow();
|
||||||
void OnEmulationStateChanged(Core::State state);
|
void OnEmulationStateChanged(Core::State state);
|
||||||
void EmulateWiiSpeak(bool emulate);
|
void EmulateWiiSpeak(bool emulate);
|
||||||
void SetWiiSpeakConnectionState(bool connected);
|
void SetWiiSpeakMuted(bool muted);
|
||||||
void OnInputDeviceChange();
|
void OnInputDeviceChange();
|
||||||
|
|
||||||
QCheckBox* m_checkbox_enabled;
|
QCheckBox* m_checkbox_enabled;
|
||||||
|
Reference in New Issue
Block a user