Beispiel #1
0
void StaffTypeTablature::init()
      {
      // set reasonable defaults for type-specific members */
      setDurationFontName(_durationFonts[0].displayName);
      setDurationFontSize(15.0);
      setDurationFontUserY(0.0);
      setFretFontName(_fretFonts[0].displayName);
      setFretFontSize(10.0);
      setFretFontUserY(0.0);
      setGenDurations(false);
      setGenTimesig(false);
      setLineDistance(Spatium(TAB_DEFAULT_LINE_SP));
      setLines(6);
      setLinesThrough(false);
      setMinimStyle(TAB_MINIM_NONE);
      setOnLines(true);
      setShowRests(false);
      setStemsDown(true);
      setStemsThrough(true);
      setUpsideDown(false);
      setUseNumbers(true);
      // internal
      _durationMetricsValid = _fretMetricsValid = false;
      _durationBoxH = _durationBoxY = _durationYOffset = _fretBoxH = _fretBoxY = _fretYOffset = _refDPI = 0.0;
      }
Beispiel #2
0
pxError pxOffscreen::init(int width, int height)
{
    // Optimization
    if (bitmap)
    {
        if (width == pxBuffer::width() && height == pxBuffer::height())
            return PX_OK;
    }

    term();  // release all resources if this object is reinitialized

    void *base;
    BITMAPINFO bmpInfo = { { sizeof(BITMAPINFOHEADER), width, height, 1, 32 } };            
    
    bitmap = CreateDIBSection(NULL, (BITMAPINFO*)&bmpInfo, DIB_RGB_COLORS, 
                                (void **)&base, NULL, NULL);
    
    setBase(base);
    setWidth(width);
    setHeight(height);
    setStride(width*4);
    setUpsideDown(true);
    
    return bitmap?PX_OK:PX_FAIL;
}
Beispiel #3
0
void StaffTypeTablature::read(const QDomElement& de)
      {
      for (QDomElement e = de.firstChildElement(); !e.isNull(); e = e.nextSiblingElement()) {
            const QString& tag(e.tagName());
            const QString& val(e.text());

            if (tag == "durations")
                  setGenDurations(val.toInt() != 0);
            else if (tag == "durationFontName")
                  setDurationFontName(e.text());
            else if (tag == "durationFontSize")
                  setDurationFontSize(val.toDouble());
            else if (tag == "durationFontY")
                  setDurationFontUserY(val.toDouble());
            else if (tag == "fretFontName")
                  setFretFontName(e.text());
            else if (tag == "fretFontSize")
                  setFretFontSize(val.toDouble());
            else if (tag == "fretFontY")
                  setFretFontUserY(val.toDouble());
            else if (tag == "linesThrough")
                  setLinesThrough(val.toInt() != 0);
            else if (tag == "onLines")
                  setOnLines(val.toInt() != 0);
            else if (tag == "timesig")
                  setGenTimesig(val.toInt() != 0);
            else if (tag == "upsideDown")
                  setUpsideDown(val.toInt() != 0);
            else if (tag == "useNumbers")
                  setUseNumbers(val.toInt() != 0);
            else
                  if(!StaffType::readProperties(e))
                        domError(e);
            }
      }
Beispiel #4
0
void StaffTypeTablature::init()
      {
      // set reasonable defaults for inherited members
      setLines(6);
      setLineDistance(Spatium(TAB_DEFAULT_LINE_SP));
      setGenClef(true);
//      setGenKeysig(false);
      setSlashStyle(false);
      setShowBarlines(true);
//      setShowLedgerLines(false);
      // for specific members
      setDurationFontName("MScoreTabulatureModern");
      setDurationFontSize(15.0);
      setDurationFontUserY(0.0);
      setFretFontName("MScoreTabulatureModern");
      setFretFontSize(10.0);
      setFretFontUserY(0.0);
      setGenDurations(false);
      setGenTimesig(false);
      setLinesThrough(false);
      setOnLines(true);
      setUpsideDown(false);
      setUseNumbers(true);
      // internal
      _durationMetricsValid = _fretMetricsValid = false;
      _durationBoxH = _durationBoxY = _durationYOffset = _fretBoxH = _fretBoxY = _fretYOffset = _refDPI = 0.0;
      }
