42 void setCwd(QDir dir) { _cwd = dir; }
48 QString
absoluteFilePath(
const QString& filePath)
const {
return _cwd.absoluteFilePath(filePath); }
49 QString
relativeFilePath(
const QString& filePath)
const {
return _cwd.relativeFilePath(filePath); }
58 std::vector<std::unique_ptr<ScriptEntry>>
_entries;
63 size_t nentries()
const {
return _entries.size(); }
64 bool empty()
const {
return _entries.empty(); }
68 void clear() { _entries.clear(); }
69 void addEntry(std::unique_ptr<ScriptEntry>&& e) {
if (e) _entries.push_back(std::move(e)); }
74 void addFromLine(
const QString& line);
76 static std::unique_ptr<Script> fromFile(QString fileName);
77 void writeToFile(QString fileName)
const;
94 bool _recording =
false;
97 bool ensureFileOpen();
106 void close() { setRecording(
false); _file.close(); _script.
clear(); _recorded = 0; }
107 void setFile(QString fileName) { close(); _file.setFileName(fileName); }
111 void recordInitState();
112 void recordCommand(
const QString& name);
113 void recordPaletteElement(
Element* e);
115 void recordCurrentScoreChange();
116 void recordScoreTest(QString scoreName = QString());
ScriptContext(MuseScore *mscore)
Definition: script.cpp:28
const ScriptEntry & lastEntry() const
Definition: script.h:62
void clear()
Definition: script.h:68
void setRelativePaths(bool rel)
Definition: script.h:44
size_t nentries() const
Definition: script.h:63
Definition: musescore.h:180
QDir _cwd
Definition: script.h:30
bool relativePaths() const
Definition: script.h:43
QTextStream & execLog()
Definition: script.cpp:41
Script _script
Definition: script.h:91
QString absoluteFilePath(const QString &filePath) const
Definition: script.h:48
bool isRecording() const
Definition: script.h:103
Base class of score layout elements.
Definition: element.h:158
std::unique_ptr< QTextStream > _execLog
Definition: script.h:33
MuseScore * _mscore
Definition: script.h:29
const MuseScore * mscore() const
Definition: script.h:39
bool _stopOnError
Definition: script.h:32
Definition: inspectorBase.h:37
void setFile(QString fileName)
Definition: script.h:107
bool stopOnError() const
Definition: script.h:45
MuseScore * mscore()
Definition: script.h:38
void close()
Definition: script.h:106
void addEntry(std::unique_ptr< ScriptEntry > &&e)
Definition: script.h:69
ScriptContext & context()
Definition: script.h:108
const ScriptContext & context() const
Definition: script.h:109
bool _relativePaths
Definition: script.h:31
const ScriptEntry & entry(size_t n) const
Definition: script.h:61
Definition: aeolus.cpp:26
void addCommand(const QString &cmd)
Definition: script.h:72
void addEntry(ScriptEntry *e)
Definition: script.h:70
QTextStream _stream
Definition: script.h:90
QString relativeFilePath(const QString &filePath) const
Definition: script.h:49
QFile _file
Definition: script.h:89
Definition: scriptentry.h:64
bool empty() const
Definition: script.h:64
void addCommand(const QByteArray &cmd)
Definition: script.h:71
void setStopOnError(bool stop)
Definition: script.h:46
void setCwd(QDir dir)
Definition: script.h:42
Definition: scriptentry.h:27
void setRecording(bool r)
Definition: script.h:104
ScriptRecorder(MuseScore *context)
Definition: script.h:101
std::vector< std::unique_ptr< ScriptEntry > > _entries
Definition: script.h:58
ScriptContext _ctx
Definition: script.h:92
const QDir & cwd() const
Definition: script.h:41