X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Faudio-item.cc;h=8460ee8e5eeb1b917f30b8c3ed1c335564c7b101;hb=ca7baa2950c23337825b1c5f6e22e8fd514cd648;hp=1cbf7765b70f338ff82a5b9ed004ddf47c8eebbd;hpb=4a401ca1c60f428daa242dbdd102fdb3f327ebfb;p=lilypond.git diff --git a/lily/audio-item.cc b/lily/audio-item.cc index 1cbf7765b7..8460ee8e5e 100644 --- a/lily/audio-item.cc +++ b/lily/audio-item.cc @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 1997--2011 Jan Nieuwenhuizen + Copyright (C) 1997--2012 Jan Nieuwenhuizen LilyPond is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -79,9 +79,11 @@ Audio_dynamic::Audio_dynamic () { } -Audio_span_dynamic::Audio_span_dynamic () +Audio_span_dynamic::Audio_span_dynamic (Real min_volume, Real max_volume) { grow_dir_ = CENTER; + min_volume_ = min_volume; + max_volume_ = max_volume; } void @@ -135,7 +137,7 @@ Audio_span_dynamic::render () Real start_v = dynamics_[0]->volume_; if (dynamics_.back ()->volume_ < 0) - dynamics_.back ()->volume_ = max (min (start_v + grow_dir_ * 0.25, 1.0), 0.1); + dynamics_.back ()->volume_ = max (min (start_v + grow_dir_ * 0.25, max_volume_), min_volume_); delta_v = dynamics_.back ()->volume_ - dynamics_[0]->volume_;