⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.cpp

📁 LINUX下的混音软件
💻 CPP
📖 第 1 页 / 共 3 页
字号:
and Events (our basic music element).  To help lift the ambiguity,"events" is for UI events, Events is for Event.]  -# The canvas view gets the user events (see    NotationCanvasView::contentsMousePressEvent(QMouseEvent*) for an    example).  It locates where the event occured in terms of musical    element: which note or staff line the user clicked on, which pitch    and time this corresponds to, that kind of stuff.  (In the    Notation and Matrix views, the LinedStaff calculates mappings    between coordinates and staff lines: the former is especially    complicated because of its support for page layout.)\n -# The canvas view transmits this kind of info as a signal, which is connected to a slot in the parent EditView. -# The EditView delegates action to the current tool.\n -# The tool performs the actual job (inserting or deleting a note,    etc...). Since this action is usually complex (merely inserting a note requiresdealing with the surrounding Events, rests or notes), it does itthrough a SegmentHelper (for instance, base/SegmentNotationHelper)which "wraps" the complexity into simple calls and performs all thehidden tasks. The EditView also maintains (obviously) its visual appearance with thelayout classes, applying them when appropriate. \section sequencer Sequencer The sequencer directory also builds into a KDE/Qt application, but onewhich doesn't have a gui.  The Sequencer can be started automaticallyby the main Rosegarden GUI or manually if testing - it's sometimesmore convenient to do the latter as the Sequencer needs to be connectedup to the underlying sound system every time it is started. The Sequencer interfaces directly with \link AlsaDriver ALSA\endlinkand provides MIDI "play" and "record" ports which can be connected toother MIDI clients (MIDI IN and OUT hardware ports or ALSA synth devices)using any ALSA MIDI Connection Manager.  The Sequencer also supports playing and recording of Audio sample files using \link JackDriver Jack\endlink  The GUI and Sequencer communicate using the KDE DCOP communication framework.Look in: - \link rosegardenguiiface.h gui/rosegardenguiiface.h\endlink - \link rosegardensequenceriface.h sequencer/rosegardensequenceriface.h\endlink for definitions of the DCOP interfaces pertinent to the Sequencerand GUI.  The main DCOP operations from the GUI involve starting andstopping the Sequencer, playing and recording, fast forwarding andrewinding.  Once a play or record cycle is enabled it's the Sequencerthat does most of the hard work.  Events are read from (or written to, when recording)a set of mmapped files.  The Sequencer makes use of two libraries libRosegardenSequencerand libRosegardenSound:  - libRosegardenSequencer holds everything pertinent to sequencing    for Rosegarden including the    Sequencer class itself.  This library is only linked into the    Rosegarden Sequencer.  - libRosegardenSound holds the MidiFile class (writing and reading    MIDI files) and the MappedEvent and MappedComposition classes (the    communication class for transferring events back and forth across    DCOP).  This library is needed by the GUI as well as the Sequencer. The main Sequencer state machine is a good starting point and clearlyvisible at the bottom of rosegarden/sequencer/main.cpp.  */static const char *description =    I18N_NOOP("Rosegarden - A sequencer and musical notation editor");static KCmdLineOptions options[] =    {        { "nosequencer", I18N_NOOP("Don't use the sequencer (support editing only)"), 0 },        { "nosplash", I18N_NOOP("Don't show the splash screen"), 0 },        { "nofork", I18N_NOOP("Don't automatically run in the background"), 0 },        { "existingsequencer", I18N_NOOP("Attach to a running sequencer process, if found"), 0 },        { "ignoreversion", I18N_NOOP("Ignore installed version - for devs only"), 0 },        { "+[File]", I18N_NOOP("file to open"), 0 },        { 0, 0, 0 }    };// -----------------------------------------------------------------#ifdef Q_WS_X11#include <X11/Xlib.h>#include <X11/Xutil.h>#include <X11/Xatom.h>#include <X11/SM/SMlib.h>static int _x_errhandler( Display *dpy, XErrorEvent *err ){    char errstr[256];    XGetErrorText( dpy, err->error_code, errstr, 256 );    if ( err->error_code != BadWindow )        kdWarning() << "Rosegarden: detected X Error: " << errstr << " " << err->error_code        << "\n  Major opcode:  " << err->request_code << endl;    return 0;}#endif// NOTE: to get a dump of the stack trace from KDE during program execution:// std::cerr << kdBacktrace() << std::endl// (see kdebug.h)void testInstalledVersion(){    QString versionLocation = locate("appdata", "version.txt");    QString installedVersion;    if (versionLocation) {        QFile versionFile(versionLocation);        if (versionFile.open(IO_ReadOnly)) {            QTextStream text(&versionFile);            QString s = text.readLine().stripWhiteSpace();            versionFile.close();            if (s) {                if (s == VERSION)                    return ;                installedVersion = s;            }        }    }    if (installedVersion) {        KMessageBox::detailedError        (0,         i18n("Installation contains the wrong version of Rosegarden."),         i18n(" The wrong versions of Rosegarden's data files were\n"              " found in the standard KDE installation directories.\n"              " (I am %1, but the installed files are for version %2.)\n\n"              " This may mean one of the following:\n\n"              " 1. This is a new upgrade of Rosegarden, and it has not yet been\n"              "     installed.  If you compiled it yourself, check that you have\n"              "     run \"make install\" and that the procedure completed\n"              "     successfully.\n\n"              " 2. The upgrade was installed in a non-standard directory,\n"              "     and an old version was found in a standard directory.  If so,\n"              "     you will need to add the correct directory to your KDEDIRS\n"              "     environment variable before you can run it.").arg(VERSION).arg(installedVersion),         i18n("Installation problem"));    } else {        KMessageBox::detailedError        (0,         i18n("Rosegarden does not appear to have been installed."),         i18n(" One or more of Rosegarden's data files could not be\n"              " found in the standard KDE installation directories.\n\n"              " This may mean one of the following:\n\n"              " 1. Rosegarden has not been correctly installed.  If you compiled\n"              "     it yourself, check that you have run \"make install\" and that\n"              "     the procedure completed successfully.\n\n"              " 2. Rosegarden has been installed in a non-standard directory,\n"              "     and you need to add this directory to your KDEDIRS environment\n"              "     variable before you can run it.  This may be the case if you\n"              "     installed into $HOME or a local third-party package directory\n"              "     like /usr/local or /opt."),         i18n("Installation problem"));    }    exit(1);}int main(int argc, char *argv[]){    setsid(); // acquire shiny new process group    srandom((unsigned int)time(0) * (unsigned int)getpid());    KAboutData aboutData( "rosegarden", I18N_NOOP("Rosegarden"),                          VERSION, description, KAboutData::License_GPL,                          I18N_NOOP("Copyright 2000 - 2007 Guillaume Laurent, Chris Cannam, Richard Bown\nParts copyright 1994 - 2004 Chris Cannam, Andy Green, Richard Bown, Guillaume Laurent\nLilypond fonts copyright 1997 - 2005 Han-Wen Nienhuys and Jan Nieuwenhuizen"),                          0,                          "http://www.rosegardenmusic.com/",                          "rosegarden-devel@lists.sourceforge.net");    aboutData.addAuthor("Guillaume Laurent (lead)", 0, "glaurent@telegraph-road.org", "http://telegraph-road.org");    aboutData.addAuthor("Chris Cannam (lead)", 0, "cannam@all-day-breakfast.com", "http://all-day-breakfast.com");    aboutData.addAuthor("Richard Bown (lead)", 0, "richard.bown@ferventsoftware.com");    aboutData.addAuthor("D. Michael McIntyre", 0, "dmmcintyr@users.sourceforge.net");    aboutData.addAuthor("Pedro Lopez-Cabanillas", 0, "plcl@users.sourceforge.net");    aboutData.addAuthor("Heikki Johannes Junes", 0, "hjunes@users.sourceforge.net");    aboutData.addCredit("Randall Farmer", I18N_NOOP("Chord labelling code"), " rfarme@simons-rock.edu");    aboutData.addCredit("Hans  Kieserman", I18N_NOOP("Lilypond output\nassorted other patches\ni18n-ization"), "hkieserman@mail.com");    aboutData.addCredit("Levi Burton", I18N_NOOP("UI improvements\nbug fixes"), "donburton@sbcglobal.net");    aboutData.addCredit("Mark Hymers", I18N_NOOP("Segment colours\nOther UI and bug fixes"), "<markh@linuxfromscratch.org>");    aboutData.addCredit("Alexandre Prokoudine", I18N_NOOP("Russian translation\ni18n-ization"), "avp@altlinux.ru");    aboutData.addCredit("J枚rg Schumann", I18N_NOOP("German translation"), "jrschumann@gmx.de");    aboutData.addCredit("Eckhard Jokisch", I18N_NOOP("German translation"), "e.jokisch@u-code.de");    aboutData.addCredit("Kevin Donnelly", I18N_NOOP("Welsh translation"));    aboutData.addCredit("Didier Burli", I18N_NOOP("French translation"), "didierburli@bluewin.ch");    aboutData.addCredit("Yves Guillemot", I18N_NOOP("French translation\nBug fixes"), "yc.guillemot@wanadoo.fr");    aboutData.addCredit("Daniele Medri", I18N_NOOP("Italian translation"), "madrid@linuxmeeting.net");    aboutData.addCredit("Alessandro Musesti", I18N_NOOP("Italian translation"), "a.musesti@dmf.unicatt.it");    aboutData.addCredit("Stefan Asserh盲ll", I18N_NOOP("Swedish translation"), "stefan.asserhall@comhem.se");    aboutData.addCredit("Erik Magnus Johansson", I18N_NOOP("Swedish translation"), "erik.magnus.johansson@telia.com");    aboutData.addCredit("Hasso Tepper", I18N_NOOP("Estonian translation"), "hasso@estpak.ee");    aboutData.addCredit("Jelmer Vernooij", I18N_NOOP("Dutch translation"), "jelmer@samba.org");    aboutData.addCredit("Jasper Stein", I18N_NOOP("Dutch translation"), "jasper.stein@12move.nl");    aboutData.addCredit("Kevin Liang", I18N_NOOP("HSpinBox class"), "xkliang@rhpcs.mcmaster.ca");    aboutData.addCredit("Arnout Engelen", I18N_NOOP("Transposition by interval"));    aboutData.addCredit("Thorsten Wilms", I18N_NOOP("Original designs for rotary controllers"), "t_w_@freenet.de");    aboutData.addCredit("Oota Toshiya", I18N_NOOP("Japanese translation"), "ribbon@users.sourceforge.net");    aboutData.addCredit("William", I18N_NOOP("Auto-scroll deceleration\nRests outside staves and other bug fixes"), "rosegarden4p AT orthoset.com");    aboutData.addCredit("Liu Songhe", I18N_NOOP("Simplified Chinese translation"), "jackliu9999@msn.com");    aboutData.addCredit("Toni Arnold", I18N_NOOP("LIRC infrared remote-controller support"), "<toni__arnold@bluewin.ch>");    aboutData.addCredit("Vince Negri", I18N_NOOP("MTC slave timing implementation"), "vince.negri@gmail.com");    aboutData.addCredit("Jan B铆na", I18N_NOOP("Czech translation"), "jbina@sky.cz");    aboutData.addCredit("Thomas Nagy", I18N_NOOP("SCons/bksys building system"), "tnagy256@yahoo.fr");    aboutData.addCredit("Vladimir Savic", I18N_NOOP("icons, icons, icons"), "vladimir@vladimirsavic.net");    aboutData.addCredit("Marcos Germ谩n Guglielmetti", I18N_NOOP("Spanish translation"), "marcospcmusica@yahoo.com.ar");    aboutData.addCredit("Lisandro Dami谩n Nicanor P茅rez Meyer", I18N_NOOP("Spanish translation"), "perezmeyer@infovia.com.ar");    aboutData.addCredit("Javier Castrillo", I18N_NOOP("Spanish translation"), "riverplatense@gmail.com");    aboutData.addCredit("Lucas Godoy", I18N_NOOP("Spanish translation"), "godoy.lucas@gmail.com");    aboutData.addCredit("Feliu Ferrer", I18N_NOOP("Catalan translation"), "mverge2@pie.xtec.es");    aboutData.addCredit("Quim Perez i Noguer", I18N_NOOP("Catalan translation"), "noguer@osona.com");    aboutData.addCredit("Carolyn McIntyre", I18N_NOOP("1.2.3 splash screen photo\nGave birth to D. Michael McIntyre, bought him a good flute once\nupon a time, and always humored him when he came over to play her\nsome new instrument, even though she really hated his playing.\nBorn October 19, 1951, died September 21, 2007, R. I. P."), "DECEASED");    aboutData.addCredit("Stephen Torri", I18N_NOOP("Initial guitar chord editing code"), "storri@torri.org");    aboutData.addCredit("Piotr Sawicki", I18N_NOOP("Polish translation"), "pelle@plusnet.pl");    aboutData.addCredit("David Garc铆a-Abad", I18N_NOOP("Basque translation"), "davidgarciabad@telefonica.net");    aboutData.addCredit("Joerg C. Koenig, Craig Drummond, Bernhard Rosenkr盲nzer, Preston Brown, Than Ngo", I18N_NOOP("Klearlook theme"), "jck@gmx.org");    aboutData.setTranslator(I18N_NOOP("_: NAME OF TRANSLATORS\nYour names") , I18N_NOOP("_: EMAIL OF TRANSLATORS\nYour emails"));

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -