From fa677c584b698d4d8aa8acc967f31960a01a9cf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Gl=C3=B6ckner?= Date: Tue, 29 Mar 2016 10:23:56 +0200 Subject: refactored class Channel --- src/channel.cc | 14 +++++++------- src/channel.h | 16 +++++++--------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/channel.cc b/src/channel.cc index 6aece18..402a09a 100644 --- a/src/channel.cc +++ b/src/channel.cc @@ -26,16 +26,16 @@ */ #include "channel.h" -Channel::Channel(std::string name) +Channel::Channel(const std::string& name) + : name{name} + , num{NO_CHANNEL} { - this->name = name; - num = NO_CHANNEL; } #ifdef TEST_CHANNEL -//deps: -//cflags: -//libs: +// deps: +// cflags: +// libs: #include "test.h" TEST_BEGIN; @@ -54,4 +54,4 @@ channels.push_back(c2); TEST_END; -#endif/*TEST_CHANNEL*/ +#endif /*TEST_CHANNEL*/ diff --git a/src/channel.h b/src/channel.h index c031973..6cfee81 100644 --- a/src/channel.h +++ b/src/channel.h @@ -24,8 +24,7 @@ * along with DrumGizmo; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#ifndef __DRUMGIZMO_CHANNEL_H__ -#define __DRUMGIZMO_CHANNEL_H__ +#pragma once #include #include @@ -35,16 +34,15 @@ #define ALL_CHANNELS ((channel_t)0xffffffff) #define NO_CHANNEL ((channel_t)0xfffffffe) -class Channel { +class Channel +{ public: - Channel(std::string name = ""); + Channel(const std::string& name = ""); - std::string name; - channel_t num; + std::string name; + channel_t num; }; typedef Channel InstrumentChannel; -typedef std::vector< Channel > Channels; - -#endif/*__DRUMGIZMO_CHANNEL_H__*/ +typedef std::vector Channels; -- cgit v1.2.3