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; }
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; }
void DrawableStatsAttachment::operator -=(DrawableStatsAttachment *arg) { setVertices (getVertices() - arg->getVertices()); setPoints (getPoints() - arg->getPoints()); setLines (getLines() - arg->getLines()); setTriangles (getTriangles() - arg->getTriangles()); setPatches (getPatches () - arg->getPatches ()); setProcessedAttributeBytes(getProcessedAttributeBytes() - arg->getProcessedAttributeBytes()); setStoredAttributeBytes (getStoredAttributeBytes() - arg->getStoredAttributeBytes()); setValid(true); }
void commonController::lineChange( commonLineControl *line ) { /* RPCPubSub::publish( "LineControl", line->lineName, line->getState()?"set":"unset" ); // we also want time of change and time in state? */ commonLineControl * pttout = findLine( "PTTOut", false ); commonLineControl *pttin = findLine( "PTTIn", true ); commonLineControl *l1 = findLine( "L1", true ); commonLineControl *l2 = findLine( "L2", true ); if ( pttout && pttin && l1 && l2 ) { setLines( pttout->getState(), pttin->getState(), l1->getState(), l2->getState() ); } LineSet *ls = LineSet::GetLineSet(); ls->publish( line->lineName, line->getState() ); }
void DrawableStatsAttachment::reset(void) { // Don't change it unless it's valid. // Needed to protect intermediate results if(!getValid()) return; setVertices (0); setPoints (0); setLines (0); setTriangles (0); setPatches (0); setProcessedAttributeBytes(0); setStoredAttributeBytes (0); setValid(false); }
/** * Construct the importer. * * @param inputName The name of the input image */ TiffImporter::TiffImporter(FileName inputName) : ImageImporter(inputName) { // Open the TIFF image m_image = NULL; if ((m_image = TIFFOpen(inputName.expanded().toAscii().data(), "r")) == NULL) { throw IException(IException::Programmer, "Could not open incoming image", _FILEINFO_); } // Get its constant dimensions. Note, height seems to get reset to 0 if // called before setting width. uint32 height; TIFFGetField(m_image, TIFFTAG_IMAGELENGTH, &height); setLines(height); uint32 width; TIFFGetField(m_image, TIFFTAG_IMAGEWIDTH, &width); setSamples(width); TIFFGetField(m_image, TIFFTAG_SAMPLESPERPIXEL, &m_samplesPerPixel); // Setup the width and height of the image unsigned long imagesize = lines() * samples(); m_raster = NULL; if ((m_raster = (uint32 *) malloc(sizeof(uint32) * imagesize)) == NULL) { throw IException(IException::Programmer, "Could not allocate enough memory", _FILEINFO_); } // Read the image into the memory buffer if (TIFFReadRGBAImage(m_image, samples(), lines(), m_raster, 0) == 0) { throw IException(IException::Programmer, "Could not read image", _FILEINFO_); } // Deal with photometric interpretations if (TIFFGetField(m_image, TIFFTAG_PHOTOMETRIC, &m_photo) == 0) { throw IException(IException::Programmer, "Image has an undefined photometric interpretation", _FILEINFO_); } setDefaultBands(); }
bool StaffType::readProperties(const QDomElement& e) { const QString& tag(e.tagName()); int v = e.text().toInt(); if (tag == "name") setName(e.text()); else if (tag == "lines") setLines(v); else if (tag == "lineDistance") setLineDistance(Spatium(e.text().toDouble())); else if (tag == "clef") setGenClef(v); else if (tag == "slashStyle") setSlashStyle(v); else if (tag == "barlines") setShowBarlines(v); else return false; return true; }
bool ConsoleModel::executeCommand(QString command, QStringList arguments) { // don't execute the command if an old command is still running if (m_process && m_process->state() != QProcess::NotRunning) { // if the old process doesn't stop in 1/2 secs, then don't run the new command if (!m_process->waitForFinished(500)) return false; } setLines(QStringList()); m_process = new QProcess(this); m_process->setReadChannel(QProcess::StandardOutput); m_process->setProcessChannelMode(QProcess::MergedChannels); // merged stderr channel with stdout channel connect(m_process, SIGNAL(readyReadStandardOutput()), this, SLOT(readProcessChannels())); connect(m_process, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(handleProcessFinish(int, QProcess::ExitStatus))); connect(m_process, SIGNAL(error(QProcess::ProcessError)), this, SLOT(handleProcessError(QProcess::ProcessError))); m_process->start(command, arguments); // the process is killed when ConsoleModel is destroyed (usually when Page is closed) // should we run the process in bg thread to allow the command to finish(?) return true; }
bool StaffType::readProperties(XmlReader& e) { const QStringRef& tag(e.name()); if (tag == "name") setName(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 return false; return true; }
//--------------------------------------------------------------------------- void __fastcall TWindowsMonitorForm::PTTInCheckBoxClick( TObject */*Sender*/ ) { setLines( PTTInCheckBox->Checked, L1CheckBox->Checked, L2CheckBox->Checked ); }
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(); } }
Section *Section::init(Primitive *label, List *lines) { Object::init(); setLabel(label); setLines(lines); return this; }
void Section::initRoot() { setLabel(Primitive::root()); setLines(List::root()); }
Section::~Section() { setLabel(); setLines(); }
Section *Section::initCopy(const Section *other) { Object::initCopy(other); setLabel(other->_label); setLines(other->_lines); return this; }