Beispiel #1
0
TextTrackCue::TextTrackCue(ScriptExecutionContext* context, const String& id, double start, double end, const String& content, const String& settings, bool pauseOnExit)
    : m_id(id)
    , m_startTime(start)
    , m_endTime(end)
    , m_content(content)
    , m_linePosition(undefinedPosition)
    , m_computedLinePosition(undefinedPosition)
    , m_textPosition(50)
    , m_cueSize(100)
    , m_cueIndex(invalidCueIndex)
    , m_writingDirection(Horizontal)
    , m_cueAlignment(Middle)
    , m_scriptExecutionContext(context)
    , m_isActive(false)
    , m_pauseOnExit(pauseOnExit)
    , m_snapToLines(true)
    , m_displayTreeShouldChange(true)
    , m_displayTree(HTMLDivElement::create(static_cast<Document*>(context)))
    , m_displayXPosition(undefinedPosition)
    , m_displayYPosition(undefinedPosition)
{
    ASSERT(m_scriptExecutionContext->isDocument());

    // The text track cue writing directions are directly relatd to the
    // block-flow element, which can be set through the CSS writing modes.
    m_displayWritingModeMap[Horizontal] = CSSValueHorizontalTb;
    m_displayWritingModeMap[VerticalGrowingLeft] = CSSValueVerticalLr;
    m_displayWritingModeMap[VerticalGrowingRight] = CSSValueVerticalRl;

    parseSettings(settings);

    // A text track cue has a text track cue computed line position whose value
    // is defined in terms of the other aspects of the cue.
    m_computedLinePosition = calculateComputedLinePosition();
}
Beispiel #2
0
//This function parses the command line options.  It assumes that the options
//have already been checked for correctness.
void parseImageOptions(QStringList arguments, int * width, int * height)
{
    if (isOptionPresent("--height", &arguments))
        *height = getIntOption("--height", &arguments);

    if (isOptionPresent("--width", &arguments))
        *width = getIntOption("--width", &arguments);

    parseSettings(arguments);
}
Beispiel #3
0
void Parameters::parseSettingsFile(string filename)
{ string pathname = filename;
  if (pathname[0] != '/' && pathname.substr(0,2) != "./")
   pathname = dirnameForSettings() + '/' + pathname;
  cout << "parseSettingsFile(\"" << pathname << "\")\n";
  ifstream settings(pathname.c_str());
  if (settings.is_open())
    parseSettings(settings);
  else
  { cout << "couldn't open " << pathname << endl;
    exit(-1);
  }
}
TextTrackCue::TextTrackCue(ScriptExecutionContext* context, const String& id, double start, double end, const String& content, const String& settings, bool pauseOnExit)
    : m_id(id)
    , m_startTime(start)
    , m_endTime(end)
    , m_content(content)
    , m_writingDirection(Horizontal)
    , m_linePosition(-1)
    , m_textPosition(50)
    , m_cueSize(100)
    , m_cueAlignment(Middle)
    , m_scriptExecutionContext(context)
    , m_isActive(false)
    , m_pauseOnExit(pauseOnExit)
    , m_snapToLines(true)
{
    parseSettings(settings);
}
Beispiel #5
0
void Fritzbox::modifySettings(queryItemsList list) {
	// prepare post data
	QByteArray data;
	for (queryItemsList::iterator iter = list.begin(); iter != list.end(); iter++) {
		data.append("tam:settings/TAM" + QString::number(tamId) + "/" + iter->first + "=" + iter->second + "&");
	}

	//additional stuff
	QUrl url = getUrl();
	data.append(url.encodedQuery());

	// request
	QNetworkRequest request(url);
	// execute
	reply = network.post(request, data);
	connect(reply, SIGNAL(finished()), this, SLOT(parseSettings()));

}
Beispiel #6
0
OctreePersistThread::OctreePersistThread(Octree* tree, const QString& filename, int persistInterval, 
                                         bool wantBackup, const QJsonObject& settings, bool debugTimestampNow,
                                         QString persistAsFileType) :
    _tree(tree),
    _filename(filename),
    _persistInterval(persistInterval),
    _initialLoadComplete(false),
    _loadTimeUSecs(0),
    _lastCheck(0),
    _wantBackup(wantBackup),
    _debugTimestampNow(debugTimestampNow),
    _lastTimeDebug(0),
    _persistAsFileType(persistAsFileType)
{
    parseSettings(settings);

    // in case the persist filename has an extension that doesn't match the file type
    QString sansExt = fileNameWithoutExtension(_filename, PERSIST_EXTENSIONS);
    _filename = sansExt + "." + _persistAsFileType;
}
Beispiel #7
0
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    QApplication::setApplicationName("Bandage");
    QApplication::setApplicationVersion("0.6.2");

    QTextStream out(stdout);
    QTextStream err(stdout);

    //Create the important global objects.
    g_settings.reset(new Settings());
    g_blastSearch.reset(new BlastSearch());
    g_assemblyGraph.reset(new AssemblyGraph());
    g_graphicsView = new MyGraphicsView();

    QStringList arguments = QCoreApplication::arguments();
    arguments.pop_front();

    if (checkForVersion(arguments))
    {
        out << "Version: " << QApplication::applicationVersion() << endl;
        return 0;
    }

    //If the first argument was a recognised command, move to that command's function.
    if (arguments.size() > 0)
    {
        QString first = arguments.at(0);
        if (first == "load")
        {
            arguments.pop_front();
            g_settings->commandLineCommand = BANDAGE_LOAD;
            return bandageLoad(&a, arguments);
        }
        else if (first == "image")
        {
            arguments.pop_front();
            g_settings->commandLineCommand = BANDAGE_IMAGE;
            return bandageImage(arguments);
        }
//        else if (first == "contiguous")
//        {
//            arguments.pop_front();
//            return bandageContiguous(arguments);
//        }
    }

    //Since a recognised command was not seen, we now check to see if the user
    //was looking for help information.
    if (checkForHelp(arguments))
    {
        out << "" << endl;
        out << "Program: Bandage" << endl;
        out << "Version: " << QApplication::applicationVersion() << endl;
        printUsage(&out, false);
        return 0;
    }
    if (checkForHelpAll(arguments))
    {
        out << "" << endl;
        out << "Program: Bandage" << endl;
        out << "Version: " << QApplication::applicationVersion() << endl;
        printUsage(&out, true);
        return 0;
    }

    //If the code got here, we assume the user is simply launching Bandage,
    //with or without some options to specify settings.

    //Check the settings.
    QStringList argumentsCopy = arguments;
    QString error = checkForInvalidOrExcessSettings(&argumentsCopy);
    if (error.length() > 0)
    {
        err << "Bandage error: " + error << endl;
        return 1;
    }

    //If the code got here, then the settings are good.  Parse them now and
    //run the program.
    parseSettings(arguments);
    MainWindow w;
    w.show();
    return a.exec();
}
Beispiel #8
0
//*--------------------------------------------------------------------------------------
//* Function Name       : Main
//* Object              : Software entry point
//* Input Parameters    : none.
//* Output Parameters   : none.
//*--------------------------------------------------------------------------------------
int main(void)
{
    char data[MSG_SIZE];
    unsigned int length;
    int stepCnt = 0;
    unsigned char str[10];

    /**** System init ****/
    //InitFrec();
    Init_CP_WP();
    //chek for CP and WP
    //CP - card present
    while(((AT91C_BASE_PIOA->PIO_PDSR) & BIT15)) { /*put your card present event here*/  }
    //WP - write protect
    //while(((AT91C_BASE_PIOA->PIO_PDSR) & BIT16)) { /*put your write protect event here*/ }

    if (initMMC() == MMC_SUCCESS)
    {
        //card_state |= 1;
        memset(&mmc_buffer,0,512);
        mmcReadRegister (10, 16);
        mmc_buffer[7]=0;
    }


    flashInit();

    Init_PWM();

    // Enable User Reset and set its minimal assertion to 960 us
    AT91C_BASE_RSTC->RSTC_RMR = AT91C_RSTC_URSTEN | (0x4<<8) | (unsigned int)(0xA5<<24);
    // Led init
    // First, enable the clock of the PIOB
    AT91F_PMC_EnablePeriphClock ( AT91C_BASE_PMC, 1 << AT91C_ID_PIOA ) ;
    //* to be outputs. No need to set these pins to be driven by the PIO because it is GPIO pins only.
    AT91F_PIO_CfgOutput( AT91C_BASE_PIOA, OUTPUT_MASK );
    //* Clear the LED's.
    /*
    AT91F_PIO_SetOutput( AT91C_BASE_PIOA, OUTPUT_MASK );
    AT91F_PIO_ClearOutput( AT91C_BASE_PIOA, OUTPUT_MASK );
    */


    // Init USB device
    AT91F_USB_Open();
    AT91F_PIO_ClearOutput( AT91C_BASE_PIOA, OUTPUT_MASK );
    // Init USB device
    // Wait for the end of enumeration
    setForce(40000);
    int pCDCEnablingCounter = 0;
    while (!pCDC.IsConfigured(&pCDC) && pCDCEnablingCounter < 2500000){ pCDCEnablingCounter++; };

    if (pCDCEnablingCounter < 2500000)
    {
        CDC = 1;
    }

    setForce(0);

    // Set Usart in interrupt
    //Usart_init();

    //Read and set settings
    memcpy(settings, OUR_FLASH_ADDR, 128);
    int i;memset(&mmc_buffer, 0x00, 512);
    int j;
    char *settingsBlocks[50];
    char settingsDelim[] = "~";
    char *settingsParts = strtok( settings, settingsDelim );
    i = 0;
    while( settingsParts != NULL )
    {
      settingsBlocks[i++] = settingsParts;
      settingsParts = strtok( NULL, settingsDelim );
    }
    for (j = 0; j < i; j++)
    {
       parseSettings(settingsBlocks[j]);
    }

    InitADC();

    Init_PWM();

    AT91F_PIO_CfgInput(AT91C_BASE_PIOA, SW1_MASK);
    AT91F_PIO_CfgInput(AT91C_BASE_PIOA, SW2_MASK);

    AT91F_PIO_SetOutput( AT91C_BASE_PIOA, LED_GREEN);
    AT91F_PIO_SetOutput( AT91C_BASE_PIOA, LED_YELLOW);
    setForce(0);

    //startBlinking(250000);

    /**** MMC CARD ****/

    init_extint();


    while (1)
    {
        cnt++;
        if (cnt > 50000)
        {
            cnt = 0;
            printTrace("COUNTER RESET\n");
        }
    }
}
Beispiel #9
0
void Fritzbox::retrieveSettings() {
	// execute
	getPageContent();
	connect(reply, SIGNAL(finished()), this, SLOT(parseSettings()));
}