コード例 #1
0
// ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
//		¥ Kill
// ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
// Delete strings and arrays from storage.
void CVariableStorage::Kill()
{
	TArrayIterator<CCString*>		iter(mStrings);
	CCString						*str;
	
	while (iter.Next(str))
		delete str;
		
	TArrayIterator< CStrArrayStore *>		iter4(mStringArrays);
	CStrArrayStore							*strArray;
	
	while (iter4.Next(strArray))
		delete strArray;
	
	TArrayIterator< CIntegerArrayStore *>	iter3(mIntegerArrays);
	CIntegerArrayStore						*intArray;

	while (iter3.Next(intArray))
		delete intArray;
	
	TArrayIterator< CFloatArrayStore *>		iter5(mFloatArrays);
	CFloatArrayStore						*floatArray;
	
	while (iter5.Next(floatArray))
		delete floatArray;
}
コード例 #2
0
ファイル: setjoystick.cpp プロジェクト: jlsandell/antimicro
bool SetJoystick::isSetEmpty()
{
    bool result = true;
    QHashIterator<int, JoyButton*> iter(buttons);
    while (iter.hasNext() && result)
    {
        JoyButton *button = iter.next().value();
        if (!button->isDefault())
        {
            result = false;
        }
    }

    QHashIterator<int, JoyAxis*> iter2(axes);
    while (iter2.hasNext() && result)
    {
        JoyAxis *axis = iter2.next().value();
        if (!axis->isDefault())
        {
            result = false;
        }
    }

    QHashIterator<int, JoyDPad*> iter3(hats);
    while (iter3.hasNext() && result)
    {
        JoyDPad *dpad = iter3.next().value();
        if (!dpad->isDefault())
        {
            result = false;
        }
    }

    QHashIterator<int, JoyControlStick*> iter4(sticks);
    while (iter4.hasNext() && result)
    {
        JoyControlStick *stick = iter4.next().value();
        if (!stick->isDefault())
        {
            result = false;
        }
    }

    QHashIterator<int, VDPad*> iter5(vdpads);
    while (iter5.hasNext() && result)
    {
        VDPad *vdpad = iter5.next().value();
        if (!vdpad->isDefault())
        {
            result = false;
        }
    }

    return result;
}
コード例 #3
0
ファイル: test_set.cpp プロジェクト: CCJY/ACE
int
ACE_TMAIN (int, ACE_TCHAR *[])
{
  ACE_Unbounded_Set<int> s1;

  ACE_ASSERT (s1.size () == 0);
  s1.insert_tail (10);
  s1.insert_tail (20);
  ACE_ASSERT (s1.size () == 2);

  ACE_Unbounded_Set<int> s2 (s1);
  ACE_ASSERT (s2.size () == 2);

  ACE_Unbounded_Set<int> s3;
  ACE_ASSERT (s3.size () == 0);

  s3 = s2;
  ACE_ASSERT (s3.size () == s2.size ());

  ACE_Unbounded_Set<int> s4 (s3);
  ACE_ASSERT (s4.size () == 2);

  int *ip = 0;

  ACE_DEBUG ((LM_DEBUG, "dumping s1\n"));
  for (ACE_Unbounded_Set_Iterator<int> iter1 (s1);
       iter1.next (ip) != 0;
       iter1.advance ())
    ACE_DEBUG ((LM_DEBUG, "item = %d\n", *ip));

  ACE_DEBUG ((LM_DEBUG, "dumping s2\n"));
  for (ACE_Unbounded_Set_Iterator<int> iter2 (s2);
       iter2.next (ip) != 0;
       iter2.advance ())
    ACE_DEBUG ((LM_DEBUG, "item = %d\n", *ip));

  ACE_DEBUG ((LM_DEBUG, "dumping s3\n"));
  for (ACE_Unbounded_Set_Iterator<int> iter3 (s3);
       iter3.next (ip) != 0;
       iter3.advance ())
    ACE_DEBUG ((LM_DEBUG, "item = %d\n", *ip));

  ACE_DEBUG ((LM_DEBUG, "dumping s4\n"));
  for (ACE_Unbounded_Set_Iterator<int> iter4 (s4);
       iter4.next (ip) != 0;
       iter4.advance ())
    ACE_DEBUG ((LM_DEBUG, "item = %d\n", *ip));

  return 0;
}
コード例 #4
0
bool TestExtMailparse::test_mailparse_rfc822_parse_addresses() {
    static const StaticString
    s_display("display"),
              s_address("address"),
              s_is_group("is_group");
    Array addresses =
        CREATE_VECTOR2("\":sysmail\"@ Some-Group. Some-Org, Muhammed."
                       "(I am the greatest) Ali @(the)Vegas.WBA",
                       "\"strange\":\":sysmail\"@ Some-Group. Some-Org, Muhammed."
                       "(I am the greatest) Ali @(the)Vegas.WBA;");

    f_ob_start();

    for (ArrayIter iter(addresses); iter; ++iter) {
        Variant parsed = f_mailparse_rfc822_parse_addresses(iter.second());
        for (ArrayIter iter2(parsed); iter2; ++iter2) {
            Variant pair = iter2.second();
            echo(pair[s_display]);
            echo("\n");
            echo(pair[s_address]);
            echo("\n");
            if (pair[s_is_group].toBoolean()) {
                Variant sub = f_mailparse_rfc822_parse_addresses
                              (f_substr(pair[s_address], 1, f_strlen(pair[s_address]) - 2));
                for (ArrayIter iter3(sub); iter3; ++iter3) {
                    echo("   ");
                    echo(iter3.second()[s_address]);
                    echo("\n");
                }
            }
        }
        echo("...\n");
    }

    String output = f_ob_get_contents();
    f_ob_end_clean();
    VS(output,
       ":[email protected]\n"
       "\":sysmail\"@Some-Group.Some-Org\n"
       "I am the greatest the\n"
       "[email protected]\n"
       "...\n"
       "strange\n"
       ":\":sysmail\"@Some-Group.Some-Org,[email protected];\n"
       "   \":sysmail\"@Some-Group.Some-Org\n"
       "   [email protected]\n"
       "...\n");

    return Count(true);
}
コード例 #5
0
ファイル: gdaldataaccess.cpp プロジェクト: 52North/IlwisTests
void GdalDataAccess::accessingFeatureData() {
    try {
        Ilwis::IFeatureCoverage fc;
        qDebug() << "Features : accessing data ";

        DOTEST(fc.prepare(makeInputPath("regions.shp")), "Loading regions.shp");
        QString env = fc->envelope().toString();
        DOTEST(env == "33.0065 3.40088 47.9605 14.9637","FeatureCoverage: testing envelope (bbox)");

        DOTEST(fc.prepare(makeInputPath("rainfall.shp")),"loading point map");
        Ilwis::FeatureIterator iter1(fc);

        Ilwis::SPFeatureI f1 = *(iter1 + 1);
        QVariant output = f1->cell("RAINFALL");
        DOTEST(output.toString() =="taquina","accesing attribute string data of pointmap");

        Ilwis::SPFeatureI f2 = *(iter1 + 4);
        output = f2("JANUARY");
        DOCOMPARE(output.toInt(), 85 ,"accesing attribute numeric data of pointmap");

        DOTEST(fc.prepare(makeInputPath("drainage.shp")),"loading segment map");
        Ilwis::FeatureIterator iter2(fc);

        Ilwis::SPFeatureI f3 = *(iter2 + 104);
        output = f3->cell("DRAINAGE");
        DOTEST(output.toString() == "lake","accesing attribute string data of line coverage");

        Ilwis::SPFeatureI f4 = *(iter2 + 21);
        output = f4("C1");
        DOCOMPARE(output.toInt(), 1 ,"accesing attribute numeric data ofline coverage");

        DOTEST(fc.prepare(makeInputPath("geology.shp")),"loading polygon map");
        Ilwis::FeatureIterator iter3(fc);

        Ilwis::SPFeatureI f5 = *(iter3 + 40);
        output = f5->cell("GEOLOGY");
        DOTEST(output.toString() == "Shales","accesing attribute string data of polygon coverage");


    }catch (const Ilwis::ErrorObject& err) {
        QString error = "Test threw exception : " + err.message();
        QFAIL(error.toLatin1());
    }
}
コード例 #6
0
void DataAccess::features() {
    Ilwis::IFeatureCoverage features;

    features.prepare(makeInputPath("rainfall.mpp"));

    Ilwis::FeatureIterator iter(features);
    Ilwis::SPFeatureI f = *(iter + 4);
    DOCOMPARE(f("january").toInt(), 93,"accessing value of 4th feature, january attribute column");

    features.prepare(makeInputPath("Contour.mps"));
    Ilwis::FeatureIterator iter2(features);
    Ilwis::SPFeatureI f2 = *(iter2 + 10);
    DOCOMPARE(f2(FEATUREVALUECOLUMN).toInt(), 2600, "accessing map value of the 10th segment");

    features.prepare(makeInputPath("soils_sadc.mpa"));
    Ilwis::FeatureIterator iter3(features);
    Ilwis::SPFeatureI f3 = *(iter3 + 4);
    auto result = f3->cell(QString("FAOSOIL"),false);
    DOTEST(result.toString() == "Rd18-3ab", "accessing attribute value of the 4th polygon");

}
コード例 #7
0
ファイル: setjoystick.cpp プロジェクト: jlsandell/antimicro
void SetJoystick::release()
{
    QHashIterator<int, JoyButton*> iter(buttons);
    while (iter.hasNext())
    {
        JoyButton *button = iter.next().value();
        button->joyEvent(false, true);
    }

    QHashIterator<int, JoyAxis*> iter2(axes);
    while (iter2.hasNext())
    {
        JoyAxis *axis = iter2.next().value();
        axis->joyEvent(axis->getCurrentThrottledDeadValue(), true);
    }

    QHashIterator<int, JoyDPad*> iter3(hats);
    while (iter3.hasNext())
    {
        JoyDPad *dpad = iter3.next().value();
        dpad->joyEvent(0, true);
    }
}
コード例 #8
0
ファイル: mainwindow.cpp プロジェクト: tioui/antimicro
void MainWindow::enableFlashActions()
{
    for (int i=0; i < ui->tabWidget->count(); i++)
    {
        QList<JoyButtonWidget*> list = ui->tabWidget->widget(i)->findChildren<JoyButtonWidget*>();
        QListIterator<JoyButtonWidget*> iter(list);
        while (iter.hasNext())
        {
            JoyButtonWidget *buttonWidget = iter.next();
            buttonWidget->enableFlashes();
        }

        QList<JoyAxisWidget*> list2 = ui->tabWidget->widget(i)->findChildren<JoyAxisWidget*>();
        QListIterator<JoyAxisWidget*> iter2(list2);
        while (iter2.hasNext())
        {
            JoyAxisWidget *axisWidget = iter2.next();
            axisWidget->enableFlashes();
        }

        QList<JoyControlStickPushButton*> list3 = ui->tabWidget->widget(i)->findChildren<JoyControlStickPushButton*>();
        QListIterator<JoyControlStickPushButton*> iter3(list3);
        while (iter3.hasNext())
        {
            JoyControlStickPushButton *stickWidget = iter3.next();
            stickWidget->enableFlashes();
        }

        QList<JoyDPadButtonWidget*> list4 = ui->tabWidget->widget(i)->findChildren<JoyDPadButtonWidget*>();
        QListIterator<JoyDPadButtonWidget*> iter4(list4);
        while (iter4.hasNext())
        {
            JoyDPadButtonWidget *dpadWidget = iter4.next();
            dpadWidget->enableFlashes();
        }

        QList<VirtualDPadPushButton*> list5 = ui->tabWidget->widget(i)->findChildren<VirtualDPadPushButton*>();
        QListIterator<VirtualDPadPushButton*> iter5(list5);
        while (iter5.hasNext())
        {
            VirtualDPadPushButton *dpadWidget = iter5.next();
            dpadWidget->enableFlashes();
        }

        QList<JoyControlStickButtonPushButton*> list6 = ui->tabWidget->widget(i)->findChildren<JoyControlStickButtonPushButton*>();
        QListIterator<JoyControlStickButtonPushButton*> iter6(list6);
        while (iter6.hasNext())
        {
            JoyControlStickButtonPushButton *stickButtonWidget = iter6.next();
            stickButtonWidget->enableFlashes();
        }

        QList<DPadPushButton*> list7 = ui->tabWidget->widget(i)->findChildren<DPadPushButton*>();
        QListIterator<DPadPushButton*> iter7(list7);
        while (iter7.hasNext())
        {
            DPadPushButton *dpadWidget = iter7.next();
            dpadWidget->enableFlashes();
        }
    }
}
コード例 #9
0
ファイル: main.cpp プロジェクト: LukasKoudela/hermes-examples
int main(int argc, char* argv[])
{
  // Load the mesh.
  Mesh mesh;
  MeshReaderH2D mloader;
  mloader.load(mesh_file.c_str(), &mesh);

  // Perform initial mesh refinements.
  for (int i = 0; i < INIT_REF_NUM; i++) mesh.refine_all_elements();

  // Solution variables.
  Solution<double> sln1, sln2, sln3, sln4;
  Hermes::vector<Solution<double>*> solutions(&sln1, &sln2, &sln3, &sln4);
  
  // Define initial conditions.
  Hermes::Mixins::Loggable::Static::info("Setting initial conditions.");
  ConstantSolution<double> iter1(&mesh, 1.00), iter2(&mesh, 1.00), iter3(&mesh, 1.00), iter4(&mesh, 1.00);

  Hermes::vector<MeshFunction<double>*> iterates(&iter1, &iter2, &iter3, &iter4);

  // Create H1 spaces with default shapesets.
  H1Space<double> space1(&mesh, P_INIT_1);
  H1Space<double> space2(&mesh, P_INIT_2);
  H1Space<double> space3(&mesh, P_INIT_3);
  H1Space<double> space4(&mesh, P_INIT_4);
  Hermes::vector<const Space<double>* > spaces(&space1, &space2, &space3, &space4);
  int ndof = Space<double>::get_num_dofs(spaces);
  Hermes::Mixins::Loggable::Static::info("ndof = %d", ndof);

  // Initialize views.
  ScalarView view1("Neutron flux 1", new WinGeom(0, 0, 320, 600));
  ScalarView view2("Neutron flux 2", new WinGeom(350, 0, 320, 600));
  ScalarView view3("Neutron flux 3", new WinGeom(700, 0, 320, 600));
  ScalarView view4("Neutron flux 4", new WinGeom(1050, 0, 320, 600));
  
  // Do not show meshes, set 3D mode.
  view1.show_mesh(false); view1.set_3d_mode(true);
  view2.show_mesh(false); view2.set_3d_mode(true);
  view3.show_mesh(false); view3.set_3d_mode(true);
  view4.show_mesh(false); view4.set_3d_mode(true);
  
  // Load physical data of the problem for the 4 energy groups.
  Hermes::Hermes2D::WeakFormsNeutronics::Multigroup::MaterialProperties::Diffusion::MaterialPropertyMaps matprop(4);
  matprop.set_D(D);
  matprop.set_Sigma_r(Sr);
  matprop.set_Sigma_s(Ss);
  matprop.set_Sigma_a(Sa);
  matprop.set_Sigma_f(Sf);
  matprop.set_nu(nu);
  matprop.set_chi(chi);
  matprop.validate();
  
  // Printing table of material properties.
  std::cout << matprop;
  
  // Initialize the weak formulation.
  CustomWeakForm wf(matprop, iterates, k_eff, bdy_vacuum);

  // Initialize the FE problem.
  DiscreteProblem<double> dp(&wf, spaces);

  // Initialize Newton solver.
  NewtonSolver<double> newton(&dp);

  // Time measurement.
  Hermes::Mixins::TimeMeasurable cpu_time;
      
  // Main power iteration loop:
  int it = 1; bool done = false;
  do
  {
    Hermes::Mixins::Loggable::Static::info("------------ Power iteration %d:", it);
    
    Hermes::Mixins::Loggable::Static::info("Newton's method.");
    
    // Perform Newton's iteration.
    try
    {
      newton.set_newton_max_iter(NEWTON_MAX_ITER);
      newton.set_newton_tol(NEWTON_TOL);
      newton.solve_keep_jacobian();
    }
    catch(Hermes::Exceptions::Exception e)
    {
      e.printMsg();
      throw Hermes::Exceptions::Exception("Newton's iteration failed.");
    }
       
    // Debug.
    //printf("\n=================================================\n");
    //for (int d = 0; d < ndof; d++) printf("%g ", newton.get_sln_vector()[d]);

    // Translate the resulting coefficient vector into a Solution.
    Solution<double>::vector_to_solutions(newton.get_sln_vector(), spaces, solutions);
    
    // Show intermediate solutions.
    view1.show(&sln1);    
    view2.show(&sln2);
    view3.show(&sln3);    
    view4.show(&sln4);
    
    // Compute eigenvalue.
    SourceFilter source(solutions, &matprop, core);
    SourceFilter source_prev(iterates, &matprop, core);
    
    double k_new = k_eff * (integrate(&source, core) / integrate(&source_prev, core));
    Hermes::Mixins::Loggable::Static::info("Largest eigenvalue: %.8g, rel. difference from previous it.: %g", k_new, fabs((k_eff - k_new) / k_new));
    
    // Stopping criterion.
    if (fabs((k_eff - k_new) / k_new) < ERROR_STOP) done = true;

    // Update eigenvalue.
    k_eff = k_new;
    wf.update_keff(k_eff);
    
    if (!done)
    {
      // Save solutions for the next iteration.
      iter1.copy(&sln1);    
      iter2.copy(&sln2);
      iter3.copy(&sln3);    
      iter4.copy(&sln4);
      
      it++;
    }
  }
  while (!done);
  
  // Time measurement.
  cpu_time.tick();
  
  // Show solutions.
  view1.show(&sln1);
  view2.show(&sln2);
  view3.show(&sln3);    
  view4.show(&sln4);
  
  // Skip visualization time.
  cpu_time.tick(Hermes::Mixins::TimeMeasurable::HERMES_SKIP);

  // Print timing information.
  Hermes::Mixins::Loggable::Static::info("Total running time: %g s", cpu_time.accumulated());
    
  // Wait for all views to be closed.
  View::wait();
  return 0;
}
コード例 #10
0
ファイル: qtractorOptions.cpp プロジェクト: EQ4/qtractor
// Explicit save method.
void qtractorOptions::saveOptions (void)
{
	// Make program version available in the future.
	m_settings.beginGroup("/Program");
	m_settings.setValue("/Version", QTRACTOR_VERSION);
	m_settings.endGroup();

	// And go into general options group.
	m_settings.beginGroup("/Options");

	// Save display options.
	m_settings.beginGroup("/Display");
	m_settings.setValue("/MessagesFont", sMessagesFont);
	m_settings.setValue("/MessagesLimit", bMessagesLimit);
	m_settings.setValue("/MessagesLimitLines", iMessagesLimitLines);
	m_settings.setValue("/ConfirmRemove", bConfirmRemove);
	m_settings.setValue("/ConfirmArchive", bConfirmArchive);
	m_settings.setValue("/StdoutCapture", bStdoutCapture);
	m_settings.setValue("/CompletePath", bCompletePath);
	m_settings.setValue("/PeakAutoRemove", bPeakAutoRemove);
	m_settings.setValue("/KeepToolsOnTop", bKeepToolsOnTop);
	m_settings.setValue("/DisplayFormat", iDisplayFormat);
	m_settings.setValue("/MaxRecentFiles", iMaxRecentFiles);
	m_settings.setValue("/BaseFontSize", iBaseFontSize);
	m_settings.endGroup();

	// Save logging options...
	m_settings.beginGroup("/Logging");
	m_settings.setValue("/MessagesLog", bMessagesLog);
	m_settings.setValue("/MessagesLogPath", sMessagesLogPath);
	m_settings.endGroup();

	// View options group.
	m_settings.beginGroup("/View");
	m_settings.setValue("/Menubar", bMenubar);
	m_settings.setValue("/Statusbar", bStatusbar);
	m_settings.setValue("/FileToolbar", bFileToolbar);
	m_settings.setValue("/EditToolbar", bEditToolbar);
	m_settings.setValue("/TrackToolbar", bTrackToolbar);
	m_settings.setValue("/ViewToolbar", bViewToolbar);
	m_settings.setValue("/OptionsToolbar", bOptionsToolbar);
	m_settings.setValue("/TransportToolbar", bTransportToolbar);
	m_settings.setValue("/TimeToolbar", bTimeToolbar);
	m_settings.setValue("/ThumbToolbar", bThumbToolbar);
	m_settings.setValue("/ZoomMode", iZoomMode);
	m_settings.endGroup();

	// Transport options group.
	m_settings.beginGroup("/Transport");
	m_settings.setValue("/Metronome", bMetronome);
	m_settings.setValue("/FollowPlayhead", bFollowPlayhead);
	m_settings.setValue("/AutoBackward", bAutoBackward);
	m_settings.setValue("/ContinuePastEnd", bContinuePastEnd);
	m_settings.setValue("/TransportMode", iTransportMode);
	m_settings.setValue("/Timebase", bTimebase);
	m_settings.endGroup();

	// Audio rendering options group.
	m_settings.beginGroup("/Audio");
	m_settings.setValue("/CaptureExt", sAudioCaptureExt);
	m_settings.setValue("/CaptureType", iAudioCaptureType);
	m_settings.setValue("/CaptureFormat", iAudioCaptureFormat);
	m_settings.setValue("/CaptureQuality", iAudioCaptureQuality);
	m_settings.setValue("/ResampleType", iAudioResampleType);
	m_settings.setValue("/AutoTimeStretch", bAudioAutoTimeStretch);
	m_settings.setValue("/WsolaTimeStretch", bAudioWsolaTimeStretch);
	m_settings.setValue("/WsolaQuickSeek", bAudioWsolaQuickSeek);
	m_settings.setValue("/PlayerBus", bAudioPlayerBus);
	m_settings.setValue("/MetroBus", bAudioMetroBus);
	m_settings.setValue("/Metronome", bAudioMetronome);
	m_settings.setValue("/MasterAutoConnect", bAudioMasterAutoConnect);
	m_settings.setValue("/PlayerAutoConnect", bAudioPlayerAutoConnect);
	m_settings.setValue("/MetroAutoConnect", bAudioMetroAutoConnect);
	m_settings.endGroup();

	// MIDI rendering options group.
	m_settings.beginGroup("/Midi");
	m_settings.setValue("/CaptureFormat", iMidiCaptureFormat);
	m_settings.setValue("/CaptureQuantize", iMidiCaptureQuantize);
	m_settings.setValue("/QueueTimer", iMidiQueueTimer);
	m_settings.setValue("/DriftCorrect", bMidiDriftCorrect);
	m_settings.setValue("/PlayerBus", bMidiPlayerBus);
	m_settings.setValue("/ControlBus", bMidiControlBus);
	m_settings.setValue("/MetroBus", bMidiMetroBus);
	m_settings.setValue("/Metronome", bMidiMetronome);
	m_settings.setValue("/MmcDevice", iMidiMmcDevice);
	m_settings.setValue("/MmcMode", iMidiMmcMode);
	m_settings.setValue("/SppMode", iMidiSppMode);
	m_settings.setValue("/ClockMode", iMidiClockMode);
	m_settings.endGroup();

	// Metronome options group.
	m_settings.beginGroup("/Metronome");
	// Audio metronome...
	m_settings.setValue("/BarFilename", sMetroBarFilename);
	m_settings.setValue("/BarGain", double(fMetroBarGain));
	m_settings.setValue("/BeatFilename", sMetroBeatFilename);
	m_settings.setValue("/BeatGain", double(fMetroBeatGain));
	// MIDI metronome...
	m_settings.setValue("/Channel", iMetroChannel);
	m_settings.setValue("/BarNote", iMetroBarNote);
	m_settings.setValue("/BarVelocity", iMetroBarVelocity);
	m_settings.setValue("/BarDuration", iMetroBarDuration);
	m_settings.setValue("/BeatNote", iMetroBeatNote);
	m_settings.setValue("/BeatVelocity", iMetroBeatVelocity);
	m_settings.setValue("/BeatDuration", iMetroBeatDuration);
	m_settings.endGroup();

	m_settings.endGroup(); // Options group.

	// Default directories.
	m_settings.beginGroup("/Default");
	m_settings.setValue("/SessionExt", sSessionExt);
	m_settings.setValue("/SessionTemplate", bSessionTemplate);
	m_settings.setValue("/SessionTemplatePath", sSessionTemplatePath);
	m_settings.setValue("/SessionBackup", bSessionBackup);
	m_settings.setValue("/SessionBackupMode", iSessionBackupMode);
	m_settings.setValue("/SessionDir", sSessionDir);
	m_settings.setValue("/AudioDir", sAudioDir);
	m_settings.setValue("/MidiDir", sMidiDir);
	m_settings.setValue("/PresetDir", sPresetDir);
	m_settings.setValue("/InstrumentDir", sInstrumentDir);
	m_settings.setValue("/MidiControlDir", sMidiControlDir);
	m_settings.setValue("/MidiSysexDir", sMidiSysexDir);
	m_settings.setValue("/AutoMonitor", bAutoMonitor);
	m_settings.setValue("/SnapPerBeat", iSnapPerBeat);
	m_settings.setValue("/Tempo", double(fTempo));
	m_settings.setValue("/BeatsPerBar", iBeatsPerBar);
	m_settings.setValue("/BeatDivisor", iBeatDivisor);
	m_settings.setValue("/LoopRecordingMode", iLoopRecordingMode);
	m_settings.setValue("/PasteRepeatCount", iPasteRepeatCount);
	m_settings.setValue("/PasteRepeatPeriod", bPasteRepeatPeriod);
	m_settings.setValue("/PluginSearch", sPluginSearch);
	m_settings.setValue("/PluginType", iPluginType);
	m_settings.setValue("/PluginActivate", bPluginActivate);
	m_settings.setValue("/CurveMode", iCurveMode);
	m_settings.setValue("/EditRangeOptions", iEditRangeOptions);
	m_settings.setValue("/MidButtonModifier", bMidButtonModifier);
	m_settings.endGroup();

	// Session auto-save group.
	m_settings.beginGroup("/AutoSave");
	m_settings.setValue("/Enabled", bAutoSaveEnabled);
	m_settings.setValue("/Period", iAutoSavePeriod);
	m_settings.setValue("/Pathname", sAutoSavePathname);
	m_settings.setValue("/Filename", sAutoSaveFilename);
	m_settings.endGroup();

	// Plug-in paths.
	m_settings.beginGroup("/Plugins");
	m_settings.setValue("/LadspaPaths", ladspaPaths);
	m_settings.setValue("/DssiPaths", dssiPaths);
	m_settings.setValue("/VstPaths", vstPaths);
	m_settings.setValue("/Lv2Paths", lv2Paths);
	m_settings.setValue("/Lv2PresetDir", sLv2PresetDir);
	m_settings.setValue("/AudioOutputBus", bAudioOutputBus);
	m_settings.setValue("/AudioOutputAutoConnect", bAudioOutputAutoConnect);
	m_settings.setValue("/OpenEditor", bOpenEditor);
	m_settings.setValue("/DummyVstScan", bDummyVstScan);
	m_settings.setValue("/Lv2DynManifest", bLv2DynManifest);
	m_settings.setValue("/SaveCurve14bit", bSaveCurve14bit);
	m_settings.endGroup();

	// Instrument file list.
	const QString sFilePrefix = "/File%1";
	int iFile = 0;
	m_settings.beginGroup("/InstrumentFiles");
	QStringListIterator iter1(instrumentFiles);
    while (iter1.hasNext())
		m_settings.setValue(sFilePrefix.arg(++iFile), iter1.next());
    // Cleanup old entries, if any...
    while (!m_settings.value(sFilePrefix.arg(++iFile)).isNull())
        m_settings.remove(sFilePrefix.arg(iFile));
	m_settings.endGroup();

	// MIDI controller file list.
	iFile = 0;
	m_settings.beginGroup("/MidiControlFiles");
	QStringListIterator iter2(midiControlFiles);
	while (iter2.hasNext())
		m_settings.setValue(sFilePrefix.arg(++iFile), iter2.next());
	// Cleanup old entries, if any...
	while (!m_settings.value(sFilePrefix.arg(++iFile)).isNull())
		m_settings.remove(sFilePrefix.arg(iFile));
	m_settings.endGroup();

	// Recent file list.
	iFile = 0;
	m_settings.beginGroup("/RecentFiles");
	QStringListIterator iter3(recentFiles);
	while (iter3.hasNext())
		m_settings.setValue(sFilePrefix.arg(++iFile), iter3.next());
	m_settings.endGroup();

	// Tracks widget settings.
	m_settings.beginGroup("/Tracks");
	m_settings.setValue("/TrackViewSelectMode", iTrackViewSelectMode);
	m_settings.setValue("/TrackViewDropSpan", bTrackViewDropSpan);
	m_settings.setValue("/TrackViewSnapZebra", bTrackViewSnapZebra);
	m_settings.setValue("/TrackViewSnapGrid", bTrackViewSnapGrid);
	m_settings.setValue("/TrackViewToolTips", bTrackViewToolTips);
	m_settings.setValue("/TrackViewCurveEdit", bTrackViewCurveEdit);
	m_settings.endGroup();

	// MIDI Editor options group.
	m_settings.beginGroup("/MidiEditor");

	m_settings.beginGroup("/View");
	m_settings.setValue("/Menubar", bMidiMenubar);
	m_settings.setValue("/Statusbar", bMidiStatusbar);
	m_settings.setValue("/FileToolbar", bMidiFileToolbar);
	m_settings.setValue("/EditToolbar", bMidiEditToolbar);
	m_settings.setValue("/ViewToolbar", bMidiViewToolbar);
	m_settings.setValue("/TransportToolbar", bMidiTransportToolbar);
	m_settings.setValue("/ScaleToolbar", bMidiScaleToolbar);
	m_settings.setValue("/ThumbToolbar", bMidiThumbToolbar);
	m_settings.setValue("/NoteDuration", bMidiNoteDuration);
	m_settings.setValue("/NoteColor", bMidiNoteColor);
	m_settings.setValue("/ValueColor", bMidiValueColor);
	m_settings.setValue("/Preview", bMidiPreview);
	m_settings.setValue("/Follow", bMidiFollow);
	m_settings.setValue("/EditMode", bMidiEditMode);
	m_settings.setValue("/EditModeDraw", bMidiEditModeDraw);
	m_settings.setValue("/ZoomMode", iMidiZoomMode);
	m_settings.setValue("/HorizontalZoom", iMidiHorizontalZoom);
	m_settings.setValue("/VerticalZoom", iMidiVerticalZoom);
	m_settings.setValue("/SnapPerBeat", iMidiSnapPerBeat);
	m_settings.setValue("/SnapZebra", bMidiSnapZebra);
	m_settings.setValue("/SnapGrid", bMidiSnapGrid);
	m_settings.setValue("/ToolTips", bMidiToolTips);
	m_settings.setValue("/ViewType", iMidiViewType);
	m_settings.setValue("/EventType", iMidiEventType);
	m_settings.setValue("/EventParam", iMidiEventParam);
	m_settings.setValue("/SnapToScaleKey", iMidiSnapToScaleKey);
	m_settings.setValue("/SnapToScaleType", iMidiSnapToScaleType);
	m_settings.endGroup();

	m_settings.endGroup(); // MidiEditor

	// User preference options.
	m_settings.beginGroup("/Preferences");

	// Mixer options.
	m_settings.beginGroup("/Mixer");
	m_settings.setValue("/AutoGridLayout", bMixerAutoGridLayout);
	m_settings.endGroup();

	// Meter colors.
	m_settings.beginGroup("/Colors");
	m_settings.setValue("/AudioMeter", audioMeterColors);
	m_settings.setValue("/MidiMeter", midiMeterColors);
	m_settings.endGroup();

	// Transport view options.
	m_settings.beginGroup("/Transport");
	m_settings.setValue("/SyncViewHold", bSyncViewHold);
	m_settings.endGroup();

	// Run-time special semi/non-persistent options.
	m_settings.beginGroup("/Dialogs");
	m_settings.setValue("/UseNativeDialogs", bUseNativeDialogs);
	m_settings.endGroup();

	// Custom display options.
	m_settings.beginGroup("/Custom");
	m_settings.setValue("/ColorTheme", sCustomColorTheme);
	m_settings.setValue("/StyleTheme", sCustomStyleTheme);
	m_settings.endGroup();

	m_settings.endGroup(); // Preferences

	// Save/commit to disk.
	m_settings.sync();
}
コード例 #11
0
ファイル: setjoystick.cpp プロジェクト: jlsandell/antimicro
void SetJoystick::setIgnoreEventState(bool ignore)
{
    QHashIterator<int, JoyButton*> iter(buttons);
    while (iter.hasNext())
    {
        JoyButton *button = iter.next().value();
        if (button)
        {
            button->setIgnoreEventState(ignore);
        }
    }

    QHashIterator<int, JoyAxis*> iter2(axes);
    while (iter2.hasNext())
    {
        JoyAxis *axis = iter2.next().value();
        if (axis)
        {
            JoyAxisButton *naxisbutton = axis->getNAxisButton();
            naxisbutton->setIgnoreEventState(ignore);

            JoyAxisButton *paxisbutton = axis->getPAxisButton();
            paxisbutton->setIgnoreEventState(ignore);
        }
    }

    QHashIterator<int, JoyDPad*> iter3(hats);
    while (iter3.hasNext())
    {
        JoyDPad *dpad = iter3.next().value();

        if (dpad)
        {
            QHash<int, JoyDPadButton*>* dpadbuttons = dpad->getButtons();
            QHashIterator<int, JoyDPadButton*> iterdpadbuttons(*dpadbuttons);
            while (iterdpadbuttons.hasNext())
            {
                JoyDPadButton *dpadbutton = iterdpadbuttons.next().value();
                if (dpadbutton)
                {
                    dpadbutton->setIgnoreEventState(ignore);
                }
            }
        }
    }

    QHashIterator<int, JoyControlStick*> iter4(sticks);
    while (iter4.hasNext())
    {
        JoyControlStick *stick = iter4.next().value();
        if (stick)
        {
            QHash<JoyControlStick::JoyStickDirections, JoyControlStickButton*> *stickButtons = stick->getButtons();
            QHashIterator<JoyControlStick::JoyStickDirections, JoyControlStickButton*> iterstickbuttons(*stickButtons);
            while (iterstickbuttons.hasNext())
            {
                JoyControlStickButton *stickbutton = iterstickbuttons.next().value();
                stickbutton->setIgnoreEventState(ignore);
            }
        }
    }

    QHashIterator<int, VDPad*> iter5(vdpads);
    while (iter5.hasNext())
    {
        VDPad *vdpad = iter5.next().value();
        if (vdpad)
        {
            QHash<int, JoyDPadButton*>* dpadbuttons = vdpad->getButtons();
            QHashIterator<int, JoyDPadButton*> itervdpadbuttons(*dpadbuttons);
            while (itervdpadbuttons.hasNext())
            {
                JoyDPadButton *dpadbutton = itervdpadbuttons.next().value();
                dpadbutton->setIgnoreEventState(ignore);
            }
        }
    }

}
コード例 #12
0
void dng_area_task::ProcessOnThread (uint32 threadIndex,
									 const dng_rect &area,
									 const dng_point &tileSize,
									 dng_abort_sniffer *sniffer)
	{
	
	dng_rect repeatingTile1 = RepeatingTile1 ();
	dng_rect repeatingTile2 = RepeatingTile2 ();
	dng_rect repeatingTile3 = RepeatingTile3 ();
	
	if (repeatingTile1.IsEmpty ())
		{
		repeatingTile1 = area;
		}
	
	if (repeatingTile2.IsEmpty ())
		{
		repeatingTile2 = area;
		}
	
	if (repeatingTile3.IsEmpty ())
		{
		repeatingTile3 = area;
		}
		
	dng_rect tile1;
	
	dng_tile_iterator iter1 (repeatingTile3, area);
	
	while (iter1.GetOneTile (tile1))
		{
		
		dng_rect tile2;
		
		dng_tile_iterator iter2 (repeatingTile2, tile1);
		
		while (iter2.GetOneTile (tile2))
			{
			
			dng_rect tile3;
			
			dng_tile_iterator iter3 (repeatingTile1, tile2);
			
			while (iter3.GetOneTile (tile3))
				{
				
				dng_rect tile4;
				
				dng_tile_iterator iter4 (tileSize, tile3);
				
				while (iter4.GetOneTile (tile4))
					{
					
					dng_abort_sniffer::SniffForAbort (sniffer);
					
					Process (threadIndex, tile4, sniffer);
					
					}
					
				}
				
			}
		
		}
	
	}
