LCOV - code coverage report
Current view: top level - src/engraving/dom - vibrato.h Coverage Total Hit
Test: filtered_coverage.info Lines: 63.6 % 11 7
Test Date: 2026-11-19 04:14:36

            Line data    Source code
       1              : /*
       2              :  * SPDX-License-Identifier: GPL-3.0-only
       3              :  * MuseScore-Studio-CLA-applies
       4              :  *
       5              :  * MuseScore Studio
       6              :  * Music Composition & Notation
       7              :  *
       8              :  * Copyright (C) 2021 MuseScore Limited and others
       9              :  *
      10              :  * This program is free software: you can redistribute it and/or modify
      11              :  * it under the terms of the GNU General Public License version 3 as
      12              :  * published by the Free Software Foundation.
      13              :  *
      14              :  * This program is distributed in the hope that it will be useful,
      15              :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      16              :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      17              :  * GNU General Public License for more details.
      18              :  *
      19              :  * You should have received a copy of the GNU General Public License
      20              :  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
      21              :  */
      22              : 
      23              : #ifndef MU_ENGRAVING_VIBRATO_H
      24              : #define MU_ENGRAVING_VIBRATO_H
      25              : 
      26              : #include "line.h"
      27              : 
      28              : namespace mu::engraving {
      29              : class Vibrato;
      30              : 
      31              : //---------------------------------------------------------
      32              : //   @@ VibratoSegment
      33              : //---------------------------------------------------------
      34              : 
      35              : class VibratoSegment final : public LineSegment
      36              : {
      37           52 :     OBJECT_ALLOCATOR(engraving, VibratoSegment)
      38              :     DECLARE_CLASSOF(ElementType::VIBRATO_SEGMENT)
      39              : 
      40              : public:
      41              :     VibratoSegment(Vibrato* sp);
      42              : 
      43            0 :     VibratoSegment* clone() const override { return new VibratoSegment(*this); }
      44              : 
      45           28 :     Vibrato* vibrato() const { return toVibrato(spanner()); }
      46              : 
      47              :     PropertyDelegate resolvePropertyDelegate(Pid) const override;
      48              : 
      49            0 :     const SymIdList& symbols() const { return m_symbols; }
      50              :     void setSymbols(const SymIdList& s) { m_symbols = s; }
      51              : 
      52              :     void symbolLine(SymId start, SymId fill);
      53              :     void symbolLine(SymId start, SymId fill, SymId end);
      54              : 
      55              : private:
      56              :     SymIdList m_symbols;
      57              : };
      58              : 
      59              : //---------------------------------------------------------
      60              : //   Vibrato
      61              : //---------------------------------------------------------
      62              : 
      63              : class Vibrato final : public SLine
      64              : {
      65           60 :     OBJECT_ALLOCATOR(engraving, Vibrato)
      66          100 :     DECLARE_CLASSOF(ElementType::VIBRATO)
      67              : 
      68              : public:
      69              :     Vibrato(DummyParent* parent);
      70              :     ~Vibrato();
      71              : 
      72            0 :     Vibrato* clone() const override { return new Vibrato(*this); }
      73              :     void setOwnershipParent(EngravingObject*) = delete;
      74              : 
      75          286 :     Anchor anchor() const override { return Anchor::SEGMENT; }
      76              : 
      77              :     LineSegment* createLineSegment() override;
      78              :     PointF linePos(Grip grip, System** system) const override;
      79              : 
      80           35 :     void setVibratoType(VibratoType tt) { m_vibratoType = tt; }
      81           58 :     VibratoType vibratoType() const { return m_vibratoType; }
      82              :     String vibratoTypeUserName() const;
      83              : 
      84              :     Segment* segment() const { return (Segment*)ownershipParent(); }
      85              : 
      86              :     PropertyValue getProperty(Pid propertyId) const override;
      87              :     bool setProperty(Pid propertyId, const PropertyValue&) override;
      88              :     PropertyValue propertyDefault(Pid) const override;
      89              :     String accessibleInfo() const override;
      90              : 
      91            0 :     int subtype() const override { return int(m_vibratoType); }
      92              :     TranslatableString subtypeUserName() const override;
      93              : 
      94              : protected:
      95              :     Sid defaultPosSid() const override;
      96              : 
      97              : private:
      98              :     VibratoType m_vibratoType = VibratoType::GUITAR_VIBRATO;
      99              : };
     100              : } // namespace mu::engraving
     101              : 
     102              : #endif
        

Generated by: LCOV version 2.0-1