History

Merge branch 'master' of https://github.com/highfidelity/hifi into placement_tool

Atlante45 committed 12 years ago

Commit 8a7a5902 parents c4102e3 16cd2ca21 files · +567 −102Browse files

Showing the changes to interface/src/Application.cpp (1 of 21 files). Show all

Unified · Split

interface/src/Application.cpp+42−0
@@ -356,6 +356,8 @@ Application::Application(int& argc, char** argv, timeval &startup_time) : · 355 unmodified lines
356356 QMutexLocker locker(&_settingsMutex);
357357 _previousScriptLocation = _settings->value("LastScriptLocation", QVariant("")).toString();
358358 }
359+ //When -url in command line, teleport to location
360+ urlGoTo(argc, constArgv);
359361 }
360362
361363 Application::~Application() {
@@ -1679,8 +1681,12 @@ void Application::init() { · 1317 unmodified lines
16791681 _audioReflector.setMyAvatar(getAvatar());
16801682 _audioReflector.setVoxels(_voxels.getTree());
16811683 _audioReflector.setAudio(getAudio());
1684+ _audioReflector.setAvatarManager(&_avatarManager);
1685+
16821686 connect(getAudio(), &Audio::processInboundAudio, &_audioReflector, &AudioReflector::processInboundAudio,Qt::DirectConnection);
16831687 connect(getAudio(), &Audio::processLocalAudio, &_audioReflector, &AudioReflector::processLocalAudio,Qt::DirectConnection);
1688+ connect(getAudio(), &Audio::preProcessOriginalInboundAudio, &_audioReflector,
1689+ &AudioReflector::preProcessOriginalInboundAudio,Qt::DirectConnection);
16841690
16851691 // save settings when avatar changes
16861692 connect(_myAvatar, &MyAvatar::transformChanged, this, &Application::bumpSettings);
@@ -3020,6 +3026,7 @@ void Application::resetSensors() { · 1333 unmodified lines
30203026 _mouseX = _glWidget->width() / 2;
30213027 _mouseY = _glWidget->height() / 2;
30223028
3029+ _faceplus.reset();
30233030 _faceshift.reset();
30243031 _visage.reset();
30253032
@@ -3561,3 +3568,38 @@ void Application::takeSnapshot() { · 535 unmodified lines
35613568
35623569 Snapshot::saveSnapshot(_glWidget, _myAvatar);
35633570 }
3571+
3572+void Application::urlGoTo(int argc, const char * constArgv[]) {
3573+ //Gets the url (hifi://domain/destination/orientation)
3574+ QString customUrl = getCmdOption(argc, constArgv, "-url");
3575+
3576+ if (customUrl.startsWith("hifi://")) {
3577+ QStringList urlParts = customUrl.remove(0, CUSTOM_URL_SCHEME.length() + 2).split('/', QString::SkipEmptyParts);
3578+ if (urlParts.count() > 1) {
3579+ // if url has 2 or more parts, the first one is domain name
3580+ QString domain = urlParts[0];
3581+
3582+ // second part is either a destination coordinate or
3583+ // a place name
3584+ QString destination = urlParts[1];
3585+
3586+ // any third part is an avatar orientation.
3587+ QString orientation = urlParts.count() > 2 ? urlParts[2] : QString();
3588+
3589+ Menu::goToDomain(domain);
3590+
3591+ // goto either @user, #place, or x-xx,y-yy,z-zz
3592+ // style co-ordinate.
3593+ Menu::goTo(destination);
3594+
3595+ if (!orientation.isEmpty()) {
3596+ // location orientation
3597+ Menu::goToOrientation(orientation);
3598+ }
3599+ } else if (urlParts.count() == 1) {
3600+ // location coordinates or place name
3601+ QString destination = urlParts[0];
3602+ Menu::goTo(destination);
3603+ }
3604+ }
3605+}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t