コード例 #13
0
ファイル: itercoll.cpp プロジェクト: LittoCats/OT_4010D
void CollationIteratorTest::TestAssignment()
{
    UErrorCode status = U_ZERO_ERROR;
    RuleBasedCollator *coll = 
        (RuleBasedCollator *)Collator::createInstance(status);

    if (coll == NULL || U_FAILURE(status))
    {
        errln("Couldn't create a default collator.");
        return;
    }

    UnicodeString source("abcd");
    CollationElementIterator *iter1 = 
        coll->createCollationElementIterator(source);

    CollationElementIterator iter2 = *iter1;

    if (*iter1 != iter2) {
        errln("Fail collation iterator assignment does not produce the same elements");
    }

    CollationElementIterator iter3(*iter1);

    if (*iter1 != iter3) {
        errln("Fail collation iterator copy constructor does not produce the same elements");
    }

    source = CharsToUnicodeString("a\\u0300\\u0325");
    coll->setAttribute(UCOL_NORMALIZATION_MODE, UCOL_ON, status);
    CollationElementIterator *iter4 
                        = coll->createCollationElementIterator(source);
    CollationElementIterator iter5(*iter4);
    if (*iter4 != iter5) {
        errln("collation iterator assignment does not produce the same elements");
    }
    iter4->next(status);
    if (U_FAILURE(status) || *iter4 == iter5) {
        errln("collation iterator not equal");
    }
    iter5.next(status);
    if (U_FAILURE(status) || *iter4 != iter5) {
        errln("collation iterator equal");
    }
    iter4->next(status);
    if (U_FAILURE(status) || *iter4 == iter5) {
        errln("collation iterator not equal");
    }
    iter5.next(status);
    if (U_FAILURE(status) || *iter4 != iter5) {
        errln("collation iterator equal");
    }
    CollationElementIterator iter6(*iter4);
    if (*iter4 != iter6) {
        errln("collation iterator equal");
    }
    iter4->next(status);
    if (U_FAILURE(status) || *iter4 == iter5) {
        errln("collation iterator not equal");
    }
    iter5.next(status);
    if (U_FAILURE(status) || *iter4 != iter5) {
        errln("collation iterator equal");
    }
    iter4->next(status);
    if (U_FAILURE(status) || *iter4 == iter5) {
        errln("collation iterator not equal");
    }
    iter5.next(status);
    if (U_FAILURE(status) || *iter4 != iter5) {
        errln("collation iterator equal");
    }
    delete iter1;
    delete iter4;
    delete coll;
}