diff options
author | Robert Jonsson <spamatica@gmail.com> | 2010-10-13 19:34:22 +0000 |
---|---|---|
committer | Robert Jonsson <spamatica@gmail.com> | 2010-10-13 19:34:22 +0000 |
commit | 8a2c2824a59d7644e13bc52c9a0ecbd641f21f95 (patch) | |
tree | 064ad3f2bf8daab0ad27b128abd86a9bbdb1e496 /muse2/muse/app.h | |
parent | a27706d9629e8b592cca4659f865b70adef24e6d (diff) |
new branch muse2, first checkin
Diffstat (limited to 'muse2/muse/app.h')
-rw-r--r-- | muse2/muse/app.h | 327 |
1 files changed, 327 insertions, 0 deletions
diff --git a/muse2/muse/app.h b/muse2/muse/app.h new file mode 100644 index 00000000..3e0d36a6 --- /dev/null +++ b/muse2/muse/app.h @@ -0,0 +1,327 @@ +//========================================================= +// MusE +// Linux Music Editor +// $Id: app.h,v 1.34.2.14 2009/11/16 11:29:33 lunar_shuttle Exp $ +// +// (C) Copyright 1999-2004 Werner Schweer (ws@seh.de) +//========================================================= + +#ifndef __APP_H__ +#define __APP_H__ + +#include "config.h" + +#include <q3mainwindow.h> +#include <qrect.h> +//Added by qt3to4: +#include <Qt3Support> +#include <Q3PopupMenu> +#include <QFocusEvent> +#include <QCloseEvent> +#include "cobject.h" +#include "tools.h" +#include <qfileinfo.h> + +class Part; +class PartList; +class Q3ToolBar; +class Q3PopupMenu; +class Transport; +class BigTime; +class Arranger; +class Instrument; +class Q3ListView; +class Q3ListViewItem; +class QPoint; +class QToolButton; +class PopupMenu; +class Track; +class PrinterConfig; +class MidiSyncConfig; +class MRConfig; +class MetronomeConfig; +class AudioConf; +class Xml; +class AudioMixerApp; +class ClipListEdit; +class AudioRecord; +class MidiFileConfig; +class MidiFilterConfig; +class MarkerView; +class GlobalSettingsConfig; +class MidiControllerEditDialog; +class MidiInputTransformDialog; +class MidiTransformerDialog; +class SynthI; +class RhythmGen; +class MidiTrack; +class MidiInstrument; +class MidiPort; +class ShortcutConfig; +class Appearance; +class WaveTrack; +class AudioOutput; +class EditInstrument; + +#define MENU_ADD_SYNTH_ID_BASE 0x1000 + +//--------------------------------------------------------- +// MusE +//--------------------------------------------------------- + +class MusE : public Q3MainWindow + { + Q_OBJECT + enum {CMD_CUT, CMD_COPY, CMD_PASTE, CMD_INSERT, CMD_INSERTMEAS, CMD_PASTE_CLONE, + CMD_PASTE_TO_TRACK, CMD_PASTE_CLONE_TO_TRACK, CMD_DELETE, + CMD_SELECT_ALL, CMD_SELECT_NONE, CMD_SELECT_INVERT, + CMD_SELECT_ILOOP, CMD_SELECT_OLOOP, CMD_SELECT_PARTS, + CMD_FOLLOW_NO, CMD_FOLLOW_JUMP, CMD_FOLLOW_CONTINUOUS , + CMD_DELETE_TRACK + }; + + //File menu items: + enum { CMD_OPEN_RECENT=0, CMD_LOAD_TEMPLATE, CMD_SAVE_AS, CMD_IMPORT_MIDI, + CMD_EXPORT_MIDI, CMD_IMPORT_PART, CMD_IMPORT_AUDIO, CMD_QUIT, CMD_OPEN_DRUMS, CMD_OPEN_WAVE, + CMD_OPEN_LIST, CMD_OPEN_LIST_MASTER, CMD_GLOBAL_CONFIG, + CMD_OPEN_GRAPHIC_MASTER, CMD_OPEN_MIDI_TRANSFORM, CMD_TRANSPOSE, + CMD_GLOBAL_CUT, CMD_GLOBAL_INSERT, CMD_GLOBAL_SPLIT, CMD_COPY_RANGE, + CMD_CUT_EVENTS, CMD_CONFIG_SHORTCUTS, CMD_CONFIG_METRONOME, CMD_CONFIG_MIDISYNC, + CMD_MIDI_FILE_CONFIG, CMD_APPEARANCE_SETTINGS, CMD_CONFIG_MIDI_PORTS, CMD_CONFIG_AUDIO_PORTS, + CMD_MIDI_EDIT_INSTRUMENTS, CMD_MIDI_RESET, CMD_MIDI_INIT, CMD_MIDI_LOCAL_OFF, + CMD_MIXER_SNAPSHOT, CMD_MIXER_AUTOMATION_CLEAR, CMD_OPEN_HELP, CMD_OPEN_HOMEPAGE, + CMD_OPEN_BUG, CMD_START_WHATSTHIS, + CMD_AUDIO_BOUNCE_TO_FILE, CMD_AUDIO_BOUNCE_TO_TRACK, CMD_AUDIO_RESTART, + CMD_LAST }; + + int menu_ids[CMD_LAST]; + Q3Action *fileSaveAction, *fileOpenAction, *pianoAction, *fileNewAction, /* *markerAction,*/ *testAction; + QString appName; + + QFileInfo project; + Q3ToolBar *tools; + EditToolBar *tools1; + + Transport* transport; + BigTime* bigtime; + EditInstrument* editInstrument; + + Q3PopupMenu *menu_file, *menuView, *menuSettings, *menu_help; + Q3PopupMenu *menuEdit, *menuStructure; + Q3PopupMenu* menu_audio, *menuAutomation; + Q3PopupMenu* menu_functions, *menuScriptPlugins; + Q3PopupMenu* select, *master, *midiEdit, *addTrack; + + // Special 'stay-open' menu for routes. + PopupMenu* routingPopupMenu; + + int aid1a, aid1b, aid2, aid3, autoId; + int tr_id, bt_id, mr_id; + int cc_id; + Q3PopupMenu* follow; + int fid0, fid1, fid2; + Q3PopupMenu* midiInputPlugins; + int mpid0, mpid1, mpid2, mpid3, mpid4; + + QWidget* midiPortConfig; + QWidget* softSynthesizerConfig; + MidiSyncConfig* midiSyncConfig; + MRConfig* midiRemoteConfig; + RhythmGen* midiRhythmGenerator; + MetronomeConfig* metronomeConfig; + AudioConf* audioConfig; + MidiFileConfig* midiFileConfig; + GlobalSettingsConfig* globalSettingsConfig; + MidiFilterConfig* midiFilterConfig; + MidiInputTransformDialog* midiInputTransform; + ShortcutConfig* shortcutConfig; + Appearance* appearance; + AudioMixerApp* mixer1; + AudioMixerApp* mixer2; + + ToplevelList toplevels; + ClipListEdit* clipListEdit; + MarkerView* markerView; + MidiTransformerDialog* midiTransformerDialog; + Q3PopupMenu* openRecent; + + bool readMidi(FILE*); + void read(Xml& xml, bool skipConfig); + void processTrack(MidiTrack* track); + + void write(Xml& xml) const; + bool clearSong(); + bool save(const QString&, bool); + void setUntitledProject(); + void setConfigDefaults(); + + void setFollow(); + void readConfigParts(Xml& xml); + void readMidiport(Xml& xml); + void readMidichannel(Xml& xml, int port); + void readCtrl(Xml& xml, int port, int channel); + void readToplevels(Xml& xml); + PartList* getMidiPartsToEdit(); + Part* readPart(Xml& xml); + bool checkRegionNotNull(); + void loadProjectFile1(const QString&, bool songTemplate, bool loadAll); + void writeGlobalConfiguration(int level, Xml&) const; + void writeConfiguration(int level, Xml&) const; + void updateConfiguration(); + + virtual void focusInEvent(QFocusEvent*); + + signals: + void configChanged(); + + private slots: + //void runPythonScript(); + void loadProject(); + bool save(); + void configGlobalSettings(); + void quitDoc(); + void about(); + void aboutQt(); + void startHelpBrowser(); + void startHomepageBrowser(); + void startBugBrowser(); + void launchBrowser(QString &whereTo); + void importMidi(); + void importWave(); + void importPart(); + void exportMidi(); + + void toggleTransport(); + void toggleMarker(); + void toggleBigTime(); + //void toggleMixer(); + void toggleMixer1(); + void toggleMixer2(); + + void configMidiPorts(); + void configMidiSync(); + void configMidiFile(); + void configShortCuts(); + void configMetronome(); + void configAppearance(); + void startEditor(PartList*, int); + void startMasterEditor(); + void startLMasterEditor(); + void startListEditor(); + void startListEditor(PartList*); + void startDrumEditor(); + void startDrumEditor(PartList*); + void startEditor(Track*); + void startPianoroll(); + void startPianoroll(PartList* pl); + void startWaveEditor(); + void startWaveEditor(PartList*); + void startSongInfo(bool editable=true); + + void startMidiTransformer(); + void writeGlobalConfiguration() const; + void startEditInstrument(); + void startClipList(); + + void openRecentMenu(); + void selectProject(int id); + void cmd(int); + void clipboardChanged(); + void selectionChanged(); + void transpose(); + void modifyGateTime(); + void modifyVelocity(); + void crescendo(); + void thinOut(); + void eraseEvent(); + void noteShift(); + void moveClock(); + void copyMeasure(); + void eraseMeasure(); + void deleteMeasure(); + void createMeasure(); + void mixTrack(); + void startMidiInputPlugin(int); + void hideMitPluginTranspose(); + void hideMidiInputTransform(); + void hideMidiFilterConfig(); + void hideMidiRemoteConfig(); + void hideMidiRhythmGenerator(); + void globalCut(); + void globalInsert(); + void globalSplit(); + void copyRange(); + void cutEvents(); + void bounceToTrack(); + void resetMidiDevices(); + void initMidiDevices(); + void localOff(); + void switchMixerAutomation(); + void takeAutomationSnapshot(); + void clearAutomation(); + void bigtimeClosed(); + //void mixerClosed(); + void mixer1Closed(); + void mixer2Closed(); + void markerClosed(); + + void execDeliveredScript(int); + void execUserScript(int); + + public slots: + bool saveAs(); + void bounceToFile(AudioOutput* ao = 0); + void closeEvent(QCloseEvent*e); + void loadProjectFile(const QString&); + void loadProjectFile(const QString&, bool songTemplate, bool loadAll); + void toplevelDeleted(unsigned long tl); + void loadTheme(QString); + bool seqRestart(); + void loadTemplate(); + void showBigtime(bool); + //void showMixer(bool); + void showMixer1(bool); + void showMixer2(bool); + void showMarker(bool); + void importMidi(const QString &file); + void setUsedTool(int); + void showDidYouKnowDialog(); + + void routingPopupMenuAboutToHide(); + + public: + MusE(int argc, char** argv); + Arranger* arranger; + QRect configGeometryMain; + bool importMidi(const QString name, bool merge); + void kbAccel(int); + void changeConfig(bool writeFlag); + + void seqStop(); + bool seqStart(); + void setHeartBeat(); + void importController(int, MidiPort*, int); + //QWidget* mixerWindow(); + QWidget* mixer1Window(); + QWidget* mixer2Window(); + QWidget* transportWindow(); + QWidget* bigtimeWindow(); + bool importWaveToTrack(QString& name, unsigned tick=0, Track* track=NULL); + void importPartToTrack(QString& filename, unsigned tick, Track* track); + + void showTransport(bool flag); + + // Special 'stay-open' menu for routes. + PopupMenu* getRoutingPopupMenu(); + PopupMenu* prepareRoutingPopupMenu(Track* /*track*/, bool /*dst*/); + void routingPopupMenuActivated(Track* /*track*/, int /*id*/); + void updateRouteMenus(Track* /*track*/, QObject* /*master*/); + +#ifdef HAVE_LASH + void lash_idle_cb (); +#endif + }; + +extern void addProject(const QString& name); +#endif + |