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

void Rosegarden::RosegardenGUIApp::slotSplitSelectionByRecordedSrc (  )  [slot]

Split the selected segments by recorded source

Definition at line 2935 of file RosegardenGUIApp.cpp.

References Rosegarden::RosegardenGUIView::getSelection(), Rosegarden::RosegardenGUIView::haveSelection(), m_doc, m_view, and Rosegarden::RosegardenGUIView::slotAddCommandToHistory().

Referenced by setupActions().

{
    if (!m_view->haveSelection())
        return ;

    SplitByRecordingSrcDialog dialog(m_view, m_doc);
    if (dialog.exec() != QDialog::Accepted)
        return ;

    SegmentSelection selection = m_view->getSelection();

    KMacroCommand *command = new KMacroCommand
                             (SegmentSplitByRecordingSrcCommand::getGlobalName());

    bool haveSomething = false;

    for (SegmentSelection::iterator i = selection.begin();
            i != selection.end(); ++i) {

        if ((*i)->getType() == Segment::Audio) {
            // nothing
        } else {
            command->addCommand
            (new SegmentSplitByRecordingSrcCommand(*i,
                                                   dialog.getChannel(),
                                                   dialog.getDevice()));
            haveSomething = true;
        }
    }
    if (haveSomething)
        m_view->slotAddCommandToHistory(command);
}


Generated by  Doxygen 1.6.0   Back to index