Ejemplo n.º 1
0
InspectorNote::InspectorNote(QWidget* parent)
   : InspectorBase(parent)
      {
      b.setupUi(addWidget());
      s.setupUi(addWidget());
      c.setupUi(addWidget());
      n.setupUi(addWidget());

      static const NoteHead::Group heads[] = {
            NoteHead::Group::HEAD_NORMAL,
            NoteHead::Group::HEAD_CROSS,
            NoteHead::Group::HEAD_DIAMOND,
            NoteHead::Group::HEAD_TRIANGLE,
            NoteHead::Group::HEAD_SLASH,
            NoteHead::Group::HEAD_XCIRCLE,
            NoteHead::Group::HEAD_DO,
            NoteHead::Group::HEAD_RE,
            NoteHead::Group::HEAD_MI,
            NoteHead::Group::HEAD_FA,
            NoteHead::Group::HEAD_SOL,
            NoteHead::Group::HEAD_LA,
            NoteHead::Group::HEAD_TI,
            NoteHead::Group::HEAD_BREVIS_ALT
            };

      //
      // fix order of note heads
      //
      for (unsigned i = 0; i < sizeof(heads)/sizeof(*heads); ++i) {
            n.noteHeadGroup->addItem(qApp->translate("noteheadnames", NoteHead::groupToGroupName(heads[i])));
            n.noteHeadGroup->setItemData(i, QVariant(int(heads[i])));
            }

      // noteHeadType starts at -1: correct values and count one item more (HEAD_AUTO)
      for (int i = 0; i <= int(NoteHead::Type::HEAD_TYPES); ++i)
            n.noteHeadType->setItemData(i, i-1);

      iList = {
            { P_ID::COLOR,          0, 0, b.color,         b.resetColor         },
            { P_ID::VISIBLE,        0, 0, b.visible,       b.resetVisible       },
            { P_ID::USER_OFF,       0, 0, b.offsetX,       b.resetX             },
            { P_ID::USER_OFF,       1, 0, b.offsetY,       b.resetY             },

            { P_ID::SMALL,          0, 0, n.small,         n.resetSmall         },
            { P_ID::HEAD_GROUP,     0, 0, n.noteHeadGroup, n.resetNoteHeadGroup },
            { P_ID::HEAD_TYPE,      0, 0, n.noteHeadType,  n.resetNoteHeadType  },
            { P_ID::MIRROR_HEAD,    0, 0, n.mirrorHead,    n.resetMirrorHead    },
            { P_ID::DOT_POSITION,   0, 0, n.dotPosition,   n.resetDotPosition   },
            { P_ID::PLAY,           0, 0, n.play,          n.resetPlay          },
            { P_ID::TUNING,         0, 0, n.tuning,        n.resetTuning        },
            { P_ID::VELO_TYPE,      0, 0, n.velocityType,  n.resetVelocityType  },
            { P_ID::VELO_OFFSET,    0, 0, n.velocity,      n.resetVelocity      },
            { P_ID::FIXED,          0, 0, n.fixed,         n.resetFixed         },
            { P_ID::FIXED_LINE,     0, 0, n.fixedLine,     n.resetFixedLine     },

            { P_ID::USER_OFF,       0, 1, c.offsetX,       c.resetX             },
            { P_ID::USER_OFF,       1, 1, c.offsetY,       c.resetY             },
            { P_ID::SMALL,          0, 1, c.small,         c.resetSmall         },
            { P_ID::NO_STEM,        0, 1, c.stemless,      c.resetStemless      },
            { P_ID::STEM_DIRECTION, 0, 1, c.stemDirection, c.resetStemDirection },

            { P_ID::LEADING_SPACE,  0, 2, s.leadingSpace,  s.resetLeadingSpace  },
            };

      mapSignals();

      //
      // Select
      //
      QLabel* l = new QLabel;
      l->setText(tr("Select"));
      QFont font(l->font());
      font.setBold(true);
      l->setFont(font);
      l->setAlignment(Qt::AlignHCenter);
      _layout->addWidget(l);
      QFrame* f = new QFrame;
      f->setFrameStyle(QFrame::HLine | QFrame::Raised);
      f->setLineWidth(2);
      _layout->addWidget(f);

      QHBoxLayout* hbox = new QHBoxLayout;
      dot1 = new QToolButton(this);
      dot1->setText(tr("Dot1"));
      dot1->setEnabled(false);
      hbox->addWidget(dot1);
      dot2 = new QToolButton(this);
      dot2->setText(tr("Dot2"));
      dot2->setEnabled(false);
      hbox->addWidget(dot2);
      dot3 = new QToolButton(this);
      dot3->setText(tr("Dot3"));
      dot3->setEnabled(false);
      hbox->addWidget(dot3);
      _layout->addLayout(hbox);

      hbox = new QHBoxLayout;
      hook = new QToolButton(this);
      hook->setText(tr("Hook"));
      hook->setEnabled(false);
      hbox->addWidget(hook);
      stem = new QToolButton(this);
      stem->setText(tr("Stem"));
      stem->setEnabled(false);
      hbox->addWidget(stem);
      beam = new QToolButton(this);
      beam->setText(tr("Beam"));
      beam->setEnabled(false);
      hbox->addWidget(beam);
      _layout->addLayout(hbox);

      hbox = new QHBoxLayout;
      tuplet = new QToolButton(this);
      tuplet->setText(tr("Tuplet"));
      tuplet->setEnabled(false);
      hbox->addWidget(tuplet);
      _layout->addLayout(hbox);

      connect(dot1,     SIGNAL(clicked()),     SLOT(dot1Clicked()));
      connect(dot2,     SIGNAL(clicked()),     SLOT(dot2Clicked()));
      connect(dot3,     SIGNAL(clicked()),     SLOT(dot3Clicked()));
      connect(hook,     SIGNAL(clicked()),     SLOT(hookClicked()));
      connect(stem,     SIGNAL(clicked()),     SLOT(stemClicked()));
      connect(beam,     SIGNAL(clicked()),     SLOT(beamClicked()));
      connect(tuplet,   SIGNAL(clicked()),     SLOT(tupletClicked()));
      }
