示例#1
0
void PosEdit::setSmpte(bool f)
      {
      _smpte = f;
      sec   = f ? smpteSections : midiSections;
      setSections();
      ed->repaint(ed->rect(), false);
      }
示例#2
0
AppSettings::AppSettings(QObject *parent) :
    QObject(parent), m_settings(new QSettings(this))
{
    m_whiteTheme = m_settings->value("whiteTheme", false).toBool();
    m_source = static_cast<Source>(m_settings->value("source", 0).toInt());
    m_scrollWithVolumeKeys = m_settings->value("scrollWithVolumeKeys", false).toBool();
    m_sections = m_settings->value("sections").toStringList();

    if (m_sections.isEmpty())
        setSections(defaultSections());
}
pdsp::ScoreProcessor::ScoreProcessor(){
    
    //synchronizeClockable = true;
    tempo = 120.0;
    playHead = 0.0;
    playHeadEnd = 0.0;
    maxBars = 32000.0;
    
    clearToken = 0;
    
    playhead_meter.store(0.0f);
    
    sections.clear();
    setSections(1);
    
    playing.store(false);
    
    if(dynamicConstruction){
        prepareToPlay(globalBufferSize, globalSampleRate);
    }
}
示例#4
0
void PosEdit::init()
      {
      ed       = new PosEditor(this, "pos editor");
      controls = new SpinBox(this);
      controls->setEditor(ed);
      setFocusProxy(ed);
      connect(controls, SIGNAL(stepUpPressed()), SLOT(stepUp()));
      connect(controls, SIGNAL(stepDownPressed()), SLOT(stepDown()));
      connect(this, SIGNAL(valueChanged(const Pos&)),SLOT(updateButtons()));

      overwrite = false;
      timerId   = 0;
      typing    = false;
      min       = Pos(0);
      max       = Pos(MAX_TICK);
      changed   = false;
      adv       = false;


      static Section s_midiSections[3] = {  // measure, beat, tick
            { 0, 4, 1, 0 },
            { 5, 2, 1, 0 },
            { 8, 3, 0, 0 }
            };
      static Section s_smpteSections[4] = {  // minute second frame subframe
            {  0, 3, 0, 0 },
            {  4, 2, 0, 0 },
            {  7, 2, 0, 0 },
            { 10, 2, 0, 0 }
            };
      memcpy(midiSections, s_midiSections, sizeof(s_midiSections));
      memcpy(smpteSections, s_smpteSections, sizeof(s_smpteSections));

      _smpte     = false;  // show position in smpte format
      sec       = midiSections;
      setSections();
      setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed));
      }