History

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

ZappoMan committed 12 years ago

Commit 77e18672 parents dd3d4be d4d4069117 files · +4891 −2061Browse files

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

Unified · Split

interface/src/Application.cpp+42−25
@@ -103,10 +103,6 @@ const int IDLE_SIMULATE_MSECS = 16; // How often should call simul · 102 unmodified lines
103 // in the idle loop? (60 FPS is default)103 // in the idle loop? (60 FPS is default)
104static QTimer* idleTimer = NULL;104static QTimer* idleTimer = NULL;
105 105
106const int STARTUP_JITTER_SAMPLES = NETWORK_BUFFER_LENGTH_SAMPLES_PER_CHANNEL / 2;
107 // Startup optimistically with small jitter buffer that
108 // will start playback on the second received audio packet.
109
110const QString CHECK_VERSION_URL = "https://highfidelity.io/latestVersion.xml";106const QString CHECK_VERSION_URL = "https://highfidelity.io/latestVersion.xml";
111const QString SKIP_FILENAME = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + "/hifi.skipversion";107const QString SKIP_FILENAME = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + "/hifi.skipversion";
112 108
@@ -162,7 +158,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 49 unmodified lines
162 _touchAvgY(0.0f),158 _touchAvgY(0.0f),
163 _isTouchPressed(false),159 _isTouchPressed(false),
164 _mousePressed(false),160 _mousePressed(false),
165 _audio(STARTUP_JITTER_SAMPLES),161 _audio(),
166 _enableProcessVoxelsThread(true),162 _enableProcessVoxelsThread(true),
167 _octreeProcessor(),163 _octreeProcessor(),
168 _voxelHideShowThread(&_voxels),164 _voxelHideShowThread(&_voxels),
@@ -1494,9 +1490,10 @@ glm::vec3 Application::getMouseVoxelWorldCoordinates(const VoxelDetail& mouseVox · 1325 unmodified lines
1494}1490}
1495 1491
1496FaceTracker* Application::getActiveFaceTracker() {1492FaceTracker* Application::getActiveFaceTracker() {
1497 return _faceshift.isActive() ? static_cast<FaceTracker*>(&_faceshift) :1493 return _cara.isActive() ? static_cast<FaceTracker*>(&_cara) :
1494 (_faceshift.isActive() ? static_cast<FaceTracker*>(&_faceshift) :
1498 (_faceplus.isActive() ? static_cast<FaceTracker*>(&_faceplus) :1495 (_faceplus.isActive() ? static_cast<FaceTracker*>(&_faceplus) :
1499 (_visage.isActive() ? static_cast<FaceTracker*>(&_visage) : NULL));1496 (_visage.isActive() ? static_cast<FaceTracker*>(&_visage) : NULL)));
1500}1497}
1501 1498
1502struct SendVoxelsOperationArgs {1499struct SendVoxelsOperationArgs {
@@ -1713,9 +1710,15 @@ void Application::init() { · 210 unmodified lines
1713 _lastTimeUpdated.start();1710 _lastTimeUpdated.start();
1714 1711
1715 Menu::getInstance()->loadSettings();1712 Menu::getInstance()->loadSettings();
1716 if (Menu::getInstance()->getAudioJitterBufferSamples() != 0) {1713 if (Menu::getInstance()->getAudioJitterBufferFrames() != 0) {
1717 _audio.setJitterBufferSamples(Menu::getInstance()->getAudioJitterBufferSamples());1714 _audio.setDynamicJitterBuffers(false);
1715 _audio.setStaticDesiredJitterBufferFrames(Menu::getInstance()->getAudioJitterBufferFrames());
1716 } else {
1717 _audio.setDynamicJitterBuffers(true);
1718 }1718 }
1719
1720 _audio.setMaxFramesOverDesired(Menu::getInstance()->getMaxFramesOverDesired());
1721
1719 qDebug("Loaded settings");1722 qDebug("Loaded settings");
1720 1723
1721 // initialize our face trackers after loading the menu settings1724 // initialize our face trackers after loading the menu settings
@@ -1878,6 +1881,19 @@ void Application::updateVisage() { · 156 unmodified lines
1878 _visage.update();1881 _visage.update();
1879}1882}
1880 1883
1884void Application::updateCara() {
1885 bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);
1886 PerformanceWarning warn(showWarnings, "Application::updateCara()");
1887
1888 // Update Cara
1889 _cara.update();
1890
1891 // Copy angular velocity if measured by cara, to the head
1892 if (_cara.isActive()) {
1893 _myAvatar->getHead()->setAngularVelocity(_cara.getHeadAngularVelocity());
1894 }
1895}
1896
1881void Application::updateMyAvatarLookAtPosition() {1897void Application::updateMyAvatarLookAtPosition() {
1882 PerformanceTimer perfTimer("lookAt");1898 PerformanceTimer perfTimer("lookAt");
1883 bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);1899 bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);
@@ -2101,21 +2117,6 @@ void Application::update(float deltaTime) { · 217 unmodified lines
2101 // let external parties know we're updating2117 // let external parties know we're updating
2102 emit simulating(deltaTime);2118 emit simulating(deltaTime);
2103 }2119 }
2104}
2105
2106void Application::updateMyAvatar(float deltaTime) {
2107 bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);
2108 PerformanceWarning warn(showWarnings, "Application::updateMyAvatar()");
2109
2110 _myAvatar->update(deltaTime);
2111
2112 {
2113 // send head/hand data to the avatar mixer and voxel server
2114 PerformanceTimer perfTimer("send");
2115 QByteArray packet = byteArrayWithPopulatedHeader(PacketTypeAvatarData);
2116 packet.append(_myAvatar->toByteArray());
2117 controlledBroadcastToNodes(packet, NodeSet() << NodeType::AvatarMixer);
2118 }
2119 2120
2120 // Update _viewFrustum with latest camera and view frustum data...2121 // Update _viewFrustum with latest camera and view frustum data...
2121 // NOTE: we get this from the view frustum, to make it simpler, since the2122 // NOTE: we get this from the view frustum, to make it simpler, since the
@@ -2165,16 +2166,32 @@ void Application::updateMyAvatar(float deltaTime) { · 43 unmodified lines
2165 }2166 }
2166 }2167 }
2167 2168
2169 // send packet containing downstream audio stats to the AudioMixer
2168 {2170 {
2169 quint64 sinceLastNack = now - _lastSendDownstreamAudioStats;2171 quint64 sinceLastNack = now - _lastSendDownstreamAudioStats;
2170 if (sinceLastNack > TOO_LONG_SINCE_LAST_SEND_DOWNSTREAM_AUDIO_STATS) {2172 if (sinceLastNack > TOO_LONG_SINCE_LAST_SEND_DOWNSTREAM_AUDIO_STATS) {
2171 _lastSendDownstreamAudioStats = now;2173 _lastSendDownstreamAudioStats = now;
2172 2174
2173 QMetaObject::invokeMethod(&_audio, "sendDownstreamAudioStatsPacket", Qt::QueuedConnection);2175 QMetaObject::invokeMethod(&_audio, "sendDownstreamAudioStatsPacket", Qt::QueuedConnection);
2174 }2176 }
2175 }2177 }
2176}2178}
2177 2179
2180void Application::updateMyAvatar(float deltaTime) {
2181 bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);
2182 PerformanceWarning warn(showWarnings, "Application::updateMyAvatar()");
2183
2184 _myAvatar->update(deltaTime);
2185
2186 {
2187 // send head/hand data to the avatar mixer and voxel server
2188 PerformanceTimer perfTimer("send");
2189 QByteArray packet = byteArrayWithPopulatedHeader(PacketTypeAvatarData);
2190 packet.append(_myAvatar->toByteArray());
2191 controlledBroadcastToNodes(packet, NodeSet() << NodeType::AvatarMixer);
2192 }
2193}
2194
2178int Application::sendNackPackets() {2195int Application::sendNackPackets() {
2179 2196
2180 if (Menu::getInstance()->isOptionChecked(MenuOption::DisableNackPackets)) {2197 if (Menu::getInstance()->isOptionChecked(MenuOption::DisableNackPackets)) {

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