commit 9cb381ecd6f53182b6f415e3c7e8c82d098d2f45
Author: Robert Haschke <rhaschke@techfak.uni-bielefeld.de>
Date:   Mon Oct 26 01:36:30 2020 +0100

    Modernize: boost::time -> std::chrono

diff --git a/server/src/Arbiter.cpp b/server/src/Arbiter.cpp
index 938e76e..65c6630 100644
--- a/server/src/Arbiter.cpp
+++ b/server/src/Arbiter.cpp
@@ -30,6 +30,8 @@
 #include "AudioPlayerLibAO.h"
 #include "AudioPlayerRSB.h"
 #include <boost/algorithm/string/predicate.hpp>
+#include <boost/thread/mutex.hpp>
+#include <iostream>
 
 using namespace boost;
 using namespace std;
@@ -66,7 +68,7 @@ Arbiter::~Arbiter(){
 
 void Arbiter::set_default_emotion(EmotionState e){
     //lock access
-    mutex::scoped_lock scoped_lock(emotion_config_default_mutex);
+    boost::mutex::scoped_lock scoped_lock(emotion_config_default_mutex);
 
     //update our config, ignore duration as this is the default emotion
     emotion_config_default.select_config(e.value);
@@ -79,7 +81,7 @@ void Arbiter::set_default_emotion(EmotionState e){
 
 void Arbiter::set_current_emotion(EmotionState e){
     //lock access
-    mutex::scoped_lock scoped_lock(emotion_config_current_mutex);
+    boost::mutex::scoped_lock scoped_lock(emotion_config_current_mutex);
 
     //this will set a emotion override for a given time, after the timeout
     //we will return to the default emotion state:
@@ -94,21 +96,21 @@ void Arbiter::set_current_emotion(EmotionState e){
 
 void Arbiter::set_mouth_config(MouthConfig m){
     //lock access
-    mutex::scoped_lock scoped_lock(mouth_config_override_mutex);
+    boost::mutex::scoped_lock scoped_lock(mouth_config_override_mutex);
 
     mouth_config = m;
 }
 
 void Arbiter::set_gaze_target(humotion::GazeState target){
     //lock access
-    mutex::scoped_lock scoped_lock(requested_gaze_state_mutex);
+    boost::mutex::scoped_lock scoped_lock(requested_gaze_state_mutex);
 
     requested_gaze_state = target;
 }
 
 void Arbiter::set_mouth_target(humotion::MouthState target){
     //lock access
-    mutex::scoped_lock scoped_lock(requested_mouth_state_mutex);
+    boost::mutex::scoped_lock scoped_lock(requested_mouth_state_mutex);
 
     requested_mouth_state = target;
 }
@@ -117,7 +119,7 @@ void Arbiter::set_mouth_target(humotion::MouthState target){
 void Arbiter::play_animation(boost::shared_ptr<Animation> incoming_animation){
     //incoming animation, check if this would conflict with any pending animations:
     //lock access & iterate over vector:
-    mutex::scoped_lock lock_av(active_animation_vector_mutex);
+    boost::mutex::scoped_lock lock_av(active_animation_vector_mutex);
     active_animation_vector_t::iterator it;
     for(it = active_animation_vector.begin(); it<active_animation_vector.end(); it++){
         boost::shared_ptr<Animation> current_ani = *it;
@@ -160,10 +162,10 @@ void Arbiter::play_animation(boost::shared_ptr<Animation> incoming_animation){
 
 void Arbiter::speak(boost::shared_ptr<Utterance> u){ //, ao_sample_format audio_format, char *audio_data, unsigned int audio_len){
     //lock audio playback as such:
-    mutex::scoped_lock scoped_lock_audio(audio_player_mutex);
+    boost::mutex::scoped_lock scoped_lock_audio(audio_player_mutex);
 
     //lock utterance & store data:
-    mutex::scoped_lock scoped_lock(utterance_mutex);
+    boost::mutex::scoped_lock scoped_lock(utterance_mutex);
     utterance = u;
     scoped_lock.unlock();
 
@@ -270,7 +272,7 @@ void Arbiter::override_by_emotion(){
     }
 
     //lock access
-    mutex::scoped_lock scoped_lock1(emotion_config_default_mutex);
+    boost::mutex::scoped_lock scoped_lock1(emotion_config_default_mutex);
 
 
     // did the current emotion time out?
@@ -312,17 +314,16 @@ humotion::GazeState Arbiter::soft_overblend_gaze(humotion::GazeState gaze_now,
         // new incoming target, set up soft fade:
         cout << "NEW EMOTION\n";
         gaze_state_old = gaze_state;
-        gaze_state_end_time = get_system_time() + boost::posix_time::milliseconds(overblend_time);
+        gaze_state_end_time = std::chrono::steady_clock::now() + std::chrono::milliseconds(overblend_time);
         gaze_state_animation_restart = false;
     }
     // do smooth overblend, all targets should be reached at gaze_state_end_time
-    boost::posix_time::time_duration tdiff = gaze_state_end_time - get_system_time();
-    if (tdiff.is_negative()) {
+    double diff_ms = std::chrono::duration<double, std::milli>(gaze_state_end_time - std::chrono::steady_clock::now()).count();
+    if (diff_ms < 0) {
         // animation is done, exit now
         return gaze_target;
     } else {
         // do smooth animation
-        double diff_ms = tdiff.total_milliseconds();
         double tp = 1.0 - diff_ms / static_cast<double>(overblend_time);
 
         result.pan_offset = gaze_state_old.pan_offset + tp * (gaze_target.pan_offset - gaze_state_old.pan_offset);
@@ -343,7 +344,7 @@ humotion::GazeState Arbiter::soft_overblend_gaze(humotion::GazeState gaze_now,
 
 void Arbiter::override_by_animation(){
     //lock access & iterate over vector:
-    mutex::scoped_lock lock_av(active_animation_vector_mutex);
+    boost::mutex::scoped_lock lock_av(active_animation_vector_mutex);
     active_animation_vector_t::iterator it;
     for(it = active_animation_vector.begin(); it<active_animation_vector.end(); it++){
         boost::shared_ptr<Animation> current_ani = *it;
