MuseScore/mscore/preferences.h

214 lines
5.2 KiB
C
Raw Normal View History

2012-05-26 14:49:10 +02:00
//=============================================================================
// MusE Score
// Linux Music Score Editor
// $Id: preferences.h 5660 2012-05-22 14:17:39Z wschweer $
//
2016-06-30 15:34:02 +02:00
// 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 __PREFERENCES_H__
#define __PREFERENCES_H__
#include "globals.h"
2012-06-06 14:16:06 +02:00
#include "shortcut.h"
#include "mscore/importmidi/importmidi_operations.h"
2012-05-26 14:49:10 +02:00
2013-05-13 18:49:17 +02:00
namespace Ms {
extern QString mscoreGlobalShare;
2014-07-01 14:44:45 +02:00
enum class SessionStart : char {
EMPTY, LAST, NEW, SCORE
2012-05-26 14:49:10 +02:00
};
// midi remote control values:
enum {
RMIDI_REWIND,
RMIDI_TOGGLE_PLAY,
RMIDI_PLAY,
RMIDI_STOP,
RMIDI_NOTE1,
RMIDI_NOTE2,
RMIDI_NOTE4,
RMIDI_NOTE8,
RMIDI_NOTE16,
RMIDI_NOTE32,
RMIDI_NOTE64,
RMIDI_REST,
RMIDI_DOT,
RMIDI_DOTDOT,
RMIDI_TIE,
RMIDI_UNDO,
2012-05-26 14:49:10 +02:00
RMIDI_NOTE_EDIT_MODE,
2016-08-08 17:46:43 +02:00
RMIDI_REALTIME_ADVANCE,
2012-05-26 14:49:10 +02:00
MIDI_REMOTES
};
enum class MuseScoreStyleType : char {
DARK,
LIGHT
2012-05-26 14:49:10 +02:00
};
// MusicXML export break values
enum class MusicxmlExportBreaks : char {
ALL, MANUAL, NO
2012-05-26 14:49:10 +02:00
};
//---------------------------------------------------------
// PluginDescription
//---------------------------------------------------------
struct PluginDescription {
QString path;
QString version;
QString description;
2012-05-26 14:49:10 +02:00
bool load;
2012-06-06 14:16:06 +02:00
Shortcut shortcut;
QString menuPath;
2012-05-26 14:49:10 +02:00
};
//---------------------------------------------------------
// Preferences
//---------------------------------------------------------
struct Preferences {
bool bgUseColor;
bool fgUseColor;
QString bgWallpaper;
QString fgWallpaper;
QColor fgColor;
int iconHeight, iconWidth;
QColor dropColor;
QColor pianoHlColor;
2012-05-26 14:49:10 +02:00
bool enableMidiInput;
int realtimeDelay;
2012-05-26 14:49:10 +02:00
bool playNotes; // play notes on click
bool playChordOnAddNote;
2012-05-26 14:49:10 +02:00
bool showNavigator;
bool showPlayPanel;
bool showStatusBar;
bool useAlsaAudio;
bool useJackAudio;
bool usePortaudioAudio;
bool usePulseAudio;
bool useJackMidi;
bool useJackTransport;
bool jackTimebaseMaster;
2014-07-05 20:59:24 +02:00
bool rememberLastConnections;
2012-05-26 14:49:10 +02:00
QString alsaDevice;
int alsaSampleRate;
int alsaPeriodSize;
int alsaFragments;
int portaudioDevice;
QString portMidiInput;
bool antialiasedDrawing;
SessionStart sessionStart;
QString startScore;
QString defaultStyleFile;
bool showSplashScreen;
2014-11-10 10:05:25 +01:00
bool showStartcenter;
2012-05-26 14:49:10 +02:00
bool useMidiRemote;
MidiRemote midiRemote[MIDI_REMOTES];
bool advanceOnRelease;
2012-05-26 14:49:10 +02:00
bool midiExpandRepeats;
2015-06-02 20:05:44 +02:00
bool midiExportRPNs;
QString instrumentList1; // file path of instrument templates
QString instrumentList2;
2012-05-26 14:49:10 +02:00
bool musicxmlImportLayout;
bool musicxmlImportBreaks;
bool musicxmlExportLayout;
MusicxmlExportBreaks musicxmlExportBreaks;
bool alternateNoteEntryMethod;
int proximity; // proximity for selecting elements on canvas
bool autoSave;
int autoSaveTime;
double pngResolution;
bool pngTransparent;
QString language;
double mag;
bool showMidiControls;
2012-05-26 14:49:10 +02:00
//update
2015-03-09 17:20:23 +01:00
bool checkUpdateStartup;
2012-05-26 14:49:10 +02:00
bool followSong;
QString importCharsetOve;
QString importCharsetGP;
2012-05-26 14:49:10 +02:00
QString importStyleFile;
int shortestNote; // for midi input
MidiOperations::Data midiImportOperations;
2013-05-03 19:44:23 +02:00
2012-05-26 14:49:10 +02:00
bool useOsc;
int oscPort;
bool singlePalette;
QString styleName;
MuseScoreStyleType globalStyle;
bool animations;
2012-05-26 14:49:10 +02:00
QString myScoresPath;
QString myStylesPath;
QString myImagesPath;
QString myTemplatesPath;
QString myPluginsPath;
QString mySoundfontsPath;
2012-05-26 14:49:10 +02:00
bool nativeDialogs;
int exportAudioSampleRate;
2013-02-08 11:36:50 +01:00
QString workspace;
int exportPdfDpi;
2012-05-26 14:49:10 +02:00
bool dirty;
QList<PluginDescription> pluginList;
2012-05-26 14:49:10 +02:00
bool readPluginList();
void writePluginList();
void updatePluginList();
Preferences();
void write();
void read();
void init();
bool readDefaultStyle();
};
//---------------------------------------------------------
// ShortcutItem
//---------------------------------------------------------
class ShortcutItem : public QTreeWidgetItem {
bool operator<(const QTreeWidgetItem&) const;
public:
ShortcutItem() : QTreeWidgetItem() {}
};
extern Preferences preferences;
2013-04-05 14:19:18 +02:00
extern bool useALSA, useJACK, usePortaudio, usePulseAudio;
2013-05-13 18:49:17 +02:00
} // namespace Ms
2012-05-26 14:49:10 +02:00
#endif