commit f150aab5e67a545824004a49277c82f66c0c4651
Author: Robert Haschke <rhaschke@techfak.uni-bielefeld.de>
Date:   Sat Nov 14 14:57:52 2020 +0100

    clang-format-10

diff --git a/server/src/MouthConfig.cpp b/server/src/MouthConfig.cpp
index b13f06c..c87fa24 100644
--- a/server/src/MouthConfig.cpp
+++ b/server/src/MouthConfig.cpp
@@ -1,280 +1,284 @@
 /*
-* This file is part of hlrc_server
-*
-* Copyright(c) sschulz <AT> techfak.uni-bielefeld.de
-* http://opensource.cit-ec.de/projects/hlrc_server
-*
-* This file may be licensed under the terms of the
-* GNU General Public License Version 3 (the ``GPL''),
-* or (at your option) any later version.
-*
-* Software distributed under the License is distributed
-* on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
-* express or implied. See the GPL for the specific language
-* governing rights and limitations.
-*
-* You should have received a copy of the GPL along with this
-* program. If not, go to http://www.gnu.org/licenses/gpl.html
-* or write to the Free Software Foundation, Inc.,
-* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-* The development of this software was supported by the
-* Excellence Cluster EXC 277 Cognitive Interaction Technology.
-* The Excellence Cluster EXC 277 is a grant of the Deutsche
-* Forschungsgemeinschaft (DFG) in the context of the German
-* Excellence Initiative.
-*
-*/
+ * This file is part of hlrc_server
+ *
+ * Copyright(c) sschulz <AT> techfak.uni-bielefeld.de
+ * http://opensource.cit-ec.de/projects/hlrc_server
+ *
+ * This file may be licensed under the terms of the
+ * GNU General Public License Version 3 (the ``GPL''),
+ * or (at your option) any later version.
+ *
+ * Software distributed under the License is distributed
+ * on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
+ * express or implied. See the GPL for the specific language
+ * governing rights and limitations.
+ *
+ * You should have received a copy of the GPL along with this
+ * program. If not, go to http://www.gnu.org/licenses/gpl.html
+ * or write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The development of this software was supported by the
+ * Excellence Cluster EXC 277 Cognitive Interaction Technology.
+ * The Excellence Cluster EXC 277 is a grant of the Deutsche
+ * Forschungsgemeinschaft (DFG) in the context of the German
+ * Excellence Initiative.
+ *
+ */
 
 #include "MouthConfig.h"
 using namespace std;
 
