MuseScore/mscore/musescore.h

793 lines
26 KiB
C
Raw Normal View History

2012-05-26 14:49:10 +02:00
//=============================================================================
// MuseScore
// Music Composition & Notation
// $Id: musescore.h 5657 2012-05-21 15:46:06Z lasconic $
//
// Copyright (C) 2002-2016 Werner Schweer and others
2012-05-26 14:49:10 +02:00
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//=============================================================================
#ifndef __MUSESCORE_H__
#define __MUSESCORE_H__
#include "config.h"
#include "globals.h"
#include "ui_measuresdialog.h"
#include "ui_insertmeasuresdialog.h"
#include "ui_aboutbox.h"
#include "ui_aboutmusicxmlbox.h"
#include "singleapp/src/QtSingleApplication"
#include "updatechecker.h"
// #include "loginmanager.h"
// #include "uploadscoredialog.h"
#include "libmscore/musescoreCore.h"
2016-03-11 12:18:46 +01:00
#include "libmscore/score.h"
#include "newwizard.h"
2012-05-26 14:49:10 +02:00
2013-05-13 18:49:17 +02:00
namespace Ms {
class UploadScoreDialog;
class LoginManager;
2012-05-26 14:49:10 +02:00
class Shortcut;
class ScoreView;
class Element;
class PreferenceDialog;
class InstrumentsDialog;
class Instrument;
class MidiFile;
class TextStyleDialog;
class PlayPanel;
2013-04-03 12:13:23 +02:00
class Mixer;
2012-05-26 14:49:10 +02:00
class Debugger;
class MeasureListEditor;
2016-03-10 10:41:31 +01:00
class MasterScore;
2012-05-26 14:49:10 +02:00
class Score;
class Tuplet;
2012-05-26 14:49:10 +02:00
class PageSettings;
class PaletteBox;
class Palette;
class PaletteScrollArea;
2014-06-02 12:12:53 +02:00
class SelectionWindow;
2016-11-19 11:51:21 +01:00
class XmlWriter;
2012-05-26 14:49:10 +02:00
class MagBox;
class NewWizard;
class ExcerptsDialog;
class SynthControl;
class PianorollEditor;
class DrumrollEditor;
class Staff;
class ScoreTab;
class Drumset;
class TextTools;
class DrumTools;
class ScriptEngine;
class KeyEditor;
class ChordStyleEditor;
class Navigator;
class PianoTools;
class MediaDialog;
2013-02-06 16:43:25 +01:00
class Workspace;
2012-05-26 14:49:10 +02:00
class AlbumManager;
class WebPageDockWidget;
class ChordList;
class Capella;
class Inspector;
class OmrPanel;
class NScrollArea;
class Sym;
class MasterPalette;
2012-07-02 18:05:10 +02:00
class PluginCreator;
class PluginManager;
class MasterSynthesizer;
class SynthesizerState;
class Driver;
class Seq;
2013-04-28 21:29:12 +02:00
class ImportMidiPanel;
2014-11-10 10:05:25 +01:00
class Startcenter;
2015-02-06 16:36:43 +01:00
class HelpBrowser;
2016-05-31 17:44:39 +02:00
class ToolbarEditor;
2012-07-02 18:05:10 +02:00
2012-06-06 14:16:06 +02:00
struct PluginDescription;
enum class SelState : char;
enum class IconType : signed char;
enum class MagIdx : char;
2012-05-26 14:49:10 +02:00
2016-10-07 13:00:49 +02:00
enum class PaletteType { MASTER, ADVANCED, BASIC };
2012-05-26 14:49:10 +02:00
extern QString mscoreGlobalShare;
static const int PROJECT_LIST_LEN = 6;
extern const char* voiceActions[];
2012-05-26 14:49:10 +02:00
//---------------------------------------------------------
// IconActions
//---------------------------------------------------------
struct IconAction {
IconType subtype;
2014-11-14 18:08:02 +01:00
const char* action;
2012-05-26 14:49:10 +02:00
};
//---------------------------------------------------------
// LanguageItem
//---------------------------------------------------------
struct LanguageItem {
QString key;
QString name;
QString handbook;
LanguageItem(const QString k, const QString n) {
key = k;
name = n;
handbook = QString::null;
}
LanguageItem(const QString k, const QString n, const QString h) {
key = k;
name = n;
handbook = h;
}
};
//---------------------------------------------------------
// AboutBoxDialog
//---------------------------------------------------------
class AboutBoxDialog : public QDialog, Ui::AboutBox {
Q_OBJECT
public:
AboutBoxDialog();
2013-05-13 18:49:17 +02:00
private slots:
void copyRevisionToClipboard();
2012-05-26 14:49:10 +02:00
};
//---------------------------------------------------------
// AboutMusicXMLBoxDialog
//---------------------------------------------------------
class AboutMusicXMLBoxDialog : public QDialog, Ui::AboutMusicXMLBox {
Q_OBJECT
public:
AboutMusicXMLBoxDialog();
};
//---------------------------------------------------------
// InsertMeasuresDialog
// Added by DK, 05.08.07
//---------------------------------------------------------
class InsertMeasuresDialog : public QDialog, public Ui::InsertMeasuresDialogBase {
Q_OBJECT
virtual void hideEvent(QHideEvent*);
2012-05-26 14:49:10 +02:00
private slots:
virtual void accept();
public:
InsertMeasuresDialog(QWidget* parent = 0);
};
//---------------------------------------------------------
// MeasuresDialog
//---------------------------------------------------------
class MeasuresDialog : public QDialog, public Ui::MeasuresDialogBase {
Q_OBJECT
private slots:
virtual void accept();
public:
MeasuresDialog(QWidget* parent = 0);
};
//---------------------------------------------------------
// MuseScoreApplication (mac only)
//---------------------------------------------------------
class MuseScoreApplication : public QtSingleApplication {
public:
QStringList paths;
MuseScoreApplication(const QString &id, int &argc, char **argv)
: QtSingleApplication(id, argc, argv) {
};
2015-02-19 19:55:17 +01:00
virtual bool event(QEvent *ev) override;
2012-05-26 14:49:10 +02:00
};
2016-05-31 17:44:39 +02:00
2012-05-26 14:49:10 +02:00
//---------------------------------------------------------
// MuseScore
//---------------------------------------------------------
2012-12-10 09:15:50 +01:00
class MuseScore : public QMainWindow, public MuseScoreCore {
2012-05-26 14:49:10 +02:00
Q_OBJECT
2014-11-13 13:04:04 +01:00
QSettings settings;
ScoreView* cv { 0 };
2012-05-26 14:49:10 +02:00
ScoreState _sstate;
UpdateChecker* ucheck;
2016-05-31 17:44:39 +02:00
static const std::list<const char*> _allNoteInputMenuEntries;
static const std::list<const char*> _basicNoteInputMenuEntries;
static const std::list<const char*> _advancedNoteInputMenuEntries;
std::list<const char*> _noteInputMenuEntries { _allNoteInputMenuEntries };
2012-05-26 14:49:10 +02:00
QVBoxLayout* layout; // main window layout
QSplitter* splitter;
ScoreTab* tab1;
ScoreTab* tab2;
NScrollArea* _navigator;
ImportMidiPanel* importmidiPanel { 0 };
QFrame* importmidiShowPanel;
2012-05-26 14:49:10 +02:00
QSplitter* mainWindow;
MagBox* mag;
QComboBox* viewModeCombo;
QAction* playId;
2016-06-30 15:34:02 +02:00
QAction* pref;
QAction* onlineHandbookAction;
QAction* aboutAction;
QAction* aboutQtAction;
QAction* aboutMusicXMLAction;
2016-07-03 13:03:58 +02:00
QAction* checkForUpdateAction { 0 };
2016-06-30 15:34:02 +02:00
QAction* askForHelpAction;
QAction* reportBugAction;
QAction* revertToFactoryAction;
QProgressBar* _progressBar { 0 };
2014-11-10 10:05:25 +01:00
PreferenceDialog* preferenceDialog { 0 };
2012-05-26 14:49:10 +02:00
QToolBar* cpitchTools;
2016-06-30 15:34:02 +02:00
QToolBar* fotoTools;
2012-05-26 14:49:10 +02:00
QToolBar* fileTools;
QToolBar* transportTools;
QToolBar* entryTools;
2014-11-10 10:05:25 +01:00
TextTools* _textTools { 0 };
PianoTools* _pianoTools { 0 };
MediaDialog* _mediaDialog { 0 };
DrumTools* _drumTools { 0 };
2012-05-26 14:49:10 +02:00
QToolBar* voiceTools;
2014-11-10 10:05:25 +01:00
InstrumentsDialog* instrList { 0 };
MeasuresDialog* measuresDialog { 0 };
InsertMeasuresDialog* insertMeasuresDialog { 0 };
MasterPalette* masterPalette { 0 };
PluginCreator* _pluginCreator { 0 };
PluginManager* pluginManager { 0 };
SelectionWindow* selectionWindow { 0 };
2012-05-26 14:49:10 +02:00
2016-06-30 15:34:02 +02:00
QMenu* menuFile;
QMenu* openRecent;
2012-05-26 14:49:10 +02:00
QMenu* menuEdit;
2016-06-30 15:34:02 +02:00
QMenu* menuView;
QMenu* menuToolbars;
2016-06-30 15:34:02 +02:00
QMenu* menuWorkspaces;
2016-07-03 13:03:58 +02:00
2016-06-30 15:34:02 +02:00
QMenu* menuAdd;
QMenu* menuAddMeasures;
QMenu* menuAddFrames;
QMenu* menuAddText;
QMenu* menuAddLines;
QMenu* menuAddPitch;
QMenu* menuAddInterval;
QMenu* menuTuplet;
2016-07-03 13:03:58 +02:00
QMenu* menuFormat;
2016-06-30 15:34:02 +02:00
QMenu* menuTools;
QMenu* menuVoices;
2016-07-03 13:03:58 +02:00
2016-06-30 15:34:02 +02:00
QMenu* menuPlugins;
QMenu* menuHelp;
AlbumManager* albumManager { 0 };
2012-05-26 14:49:10 +02:00
QWidget* _searchDialog { 0 };
2012-05-26 14:49:10 +02:00
QComboBox* searchCombo;
PlayPanel* playPanel { 0 };
Mixer* mixer { 0 };
SynthControl* synthControl { 0 };
Debugger* debugger { 0 };
MeasureListEditor* measureListEdit { 0 };
PageSettings* pageSettings { 0 };
2012-05-26 14:49:10 +02:00
QWidget* symbolDialog { 0 };
2012-05-26 14:49:10 +02:00
PaletteScrollArea* clefPalette { 0 };
PaletteScrollArea* keyPalette { 0 };
KeyEditor* keyEditor { 0 };
ChordStyleEditor* chordStyleEditor { 0 };
2012-05-26 14:49:10 +02:00
QStatusBar* _statusBar;
QLabel* _modeText;
QLabel* _positionLabel;
2014-11-10 10:05:25 +01:00
NewWizard* newWizard { 0 };
2015-02-06 16:36:43 +01:00
HelpBrowser* helpBrowser { 0 };
QDockWidget* manualDock { 0 };
2012-05-26 14:49:10 +02:00
2014-11-10 10:05:25 +01:00
PaletteBox* paletteBox { 0 };
Inspector* _inspector { 0 };
OmrPanel* omrPanel { 0 };
2016-07-03 13:03:58 +02:00
2016-06-30 15:34:02 +02:00
QPushButton* showMidiImportButton {0};
2012-05-26 14:49:10 +02:00
2014-11-10 10:05:25 +01:00
bool _midiinEnabled { true };
2012-05-26 14:49:10 +02:00
QList<QString> plugins;
2014-11-10 10:05:25 +01:00
ScriptEngine* se { 0 };
2012-05-26 14:49:10 +02:00
QString pluginPath;
2012-06-06 14:16:06 +02:00
void createMenuEntry(PluginDescription*);
void removeMenuEntry(PluginDescription*);
2012-05-26 14:49:10 +02:00
QTimer* autoSaveTimer;
QList<QAction*> pluginActions;
QSignalMapper* pluginMapper { 0 };
2012-05-26 14:49:10 +02:00
PianorollEditor* pianorollEditor { 0 };
DrumrollEditor* drumrollEditor { 0 };
bool _splitScreen { false };
bool _horizontalSplit { true };
2012-05-26 14:49:10 +02:00
QString rev;
int _midiRecordId { -1 };
2012-05-26 14:49:10 +02:00
bool _fullscreen { false };
2012-05-26 14:49:10 +02:00
QList<LanguageItem> _languages;
Startcenter* startcenter { 0 };
QWidget* loginDialog { 0 };
UploadScoreDialog* uploadScoreDialog { 0 };
LoginManager* _loginManager { 0 };
QFileDialog* loadScoreDialog { 0 };
QFileDialog* saveScoreDialog { 0 };
QFileDialog* loadStyleDialog { 0 };
QFileDialog* saveStyleDialog { 0 };
QFileDialog* saveImageDialog { 0 };
QFileDialog* loadChordStyleDialog { 0 };
QFileDialog* saveChordStyleDialog { 0 };
QFileDialog* loadSfzFileDialog { 0 };
QFileDialog* loadBackgroundDialog { 0 };
QFileDialog* loadScanDialog { 0 };
QFileDialog* loadAudioDialog { 0 };
QFileDialog* loadDrumsetDialog { 0 };
QFileDialog* loadPluginDialog { 0 };
QFileDialog* loadPaletteDialog { 0 };
QFileDialog* savePaletteDialog { 0 };
QFileDialog* saveDrumsetDialog { 0 };
QFileDialog* savePluginDialog { 0 };
QDialog* editRasterDialog { 0 };
2012-05-26 14:49:10 +02:00
QAction* hRasterAction;
QAction* vRasterAction;
2016-05-31 17:44:39 +02:00
ToolbarEditor* editToolbars { 0 };
QActionGroup* workspaces { 0 };
2012-05-26 14:49:10 +02:00
bool inChordEditor { false };
2012-05-26 14:49:10 +02:00
QComboBox* layerSwitch;
QComboBox* playMode;
QNetworkAccessManager* _networkManager { 0 };
QAction* lastCmd { 0 };
const Shortcut* lastShortcut { 0 };
QHelpEngine* _helpEngine { 0 };
2015-02-19 19:55:17 +01:00
int globalX, globalY; // current mouse position
2012-05-26 14:49:10 +02:00
QAction* countInAction;
2012-05-26 14:49:10 +02:00
QAction* metronomeAction;
2013-07-31 19:47:33 +02:00
QAction* loopAction;
2013-08-19 08:53:30 +02:00
QAction* loopInAction;
QAction* loopOutAction;
2012-05-26 14:49:10 +02:00
QAction* panAction;
QLabel* cornerLabel;
QStringList _recentScores;
QToolButton* _playButton;
2012-05-26 14:49:10 +02:00
2015-11-16 14:24:47 +01:00
qreal _physicalDotsPerInch;
2012-05-26 14:49:10 +02:00
//---------------------
virtual void closeEvent(QCloseEvent*);
virtual void dragEnterEvent(QDragEnterEvent*);
virtual void dropEvent(QDropEvent*);
2016-06-30 15:34:02 +02:00
virtual void changeEvent(QEvent *e);
void retranslate(bool firstStart = false);
2012-05-26 14:49:10 +02:00
void playVisible(bool flag);
void launchBrowser(const QString whereTo);
void loadScoreList();
void editInstrList();
void symbolMenu();
void showKeyEditor();
2013-07-19 11:23:44 +02:00
bool saveFile();
2016-10-10 18:37:28 +02:00
bool saveFile(MasterScore* score);
2012-05-26 14:49:10 +02:00
void fingeringMenu();
2014-09-06 10:23:37 +02:00
2012-05-26 14:49:10 +02:00
int pluginIdxFromPath(QString pluginPath);
void startDebugger();
void midiinToggled(bool);
void undoRedo(bool undo);
2012-05-26 14:49:10 +02:00
void showPalette(bool);
void showInspector(bool);
void showOmrPanel(bool);
void showNavigator(bool);
2014-06-02 12:12:53 +02:00
void showSelectionWindow(bool);
void showSearchDialog();
2016-05-31 17:44:39 +02:00
void showToolbarEditor();
2012-05-26 14:49:10 +02:00
void splitWindow(bool horizontal);
void removeSessionFile();
void editChordStyle();
void startExcerptsDialog();
void initOsc();
void editRaster();
void showPianoKeyboard(bool);
void showMediaDialog();
void showAlbumManager();
void showLayerManager();
void updateUndoRedo();
void changeScore(int);
virtual void resizeEvent(QResizeEvent*);
void showModeText(const QString&);
void addRecentScore(const QString& scorePath);
2012-05-26 14:49:10 +02:00
void updateViewModeCombo();
2016-05-18 15:43:47 +02:00
void switchLayoutMode(LayoutMode);
2012-05-26 14:49:10 +02:00
private slots:
2012-06-08 19:06:52 +02:00
void cmd(QAction* a, const QString& cmd);
2012-05-26 14:49:10 +02:00
void autoSaveTimerTimeout();
void helpBrowser1() const;
void resetAndRestart();
2012-05-26 14:49:10 +02:00
void about();
void aboutQt();
void aboutMusicXML();
void reportBug();
void askForHelp();
2012-05-26 14:49:10 +02:00
void openRecentMenu();
void selectScore(QAction*);
void startPreferenceDialog();
void preferencesChanged();
void seqStarted();
void seqStopped();
void cmdAppendMeasures();
void cmdInsertMeasures();
2015-11-23 16:02:33 +01:00
void magChanged(MagIdx);
2012-05-26 14:49:10 +02:00
void showPageSettings();
void removeTab(int);
void removeTab();
void clipboardChanged();
void inputMethodLocaleChanged();
2012-05-26 14:49:10 +02:00
void endSearch();
void saveScoreDialogFilterSelected(const QString&);
#ifdef OSC
void oscIntMessage(int);
void oscVolume(int val);
void oscTempo(int val);
void oscGoto(int m);
void oscSelectMeasure(int m);
void oscVolChannel(double val);
void oscPanChannel(double val);
void oscMuteChannel(double val);
void oscOpen(QString path);
void oscCloseAll();
void oscTriggerPlugin(QString list);
void oscColorNote(QVariantList list);
2014-03-26 23:28:26 +01:00
void oscAction();
2012-05-26 14:49:10 +02:00
#endif
2013-02-06 16:43:25 +01:00
void deleteWorkspace();
2013-02-08 11:36:50 +01:00
void undoWorkspace();
2013-02-06 16:43:25 +01:00
void showWorkspaceMenu();
2012-05-26 14:49:10 +02:00
void switchLayer(const QString&);
void switchPlayMode(int);
void networkFinished(QNetworkReply*);
void switchLayoutMode(int);
void showMidiImportPanel();
2014-10-14 15:25:55 +02:00
void changeWorkspace(QAction*);
virtual QMenu* createPopupMenu() override;
2012-05-26 14:49:10 +02:00
public slots:
2012-12-10 09:15:50 +01:00
virtual void cmd(QAction* a);
2012-05-26 14:49:10 +02:00
void dirtyChanged(Score*);
void setPos(int tick);
void pluginTriggered(int);
void handleMessage(const QString& message);
void setCurrentScoreView(ScoreView*);
void setCurrentScoreView(int);
void setNormalState() { changeState(STATE_NORMAL); }
void setPlayState() { changeState(STATE_PLAY); }
2016-08-08 17:45:45 +02:00
void setNoteEntryState() { changeState(STATE_NOTE_ENTRY); }
2012-05-26 14:49:10 +02:00
void checkForUpdate();
void midiNoteReceived(int channel, int pitch, int velo);
void midiNoteReceived(int pitch, bool ctrl, int velo);
2012-05-26 14:49:10 +02:00
void instrumentChanged();
2013-02-07 17:34:44 +01:00
void showMasterPalette(const QString& = 0);
void selectionChanged(SelState);
2014-10-14 15:25:55 +02:00
void createNewWorkspace();
void changeWorkspace(Workspace* p);
void mixerPreferencesChanged(bool showMidiControls);
2012-05-26 14:49:10 +02:00
public:
MuseScore();
~MuseScore();
2016-10-10 18:37:28 +02:00
bool checkDirty(MasterScore*);
2012-05-26 14:49:10 +02:00
PlayPanel* getPlayPanel() const { return playPanel; }
Mixer* getMixer() const { return mixer; }
2012-05-26 14:49:10 +02:00
QMenu* genCreateMenu(QWidget* parent = 0);
2016-03-11 12:18:46 +01:00
virtual int appendScore(MasterScore*);
2012-05-26 14:49:10 +02:00
void midiCtrlReceived(int controller, int value);
void showElementContext(Element* el);
2012-06-08 19:06:52 +02:00
void cmdAppendMeasures(int);
2012-05-26 14:49:10 +02:00
bool midiinEnabled() const;
void incMag();
void decMag();
void readSettings();
void writeSettings();
void play(Element* e) const;
void play(Element* e, int pitch) const;
bool loadPlugin(const QString& filename);
QString createDefaultName() const;
void startAutoSave();
double getMag(ScoreView*) const;
void setMag(double);
bool noScore() const { return scoreList.isEmpty(); }
TextTools* textTools();
void showDrumTools(const Drumset*, Staff*);
2015-03-17 11:50:59 +01:00
void updateDrumTools(const Drumset* ds);
2012-07-02 18:05:10 +02:00
void showPluginCreator(QAction*);
2014-09-01 22:35:04 +02:00
void showPluginManager();
2012-05-26 14:49:10 +02:00
2016-10-10 18:37:28 +02:00
// void updateTabNames();
2012-05-26 14:49:10 +02:00
QProgressBar* showProgressBar();
void hideProgressBar();
void addRecentScore(Score*);
2012-05-26 14:49:10 +02:00
QFileDialog* saveAsDialog();
QFileDialog* saveCopyDialog();
QString lastSaveCopyDirectory;
QString lastSaveCopyFormat;
2012-05-26 14:49:10 +02:00
QString lastSaveDirectory;
QString lastSaveCaptureName;
SynthControl* getSynthControl() const { return synthControl; }
2012-05-26 14:49:10 +02:00
void editInPianoroll(Staff* staff);
void editInDrumroll(Staff* staff);
PianorollEditor* getPianorollEditor() const { return pianorollEditor; }
DrumrollEditor* getDrumrollEditor() const { return drumrollEditor; }
PianoTools* pianoTools() const { return _pianoTools; }
2012-05-26 14:49:10 +02:00
void writeSessionFile(bool);
bool restoreSession(bool);
bool splitScreen() const { return _splitScreen; }
2012-12-10 09:15:50 +01:00
virtual void setCurrentView(int tabIdx, int idx);
2012-05-26 14:49:10 +02:00
void loadPlugins();
void unloadPlugins();
2013-02-15 22:39:56 +01:00
2012-05-26 14:49:10 +02:00
ScoreState state() const { return _sstate; }
void changeState(ScoreState);
2013-02-15 22:39:56 +01:00
void updateInputState(Score*);
void updateShadowNote();
2013-02-15 22:39:56 +01:00
2012-05-26 14:49:10 +02:00
bool readLanguages(const QString& path);
2013-02-15 22:39:56 +01:00
void setRevision(QString& r) {rev = r;}
2013-02-21 23:07:43 +01:00
Q_INVOKABLE QString revision() {return rev;}
Q_INVOKABLE QString version() {return VERSION;}
2012-05-26 14:49:10 +02:00
Q_INVOKABLE void newFile();
2017-02-28 14:26:19 +01:00
MasterScore* getNewFile();
2012-05-26 14:49:10 +02:00
Q_INVOKABLE void loadFile(const QString& url);
void loadFile(const QUrl&);
QNetworkAccessManager* networkManager();
2012-12-10 09:15:50 +01:00
virtual Score* openScore(const QString& fn);
2012-05-26 14:49:10 +02:00
bool hasToCheckForUpdate();
static bool unstable();
bool eventFilter(QObject *, QEvent *);
void setMidiRecordId(int id) { _midiRecordId = id; }
int midiRecordId() const { return _midiRecordId; }
void setAdvancedPalette();
void setBasicPalette();
void scorePageLayoutChanged();
bool processMidiRemote(MidiRemoteType type, int data, int value);
2012-05-26 14:49:10 +02:00
ScoreTab* getTab1() const { return tab1; }
ScoreTab* getTab2() const { return tab2; }
QList<LanguageItem>& languages() { return _languages; }
QStringList getOpenScoreNames(const QString& filter, const QString& title);
2013-05-13 10:27:06 +02:00
QString getSaveScoreName(const QString& title, QString& name, const QString& filter, bool folder = false);
2012-05-26 14:49:10 +02:00
QString getStyleFilename(bool open, const QString& title = QString());
QString getFotoFilename(QString& filter, QString *selectedFilter);
2012-05-26 14:49:10 +02:00
QString getChordStyleFilename(bool open);
QString getScanFile(const QString&);
QString getAudioFile(const QString&);
QString getDrumsetFilename(bool open);
2012-07-02 18:05:10 +02:00
QString getPluginFilename(bool open);
QString getPaletteFilename(bool open, const QString& name = "");
2012-05-26 14:49:10 +02:00
QString getWallpaper(const QString& caption);
bool hRaster() const { return hRasterAction->isChecked(); }
bool vRaster() const { return vRasterAction->isChecked(); }
PaletteBox* getPaletteBox();
void disableCommands(bool val) { inChordEditor = val; }
Tuplet* tupletDialog();
2012-05-26 14:49:10 +02:00
void selectSimilar(Element*, bool);
2014-07-14 13:24:47 +02:00
void selectSimilarInRange(Element* e);
2012-05-26 14:49:10 +02:00
void selectElementDialog(Element* e);
void transpose();
Q_INVOKABLE void openExternalLink(const QString&);
virtual void endCmd() override;
2012-05-26 14:49:10 +02:00
void printFile();
void exportFile();
2012-05-26 14:49:10 +02:00
bool exportParts();
virtual bool saveAs(Score*, bool saveCopy, const QString& path, const QString& ext);
bool savePdf(const QString& saveName);
bool savePdf(Score* cs, const QString& saveName);
bool savePdf(QList<Score*> cs, const QString& saveName);
2014-10-14 14:37:38 +02:00
2012-09-29 16:46:45 +02:00
2016-03-10 10:41:31 +01:00
MasterScore* readScore(const QString& name);
2012-09-29 16:46:45 +02:00
2012-05-26 14:49:10 +02:00
bool saveAs(Score*, bool saveCopy = false);
bool saveSelection(Score*);
void addImage(Score*, Element*);
2012-09-29 16:46:45 +02:00
bool savePng(Score*, const QString& name, bool screenshot, bool transparent, double convDpi, int trimMargin, QImage::Format format);
bool saveAudio(Score*, QIODevice *device, std::function<bool(float)> updateProgress = nullptr);
2014-11-14 11:44:48 +01:00
bool saveAudio(Score*, const QString& name);
2012-05-26 14:49:10 +02:00
bool saveMp3(Score*, const QString& name);
bool saveSvg(Score*, const QString& name);
bool savePng(Score*, const QString& name);
bool saveMidi(Score* score, const QString& name);
2012-05-26 14:49:10 +02:00
virtual void closeScore(Score* score);
2012-05-26 14:49:10 +02:00
void addTempo();
void addMetronome();
SynthesizerState synthesizerState();
Q_INVOKABLE QString getLocaleISOCode() const;
2012-05-26 14:49:10 +02:00
Navigator* navigator() const;
NScrollArea* navigatorScrollArea() const { return _navigator; }
QWidget* searchDialog() const;
2015-02-03 01:55:16 +01:00
SelectionWindow* getSelectionWindow() const { return selectionWindow; }
2012-05-26 14:49:10 +02:00
void updateLayer();
void updatePlayMode();
2014-05-30 13:35:44 +02:00
bool loop() const { return loopAction->isChecked(); }
2012-05-26 14:49:10 +02:00
bool metronome() const { return metronomeAction->isChecked(); }
bool countIn() const { return countInAction->isChecked(); }
2012-05-26 14:49:10 +02:00
bool panDuringPlayback() const { return panAction->isChecked(); }
void noteTooShortForTupletDialog();
void loadFiles();
2013-07-23 13:05:19 +02:00
// midi panel functions
void midiPanelOnSwitchToFile(const QString &file);
void midiPanelOnCloseFile(const QString &file);
void allowShowMidiPanel(const QString &file);
2014-07-29 21:58:36 +02:00
void setMidiReopenInProgress(const QString &file);
2012-05-26 14:49:10 +02:00
2016-10-07 13:00:49 +02:00
static Palette* newTempoPalette(PaletteType);
2012-05-26 14:49:10 +02:00
static Palette* newTextPalette();
static Palette* newTimePalette();
2012-05-26 14:49:10 +02:00
static Palette* newRepeatsPalette();
static Palette* newBreaksPalette();
2016-10-07 13:00:49 +02:00
static Palette* newBeamPalette(PaletteType);
static Palette* newDynamicsPalette(PaletteType);
2012-05-26 14:49:10 +02:00
static Palette* newFramePalette();
static Palette* newFingeringPalette();
static Palette* newTremoloPalette();
static Palette* newNoteHeadsPalette();
2016-10-07 13:00:49 +02:00
static Palette* newArticulationsPalette(PaletteType);
2016-10-06 14:58:19 +02:00
static Palette* newOrnamentsPalette();
static Palette* newAccordionPalette();
2012-05-26 14:49:10 +02:00
static Palette* newBracketsPalette();
static Palette* newBreathPalette();
static Palette* newArpeggioPalette();
2016-10-07 13:00:49 +02:00
static Palette* newClefsPalette(PaletteType);
static Palette* newGraceNotePalette(PaletteType);
2013-08-01 22:24:36 +02:00
static Palette* newBagpipeEmbellishmentPalette();
2016-10-07 13:00:49 +02:00
static Palette* newKeySigPalette(PaletteType);
static Palette* newAccidentalsPalette(PaletteType);
static Palette* newBarLinePalette(PaletteType);
static Palette* newLinesPalette(PaletteType);
static Palette* newFretboardDiagramPalette();
2014-08-29 19:18:39 +02:00
Inspector* inspector() { return _inspector; }
PluginCreator* pluginCreator() { return _pluginCreator; }
2012-12-10 09:15:50 +01:00
ScoreView* currentScoreView() const { return cv; }
QToolButton* playButton() { return _playButton; }
2013-05-24 18:40:15 +02:00
void showMessage(const QString& s, int timeout);
2015-02-06 16:36:43 +01:00
void showHelp(QString);
2015-02-19 19:55:17 +01:00
void showContextHelp();
2015-02-06 16:36:43 +01:00
void showHelp(const QUrl&);
2014-09-06 10:23:37 +02:00
void registerPlugin(PluginDescription*);
void unregisterPlugin(PluginDescription*);
2014-11-10 10:05:25 +01:00
Q_INVOKABLE void showStartcenter(bool);
void showPlayPanel(bool);
QFileInfoList recentScores() const;
2014-11-13 13:04:04 +01:00
void saveDialogState(const char* name, QFileDialog* d);
void restoreDialogState(const char* name, QFileDialog* d);
2014-11-14 13:17:56 +01:00
QPixmap extractThumbnail(const QString& name);
void showLoginDialog();
void showUploadScoreDialog();
LoginManager* loginManager() { return _loginManager; }
QHelpEngine* helpEngine() const { return _helpEngine; }
2015-01-05 10:50:47 +01:00
void updateInspector();
2015-09-08 17:14:02 +02:00
void showSynthControl(bool);
void showMixer(bool);
2015-11-16 14:24:47 +01:00
2016-05-31 17:44:39 +02:00
qreal physicalDotsPerInch() const { return _physicalDotsPerInch; }
static const std::list<const char*>& allNoteInputMenuEntries() { return _allNoteInputMenuEntries; }
static const std::list<const char*>& basicNoteInputMenuEntries() { return _basicNoteInputMenuEntries; }
static const std::list<const char*>& advancedNoteInputMenuEntries() { return _advancedNoteInputMenuEntries; }
std::list<const char*>* noteInputMenuEntries() { return &_noteInputMenuEntries; }
void setNoteInputMenuEntries(std::list<const char*> l) { _noteInputMenuEntries = l; }
2016-05-31 17:44:39 +02:00
void populateNoteInputMenu();
void showError();
static void saveGeometry(QWidget const*const qw);
static void restoreGeometry(QWidget*const qw);
2013-05-24 18:40:15 +02:00
};
2012-05-26 14:49:10 +02:00
extern MuseScore* mscore;
extern QStringList recentScores;
2012-05-26 14:49:10 +02:00
extern QString dataPath;
extern MasterSynthesizer* synti;
MasterSynthesizer* synthesizerFactory();
Driver* driverFactory(Seq*, QString driver);
2012-05-26 14:49:10 +02:00
2014-11-14 18:08:02 +01:00
extern QAction* getAction(const char*);
2012-05-26 14:49:10 +02:00
extern Shortcut* midiActionMap[128];
extern void loadTranslation(QString fileName, QString localeName);
2012-05-26 14:49:10 +02:00
extern void setMscoreLocale(QString localeName);
2012-09-27 21:34:36 +02:00
extern bool saveMxl(Score*, const QString& name);
extern bool saveXml(Score*, const QString& name);
2013-05-13 18:49:17 +02:00
2014-04-25 18:43:25 +02:00
struct PluginDescription;
extern void collectPluginMetaInformation(PluginDescription*);
2015-02-02 09:30:17 +01:00
extern QString getSharePath();
2016-03-11 12:18:46 +01:00
extern Score::FileError importMidi(MasterScore*, const QString& name);
extern Score::FileError importGTP(MasterScore*, const QString& name);
extern Score::FileError importBww(MasterScore*, const QString& path);
extern Score::FileError importMusicXml(MasterScore*, const QString&);
extern Score::FileError importCompressedMusicXml(MasterScore*, const QString&);
extern Score::FileError importMuseData(MasterScore*, const QString& name);
extern Score::FileError importLilypond(MasterScore*, const QString& name);
extern Score::FileError importBB(MasterScore*, const QString& name);
extern Score::FileError importCapella(MasterScore*, const QString& name);
extern Score::FileError importCapXml(MasterScore*, const QString& name);
extern Score::FileError readScore(MasterScore* score, QString name, bool ignoreVersionError);
2013-05-13 18:49:17 +02:00
} // namespace Ms
2016-03-11 12:18:46 +01:00
extern Ms::Score::FileError importOve(Ms::MasterScore*, const QString& name);
2012-05-26 14:49:10 +02:00
#endif