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/include/RSB/UtteranceRSB.h b/server/include/RSB/UtteranceRSB.h
index 145dece..06d31a0 100644
--- a/server/include/RSB/UtteranceRSB.h
+++ b/server/include/RSB/UtteranceRSB.h
@@ -1,30 +1,30 @@
 /*
-* 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.
+ *
+ */
 
 #pragma once
 #include "AudioData.h"
@@ -32,79 +32,89 @@
 #include <rst/audition/Utterance.pb.h>
 using namespace std;
 
-//converter from rsb utterance
+// converter from rsb utterance
 class UtteranceRSB : public Utterance {
-    public:
-        UtteranceRSB(rst::audition::Utterance rst_utterance){
-            //set text:
-            set_text(rst_utterance.textual_representation());
-
-            //convert soundchunk to audio data:
-            extract_audio_data(rst_utterance.audio());
-
-            //convert phonemes:
-            extract_phonemes(rst_utterance);
-        }
-
-        ~UtteranceRSB(){};
-
-        void extract_audio_data(rst::audition::SoundChunk sound_chunk){
-            //cout << sound_chunk.DebugString();
-
-            //extract data:
-            unsigned int audio_len = sound_chunk.data().length();
-            char *audio_data_char = (char *)sound_chunk.data().c_str();
-
-            //audio.samples = vector<char>(audio_data_char, audio_data_char+audio_len);
-            audio_data->samples.resize(audio_len);
-            audio_data->samples.assign(audio_data_char, audio_data_char+audio_len);
-
-            printf("audio samplesize is %d bytes\n",(unsigned int)audio_data->samples.size());
-
-            //extract format:
-            audio_data->sample_signed = true;
-            switch (sound_chunk.sample_type()){
-                case(rst::audition::SoundChunk::SAMPLE_U8):  audio_data->sample_signed = false; //and fall through:
-                case(rst::audition::SoundChunk::SAMPLE_S8):  audio_data->sample_bit =  8; break;
-
-                case(rst::audition::SoundChunk::SAMPLE_U16): audio_data->sample_signed = false; //and fall through:
-                case(rst::audition::SoundChunk::SAMPLE_S16): audio_data->sample_bit = 16; break;
-
-                case(rst::audition::SoundChunk::SAMPLE_U24): audio_data->sample_signed = false; //and fall through:
-                case(rst::audition::SoundChunk::SAMPLE_S24): audio_data->sample_bit = 24; break;
-
-                default:
-                    printf("> invalid sample type %d in RST SoundChunk! ignoring request!\n", sound_chunk.sample_type());
-                    throw runtime_error("UtteranceRSB::convert_audio_data() unsupported sample type in rst::audition::SoundChunk");
-            }
-
-            //bitrate
-            audio_data->sample_rate = sound_chunk.rate();
-
-        //endianness
-        if (sound_chunk.endianness() == rst::audition::SoundChunk::ENDIAN_LITTLE){
-            audio_data->sample_big_endian = false;
-        }else if (sound_chunk.endianness() == rst::audition::SoundChunk::ENDIAN_BIG){
-            audio_data->sample_big_endian = true;
-        }else{
-            printf("> invalid SoundChunk byte_format");
-            throw runtime_error("UtteranceRSB::convert_audio_data() unsupported byte_format in rst::audition::SoundChunk");
-        }
-
-        //number of channels
-        audio_data->sample_channels = sound_chunk.channels();
-
-        printf("> new AudioData: %s\n",audio_data->to_string().c_str());
-    }
-
-    void extract_phonemes(rst::audition::Utterance rst_utterance){
-        //extract phoneme vector
-        phonemes_vector.clear();
-        for(int i=0; i<rst_utterance.phonemes().element().size(); i++){
-            rst::audition::Phoneme rst_phoneme = rst_utterance.phonemes().element().Get(i);
-            Utterance::symbol_duration_pair_t phoneme = make_pair(rst_phoneme.symbol(), rst_phoneme.duration());
-            phonemes_vector.push_back(phoneme);
-        }
-    }
+public:
+	UtteranceRSB(rst::audition::Utterance rst_utterance) {
+		// set text:
+		set_text(rst_utterance.textual_representation());
+
+		// convert soundchunk to audio data:
+		extract_audio_data(rst_utterance.audio());
+
+		// convert phonemes:
+		extract_phonemes(rst_utterance);
+	}
+
+	~UtteranceRSB(){};
+
+	void extract_audio_data(rst::audition::SoundChunk sound_chunk) {
+		// cout << sound_chunk.DebugString();
+
+		// extract data:
+		unsigned int audio_len = sound_chunk.data().length();
+		char* audio_data_char = (char*)sound_chunk.data().c_str();
+
+		// audio.samples = vector<char>(audio_data_char, audio_data_char+audio_len);
+		audio_data->samples.resize(audio_len);
+		audio_data->samples.assign(audio_data_char, audio_data_char + audio_len);
+
+		printf("audio samplesize is %d bytes\n", (unsigned int)audio_data->samples.size());
+
+		// extract format:
+		audio_data->sample_signed = true;
+		switch (sound_chunk.sample_type()) {
+			case (rst::audition::SoundChunk::SAMPLE_U8):
+				audio_data->sample_signed = false; // and fall through:
+			case (rst::audition::SoundChunk::SAMPLE_S8):
+				audio_data->sample_bit = 8;
+				break;
+
+			case (rst::audition::SoundChunk::SAMPLE_U16):
+				audio_data->sample_signed = false; // and fall through:
+			case (rst::audition::SoundChunk::SAMPLE_S16):
+				audio_data->sample_bit = 16;
+				break;
+
+			case (rst::audition::SoundChunk::SAMPLE_U24):
+				audio_data->sample_signed = false; // and fall through:
+			case (rst::audition::SoundChunk::SAMPLE_S24):
+				audio_data->sample_bit = 24;
+				break;
+
+			default:
+				printf("> invalid sample type %d in RST SoundChunk! ignoring request!\n", sound_chunk.sample_type());
+				throw runtime_error("UtteranceRSB::convert_audio_data() unsupported sample type in rst::audition::SoundChunk");
+		}
+
+		// bitrate
+		audio_data->sample_rate = sound_chunk.rate();
+
+		// endianness
+		if (sound_chunk.endianness() == rst::audition::SoundChunk::ENDIAN_LITTLE) {
+			audio_data->sample_big_endian = false;
+		}
+		else if (sound_chunk.endianness() == rst::audition::SoundChunk::ENDIAN_BIG) {
+			audio_data->sample_big_endian = true;
+		}
+		else {
+			printf("> invalid SoundChunk byte_format");
+			throw runtime_error("UtteranceRSB::convert_audio_data() unsupported byte_format in rst::audition::SoundChunk");
+		}
+
+		// number of channels
+		audio_data->sample_channels = sound_chunk.channels();
+
+		printf("> new AudioData: %s\n", audio_data->to_string().c_str());
+	}
+
+	void extract_phonemes(rst::audition::Utterance rst_utterance) {
+		// extract phoneme vector
+		phonemes_vector.clear();
+		for (int i = 0; i < rst_utterance.phonemes().element().size(); i++) {
+			rst::audition::Phoneme rst_phoneme = rst_utterance.phonemes().element().Get(i);
+			Utterance::symbol_duration_pair_t phoneme = make_pair(rst_phoneme.symbol(), rst_phoneme.duration());
+			phonemes_vector.push_back(phoneme);
+		}
+	}
 };
-
