From 100e2d3bd46f64df730c8a375559680c577036ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Gl=C3=B6ckner?= Date: Mon, 25 Jan 2016 14:14:22 +0100 Subject: applied clang-format --- drumgizmo/enginefactory.cc | 61 ++++++++++++++++++++++++++++------------------ 1 file changed, 37 insertions(+), 24 deletions(-) (limited to 'drumgizmo/enginefactory.cc') diff --git a/drumgizmo/enginefactory.cc b/drumgizmo/enginefactory.cc index 06f8141..b5368ac 100644 --- a/drumgizmo/enginefactory.cc +++ b/drumgizmo/enginefactory.cc @@ -29,14 +29,12 @@ #include "cpp11fix.h" // required for c++11 #include "enginefactory.h" -EngineFactory::EngineFactory() - : input{} - , output{} +EngineFactory::EngineFactory() : input{}, output {} #ifdef USE_JACK - , jack{nullptr} +, jack { nullptr } #endif { - // list available input engines +// list available input engines #ifdef HAVE_INPUT_DUMMY input.push_back("inputdummy"); #endif @@ -46,8 +44,8 @@ EngineFactory::EngineFactory() #ifdef HAVE_INPUT_JACKMIDI input.push_back("jackmidi"); #endif - - // list available output engines + +// list available output engines #ifdef HAVE_OUTPUT_DUMMY output.push_back("outputdummy"); #endif @@ -63,70 +61,85 @@ EngineFactory::EngineFactory() } #ifdef USE_JACK -void EngineFactory::prepareJack() { - if (jack == nullptr) { +void EngineFactory::prepareJack() +{ + if (jack == nullptr) + { jack = std::make_unique(); } } #endif -std::list const & EngineFactory::getInputEngines() const { +std::list const &EngineFactory::getInputEngines() const +{ return input; } -std::list const & EngineFactory::getOutputEngines() const { +std::list const &EngineFactory::getOutputEngines() const +{ return output; } -std::unique_ptr EngineFactory::createInput(std::string const & name) { +std::unique_ptr +EngineFactory::createInput(std::string const &name) +{ #ifdef HAVE_INPUT_DUMMY - if (name == "dummy") { + if (name == "dummy") + { return std::make_unique(); } #endif #ifdef HAVE_INPUT_MIDIFILE - if (name == "midifile") { + if (name == "midifile") + { return std::make_unique(); } #endif #ifdef HAVE_INPUT_JACKMIDI - if (name == "jackmidi") { + if (name == "jackmidi") + { prepareJack(); return std::make_unique(*jack); } #endif - + // todo: add more engines - + std::cerr << "[EngineFactory] Unsupported input engine '" << name << "'\n"; return nullptr; } -std::unique_ptr EngineFactory::createOutput(std::string const & name) { +std::unique_ptr +EngineFactory::createOutput(std::string const &name) +{ #ifdef HAVE_OUTPUT_DUMMY - if (name == "dummy") { + if (name == "dummy") + { return std::make_unique(); } #endif #ifdef HAVE_OUTPUT_WAVFILE - if (name == "wavfile") { + if (name == "wavfile") + { return std::make_unique(); } #endif #ifdef HAVE_OUTPUT_ALSA - if (name == "alsa") { + if (name == "alsa") + { return std::make_unique(); } #endif #ifdef HAVE_OUTPUT_JACKAUDIO - if (name == "jackaudio") { + if (name == "jackaudio") + { prepareJack(); return std::make_unique(*jack); } #endif - + // todo: add more engines - + std::cerr << "[EngineFactory] Unsupported output engine '" << name << "'\n"; return nullptr; } -- cgit v1.2.3