Logo Search packages:      
Sourcecode: rosegarden version File versions  Download package

void RosegardenGUIApp::slotAddTracks (  )  [slot]

Add new tracks

Definition at line 3334 of file rosegardengui.cpp.

References RosegardenGUIDoc::getStudio(), m_doc, m_view, and RosegardenGUIView::slotAddTracks().

Referenced by setupActions().

{
    if (!m_view) return;

    // default to the base number - might not actually exist though
    //
    Rosegarden::InstrumentId id = Rosegarden::MidiInstrumentBase;

    // Get the first Internal/MIDI instrument
    //
    Rosegarden::DeviceList *devices = m_doc->getStudio().getDevices();
    bool have = false;

    for (Rosegarden::DeviceList::iterator it = devices->begin();
       it != devices->end() && !have; it++) {

        if ((*it)->getType() != Rosegarden::Device::Midi) continue;

      Rosegarden::InstrumentList instruments = (*it)->getAllInstruments();
      for (Rosegarden::InstrumentList::iterator iit = instruments.begin();
           iit != instruments.end(); iit++) {

          if ((*iit)->getId() >= Rosegarden::MidiInstrumentBase) {
            id = (*iit)->getId();
            have = true;
            break;
          }
        }
    }

    bool ok = false;

    int tracks = QInputDialog::getInteger(
                i18n("Add Multiple Tracks"),
                i18n("How many tracks do you want to add?"),
                1,
                1,
                32,
                1,
                &ok,
                this);

    // create tracks if ok
    //
    if (ok) m_view->slotAddTracks(tracks, id);
}


Generated by  Doxygen 1.6.0   Back to index