-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEditVBoxLayout.h
More file actions
101 lines (86 loc) · 3.36 KB
/
EditVBoxLayout.h
File metadata and controls
101 lines (86 loc) · 3.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
// This source code is part of QAbc, a minimal ABC music notation editor.
// QAbc is Copyright © 2021 Benoît Rouits <brouits@free.fr>.
//
// 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 3 of the License, or
// (at your option) any later version.
//
// SPDX-License-Identifier: GPL-3.0-or-later
#ifndef EDITVBOXLAYOUT_H
#define EDITVBOXLAYOUT_H
#include "ViewPushButton.h"
#include "PlayPushButton.h"
#include "AbcPlainTextEdit.h"
#include "AbcProcess.h"
#include "AbcTemporaryFile.h"
#include <QVBoxLayout>
#include <QSpinBox>
#include <QCheckBox>
#include <QLabel>
#include <QDir>
class EditVBoxLayout: public QVBoxLayout
{
Q_OBJECT
public:
explicit EditVBoxLayout(const QString& fileName, QWidget* parent = nullptr);
~EditVBoxLayout();
void setFileName(const QString& fn);
void cleanup();
AbcPlainTextEdit* abcPlainTextEdit();
PlayPushButton* playPushButton();
ViewPushButton* viewPushButton();
QSpinBox* xSpinBox();
void spawnCompilerPs(const QString &prog, const QStringList &args, const QDir& wrk);
void spawnViewerPs(const QString &prog, const QStringList &args, const QDir& wrk);
void spawnExportMIDI(const QString &prog, const QStringList& args, const QDir& wrk);
void spawnExportPs(const QString &prog, const QStringList& args, const QDir& wrk);
void spawnCompilerMIDI(const QString &prog, const QStringList& args, const QDir& wrk);
void spawnSynthMIDI(const QString &prog, const QStringList &args, const QDir& wrk);
signals:
void compilerPsFinished(int exitCode);
void viewerPsFinished(int exitCode);
void compilerMIDIFinished(int exitCode);
void synthMIDIFinished(int exitCode);
void doExportMIDI(const QString& = "");
void doExportPs(const QString& = "");
protected:
void spawnProgram(const QString& prog, const QStringList &args, AbcProcess::ProcessType which, const QDir &wrk);
void killSynth();
bool checkViewer();
void deleteProcess (AbcProcess::ProcessType which);
QString getAbcText();
protected slots:
void onCursorPositionChanged();
void onXChanged(int value);
void onPlayClicked(); /* midi */
void onCompileClicked(); /* ps */
void onSelectionChanged();
void onLoopStateChanged(bool checked);
void exportMIDI(const QString& outFilename = "");
void exportPs(const QString& outFilename = "");
void onErrorOccurred(QProcess::ProcessError error, const QString& program, AbcProcess::ProcessType);
void onProgramFinished(int exitCode, QProcess::ExitStatus exitStatus, AbcProcess::ProcessType);
void onProgramOutputText(const QByteArray& text);
void onProgramErrorText(const QByteArray& text);
void onCompilerMIDIFinished(int exitCode);
void onSynthMIDIFinished(int exitCode);
void onCompilerPsFinished(int exitCode);
void onViewerPsFinished(int exitCode);
private:
bool in_cursor_position_changed = false;
AbcPlainTextEdit abcplaintextedit;
PlayPushButton playpushbutton; /* midi */
QPushButton loopcheckbox;
ViewPushButton viewpushbutton; /* ps */
QHBoxLayout hboxlayout;
QSpinBox xspinbox;
QLabel xlabel;
QString fileName;
AbcTemporaryFile tempFile;
QList<AbcProcess*> processlist;
QString selection;
int selectionIndex;
int currentmidi;
};
#endif