-MouthConfig::MouthConfig(){
-    init_by_symbol("");
+MouthConfig::MouthConfig() {
+	init_by_symbol("");
 }
 
-MouthConfig::MouthConfig(string symbol){
-    init_by_symbol(symbol);
+MouthConfig::MouthConfig(string symbol) {
+	init_by_symbol(symbol);
 }
 
-
-MouthConfig::~MouthConfig(){
+MouthConfig::~MouthConfig() {
 }
 
-void MouthConfig::init_by_symbol(string symbol){
-    //default is no change:
-    for(int i=0; i<2; i++){
-        opening[i] = 0.0;
-        override[i] = 0.0;
-    }
-
-    //default?
-    if (symbol.length() == 0){
-        return;
-    }
-
-    //see http://www.phon.ucl.ac.uk/home/sampa/german.htm
-    if (symbol.length() ==1){
-        //single digit phonemes:
-        unsigned char sc = symbol.c_str()[0];
-        switch(sc){
-            default:
-                printf("> ignoring unknown phoneme '%c'\n",sc);
-                break;
+void MouthConfig::init_by_symbol(string symbol) {
+	// default is no change:
+	for (int i = 0; i < 2; i++) {
+		opening[i] = 0.0;
+		override[i] = 0.0;
+	}
 
-            case('_'): //pause
-                break;
+	// default?
+	if (symbol.length() == 0) {
+		return;
+	}
 
-            case('T'): //en: _th_in
-            case('D'): //en: _th_is
-                //as we dont have a tongue, only open the mouth slighly
-                override[CENTER] = true;
-                opening[CENTER] = 4.0;
-                break;
+	// see http://www.phon.ucl.ac.uk/home/sampa/german.htm
+	if (symbol.length() == 1) {
+		// single digit phonemes:
+		unsigned char sc = symbol.c_str()[0];
+		switch (sc) {
+			default:
+				printf("> ignoring unknown phoneme '%c'\n", sc);
+				break;
 
-            case('u'): //en: l_o_se
-                 override[CENTER] = true;
-                 opening[CENTER]  = 13.0;
+			case ('_'): // pause
+				break;
 
-            case('e'): //en: r_ai_se
-                 override[CENTER] = true;
-                 opening[CENTER]  = 5.0;
-                    break;
+			case ('T'): // en: _th_in
+			case ('D'): // en: _th_is
+				// as we dont have a tongue, only open the mouth slighly
+				override[CENTER] = true;
+				opening[CENTER] = 4.0;
+				break;
 
-            case('V'): //en: c_u_t
-                 override[CENTER] = true;
-                 opening[CENTER]  = 3.0;
-                 break;
+			case ('u'): // en: l_o_se
+				override[CENTER] = true;
+				opening[CENTER] = 13.0;
 
-            case('{'): //en: p_a_t
-                 //open mouth
-                 override[CENTER] = true;
-                 opening[CENTER]  = 12.0;
-                 break;
+			case ('e'): // en: r_ai_se
+				override[CENTER] = true;
+				opening[CENTER] = 5.0;
+				break;
 
-            case('w'): //en: _w_asp
-                //mouth nearly closed:
-                override[CENTER] = true;
-                opening[CENTER] = 4.0;
-                break;
+			case ('V'): // en: c_u_t
+				override[CENTER] = true;
+				opening[CENTER] = 3.0;
+				break;
 
-            case('p'): //Pein + en: _p_in
-            case('b'): //Bein
-                //close mouth at the center:
-                override[CENTER] = true;
-                break;
+			case ('{'): // en: p_a_t
+				// open mouth
+				override[CENTER] = true;
+				opening[CENTER] = 12.0;
+				break;
 
-            case('t'): //Teich
-            case('d'): //Deich
-            case('k'): //Kunst
-            case('g'): //Gunst
-                //open mouth at the center
-                override[CENTER] = true;
-                opening[CENTER]  = 11.0;
-                break;
+			case ('w'): // en: _w_asp
+				// mouth nearly closed:
+				override[CENTER] = true;
+				opening[CENTER] = 4.0;
+				break;
 
-            case('?'): //global stop?! ignore
-                break;
+			case ('p'): // Pein + en: _p_in
+			case ('b'): // Bein
+				// close mouth at the center:
+				override[CENTER] = true;
+				break;
 
-            case('f'): //fast
-            case('v'): //was
-            case('@'): // unstressed "schwa" vowel is
-                override[CENTER] = true;
-                opening[CENTER] = 4.0;
-                break;
+			case ('t'): // Teich
+			case ('d'): // Deich
+			case ('k'): // Kunst
+			case ('g'): // Gunst
+				// open mouth at the center
+				override[CENTER] = true;
+				opening[CENTER] = 11.0;
+				break;
 
-            case('z'): //Tasse
-            case('s'): //Tasse
-            case('Z'): //Genie
-            case('C'): //Ich
-            case('j'): //Jahr
-            case('x'): //Buch
-            case('h'): //Hand
-                override[CENTER] = true;
-                opening[CENTER] = 7.0;
-                break;
+			case ('?'): // global stop?! ignore
+				break;
 
-            case('S'): //waschen
-            case('O'): //Trotz
-            case('9'): //plötzlich
-                override[CENTER] = true;
-                opening[CENTER] = 11.0;
-                break;
+			case ('f'): // fast
+			case ('v'): // was
+			case ('@'): // unstressed "schwa" vowel is
+				override[CENTER] = true;
+				opening[CENTER] = 4.0;
+				break;
 
-            case('m'): //mein
-                override[CENTER] = true;
-                break;
+			case ('z'): // Tasse
+			case ('s'): // Tasse
+			case ('Z'): // Genie
+			case ('C'): // Ich
+			case ('j'): // Jahr
+			case ('x'): // Buch
+			case ('h'): // Hand
+				override[CENTER] = true;
+				opening[CENTER] = 7.0;
+				break;
 
-            case('n'): //nein
-            case('N'): //Ding
-            case('l'): //leim
-            case('R'): //Reim
-            case('r'): //en: wrong
-            case('I'): //Sitz
-            case('i'): //en: _ea_se
-            case('E'): //gesetz
-            case('a'): //Satz
-            case('U'): //Schutz
-            case('Y'): //hübsch
-                override[CENTER] = true;
-                opening[CENTER] = 7.0;
-                break;
+			case ('S'): // waschen
+			case ('O'): // Trotz
+			case ('9'): // plötzlich
+				override[CENTER] = true;
+				opening[CENTER] = 11.0;
+				break;
 
-            case('o'): //en: n_o_se
-            case('Q'): //gb: p_o_t
-            case('A'): //english o
-                override[CENTER] = true;
-                opening[CENTER]  = 13.0;
-                break;
-            //r:
-            case('6'): //besser
-                override[CENTER] = true;
-                opening[CENTER] = 3.0;
-                break;
-
-        }
-    }else if (symbol.length() == 2){
-        if (symbol == "pf"){ //Pfahl
-            override[CENTER] = true;
-        }else if(symbol == "ts"){ //Zahl
-            override[CENTER] = true;
-            opening[CENTER]  = 11.0;
-        }else if(symbol == "tS"){ //deutsch
-            override[CENTER] = true;
-            opening[CENTER]  = 10.5;
-        }else if(symbol == "dZ"){ //Dschungel
-            override[CENTER] = true;
-            opening[CENTER]  = 11.0;
-        }else if (
-                (symbol == "OI") || //en: n_oi_se
-                (symbol == "@`") || //en: c_o_rner
-                (symbol == "@U") || //gb: n_o_se
-                (symbol == "o:") || //rot
-                (symbol == "O:") || //gb: c_au_se
-                (symbol == "U@") || //gb: c_u_res
-                (symbol == "u:") || //Blut
-                (symbol == "y:") || //süß
-                (symbol == "2:") || //blöd
-                (symbol == "aU")    //Haus
-                  ){
-            override[CENTER] = true;
-            opening[CENTER]  = 13.0;
-        }else if (
-                (symbol == "i:") || //Lied
-                (symbol == "I@") || //gb: f_ea_rs
-                (symbol == "e:") || //Beet
-                (symbol == "E:") || //spät
-                (symbol == "a:") || //Tat
-                (symbol == "A:")    //gb: st_a_rs
-                  ){
-            override[CENTER] = true;
-            opening[CENTER]  = 9.0;
-        }else if (
-                  (symbol == "aI")|| //Eis
-                  (symbol == "eI")   //gb: r_ai_se
-                  ){
-            override[CENTER] = true;
-            opening[CENTER]  = 5.0;
-        }else if(
-                 (symbol == "OY") || //Kreuz
-                 (symbol == "3:") || //gb: f_ur_s
-                 (symbol == "3`")    //en: f_ur_s
-                 ){
-            override[CENTER] = true;
-            opening[CENTER]  = 5.0;
-        }else if (
-                  (symbol == "I6") || //Wirt
-                  (symbol == "Y6") || //Türke
-                  (symbol == "E6") || //Berg
-                  (symbol == "96") || //Wörter
-                  (symbol == "a6") || //hart
-                  (symbol == "U6") || //kurz
-                  (symbol == "e@") || //gb: st_ai_rs
-                  (symbol == "O6") //dort
-                  ){
-            override[CENTER] = true;
-            opening[CENTER]  = 5.0;
-        }
-    }else if (symbol.length() == 3){
-        if(
-                (symbol == "i:6") || //Tier
-                (symbol == "y:6") || //Tür
-                (symbol == "e:6") || //schwer
-                (symbol == "E:6") || //Bär
-                (symbol == "2:6") || //Föhr
-                (symbol == "a:6") || //Haar
-                (symbol == "u:6") || //Kur
-                (symbol == "o:6")    //Ohr
-                ){
-            override[CENTER] = true;
-            opening[CENTER]  = 5.0;
-        }else{
-            printf("> invalid phoneme '%s' unhandled\n",symbol.c_str());
-        }
-    }else{
-        printf("> invalid phoneme length, phoneme '%s' unhandled\n",symbol.c_str());
-    }
+			case ('m'): // mein
+				override[CENTER] = true;
+				break;
 
+			case ('n'): // nein
+			case ('N'): // Ding
+			case ('l'): // leim
+			case ('R'): // Reim
+			case ('r'): // en: wrong
+			case ('I'): // Sitz
+			case ('i'): // en: _ea_se
+			case ('E'): // gesetz
+			case ('a'): // Satz
+			case ('U'): // Schutz
+			case ('Y'): // hübsch
+				override[CENTER] = true;
+				opening[CENTER] = 7.0;
+				break;
 
+			case ('o'): // en: n_o_se
+			case ('Q'): // gb: p_o_t
+			case ('A'): // english o
+				override[CENTER] = true;
+				opening[CENTER] = 13.0;
+				break;
+			// r:
+			case ('6'): // besser
+				override[CENTER] = true;
+				opening[CENTER] = 3.0;
+				break;
+		}
+	}
+	else if (symbol.length() == 2) {
+		if (symbol == "pf") { // Pfahl
+			override[CENTER] = true;
+		}
+		else if (symbol == "ts") { // Zahl
+			override[CENTER] = true;
+			opening[CENTER] = 11.0;
+		}
+		else if (symbol == "tS") { // deutsch
+			override[CENTER] = true;
+			opening[CENTER] = 10.5;
+		}
+		else if (symbol == "dZ") { // Dschungel
+			override[CENTER] = true;
+			opening[CENTER] = 11.0;
+		}
+		else if ((symbol == "OI") || // en: n_oi_se
+		         (symbol == "@`") || // en: c_o_rner
+		         (symbol == "@U") || // gb: n_o_se
+		         (symbol == "o:") || // rot
+		         (symbol == "O:") || // gb: c_au_se
+		         (symbol == "U@") || // gb: c_u_res
+		         (symbol == "u:") || // Blut
+		         (symbol == "y:") || // süß
+		         (symbol == "2:") || // blöd
+		         (symbol == "aU")    // Haus
+		) {
+			override[CENTER] = true;
+			opening[CENTER] = 13.0;
+		}
+		else if ((symbol == "i:") || // Lied
+		         (symbol == "I@") || // gb: f_ea_rs
+		         (symbol == "e:") || // Beet
+		         (symbol == "E:") || // spät
+		         (symbol == "a:") || // Tat
+		         (symbol == "A:")    // gb: st_a_rs
+		) {
+			override[CENTER] = true;
+			opening[CENTER] = 9.0;
+		}
+		else if ((symbol == "aI") || // Eis
+		         (symbol == "eI")    // gb: r_ai_se
+		) {
+			override[CENTER] = true;
+			opening[CENTER] = 5.0;
+		}
+		else if ((symbol == "OY") || // Kreuz
+		         (symbol == "3:") || // gb: f_ur_s
+		         (symbol == "3`")    // en: f_ur_s
+		) {
+			override[CENTER] = true;
+			opening[CENTER] = 5.0;
+		}
+		else if ((symbol == "I6") || // Wirt
+		         (symbol == "Y6") || // Türke
+		         (symbol == "E6") || // Berg
+		         (symbol == "96") || // Wörter
+		         (symbol == "a6") || // hart
+		         (symbol == "U6") || // kurz
+		         (symbol == "e@") || // gb: st_ai_rs
+		         (symbol == "O6")    // dort
+		) {
+			override[CENTER] = true;
+			opening[CENTER] = 5.0;
+		}
+	}
+	else if (symbol.length() == 3) {
+		if ((symbol == "i:6") || // Tier
+		    (symbol == "y:6") || // Tür
+		    (symbol == "e:6") || // schwer
+		    (symbol == "E:6") || // Bär
+		    (symbol == "2:6") || // Föhr
+		    (symbol == "a:6") || // Haar
+		    (symbol == "u:6") || // Kur
+		    (symbol == "o:6")    // Ohr
+		) {
+			override[CENTER] = true;
+			opening[CENTER] = 5.0;
+		}
+		else {
+			printf("> invalid phoneme '%s' unhandled\n", symbol.c_str());
+		}
+	}
+	else {
+		printf("> invalid phoneme length, phoneme '%s' unhandled\n", symbol.c_str());
+	}
 }
 
+void MouthConfig::apply_on_mouth_state(humotion::MouthState* m) {
+	if (override[LEFT]) {
+		m->opening_left = opening[LEFT];
+	}
+	else {
+		m->opening_left += opening[LEFT];
+	}
 
-void MouthConfig::apply_on_mouth_state(humotion::MouthState *m){
-    if (override[LEFT]){
-        m->opening_left = opening[LEFT];
-    }else{
-        m->opening_left += opening[LEFT];
-    }
-
-    if (override[CENTER]){
-        m->opening_center = opening[CENTER];
-    }else{
-        m->opening_center += opening[CENTER];
-    }
+	if (override[CENTER]) {
+		m->opening_center = opening[CENTER];
+	}
+	else {
+		m->opening_center += opening[CENTER];
+	}
 
-    if (override[RIGHT]){
-        m->opening_right = opening[RIGHT];
-    }else{
-        m->opening_right += opening[RIGHT];
-    }
+	if (override[RIGHT]) {
+		m->opening_right = opening[RIGHT];
+	}
+	else {
+		m->opening_right += opening[RIGHT];
+	}
 }
