Debian Codegraph @

src/basedocument.h

raw symbols SCIP
1 /*
2 Copyright (C) 2010 Andres Cabrera
3 [email protected]
4
5 This file is part of CsoundQt.
6
7 CsoundQt is free software; you can redistribute it
8 and/or modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or (at your option) any later version.
11
12 CsoundQt is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with Csound; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20 02111-1307 USA
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; // For registering buttons with main application
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 // void setOpcodeNameList(QStringList opcodeNameList);
64 // Get internal components
65 WidgetLayout *getWidgetLayout(); // Needed to pass for placing in widget dock panel
66 ConsoleWidget *getConsole(); // Needed to pass for placing in console dock panel
67 CsoundEngine *getEngine(); // Needed to pass to python interpreter
68 QString getHtml();
69
70 // controls if midiCC messages are accepted and forwarded to widdget layout
71 // enables to forward the messages only to active page
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); // 0=16 bit int 1=32 bit int 2=float
80 void stopRecording();
81 // void playParent(); // Triggered from button, ask parent for options
82 // void renderParent();
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 // virtual BaseView *createView(QWidget *parent, O8pEntryParser *opcodeTree);
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 // BASEDOCUMENT_H