Ejemplo n.º 2
0
InspectorNote::InspectorNote(QWidget* parent)
   : InspectorElementBase(parent)
      {
      s.setupUi(addWidget());
      c.setupUi(addWidget());
      n.setupUi(addWidget());

      static const NoteHead::Group heads[] = {
            NoteHead::Group::HEAD_NORMAL,
            NoteHead::Group::HEAD_CROSS,
            NoteHead::Group::HEAD_DIAMOND,
            NoteHead::Group::HEAD_TRIANGLE,
            NoteHead::Group::HEAD_SLASH,
            NoteHead::Group::HEAD_XCIRCLE,
            NoteHead::Group::HEAD_DO,
            NoteHead::Group::HEAD_RE,
            NoteHead::Group::HEAD_MI,
            NoteHead::Group::HEAD_FA,
            NoteHead::Group::HEAD_SOL,
            NoteHead::Group::HEAD_LA,
            NoteHead::Group::HEAD_TI,
            NoteHead::Group::HEAD_BREVIS_ALT
            };

      //
      // fix order of noteheads
      //
      for (unsigned i = 0; i < sizeof(heads)/sizeof(*heads); ++i) {
            n.noteHeadGroup->addItem(qApp->translate("noteheadnames", NoteHead::groupToGroupName(heads[i])));
            n.noteHeadGroup->setItemData(i, QVariant(int(heads[i])));
            }

      // noteHeadType starts at -1: correct values and count one item more (HEAD_AUTO)
      for (int i = 0; i <= int(NoteHead::Type::HEAD_TYPES); ++i)
            n.noteHeadType->setItemData(i, i-1);

      const std::vector<InspectorItem> iiList = {
            { P_ID::SMALL,          0, 0, n.small,         n.resetSmall         },
            { P_ID::HEAD_GROUP,     0, 0, n.noteHeadGroup, n.resetNoteHeadGroup },
            { P_ID::HEAD_TYPE,      0, 0, n.noteHeadType,  n.resetNoteHeadType  },
            { P_ID::MIRROR_HEAD,    0, 0, n.mirrorHead,    n.resetMirrorHead    },
            { P_ID::DOT_POSITION,   0, 0, n.dotPosition,   n.resetDotPosition   },
            { P_ID::PLAY,           0, 0, n.play,          n.resetPlay          },
            { P_ID::TUNING,         0, 0, n.tuning,        n.resetTuning        },
            { P_ID::VELO_TYPE,      0, 0, n.velocityType,  n.resetVelocityType  },
            { P_ID::VELO_OFFSET,    0, 0, n.velocity,      n.resetVelocity      },
            { P_ID::FIXED,          0, 0, n.fixed,         n.resetFixed         },
            { P_ID::FIXED_LINE,     0, 0, n.fixedLine,     n.resetFixedLine     },

            { P_ID::USER_OFF,       0, 1, c.offsetX,       c.resetX             },
            { P_ID::USER_OFF,       1, 1, c.offsetY,       c.resetY             },
            { P_ID::SMALL,          0, 1, c.small,         c.resetSmall         },
            { P_ID::NO_STEM,        0, 1, c.stemless,      c.resetStemless      },
            { P_ID::STEM_DIRECTION, 0, 1, c.stemDirection, c.resetStemDirection },

            { P_ID::LEADING_SPACE,  0, 2, s.leadingSpace,  s.resetLeadingSpace  },
            };
      mapSignals(iiList);

      connect(n.dot1,     SIGNAL(clicked()),     SLOT(dot1Clicked()));
      connect(n.dot2,     SIGNAL(clicked()),     SLOT(dot2Clicked()));
      connect(n.dot3,     SIGNAL(clicked()),     SLOT(dot3Clicked()));
      connect(n.dot4,     SIGNAL(clicked()),     SLOT(dot4Clicked()));
      connect(n.hook,     SIGNAL(clicked()),     SLOT(hookClicked()));
      connect(n.stem,     SIGNAL(clicked()),     SLOT(stemClicked()));
      connect(n.beam,     SIGNAL(clicked()),     SLOT(beamClicked()));
      connect(n.tuplet,   SIGNAL(clicked()),     SLOT(tupletClicked()));
      }
