mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-07 19:23:04 +02:00
Introducong tablet audio events
This commit is contained in:
parent
9f8f28dd1e
commit
832e4aa5eb
15 changed files with 26 additions and 2 deletions
|
@ -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() {
|
||||
|
|
BIN
interface/resources/sounds/Button01.wav
Normal file
BIN
interface/resources/sounds/Button01.wav
Normal file
Binary file not shown.
BIN
interface/resources/sounds/Button02.wav
Normal file
BIN
interface/resources/sounds/Button02.wav
Normal file
Binary file not shown.
BIN
interface/resources/sounds/Button03.wav
Normal file
BIN
interface/resources/sounds/Button03.wav
Normal file
Binary file not shown.
BIN
interface/resources/sounds/Button04.wav
Normal file
BIN
interface/resources/sounds/Button04.wav
Normal file
Binary file not shown.
BIN
interface/resources/sounds/Button05.wav
Normal file
BIN
interface/resources/sounds/Button05.wav
Normal file
Binary file not shown.
BIN
interface/resources/sounds/Button06.wav
Normal file
BIN
interface/resources/sounds/Button06.wav
Normal file
Binary file not shown.
BIN
interface/resources/sounds/Button07.wav
Normal file
BIN
interface/resources/sounds/Button07.wav
Normal file
Binary file not shown.
BIN
interface/resources/sounds/Collapse.wav
Normal file
BIN
interface/resources/sounds/Collapse.wav
Normal file
Binary file not shown.
BIN
interface/resources/sounds/Expand.wav
Normal file
BIN
interface/resources/sounds/Expand.wav
Normal file
Binary file not shown.
BIN
interface/resources/sounds/Tab01.wav
Normal file
BIN
interface/resources/sounds/Tab01.wav
Normal file
Binary file not shown.
BIN
interface/resources/sounds/Tab02.wav
Normal file
BIN
interface/resources/sounds/Tab02.wav
Normal file
Binary file not shown.
BIN
interface/resources/sounds/Tab03.wav
Normal file
BIN
interface/resources/sounds/Tab03.wav
Normal file
Binary file not shown.
|
@ -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<QString> tabletSoundsButtonClick("TabletSounds/buttonClick", "../../../sounds/Button06.wav");
|
||||
Setting::Handle<QString> tabletSoundsButtonHover("TabletSounds/buttonHover", "../../../sounds/Button04.wav");
|
||||
Setting::Handle<QString> tabletSoundsTabletOpen("TabletSounds/tabletOpen", "../../../sounds/Button07.wav");
|
||||
Setting::Handle<QString> tabletSoundsTabletHandsIn("TabletSounds/tabletHandsIn", "../../../sounds/Tab01.wav");
|
||||
Setting::Handle<QString> 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<SoundCache>()->
|
||||
getSound(QUrl::fromLocalFile(inf.absoluteFilePath()));
|
||||
}
|
||||
|
||||
void TabletScriptingInterface::setToolbarMode(bool toolbarMode) {
|
||||
Q_ASSERT(QThread::currentThread() == qApp->thread());
|
||||
_toolbarMode = toolbarMode;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue