LCOV - code coverage report
Current view: top level - src/importexport/guitarpro/internal/gtp - gpbar.h Coverage Total Hit
Test: filtered_coverage.info Lines: 100.0 % 10 10
Test Date: 2026-11-05 04:07:02

            Line data    Source code
       1              : #ifndef MU_IMPORTEXPORT_GPBAR_H
       2              : #define MU_IMPORTEXPORT_GPBAR_H
       3              : 
       4              : #include "gpvoice.h"
       5              : 
       6              : namespace mu::iex::guitarpro {
       7              : class GPBar
       8              : {
       9              : public:
      10              :     enum class ClefType {
      11              :         G2, F4, C3, C4, Neutral
      12              :     };
      13              :     enum class OttaviaType {
      14              :         ma15, va8, Regular, vb8, mb15
      15              :     };
      16              :     enum class SimileMark {
      17              :         None, Simple, FirstOfDouble, SecondOfDouble
      18              :     };
      19              : 
      20              :     struct Clef {
      21              :         ClefType type{ ClefType::G2 };
      22              :         OttaviaType ottavia{ OttaviaType::Regular };
      23              : 
      24          536 :         bool operator==(const GPBar::Clef& c) const { return type == c.type && ottavia == c.ottavia; }
      25              :     };
      26              : 
      27          778 :     ~GPBar() = default;
      28          724 :     void addGPVoice(std::unique_ptr<GPVoice>&& v) { _voices.push_back(std::move(v)); }
      29              : 
      30          778 :     void setClefType(GPBar::ClefType clef) { _clef.type = clef; }
      31            6 :     void setOttaviaType(GPBar::OttaviaType ottavia) { _clef.ottavia = ottavia; }
      32         1568 :     GPBar::Clef clef() const { return _clef; }
      33              : 
      34            3 :     void setSimileMark(SimileMark s) { _simileMark = s; }
      35          781 :     SimileMark simileMark() const { return _simileMark; }
      36              : 
      37          778 :     void setId(int id) { _id = id; }
      38              : 
      39          775 :     const std::vector<std::unique_ptr<GPVoice> >& voices() const { return _voices; }
      40              : 
      41              : private:
      42              : 
      43              :     int _id{ -1 };
      44              :     std::vector<std::unique_ptr<GPVoice> > _voices;
      45              :     Clef _clef;
      46              :     SimileMark _simileMark;
      47              : };
      48              : } // namespace mu::iex::guitarpro
      49              : 
      50              : #endif // MU_IMPORTEXPORT_GPBAR_H
        

Generated by: LCOV version 2.0-1