]> git.sesse.net Git - casparcg/blobdiff - core/producer/frame/audio_transform.cpp
git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches...
[casparcg] / core / producer / frame / audio_transform.cpp
index 529d6280a78906137598edbb28b9f346f8e8ed90..4c85093eb8ded73a2424378c1af3024ca1fe4c9f 100644 (file)
@@ -1,3 +1,22 @@
+/*\r
+* copyright (c) 2010 Sveriges Television AB <info@casparcg.com>\r
+*\r
+*  This file is part of CasparCG.\r
+*\r
+*    CasparCG is free software: you can redistribute it and/or modify\r
+*    it under the terms of the GNU General Public License as published by\r
+*    the Free Software Foundation, either version 3 of the License, or\r
+*    (at your option) any later version.\r
+*\r
+*    CasparCG is distributed in the hope that it will be useful,\r
+*    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+*    GNU General Public License for more details.\r
+\r
+*    You should have received a copy of the GNU General Public License\r
+*    along with CasparCG.  If not, see <http://www.gnu.org/licenses/>.\r
+*\r
+*/\r
 #include "../../stdafx.h"\r
 \r
 #include "audio_transform.h"\r
 namespace caspar { namespace core {\r
        \r
 audio_transform::audio_transform()\r
-       : gain_(1.0)\r
-       , audio_(true){}\r
+       : volume_(1.0)\r
+       , has_audio_(true){}\r
 \r
-void audio_transform::set_gain(double value)\r
+void audio_transform::set_volume(double value)\r
 {\r
-       gain_ = std::max(0.0, value);\r
+       volume_ = std::max(0.0, value);\r
 }\r
 \r
-double audio_transform::get_gain() const\r
+double audio_transform::get_volume() const\r
 {\r
-       return gain_;\r
+       return volume_;\r
 }\r
 \r
 void audio_transform::set_has_audio(bool value)\r
 {\r
-       audio_ = value;\r
+       has_audio_ = value;\r
 }\r
 \r
 bool audio_transform::get_has_audio() const\r
 {\r
-       return audio_;\r
+       return has_audio_;\r
 }\r
 \r
 audio_transform& audio_transform::operator*=(const audio_transform &other) \r
 {\r
-       gain_ *= other.gain_;\r
-       audio_ &= other.audio_;\r
+       volume_ *= other.volume_;\r
+       has_audio_ &= other.has_audio_;\r
        return *this;\r
 }\r
 \r
@@ -48,7 +67,7 @@ audio_transform tween(double time, const audio_transform& source, const audio_tr
        };\r
 \r
        audio_transform result;\r
-       result.set_gain(do_tween(time, source.get_gain(), dest.get_gain(), duration, tweener));\r
+       result.set_volume(do_tween(time, source.get_volume(), dest.get_volume(), duration, tweener));\r
        result.set_has_audio(source.get_has_audio() || dest.get_has_audio());\r
        return result;\r
 }\r