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

📄 rosegardenguiapp.h

📁 LINUX下的混音软件
💻 H
📖 第 1 页 / 共 3 页
字号:
/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: *//*    Rosegarden    A MIDI and audio sequencer and musical notation editor.    This program is Copyright 2000-2007        Guillaume Laurent   <glaurent@telegraph-road.org>,        Chris Cannam        <cannam@all-day-breakfast.com>,        Richard Bown        <richard.bown@ferventsoftware.com>    The moral rights of Guillaume Laurent, Chris Cannam, and Richard    Bown to claim authorship of this work have been asserted.    Other copyrights also apply to some parts of this work.  Please    see the AUTHORS file and individual file headers for details.    This program is free software; you can redistribute it and/or    modify it under the terms of the GNU General Public License as    published by the Free Software Foundation; either version 2 of the    License, or (at your option) any later version.  See the file    COPYING included with this distribution for more information.*/#ifndef _RG_ROSEGARDENGUIAPP_H_#define _RG_ROSEGARDENGUIAPP_H_#include <map>#include <set>#include "base/MidiProgram.h"#include "gui/dialogs/TempoDialog.h"#include "gui/widgets/ZoomSlider.h"#include "RosegardenIface.h"#include "base/Event.h"#include "sound/AudioFile.h"#include "sound/Midi.h"#include <kdockwidget.h>#include <qstring.h>#include <qvaluevector.h>class QWidget;class QTimer;class QTextCodec;class QShowEvent;class QObject;class QLabel;class QCursor;class QAccel;class KURL;class KTempFile;class KToggleAction;class KRecentFilesAction;class KProcess;class KConfig;class KAction;namespace Rosegarden{class TriggerSegmentManager;class TransportDialog;class TrackParameterBox;class TempoView;class SynthPluginManagerDialog;class StartupTester;class SequenceManager;class SegmentSelection;class SegmentParameterBox;class RosegardenParameterArea;class RosegardenGUIView;class RosegardenGUIDoc;class RealTime;class ProgressBar;class PlayListDialog;class MidiMixerWindow;class MarkerEditor;class MappedComposition;class LircCommander;class LircClient;class InstrumentParameterBox;class DeviceManagerDialog;class ControlEditorDialog;class Composition;class Clipboard;class BankEditorDialog;class AudioPluginOSCGUIManager;class AudioPluginManager;class AudioPluginDialog;class AudioMixerWindow;class AudioManagerDialog;/**  * The base class for RosegardenGUI application windows. It sets up the main  * window and reads the config file as well as providing a menubar, toolbar  * and statusbar. An instance of RosegardenGUIView creates your center view, which is connected  * to the window's Doc object.  * RosegardenGUIApp reimplements the methods that KTMainWindow provides for main window handling and supports  * full session management as well as keyboard accelerator configuration by using KAccel.  * @see KTMainWindow  * @see KApplication  * @see KConfig  * @see KAccel  *  * @author Source Framework Automatically Generated by KDevelop, (c) The KDevelop Team.  * @version KDevelop version 0.4 code generation  */class RosegardenGUIApp : public KDockMainWindow, virtual public RosegardenIface{  Q_OBJECT  friend class RosegardenGUIView;public:    /**     * construtor of RosegardenGUIApp, calls all init functions to     * create the application.     * \arg useSequencer : if true, the sequencer is launched     * @see initMenuBar initToolBar     */    RosegardenGUIApp(bool useSequencer = true,                     bool useExistingSequencer = false,                     QObject *startupStatusMessageReceiver = 0);    virtual ~RosegardenGUIApp();    /*     * Get the current copy of the app object     */    static RosegardenGUIApp *self() { return m_myself; }        /**     * returns a pointer to the current document connected to the     * KTMainWindow instance and is used by * the View class to access     * the document object's methods     */     RosegardenGUIDoc *getDocument() const;          RosegardenGUIView* getView() { return m_view; }    TransportDialog* getTransport();    enum ImportType { ImportRG4, ImportMIDI, ImportRG21, ImportHydrogen, ImportCheckType };    /**     * open a Rosegarden file     */    virtual void openFile(QString filePath) { openFile(filePath, ImportCheckType); }    /**     * open a file, explicitly specifying its type     */    void openFile(QString filePath, ImportType type);    /**     * decode and open a project file     */    void importProject(QString filePath);    /**     * open a URL     */    virtual void openURL(QString url);    /**     * merge a file with the existing document     */     virtual void mergeFile(QString filePath) { mergeFile(filePath, ImportCheckType); }        /**     * merge a file, explicitly specifying its type     */    void mergeFile(QString filePath, ImportType type);    /**     * open a URL     */    void openURL(const KURL &url);    /**     * export a MIDI file     */    void exportMIDIFile(QString url);    /**     * export a Csound scorefile     */    void exportCsoundFile(QString url);    /**     * export a Mup file     */    void exportMupFile(QString url);    /**     * export a Lilypond file     */    bool exportLilypondFile(QString url, bool forPreview = false);    /**     * export a MusicXml file     */    void exportMusicXmlFile(QString url);    /**     * Get the sequence manager object     */    SequenceManager* getSequenceManager() { return m_seqManager; }    /**     * Get a progress bar     */    ProgressBar *getProgressBar() { return m_progressBar; }    /**     * Equivalents of the GUI slots, for DCOP use     */    virtual void fileNew()    { slotFileNew(); }    virtual void fileSave()   { slotFileSave(); }    virtual void fileClose()  { slotFileClose(); }    virtual void quit()       { slotQuit(); }    virtual void play()               { slotPlay(); }    virtual void stop()               { slotStop(); }    virtual void rewind()             { slotRewind(); }    virtual void fastForward()        { slotFastforward(); }    virtual void record()             { slotRecord(); }    virtual void rewindToBeginning()  { slotRewindToBeginning(); }    virtual void fastForwardToEnd()   { slotFastForwardToEnd(); }    virtual void jumpToTime(int sec, int usec) { slotJumpToTime(sec, usec); }    virtual void startAtTime(int sec, int usec) { slotStartAtTime(sec, usec); }        virtual void trackUp()            { slotTrackUp(); }    virtual void trackDown()          { slotTrackDown(); }    virtual void toggleMutedCurrentTrack() { slotToggleMutedCurrentTrack(); }    virtual void toggleRecordCurrentTrack() { slotToggleRecordCurrentTrack(); }            /**     * Start the sequencer auxiliary process     * (built in the 'sequencer' directory)     *     * @see slotSequencerExited()     */    bool launchSequencer(bool useExistingSequencer);#ifdef HAVE_LIBJACK    /*     * Launch and control JACK if required to by configuration      */    bool launchJack();#endif // HAVE_LIBJACK    /**     * Returns whether we're using a sequencer.     * false if the '--nosequencer' option was given     * true otherwise.     * This doesn't give the state of the sequencer     * @see #isSequencerRunning     */    bool isUsingSequencer() { return m_useSequencer; }    /**     * Returns whether there's a sequencer running.     * The result is dynamically updated depending on the sequencer's     * status.     */    bool isSequencerRunning() { return m_useSequencer && (m_sequencerProcess != 0); }    /**     * Returns true if the sequencer wasn't started by us     */    bool isSequencerExternal() { return m_useSequencer && (m_sequencerProcess == SequencerExternal); }        /**     * Set the sequencer status - pass through DCOP as an int     */    virtual void notifySequencerStatus(int status);    /**     * Handle some random incoming MIDI events.     */    virtual void processAsynchronousMidi(const MappedComposition &);    /*     * The sequencer calls this method when it's running to     * allow us to sync data with it.     *     */    virtual void alive();    /*     * Return the clipboard     */    Clipboard* getClipboard() { return m_clipboard; }#ifdef HAVE_LIBLO    /**     * Return the plugin native GUI manager, if we have one     */    AudioPluginOSCGUIManager *getPluginGUIManager() { return m_pluginGUIManager; }#endif    /**     * Plug a widget into our common accelerators     */    void plugAccelerators(QWidget *widget, QAccel *accel);    /**     * Override from QWidget     * Toolbars and docks need special treatment     */    virtual void setCursor(const QCursor&);    bool isTrackEditorPlayTracking() const;    bool testAudioPath(QString op); // and open the dialog to set it if unset    bool haveAudioImporter() const { return m_haveAudioImporter; }protected:    /**** File handling code that we don't want the outside world to use ****/    /**/    /**/    /**     * Create document from a file     */    RosegardenGUIDoc* createDocument(QString filePath, ImportType type = ImportRG4);    /**     * Create a document from RG file     */    RosegardenGUIDoc* createDocumentFromRGFile(QString filePath);    /**     * Create document from MIDI file     */    RosegardenGUIDoc* createDocumentFromMIDIFile(QString filePath);    /**     * Create document from RG21 file     */    RosegardenGUIDoc* createDocumentFromRG21File(QString filePath);    /**     * Create document from Hydrogen drum machine file     */    RosegardenGUIDoc* createDocumentFromHydrogenFile(QString filePath);    /**/    /**/    /***********************************************************************/    /**     * Set the 'Rewind' and 'Fast Forward' buttons in the transport     * toolbar to AutoRepeat     */    void setRewFFwdToAutoRepeat();    static const void* SequencerExternal;    /// Raise the transport along    virtual void showEvent(QShowEvent*);    /**     * read general Options again and initialize all variables like     * the recent file list     */    void readOptions();    /**     * add an item pointing to the example files in the KFileDialog speedbar     */    void setupFileDialogSpeedbar();    /**     * create menus and toolbars     */    void setupActions();    /**     * sets up the zoom toolbar     */    void initZoomToolbar();    /**     * sets up the statusbar for the main window by initialzing a     * statuslabel.     */    void initStatusBar();    /**     * creates the centerwidget of the KTMainWindow instance and sets     * it as the view     */    void initView();    /**     * queryClose is called by KTMainWindow on each closeEvent of a     * window. Against the default implementation (only returns true),     * this calls saveModified() on the document object to ask if the     * document shall be saved if Modified; on cancel the closeEvent     * is rejected.     *     * @see KTMainWindow#queryClose     * @see KTMainWindow#closeEvent     */    virtual bool queryClose();    /**     * queryExit is called by KTMainWindow when the last window of the     * application is going to be closed during the closeEvent().     * Against the default implementation that just returns true, this     * calls saveOptions() to save the settings of the last window's     * properties.     *     * @see KTMainWindow#queryExit     * @see KTMainWindow#closeEvent     */    virtual bool queryExit();    /**     * saves the window properties for each open window during session     * end to the session config file, including saving the currently     * opened file by a temporary filename provided by KApplication.     *     * @see KTMainWindow#saveProperties     */    virtual void saveGlobalProperties(KConfig *_cfg);    /**     * reads the session config file and restores the application's     * state including the last opened files and documents by reading     * the temporary files saved by saveProperties()     *     * @see KTMainWindow#readProperties     */    virtual void readGlobalProperties(KConfig *_cfg);    /**     * Create a new audio file for the sequencer and return the     * path to it as a QString.     */    QString createNewAudioFile();    QValueVector<QString> createRecordAudioFiles(const QValueVector<InstrumentId> &);    QString getAudioFilePath();    //!!!mtr    QValueVector<InstrumentId> getArmedInstruments();    /**     * Show a sequencer error to the user.  This is for errors from     * the framework code; the playback code uses mapped compositions     * to send these things back asynchronously.     */    void showError(QString error);    /*     * Return AudioManagerDialog     */    AudioManagerDialog* getAudioManagerDialog() { return m_audioManagerDialog; }    /**     * Ask the user for a file to save to, and check that it's     * good and that (if it exists) the user agrees to overwrite.     * Return a null string if the write should not go ahead.     */    QString getValidWriteFile(QString extension, QString label);    /**     * Find any non-ASCII strings in a composition that has been     * generated by MIDI import or any other procedure that produces     * events with unknown text encoding, and ask the user what     * encoding to translate them from.  This assumes all text strings     * in the composition are of the same encoding, and that it is not     * (known to be) utf8 (in which case no transcoding would be     * necessary).     */    void fixTextEncodings(Composition *);    QTextCodec *guessTextCodec(std::string);    /**     * Set the current document     *     * Do all the needed housework when the current document changes     * (like closing edit views, emitting documentChanged signal, etc...)     */    void setDocument(RosegardenGUIDoc*);    /**     * Jog a selection of segments by an amount     */    void jogSelection(timeT amount);    void createAndSetupTransport();signals:    void startupStatusMessage(QString message);    /// emitted just before the document is changed    void documentAboutToChange();    /// emitted when the current document changes    void documentChanged(RosegardenGUIDoc*);    /// emitted when the set of selected segments changes (relayed from RosegardenGUIView)    void segmentsSelected(const SegmentSelection &);    /// emitted when the composition state (selected track, solo, etc...) changes    void compositionStateUpdate();    /// emitted when instrument parameters change (relayed from InstrumentParameterBox)    void instrumentParametersChanged(InstrumentId);    /// emitted when a plugin dialog selects a plugin    void pluginSelected(InstrumentId, int, int);    /// emitted when a plugin dialog (un)bypasses a plugin    void pluginBypassed(InstrumentId, int, bool);public slots:    /**     * open a URL - used for Dn'D     *     * @param url : a string containing a url (protocol://foo/bar/file.rg)     */    virtual void slotOpenDroppedURL(QString url);    /**     * Open the document properties dialog on the Audio page     */    virtual void slotOpenAudioPathSettings();    /**     * open a new application window by creating a new instance of     * RosegardenGUIApp     */    void slotFileNewWindow();    /**     * clears the document in the actual view to reuse it as the new     * document     */    void slotFileNew();    /**     * open a file and load it into the document     */    void slotFileOpen();

⌨️ 快捷键说明

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