mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
IOS/USB: Emulate Wii Speak (OpenAL)
Credits to @degasus and shuffle2 (godisgovernment): https://github.com/degasus/dolphin/tree/wiispeak
This commit is contained in:
@ -247,6 +247,8 @@ add_executable(dolphin-emu
|
||||
DiscordHandler.h
|
||||
DiscordJoinRequestDialog.cpp
|
||||
DiscordJoinRequestDialog.h
|
||||
EmulatedUSB/WiiSpeakWindow.cpp
|
||||
EmulatedUSB/WiiSpeakWindow.h
|
||||
FIFO/FIFOAnalyzer.cpp
|
||||
FIFO/FIFOAnalyzer.h
|
||||
FIFO/FIFOPlayerWindow.cpp
|
||||
|
@ -157,6 +157,7 @@
|
||||
<ClCompile Include="Debugger\WatchWidget.cpp" />
|
||||
<ClCompile Include="DiscordHandler.cpp" />
|
||||
<ClCompile Include="DiscordJoinRequestDialog.cpp" />
|
||||
<ClCompile Include="EmulatedUSB\WiiSpeakWindow.cpp" />
|
||||
<ClCompile Include="FIFO\FIFOAnalyzer.cpp" />
|
||||
<ClCompile Include="FIFO\FIFOPlayerWindow.cpp" />
|
||||
<ClCompile Include="GameList\GameList.cpp" />
|
||||
@ -375,6 +376,7 @@
|
||||
<QtMoc Include="Debugger\WatchWidget.h" />
|
||||
<QtMoc Include="DiscordHandler.h" />
|
||||
<QtMoc Include="DiscordJoinRequestDialog.h" />
|
||||
<QtMoc Include="EmulatedUSB\WiiSpeakWindow.h" />
|
||||
<QtMoc Include="FIFO\FIFOAnalyzer.h" />
|
||||
<QtMoc Include="FIFO\FIFOPlayerWindow.h" />
|
||||
<QtMoc Include="GameList\GameList.h" />
|
||||
|
84
Source/Core/DolphinQt/EmulatedUSB/WiiSpeakWindow.cpp
Normal file
84
Source/Core/DolphinQt/EmulatedUSB/WiiSpeakWindow.cpp
Normal file
@ -0,0 +1,84 @@
|
||||
// Copyright 2025 Dolphin Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "DolphinQt/EmulatedUSB/WiiSpeakWindow.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QComboBox>
|
||||
#include <QCompleter>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QGroupBox>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QMessageBox>
|
||||
#include <QPushButton>
|
||||
#include <QScrollArea>
|
||||
#include <QString>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
#include "Common/IOFile.h"
|
||||
|
||||
#include "Core/Config/MainSettings.h"
|
||||
#include "Core/Core.h"
|
||||
#include "Core/IOS/USB/Emulated/Microphone.h"
|
||||
#include "Core/System.h"
|
||||
|
||||
#include "DolphinQt/QtUtils/DolphinFileDialog.h"
|
||||
#include "DolphinQt/Settings.h"
|
||||
|
||||
WiiSpeakWindow::WiiSpeakWindow(QWidget* parent) : QWidget(parent)
|
||||
{
|
||||
setWindowTitle(tr("Wii Speak Manager"));
|
||||
setObjectName(QStringLiteral("wii_speak_manager"));
|
||||
setMinimumSize(QSize(700, 200));
|
||||
|
||||
CreateMainWindow();
|
||||
|
||||
connect(&Settings::Instance(), &Settings::EmulationStateChanged, this,
|
||||
&WiiSpeakWindow::OnEmulationStateChanged);
|
||||
|
||||
installEventFilter(this);
|
||||
|
||||
OnEmulationStateChanged(Core::GetState(Core::System::GetInstance()));
|
||||
}
|
||||
|
||||
WiiSpeakWindow::~WiiSpeakWindow() = default;
|
||||
|
||||
void WiiSpeakWindow::CreateMainWindow()
|
||||
{
|
||||
auto* main_layout = new QVBoxLayout();
|
||||
|
||||
auto* checkbox_group = new QGroupBox();
|
||||
auto* checkbox_layout = new QHBoxLayout();
|
||||
checkbox_layout->setAlignment(Qt::AlignLeft);
|
||||
m_checkbox = new QCheckBox(tr("Emulate Wii Speak"), this);
|
||||
m_checkbox->setChecked(Config::Get(Config::MAIN_EMULATE_WII_SPEAK));
|
||||
connect(m_checkbox, &QCheckBox::toggled, this, &WiiSpeakWindow::EmulateWiiSpeak);
|
||||
checkbox_layout->addWidget(m_checkbox);
|
||||
checkbox_group->setLayout(checkbox_layout);
|
||||
|
||||
m_combobox_microphones = new QComboBox();
|
||||
for (const std::string& device : IOS::HLE::USB::Microphone::ListDevices())
|
||||
{
|
||||
m_combobox_microphones->addItem(QString::fromStdString(device));
|
||||
}
|
||||
|
||||
checkbox_layout->addWidget(m_combobox_microphones);
|
||||
|
||||
main_layout->addWidget(checkbox_group);
|
||||
setLayout(main_layout);
|
||||
}
|
||||
|
||||
void WiiSpeakWindow::EmulateWiiSpeak(bool emulate)
|
||||
{
|
||||
Config::SetBaseOrCurrent(Config::MAIN_EMULATE_WII_SPEAK, emulate);
|
||||
}
|
||||
|
||||
void WiiSpeakWindow::OnEmulationStateChanged(Core::State state)
|
||||
{
|
||||
const bool running = state != Core::State::Uninitialized;
|
||||
|
||||
m_checkbox->setEnabled(!running);
|
||||
}
|
27
Source/Core/DolphinQt/EmulatedUSB/WiiSpeakWindow.h
Normal file
27
Source/Core/DolphinQt/EmulatedUSB/WiiSpeakWindow.h
Normal file
@ -0,0 +1,27 @@
|
||||
// Copyright 2025 Dolphin Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
#include "Core/Core.h"
|
||||
|
||||
class QCheckBox;
|
||||
class QComboBox;
|
||||
|
||||
class WiiSpeakWindow : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit WiiSpeakWindow(QWidget* parent = nullptr);
|
||||
~WiiSpeakWindow() override;
|
||||
|
||||
private:
|
||||
void CreateMainWindow();
|
||||
void OnEmulationStateChanged(Core::State state);
|
||||
void EmulateWiiSpeak(bool emulate);
|
||||
|
||||
QCheckBox* m_checkbox;
|
||||
QComboBox* m_combobox_microphones;
|
||||
};
|
@ -95,6 +95,7 @@
|
||||
#include "DolphinQt/Debugger/ThreadWidget.h"
|
||||
#include "DolphinQt/Debugger/WatchWidget.h"
|
||||
#include "DolphinQt/DiscordHandler.h"
|
||||
#include "DolphinQt/EmulatedUSB/WiiSpeakWindow.h"
|
||||
#include "DolphinQt/FIFO/FIFOPlayerWindow.h"
|
||||
#include "DolphinQt/GCMemcardManager.h"
|
||||
#include "DolphinQt/GameList/GameList.h"
|
||||
@ -581,6 +582,7 @@ void MainWindow::ConnectMenuBar()
|
||||
connect(m_menu_bar, &MenuBar::ShowFIFOPlayer, this, &MainWindow::ShowFIFOPlayer);
|
||||
connect(m_menu_bar, &MenuBar::ShowSkylanderPortal, this, &MainWindow::ShowSkylanderPortal);
|
||||
connect(m_menu_bar, &MenuBar::ShowInfinityBase, this, &MainWindow::ShowInfinityBase);
|
||||
connect(m_menu_bar, &MenuBar::ShowWiiSpeakWindow, this, &MainWindow::ShowWiiSpeakWindow);
|
||||
connect(m_menu_bar, &MenuBar::ConnectWiiRemote, this, &MainWindow::OnConnectWiiRemote);
|
||||
|
||||
#ifdef USE_RETRO_ACHIEVEMENTS
|
||||
@ -1440,6 +1442,18 @@ void MainWindow::ShowInfinityBase()
|
||||
m_infinity_window->activateWindow();
|
||||
}
|
||||
|
||||
void MainWindow::ShowWiiSpeakWindow()
|
||||
{
|
||||
if (!m_wii_speak_window)
|
||||
{
|
||||
m_wii_speak_window = new WiiSpeakWindow();
|
||||
}
|
||||
|
||||
m_wii_speak_window->show();
|
||||
m_wii_speak_window->raise();
|
||||
m_wii_speak_window->activateWindow();
|
||||
}
|
||||
|
||||
void MainWindow::StateLoad()
|
||||
{
|
||||
QString dialog_path = (Config::Get(Config::MAIN_CURRENT_STATE_PATH).empty()) ?
|
||||
|
@ -56,6 +56,7 @@ class ThreadWidget;
|
||||
class ToolBar;
|
||||
class WatchWidget;
|
||||
class WiiTASInputWindow;
|
||||
class WiiSpeakWindow;
|
||||
struct WindowSystemInfo;
|
||||
|
||||
namespace Core
|
||||
@ -177,6 +178,7 @@ private:
|
||||
void ShowFIFOPlayer();
|
||||
void ShowSkylanderPortal();
|
||||
void ShowInfinityBase();
|
||||
void ShowWiiSpeakWindow();
|
||||
void ShowMemcardManager();
|
||||
void ShowResourcePackManager();
|
||||
void ShowCheatsManager();
|
||||
@ -250,6 +252,7 @@ private:
|
||||
FIFOPlayerWindow* m_fifo_window = nullptr;
|
||||
SkylanderPortalWindow* m_skylander_window = nullptr;
|
||||
InfinityBaseWindow* m_infinity_window = nullptr;
|
||||
WiiSpeakWindow* m_wii_speak_window = nullptr;
|
||||
MappingWindow* m_hotkey_window = nullptr;
|
||||
FreeLookWindow* m_freelook_window = nullptr;
|
||||
|
||||
|
@ -281,6 +281,7 @@ void MenuBar::AddToolsMenu()
|
||||
auto* usb_device_menu = new QMenu(tr("Emulated USB Devices"), tools_menu);
|
||||
usb_device_menu->addAction(tr("&Skylanders Portal"), this, &MenuBar::ShowSkylanderPortal);
|
||||
usb_device_menu->addAction(tr("&Infinity Base"), this, &MenuBar::ShowInfinityBase);
|
||||
usb_device_menu->addAction(tr("&Wii Speak"), this, &MenuBar::ShowWiiSpeakWindow);
|
||||
tools_menu->addMenu(usb_device_menu);
|
||||
|
||||
tools_menu->addSeparator();
|
||||
|
@ -94,6 +94,7 @@ signals:
|
||||
void ShowResourcePackManager();
|
||||
void ShowSkylanderPortal();
|
||||
void ShowInfinityBase();
|
||||
void ShowWiiSpeakWindow();
|
||||
void ConnectWiiRemote(int id);
|
||||
|
||||
#ifdef USE_RETRO_ACHIEVEMENTS
|
||||
|
Reference in New Issue
Block a user