pxError pxOffscreen::init(int32_t width, int32_t height)
{
  term();

  pxError e = PX_FAIL;

  data = (char*) new unsigned char[width * height * 4];

  if (data)
  {
    setBase(data);
    setWidth(width);
    setHeight(height);
    setStride(width*4);
    setUpsideDown(false);
    e = PX_OK;
  }

  return e;
}
Beispiel #6
0
void StaffTypeTablature::read(XmlReader& e)
      {
      while (e.readNextStartElement()) {
            const QStringRef& tag(e.name());

            if (tag == "durations")
                  setGenDurations(e.readInt() != 0);
            else if (tag == "durationFontName")
                  setDurationFontName(e.readElementText());
            else if (tag == "durationFontSize")
                  setDurationFontSize(e.readDouble());
            else if (tag == "durationFontY")
                  setDurationFontUserY(e.readDouble());
            else if (tag == "fretFontName")
                  setFretFontName(e.readElementText());
            else if (tag == "fretFontSize")
                  setFretFontSize(e.readDouble());
            else if (tag == "fretFontY")
                  setFretFontUserY(e.readDouble());
            else if (tag == "linesThrough")
                  setLinesThrough(e.readInt() != 0);
            else if (tag == "minimStyle")
                  setMinimStyle( (TablatureMinimStyle) e.readInt() );
            else if (tag == "onLines")
                  setOnLines(e.readInt() != 0);
            else if (tag == "showRests")
                  setShowRests(e.readInt() != 0);
            else if (tag == "stemsDown")
                  setStemsDown(e.readInt() != 0);
            else if (tag == "stemsThrough")
                  setStemsThrough(e.readInt() != 0);
            else if (tag == "upsideDown")
                  setUpsideDown(e.readInt() != 0);
            else if (tag == "useNumbers")
                  setUseNumbers(e.readInt() != 0);
            else
                  if (!StaffType::readProperties(e))
                        e.unknown();
            }
      }
Beispiel #7
0
void StaffType::read(XmlReader& e)
      {
      QString group = e.attribute("group", fileGroupNames[(int)StaffGroup::STANDARD]);
      if (group == fileGroupNames[(int)StaffGroup::TAB])
            _group = StaffGroup::TAB;
      else if (group == fileGroupNames[(int)StaffGroup::PERCUSSION])
            _group = StaffGroup::PERCUSSION;
      else if (group == fileGroupNames[(int)StaffGroup::STANDARD])
            _group = StaffGroup::STANDARD;
      else {
            qDebug("StaffType::read: unknown group: %s", qPrintable(group));
            _group = StaffGroup::STANDARD;
            }

      while (e.readNextStartElement()) {
            const QStringRef& tag(e.name());
            if (tag == "name")
                  setXmlName(e.readElementText());
            else if (tag == "lines")
                  setLines(e.readInt());
            else if (tag == "lineDistance")
                  setLineDistance(Spatium(e.readDouble()));
            else if (tag == "clef")
                  setGenClef(e.readInt());
            else if (tag == "slashStyle")
                  setSlashStyle(e.readInt());
            else if (tag == "barlines")
                  setShowBarlines(e.readInt());
            else if (tag == "timesig")
                  setGenTimesig(e.readInt());
            else if (tag == "keysig")
                  _genKeysig = e.readInt();
            else if (tag == "ledgerlines")
                  _showLedgerLines = e.readInt();
            else if (tag == "durations")
                  setGenDurations(e.readBool());
            else if (tag == "durationFontName")
                  setDurationFontName(e.readElementText());
            else if (tag == "durationFontSize")
                  setDurationFontSize(e.readDouble());
            else if (tag == "durationFontY")
                  setDurationFontUserY(e.readDouble());
            else if (tag == "fretFontName")
                  setFretFontName(e.readElementText());
            else if (tag == "fretFontSize")
                  setFretFontSize(e.readDouble());
            else if (tag == "fretFontY")
                  setFretFontUserY(e.readDouble());
            else if (tag == "linesThrough")
                  setLinesThrough(e.readBool());
            else if (tag == "minimStyle")
                  setMinimStyle( (TablatureMinimStyle) e.readInt() );
            else if (tag == "onLines")
                  setOnLines(e.readBool());
            else if (tag == "showRests")
                  setShowRests(e.readBool());
            else if (tag == "stemsDown")
                  setStemsDown(e.readBool());
            else if (tag == "stemsThrough")
                  setStemsThrough(e.readBool());
            else if (tag == "upsideDown")
                  setUpsideDown(e.readBool());
            else if (tag == "useNumbers")
                  setUseNumbers(e.readBool());
            else
                  e.unknown();
            }
      }