From 4ffcef9648d07b8e6de6d2c151ad5e87560c389d Mon Sep 17 00:00:00 2001 From: Thor Harald Johansen Date: Tue, 11 Nov 2008 23:53:38 +0100 Subject: [PATCH] Changed all string* to string because strings are already pointers internally. --- AudioTrack.cpp | 10 +++++----- AudioTrack.h | 6 +++--- Track.h | 4 ++-- TrackParameterType.h | 28 ++++++++++++++-------------- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/AudioTrack.cpp b/AudioTrack.cpp index 187fd54..1b105e2 100644 --- a/AudioTrack.cpp +++ b/AudioTrack.cpp @@ -11,11 +11,11 @@ AudioTrack::AudioTrack() : trackParameters(NULL) { AudioTrack::~AudioTrack() { } -string* AudioTrack::getName() { +string AudioTrack::getName() { return name; } -void AudioTrack::setName(string* name) { +void AudioTrack::setName(string name) { this->name = name; } @@ -26,13 +26,13 @@ vector* AudioTrack::getTrackParameters() { if(trackParameterTypes == NULL) { trackParameterTypes = new vector; - trackParameterTypes->push_back(new TrackParameterType(new string("Volume"), + trackParameterTypes->push_back(new TrackParameterType("Volume", TrackParameterType::DECIBEL, TrackParameterType::GAIN, 1.f, 0.f, 2.f)); - trackParameterTypes->push_back(new TrackParameterType(new string("Balance"), + trackParameterTypes->push_back(new TrackParameterType("Balance", TrackParameterType::PERCENT, TrackParameterType::LINEAR, 0.f, -1.f, 1.f)); - trackParameterTypes->push_back(new TrackParameterType(new string("Trim"), + trackParameterTypes->push_back(new TrackParameterType("Trim", TrackParameterType::DECIBEL, TrackParameterType::GAIN, 1.f, 0.0625f, 16.f)); } diff --git a/AudioTrack.h b/AudioTrack.h index de4e917..db7d9d5 100644 --- a/AudioTrack.h +++ b/AudioTrack.h @@ -9,13 +9,13 @@ namespace yam { AudioTrack(); virtual ~AudioTrack(); - string* getName(); - void setName(string* name); + string getName(); + void setName(string name); vector* getTrackParameters(); vector* getRegions(); vector* getChildren(); private: - string *name; + string name; vector* trackParameters; static vector* trackParameterTypes; }; diff --git a/Track.h b/Track.h index a8d8ef2..aed167b 100644 --- a/Track.h +++ b/Track.h @@ -12,8 +12,8 @@ namespace yam { class Track { public: /* Track name */ - virtual string* getName() = 0; - virtual void setName(string* name) = 0; + virtual string getName() = 0; + virtual void setName(string name) = 0; /* Track parameters */ virtual vector* getTrackParameters() = 0; diff --git a/TrackParameterType.h b/TrackParameterType.h index 3428f0d..4ca2970 100644 --- a/TrackParameterType.h +++ b/TrackParameterType.h @@ -14,51 +14,51 @@ namespace yam { enum { TOGGLE, OPTION, ADJUST, ENTER }; /* Controls */ /* General constructor */ - TrackParameterType(string* name, int datatype, int unit, int scale, int control, - void* defaultValue, void* minimumValue, void* maximumValue, vector* options) : + TrackParameterType(string name, int datatype, int unit, int scale, int control, + void* defaultValue, void* minimumValue, void* maximumValue, vector* options) : name(name), datatype(datatype), unit(unit), scale(scale), control(control), defaultValue(defaultValue), minimumValue(minimumValue), maximumValue(maximumValue), options(options) { } /* Construct boolean toggle control */ - TrackParameterType(string* name, bool defaultValue) : + TrackParameterType(string name, bool defaultValue) : name(name), datatype(BOOL), unit(0), scale(0), control(TOGGLE), defaultValue(new bool(defaultValue)), minimumValue(NULL), maximumValue(NULL), options(NULL) { } /* Construct boolean option control with two named options */ - TrackParameterType(string* name, bool defaultValue, string* falseString, string* trueString) : + TrackParameterType(string name, bool defaultValue, string falseString, string trueString) : name(name), datatype(BOOL), unit(0), scale(0), control(OPTION), defaultValue(new bool(defaultValue)), minimumValue(NULL), maximumValue(NULL), - options(new vector()) { + options(new vector()) { this->options->push_back(falseString); this->options->push_back(trueString); } /* Construct integer adjust control */ - TrackParameterType(string* name, int unit, int scale, int defaultValue, int minimumValue, int maximumValue) : + TrackParameterType(string name, int unit, int scale, int defaultValue, int minimumValue, int maximumValue) : name(name), datatype(INT), unit(unit), scale(scale), control(ADJUST), defaultValue(new int(defaultValue)), minimumValue(new int(minimumValue)), maximumValue(new int(maximumValue)), options(NULL) { } /* Construct integer option control with maximumValue-minimumValue+1 named options */ - TrackParameterType(string* name, int defaultValue, int minimumValue, int maximumValue, vector* options) : + TrackParameterType(string name, int defaultValue, int minimumValue, int maximumValue, vector* options) : name(name), datatype(INT), unit(0), scale(0), control(OPTION), defaultValue(new int(defaultValue)), minimumValue(new int(minimumValue)), maximumValue(new int(maximumValue)), options(options) { } /* Construct float adjust control */ - TrackParameterType(string* name, int unit, int scale, float defaultValue, float minimumValue, float maximumValue) : + TrackParameterType(string name, int unit, int scale, float defaultValue, float minimumValue, float maximumValue) : name(name), datatype(FLOAT), unit(unit), scale(scale), control(ADJUST), defaultValue(new float(defaultValue)), minimumValue(new float(minimumValue)), maximumValue(new float(maximumValue)), options(NULL) { } /* Construct string entry control */ - TrackParameterType(string* name, string* defaultValue) : + TrackParameterType(string name, string defaultValue) : name(name), datatype(STRING), unit(0), scale(0), control(ENTER), - defaultValue(new string(*defaultValue)), minimumValue(NULL), maximumValue(NULL) { } + defaultValue(new string(defaultValue)), minimumValue(NULL), maximumValue(NULL) { } - string* getName() { return name; } + string getName() { return name; } int getDatatype() { return datatype; } int getUnit() { return unit; } int getScale() { return scale; } @@ -66,10 +66,10 @@ namespace yam { void* getDefaultValue() { return defaultValue; } void* getMinimumValue() { return minimumValue; } void* getMaximumValue() { return maximumValue; } - vector* getOptions() { return options; } + vector* getOptions() { return options; } private: - string *name; + string name; int datatype; int unit; int scale; @@ -77,7 +77,7 @@ namespace yam { void *defaultValue; void *minimumValue; void *maximumValue; - vector* options; + vector* options; }; }; -- 2.11.4.GIT