From 9ef4d79c33535623e4ec9581ed064cce2424d861 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Tue, 14 Oct 2014 21:13:04 +0200 Subject: [PATCH 1/3] Install the audio/* plugins under windows and osx --- cockatrice/CMakeLists.txt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/cockatrice/CMakeLists.txt b/cockatrice/CMakeLists.txt index e3bcd8fa8..af031ab07 100644 --- a/cockatrice/CMakeLists.txt +++ b/cockatrice/CMakeLists.txt @@ -263,15 +263,16 @@ if(APPLE) set(qtconf_dest_dir cockatrice.app/Contents/Resources) # note: no codecs in qt5 - # note: phonon_backend => mediaservice + # note: phonon_backend => audio | mediaservice # note: needs platform on osx if (CMAKE_BUILD_TYPE STREQUAL "Debug") install(DIRECTORY "${QT_PLUGINS_DIR}/" DESTINATION ${plugin_dest_dir} COMPONENT Runtime - FILES_MATCHING REGEX "(codecs|iconengines|imageformats|mediaservice|phonon_backend|platforms)/.*_debug\\.dylib") + FILES_MATCHING REGEX "(audio|codecs|iconengines|imageformats|mediaservice|phonon_backend|platforms)/.*_debug\\.dylib") else() install(DIRECTORY "${QT_PLUGINS_DIR}/" DESTINATION ${plugin_dest_dir} COMPONENT Runtime - FILES_MATCHING REGEX "(codecs|iconengines|imageformats|mediaservice|phonon_backend|platforms)/[^_]*\\.dylib") + FILES_MATCHING REGEX "(audio|codecs|iconengines|imageformats|mediaservice|phonon_backend|platforms)/.*\\.dylib" + REGEX ".*_debug\\.dylib" EXCLUDE) endif() install(CODE " @@ -296,15 +297,15 @@ if(WIN32) set(qtconf_dest_dir .) # note: no codecs in qt5 - # note: phonon_backend => mediaservice + # note: phonon_backend => audio | mediaservice # note: needs platform on osx if (CMAKE_BUILD_TYPE STREQUAL "Debug") install(DIRECTORY "${QT_PLUGINS_DIR}/" DESTINATION ${plugin_dest_dir} COMPONENT Runtime - FILES_MATCHING REGEX "(codecs|iconengines|imageformats|mediaservice|phonon_backend|platforms)/.*d\\.dll") + FILES_MATCHING REGEX "(audio|codecs|iconengines|imageformats|mediaservice|phonon_backend|platforms)/.*d\\.dll") else() install(DIRECTORY "${QT_PLUGINS_DIR}/" DESTINATION ${plugin_dest_dir} COMPONENT Runtime - FILES_MATCHING REGEX "(codecs|iconengines|imageformats|mediaservice|phonon_backend|platforms)/.*[^d]\\.dll") + FILES_MATCHING REGEX "(audio|codecs|iconengines|imageformats|mediaservice|phonon_backend|platforms)/.*[^d]\\.dll") endif() install(CODE " From 82a3deec30b5a903d4863e6f85da558ffa6db42b Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Tue, 14 Oct 2014 21:13:16 +0200 Subject: [PATCH 2/3] Add a button in the sounds settings to play a test sound --- cockatrice/src/dlg_settings.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cockatrice/src/dlg_settings.cpp b/cockatrice/src/dlg_settings.cpp index 414550a9e..0a9fe61a5 100644 --- a/cockatrice/src/dlg_settings.cpp +++ b/cockatrice/src/dlg_settings.cpp @@ -25,6 +25,7 @@ #include "main.h" #include "settingscache.h" #include "priceupdater.h" +#include "soundengine.h" GeneralSettingsPage::GeneralSettingsPage() { @@ -503,6 +504,8 @@ UserInterfaceSettingsPage::UserInterfaceSettingsPage() connect(soundPathClearButton, SIGNAL(clicked()), this, SLOT(soundPathClearButtonClicked())); QPushButton *soundPathButton = new QPushButton("..."); connect(soundPathButton, SIGNAL(clicked()), this, SLOT(soundPathButtonClicked())); + QPushButton *soundTestButton = new QPushButton(QString("Play test sound")); + connect(soundTestButton, SIGNAL(clicked()), soundEngine, SLOT(cuckoo())); QGridLayout *soundGrid = new QGridLayout; soundGrid->addWidget(soundEnabledCheckBox, 0, 0, 1, 4); @@ -510,6 +513,7 @@ UserInterfaceSettingsPage::UserInterfaceSettingsPage() soundGrid->addWidget(soundPathEdit, 1, 1); soundGrid->addWidget(soundPathClearButton, 1, 2); soundGrid->addWidget(soundPathButton, 1, 3); + soundGrid->addWidget(soundTestButton, 1, 4); soundGroupBox = new QGroupBox; soundGroupBox->setLayout(soundGrid); From e0d76b60d0d060a91480a76ea85c3a9d77f199a4 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Tue, 14 Oct 2014 22:02:42 +0200 Subject: [PATCH 3/3] Change button label and made it translatable --- cockatrice/src/dlg_settings.cpp | 5 +++-- cockatrice/src/dlg_settings.h | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cockatrice/src/dlg_settings.cpp b/cockatrice/src/dlg_settings.cpp index 0a9fe61a5..ae7e4cc28 100644 --- a/cockatrice/src/dlg_settings.cpp +++ b/cockatrice/src/dlg_settings.cpp @@ -504,7 +504,7 @@ UserInterfaceSettingsPage::UserInterfaceSettingsPage() connect(soundPathClearButton, SIGNAL(clicked()), this, SLOT(soundPathClearButtonClicked())); QPushButton *soundPathButton = new QPushButton("..."); connect(soundPathButton, SIGNAL(clicked()), this, SLOT(soundPathButtonClicked())); - QPushButton *soundTestButton = new QPushButton(QString("Play test sound")); + soundTestButton = new QPushButton(); connect(soundTestButton, SIGNAL(clicked()), soundEngine, SLOT(cuckoo())); QGridLayout *soundGrid = new QGridLayout; @@ -513,7 +513,7 @@ UserInterfaceSettingsPage::UserInterfaceSettingsPage() soundGrid->addWidget(soundPathEdit, 1, 1); soundGrid->addWidget(soundPathClearButton, 1, 2); soundGrid->addWidget(soundPathButton, 1, 3); - soundGrid->addWidget(soundTestButton, 1, 4); + soundGrid->addWidget(soundTestButton, 2, 1); soundGroupBox = new QGroupBox; soundGroupBox->setLayout(soundGrid); @@ -542,6 +542,7 @@ void UserInterfaceSettingsPage::retranslateUi() tapAnimationCheckBox->setText(tr("&Tap/untap animation")); soundEnabledCheckBox->setText(tr("Enable &sounds")); soundPathLabel->setText(tr("Path to sounds directory:")); + soundTestButton->setText(tr("Test system sound engine")); } void UserInterfaceSettingsPage::soundPathClearButtonClicked() diff --git a/cockatrice/src/dlg_settings.h b/cockatrice/src/dlg_settings.h index 0303ceef7..de46f1b16 100644 --- a/cockatrice/src/dlg_settings.h +++ b/cockatrice/src/dlg_settings.h @@ -92,6 +92,7 @@ private: QLabel *soundPathLabel; QLineEdit *soundPathEdit; QGroupBox *generalGroupBox, *animationGroupBox, *soundGroupBox; + QPushButton *soundTestButton; public: UserInterfaceSettingsPage(); void retranslateUi();