diff --git a/interface/resources/qml/hifi/tablet/TabletRoot.qml b/interface/resources/qml/hifi/tablet/TabletRoot.qml index 5084377273..36ea16d882 100644 --- a/interface/resources/qml/hifi/tablet/TabletRoot.qml +++ b/interface/resources/qml/hifi/tablet/TabletRoot.qml @@ -1,6 +1,7 @@ import QtQuick 2.0 import Hifi 1.0 import QtQuick.Controls 1.4 + import "../../dialogs" import "../../controls" @@ -145,7 +146,7 @@ Item { SoundEffect { id: buttonClickSound volume: 0.1 - source: "../../../sounds/Gamemaster-Audio-button-click.wav" + source: "" } function playButtonClickSound() { diff --git a/interface/resources/sounds/Button01.wav b/interface/resources/sounds/Button01.wav new file mode 100644 index 0000000000..e1c8111c6f Binary files /dev/null and b/interface/resources/sounds/Button01.wav differ diff --git a/interface/resources/sounds/Button02.wav b/interface/resources/sounds/Button02.wav new file mode 100644 index 0000000000..f4bac99e38 Binary files /dev/null and b/interface/resources/sounds/Button02.wav differ diff --git a/interface/resources/sounds/Button03.wav b/interface/resources/sounds/Button03.wav new file mode 100644 index 0000000000..1eb28b7daf Binary files /dev/null and b/interface/resources/sounds/Button03.wav differ diff --git a/interface/resources/sounds/Button04.wav b/interface/resources/sounds/Button04.wav new file mode 100644 index 0000000000..cd76d0174c Binary files /dev/null and b/interface/resources/sounds/Button04.wav differ diff --git a/interface/resources/sounds/Button05.wav b/interface/resources/sounds/Button05.wav new file mode 100644 index 0000000000..72d2622e9d Binary files /dev/null and b/interface/resources/sounds/Button05.wav differ diff --git a/interface/resources/sounds/Button06.wav b/interface/resources/sounds/Button06.wav new file mode 100644 index 0000000000..30a097ce45 Binary files /dev/null and b/interface/resources/sounds/Button06.wav differ diff --git a/interface/resources/sounds/Button07.wav b/interface/resources/sounds/Button07.wav new file mode 100644 index 0000000000..5d285ffa07 Binary files /dev/null and b/interface/resources/sounds/Button07.wav differ diff --git a/interface/resources/sounds/Collapse.wav b/interface/resources/sounds/Collapse.wav new file mode 100644 index 0000000000..7a169d506c Binary files /dev/null and b/interface/resources/sounds/Collapse.wav differ diff --git a/interface/resources/sounds/Expand.wav b/interface/resources/sounds/Expand.wav new file mode 100644 index 0000000000..7f7710e7f6 Binary files /dev/null and b/interface/resources/sounds/Expand.wav differ diff --git a/interface/resources/sounds/Tab01.wav b/interface/resources/sounds/Tab01.wav new file mode 100644 index 0000000000..38cf7decc4 Binary files /dev/null and b/interface/resources/sounds/Tab01.wav differ diff --git a/interface/resources/sounds/Tab02.wav b/interface/resources/sounds/Tab02.wav new file mode 100644 index 0000000000..04ad9b909f Binary files /dev/null and b/interface/resources/sounds/Tab02.wav differ diff --git a/interface/resources/sounds/Tab03.wav b/interface/resources/sounds/Tab03.wav new file mode 100644 index 0000000000..db7545a365 Binary files /dev/null and b/interface/resources/sounds/Tab03.wav differ diff --git a/libraries/ui/src/ui/TabletScriptingInterface.cpp b/libraries/ui/src/ui/TabletScriptingInterface.cpp index adff219e0f..6901666da0 100644 --- a/libraries/ui/src/ui/TabletScriptingInterface.cpp +++ b/libraries/ui/src/ui/TabletScriptingInterface.cpp @@ -22,12 +22,22 @@ #include "../InfoView.h" #include "ToolbarScriptingInterface.h" #include "Logging.h" +#include "SoundCache.h" + +#include "SettingHandle.h" // FIXME move to global app properties const QString SYSTEM_TOOLBAR = "com.highfidelity.interface.toolbar.system"; const QString SYSTEM_TABLET = "com.highfidelity.interface.tablet.system"; +Setting::Handle tabletSoundsButtonClick("TabletSounds/buttonClick", "../../../sounds/Button06.wav"); +Setting::Handle tabletSoundsButtonHover("TabletSounds/buttonHover", "../../../sounds/Button04.wav"); +Setting::Handle tabletSoundsTabletOpen("TabletSounds/tabletOpen", "../../../sounds/Button07.wav"); +Setting::Handle tabletSoundsTabletHandsIn("TabletSounds/tabletHandsIn", "../../../sounds/Tab01.wav"); +Setting::Handle tabletSoundsTabletHandsOut("TabletSounds/tabletHandsOut", "../../../sounds/Tab02.wav"); + TabletScriptingInterface::TabletScriptingInterface() { + } TabletScriptingInterface::~TabletScriptingInterface() { @@ -61,6 +71,13 @@ TabletProxy* TabletScriptingInterface::getTablet(const QString& tabletId) { return tabletProxy; } +void TabletScriptingInterface::playSound(QString soundId) +{ + QFileInfo inf = QFileInfo(PathUtils::resourcesPath() + "sounds/snap.wav"); + SharedSoundPointer _snapshotSound = DependencyManager::get()-> + getSound(QUrl::fromLocalFile(inf.absoluteFilePath())); +} + void TabletScriptingInterface::setToolbarMode(bool toolbarMode) { Q_ASSERT(QThread::currentThread() == qApp->thread()); _toolbarMode = toolbarMode; diff --git a/libraries/ui/src/ui/TabletScriptingInterface.h b/libraries/ui/src/ui/TabletScriptingInterface.h index 822bae839e..78c616b412 100644 --- a/libraries/ui/src/ui/TabletScriptingInterface.h +++ b/libraries/ui/src/ui/TabletScriptingInterface.h @@ -34,6 +34,10 @@ class TabletButtonProxy; class QmlWindowClass; class OffscreenQmlSurface; +namespace Tablet +{ + enum AudioEvents { ButtonClick, ButtonHover, TabletOpen, TabletHandsIn, TabletHandsOut }; +} /**jsdoc * @namespace Tablet */ @@ -41,7 +45,7 @@ class TabletScriptingInterface : public QObject, public Dependency { Q_OBJECT public: TabletScriptingInterface(); - ~TabletScriptingInterface(); + virtual ~TabletScriptingInterface(); void setToolbarScriptingInterface(ToolbarScriptingInterface* toolbarScriptingInterface) { _toolbarScriptingInterface = toolbarScriptingInterface; } @@ -53,6 +57,7 @@ public: */ Q_INVOKABLE TabletProxy* getTablet(const QString& tabletId); + Q_INVOKABLE void playSound(QString soundId); void setToolbarMode(bool toolbarMode); void setQmlTabletRoot(QString tabletId, OffscreenQmlSurface* offscreenQmlSurface); @@ -308,6 +313,7 @@ protected: }; Q_DECLARE_METATYPE(TabletButtonProxy*); +Q_DECLARE_METATYPE(Tablet::AudioEvents); /**jsdoc * @typedef TabletButtonProxy.ButtonProperties