| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
#ifndef BASEDOCUMENT_H |
| 24 |
#define BASEDOCUMENT_H |
| 25 |
|
| 26 |
#include "types.h" |
| 27 |
#include "csoundoptions.h" |
| 28 |
#include <QWidget> |
| 29 |
#include <QThread> |
| 30 |
|
| 31 |
class WidgetLayout; |
| 32 |
class CsoundEngine; |
| 33 |
class DocumentView; |
| 34 |
class OpEntryParser; |
| 35 |
class ConsoleWidget; |
| 36 |
class QuteButton; |
| 37 |
class AppProperties; |
| 38 |
|
| 39 |
enum class PlayStopStatus { Ok, Starting, Stopping }; |
| 40 |
|
| 41 |
class BaseDocument : public QObject |
| 42 |
{ |
| 43 |
Q_OBJECT |
| 44 |
public: |
| 45 |
BaseDocument(QWidget *parent, OpEntryParser *opcodeTree, ConfigLists *configlists); |
| 46 |
~BaseDocument(); |
| 47 |
virtual int setTextString(QString &text) = 0; |
| 48 |
virtual void loadTextString(QString &text); |
| 49 |
virtual void setFileName(QString name); |
| 50 |
int parseAndRemoveWidgetText(QString &text); |
| 51 |
virtual WidgetLayout* newWidgetLayout(); |
| 52 |
void widgetsVisible(bool visible); |
| 53 |
void setFlags(int flags); |
| 54 |
void setAppProperties(AppProperties properties); |
| 55 |
virtual QString getFullText(); |
| 56 |
QString getBasicText(); |
| 57 |
QString getOrc(); |
| 58 |
QString getSco(); |
| 59 |
QString getOptionsText(); |
| 60 |
QString getWidgetsText(); |
| 61 |
QString getPresetsText(); |
| 62 |
AppProperties getAppProperties(); |
| 63 |
|
| 64 |
|
| 65 |
WidgetLayout *getWidgetLayout(); |
| 66 |
ConsoleWidget *getConsole(); |
| 67 |
CsoundEngine *getEngine(); |
| 68 |
QString getHtml(); |
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
bool acceptsMidiCC; |
| 73 |
|
| 74 |
|
| 75 |
public slots: |
| 76 |
virtual int play(CsoundOptions *options); |
| 77 |
void pause(); |
| 78 |
void stop(); |
| 79 |
int record(int mode); |
| 80 |
void stopRecording(); |
| 81 |
|
| 82 |
|
| 83 |
void queueEvent(QString line, int delay = 0); |
| 84 |
virtual void registerButton(QuteButton *button) = 0; |
| 85 |
protected: |
| 86 |
virtual void init(QWidget *parent, OpEntryParser *opcodeTree) = 0; |
| 87 |
|
| 88 |
QString fileName; |
| 89 |
QList<WidgetLayout *> m_widgetLayouts; |
| 90 |
OpEntryParser *m_opcodeTree; |
| 91 |
DocumentView *m_view; |
| 92 |
ConsoleWidget *m_console; |
| 93 |
CsoundEngine *m_csEngine; |
| 94 |
PlayStopStatus m_status; |
| 95 |
QMutex mutex; |
| 96 |
|
| 97 |
}; |
| 98 |
|
| 99 |
#endif |