Ejemplo n.º 3
0
InspectorNote::InspectorNote(QWidget* parent)
   : InspectorBase(parent)
      {
      b.setupUi(addWidget());
      n.setupUi(addWidget());
      c.setupUi(addWidget());
      s.setupUi(addWidget());

      static const int heads[] = {
            Note::HEAD_NORMAL,
            Note::HEAD_CROSS,
            Note::HEAD_DIAMOND,
            Note::HEAD_TRIANGLE,
            Note::HEAD_SLASH,
            Note::HEAD_XCIRCLE,
            Note::HEAD_DO,
            Note::HEAD_RE,
            Note::HEAD_MI,
            Note::HEAD_FA,
            Note::HEAD_SOL,
            Note::HEAD_LA,
            Note::HEAD_TI,
            Note::HEAD_BREVIS_ALT
            };

      //
      // fix order of note heads
      //
      for (int i = 0; i < Note::HEAD_GROUPS; ++i)
            n.noteHeadGroup->setItemData(i, QVariant(heads[i]));

      // noteHeadType starts at -1
      for (int i = 0; i < 5; ++i)
            n.noteHeadType->setItemData(i, i-1);

      iList = {
            { P_COLOR,          0, 0, b.color,         b.resetColor         },
            { P_VISIBLE,        0, 0, b.visible,       b.resetVisible       },
            { P_USER_OFF,       0, 0, b.offsetX,       b.resetX             },
            { P_USER_OFF,       1, 0, b.offsetY,       b.resetY             },

            { P_SMALL,          0, 0, n.small,         n.resetSmall         },
            { P_HEAD_GROUP,     0, 0, n.noteHeadGroup, n.resetNoteHeadGroup },
            { P_HEAD_TYPE,      0, 0, n.noteHeadType,  n.resetNoteHeadType  },
            { P_MIRROR_HEAD,    0, 0, n.mirrorHead,    n.resetMirrorHead    },
            { P_DOT_POSITION,   0, 0, n.dotPosition,   n.resetDotPosition   },
            { P_TUNING,         0, 0, n.tuning,        n.resetTuning        },
            { P_VELO_TYPE,      0, 0, n.velocityType,  n.resetVelocityType  },
            { P_VELO_OFFSET,    0, 0, n.velocity,      n.resetVelocity      },

            { P_USER_OFF,       0, 1, c.offsetX,       c.resetX             },
            { P_USER_OFF,       1, 1, c.offsetY,       c.resetY             },
            { P_SMALL,          0, 1, c.small,         c.resetSmall         },
            { P_NO_STEM,        0, 1, c.stemless,      c.resetStemless      },
            { P_STEM_DIRECTION, 0, 1, c.stemDirection, c.resetStemDirection },

            { P_LEADING_SPACE,  0, 2, s.leadingSpace,  s.resetLeadingSpace  },
            { P_TRAILING_SPACE, 0, 2, s.trailingSpace, s.resetTrailingSpace }
            };

      mapSignals();

      //
      // Select
      //
      QLabel* l = new QLabel;
      l->setText(tr("Select"));
      QFont font(l->font());
      font.setBold(true);
      l->setFont(font);
      l->setAlignment(Qt::AlignHCenter);
      _layout->addWidget(l);
      QFrame* f = new QFrame;
      f->setFrameStyle(QFrame::HLine | QFrame::Raised);
      f->setLineWidth(2);
      _layout->addWidget(f);

      QHBoxLayout* hbox = new QHBoxLayout;
      dot1 = new QToolButton(this);
      dot1->setText(tr("Dot1"));
      dot1->setEnabled(false);
      hbox->addWidget(dot1);
      dot2 = new QToolButton(this);
      dot2->setText(tr("Dot2"));
      dot2->setEnabled(false);
      hbox->addWidget(dot2);
      dot3 = new QToolButton(this);
      dot3->setText(tr("Dot3"));
      dot3->setEnabled(false);
      hbox->addWidget(dot3);
      hook = new QToolButton(this);
      hook->setText(tr("Hook"));
      hook->setEnabled(false);
      hbox->addWidget(hook);
      _layout->addLayout(hbox);

      hbox = new QHBoxLayout;
      stem = new QToolButton(this);
      stem->setText(tr("Stem"));
      stem->setEnabled(false);
      hbox->addWidget(stem);
      beam = new QToolButton(this);
      beam->setText(tr("Beam"));
      beam->setEnabled(false);
      hbox->addWidget(beam);
      _layout->addLayout(hbox);

      connect(dot1,     SIGNAL(clicked()),     SLOT(dot1Clicked()));
      connect(dot2,     SIGNAL(clicked()),     SLOT(dot2Clicked()));
      connect(dot3,     SIGNAL(clicked()),     SLOT(dot3Clicked()));
      connect(hook,     SIGNAL(clicked()),     SLOT(hookClicked()));
      connect(stem,     SIGNAL(clicked()),     SLOT(stemClicked()));
      connect(beam,     SIGNAL(clicked()),     SLOT(beamClicked()));
      }