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

void Rosegarden::RosegardenGUIApp::exportMIDIFile ( QString  url  ) 

export a MIDI file

Definition at line 4916 of file RosegardenGUIApp.cpp.

References Rosegarden::RosegardenGUIDoc::getComposition(), Rosegarden::RosegardenGUIDoc::getStudio(), and m_doc.

Referenced by slotExportMIDI().

{
    ProgressDialog progressDlg(i18n("Exporting MIDI file..."),
                               100,
                               this);

    std::string fname(QFile::encodeName(file));

    MidiFile midiFile(fname,
                      &m_doc->getStudio());

    connect(&midiFile, SIGNAL(setProgress(int)),
            progressDlg.progressBar(), SLOT(setValue(int)));

    connect(&midiFile, SIGNAL(incrementProgress(int)),
            progressDlg.progressBar(), SLOT(advance(int)));

    midiFile.convertToMidi(m_doc->getComposition());

    if (!midiFile.write()) {
        CurrentProgressDialog::freeze();
        KMessageBox::sorry(this, i18n("Export failed.  The file could not be opened for writing."));
    }
}


Generated by  Doxygen 1.6.0   Back to index