mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:44:02 +02:00
Merge branch 'android' of git://github.com/birarda/hifi into android
This commit is contained in:
commit
cb8e4f33bc
6 changed files with 45 additions and 12 deletions
10
BUILD_WIN.md
10
BUILD_WIN.md
|
@ -182,9 +182,15 @@ _Note that the INSTALL target should handle the copying of files into an install
|
|||
|
||||
Download the zip from the [soxr sourceforge page](http://sourceforge.net/projects/soxr/).
|
||||
|
||||
We recommend you extract it to %HIFI_LIB_DIR%\soxr. This will help our FindSoxr cmake module find what it needs. You can place it wherever you like on your machine if you specify SOXR_ROOT_DIR as an environment variable or a variable passed when cmake is run.
|
||||
We recommend you install it to %HIFI_LIB_DIR%\soxr. This will help our FindSoxr cmake module find what it needs. You can place it wherever you like on your machine if you specify SOXR_ROOT_DIR as an environment variable or a variable passed when cmake is run.
|
||||
|
||||
You will need to use cmake to build and install Soxr. If you'd like to keep everything containted in the Soxr folder, pass `-DCMAKE_INSTALL_PREFIX=.` when you run Cmake so that it will be installed to the same directory.
|
||||
Extract the soxr archive wherever you like. Then, inside the extracted folder, create a directory called `build`. From that build directory, the following commands will build and then install soxr to `%HIFI_LIB_DIR%`.
|
||||
|
||||
```
|
||||
cmake .. -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX=%HIFI_LIB_DIR%/soxr
|
||||
nmake
|
||||
nmake install
|
||||
```
|
||||
|
||||
###Build High Fidelity using Visual Studio
|
||||
Follow the same build steps from the CMake section of [BUILD.md](BUILD.md), but pass a different generator to CMake.
|
||||
|
|
|
@ -9,7 +9,9 @@
|
|||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
#ifdef Q_WS_ANDROID
|
||||
#ifdef ANDROID
|
||||
|
||||
#include <jni.h>
|
||||
|
||||
#include <QtAndroidExtras/QAndroidJniEnvironment>
|
||||
#include <QtAndroidExtras/QAndroidJniObject>
|
||||
|
@ -34,11 +36,20 @@
|
|||
|
||||
#include "GVRInterface.h"
|
||||
|
||||
static QString launchURLString = QString();
|
||||
|
||||
GVRInterface::GVRInterface(int argc, char* argv[]) :
|
||||
QApplication(argc, argv),
|
||||
_inVRMode(false)
|
||||
{
|
||||
_client = new RenderingClient(this);
|
||||
if (!launchURLString.isEmpty()) {
|
||||
// did we get launched with a lookup URL? If so it is time to give that to the AddressManager
|
||||
qDebug() << "We were opened via a hifi URL -" << launchURLString;
|
||||
}
|
||||
|
||||
_client = new RenderingClient(this, launchURLString);
|
||||
|
||||
launchURLString = QString();
|
||||
|
||||
connect(this, &QGuiApplication::applicationStateChanged, this, &GVRInterface::handleApplicationStateChange);
|
||||
|
||||
|
@ -58,8 +69,20 @@ GVRInterface::GVRInterface(int argc, char* argv[]) :
|
|||
idleTimer->start(0);
|
||||
}
|
||||
|
||||
#ifdef ANDROID
|
||||
|
||||
extern "C" {
|
||||
|
||||
JNIEXPORT void Java_io_highfidelity_gvrinterface_InterfaceActivity_handleHifiURL(JNIEnv *jni, jclass clazz, jstring hifiURLString) {
|
||||
launchURLString = QAndroidJniObject(hifiURLString).toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void GVRInterface::idle() {
|
||||
#if defined(Q_WS_ANDROID) && defined(HAVE_LIBOVR)
|
||||
#if defined(ANDROID) && defined(HAVE_LIBOVR)
|
||||
if (!_inVRMode && ovr_IsHeadsetDocked()) {
|
||||
qDebug() << "The headset just got docked - assume we are in VR mode.";
|
||||
_inVRMode = true;
|
||||
|
|
|
@ -29,7 +29,7 @@ GVRMainWindow::GVRMainWindow(QWidget* parent) :
|
|||
QMainWindow(parent)
|
||||
{
|
||||
|
||||
#ifndef Q_OS_ANDROID
|
||||
#ifndef ANDROID
|
||||
const int NOTE_4_WIDTH = 2560;
|
||||
const int NOTE_4_HEIGHT = 1440;
|
||||
setFixedSize(NOTE_4_WIDTH / 2, NOTE_4_HEIGHT / 2);
|
||||
|
|
|
@ -21,11 +21,16 @@
|
|||
|
||||
RenderingClient* RenderingClient::_instance = NULL;
|
||||
|
||||
RenderingClient::RenderingClient(QObject *parent) :
|
||||
RenderingClient::RenderingClient(QObject *parent, const QString& launchURLString) :
|
||||
Client(parent)
|
||||
{
|
||||
_instance = this;
|
||||
|
||||
// connect to AddressManager and pass it the launch URL, if we have one
|
||||
auto addressManager = DependencyManager::get<AddressManager>();
|
||||
connect(addressManager.data(), &AddressManager::locationChangeRequired, this, &RenderingClient::goToLocation);
|
||||
addressManager->loadSettings(launchURLString);
|
||||
|
||||
// tell the NodeList which node types all rendering clients will want to know about
|
||||
DependencyManager::get<NodeList>()->addSetOfNodeTypesToNodeInterestSet(NodeSet() << NodeType::AudioMixer << NodeType::AvatarMixer);
|
||||
|
||||
|
@ -42,9 +47,6 @@ RenderingClient::RenderingClient(QObject *parent) :
|
|||
connect(audioThread, &QThread::started, audioClient.data(), &AudioClient::start);
|
||||
|
||||
audioThread->start();
|
||||
|
||||
connect(DependencyManager::get<AddressManager>().data(), &AddressManager::locationChangeRequired,
|
||||
this, &RenderingClient::goToLocation);
|
||||
}
|
||||
|
||||
RenderingClient::~RenderingClient() {
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
class RenderingClient : public Client {
|
||||
Q_OBJECT
|
||||
public:
|
||||
RenderingClient(QObject* parent = 0);
|
||||
RenderingClient(QObject* parent = 0, const QString& launchURLString = QString());
|
||||
~RenderingClient();
|
||||
|
||||
const glm::vec3& getPosition() const { return _position; }
|
||||
|
|
|
@ -20,6 +20,8 @@ import org.qtproject.qt5.android.bindings.QtActivity;
|
|||
|
||||
public class InterfaceActivity extends QtActivity {
|
||||
|
||||
public static native void handleHifiURL(String hifiURLString);
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
@ -31,7 +33,7 @@ public class InterfaceActivity extends QtActivity {
|
|||
Uri data = intent.getData();
|
||||
|
||||
if (data.getScheme().equals("hifi")) {
|
||||
|
||||
handleHifiURL(data.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue