| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
#ifndef PYQCSOBJECT_H |
| 24 |
#define PYQCSOBJECT_H |
| 25 |
|
| 26 |
#include "PythonQt.h" |
| 27 |
|
| 28 |
#include <QObject> |
| 29 |
#include <QStringList> |
| 30 |
#include <QMainWindow> |
| 31 |
#include <QPushButton> |
| 32 |
#include <QVariant> |
| 33 |
#include <QLayout> |
| 34 |
|
| 35 |
#include <csound.hpp> |
| 36 |
|
| 37 |
#define PYQCSVERSION "1.0" |
| 38 |
|
| 39 |
class CsoundQt; |
| 40 |
class QuteSheet; |
| 41 |
|
| 42 |
class PyQcsObject : public QObject { |
| 43 |
Q_OBJECT |
| 44 |
|
| 45 |
public: |
| 46 |
PyQcsObject(); |
| 47 |
~PyQcsObject(); |
| 48 |
void setCsoundQt(CsoundQt *qcs); |
| 49 |
|
| 50 |
public slots: |
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
QString getVersion(); |
| 60 |
void refresh(); |
| 61 |
|
| 62 |
|
| 63 |
void play(int index = -1, bool realtime = true); |
| 64 |
void pause(int index = -1); |
| 65 |
void stop(int index = -1); |
| 66 |
void stopAll(); |
| 67 |
void record(int index = -1); |
| 68 |
|
| 69 |
void setCsChannel(QString channel, double value, int index = -1); |
| 70 |
void setCsChannel(QString channel, QString value, int index = -1); |
| 71 |
double getCsChannel(QString channel, int index = -1); |
| 72 |
QString getCsStringChannel(QString channel, int index = -1); |
| 73 |
|
| 74 |
bool opcodeExists(QString opcodeName); |
| 75 |
|
| 76 |
|
| 77 |
void setDocument(int index); |
| 78 |
int loadDocument(QString name, bool runNow = false); |
| 79 |
void insertText(QString text, int index = -1, int section = -1); |
| 80 |
void setCsd(QString text, int index = -1); |
| 81 |
void setFullText(QString text, int index = -1); |
| 82 |
void setOrc(QString text, int index = -1); |
| 83 |
void setSco(QString text, int index = -1); |
| 84 |
void setWidgetsText(QString text, int index = -1); |
| 85 |
void setPresetsText(QString text, int index = -1); |
| 86 |
void setOptionsText(QString text, int index = -1); |
| 87 |
|
| 88 |
int getDocument(QString name = ""); |
| 89 |
int newDocument(QString name); |
| 90 |
|
| 91 |
QString getSelectedText(int index = -1, int section = -1); |
| 92 |
QString getCsd(int index = -1); |
| 93 |
QString getFullText(int index = -1); |
| 94 |
QString getOrc(int index = -1); |
| 95 |
QString getSco(int index = -1); |
| 96 |
QString getWidgetsText(int index = -1); |
| 97 |
QString getSelectedWidgetsText(int index = -1); |
| 98 |
QString getPresetsText(int index = -1); |
| 99 |
QString getOptionsText(int index = -1); |
| 100 |
QString getFileName(int index = -1); |
| 101 |
QString getFilePath(int index = -1); |
| 102 |
|
| 103 |
|
| 104 |
void setChannelValue(QString channel, double value, int index = -1); |
| 105 |
double getChannelValue(QString channel, int index = -1); |
| 106 |
void setChannelString(QString channel, QString value, int index = -1); |
| 107 |
QString getChannelString(QString channel, int index = -1); |
| 108 |
void setWidgetProperty(QString widgetid, QString property, QVariant value, int index= -1); |
| 109 |
QVariant getWidgetProperty(QString widgetid, QString property, int index= -1); |
| 110 |
|
| 111 |
void loadPreset(int presetIndex, int index = -1); |
| 112 |
|
| 113 |
QStringList getWidgetUuids(int index = -1); |
| 114 |
QStringList listWidgetProperties(QString widgetid, int index = -1); |
| 115 |
QString createNewLabel(int x = 0, int y = 0, QString channel = QString(), int index = -1); |
| 116 |
QString createNewDisplay(int x = 0, int y = 0, QString channel = QString(), int index = -1); |
| 117 |
QString createNewScrollNumber(int x = 0, int y = 0, QString channel = QString(), int index = -1); |
| 118 |
QString createNewLineEdit(int x = 0, int y = 0, QString channel = QString(), int index = -1); |
| 119 |
QString createNewSpinBox(int x = 0, int y = 0, QString channel = QString(), int index = -1); |
| 120 |
QString createNewSlider(QString channel, int index = -1); |
| 121 |
QString createNewSlider(int x = 0, int y = 0, QString channel = QString(), int index = -1); |
| 122 |
QString createNewButton(int x = 0, int y = 0, QString channel = QString(), int index = -1); |
| 123 |
QString createNewKnob(int x = 0, int y = 0, QString channel = QString(), int index = -1); |
| 124 |
QString createNewCheckBox(int x = 0, int y = 0, QString channel = QString(), int index = -1); |
| 125 |
QString createNewMenu(int x = 0, int y = 0, QString channel = QString(), int index = -1); |
| 126 |
QString createNewMeter(int x = 0, int y = 0, QString channel = QString(), int index = -1); |
| 127 |
QString createNewConsole(int x = 0, int y = 0, QString channel = QString(), int index = -1); |
| 128 |
QString createNewGraph(int x = 0, int y = 0, QString channel = QString(), int index = -1); |
| 129 |
QString createNewScope(int x = 0, int y = 0, QString channel = QString(), int index = -1); |
| 130 |
|
| 131 |
bool destroyWidget(QString widgetid); |
| 132 |
|
| 133 |
|
| 134 |
QuteSheet* getSheet(int index = -1, int sheetIndex = -1); |
| 135 |
QuteSheet* getSheet(int index, QString sheetName); |
| 136 |
|
| 137 |
|
| 138 |
void schedule(QVariant time, QVariant event); |
| 139 |
void sendEvent(int index, QString events); |
| 140 |
void sendEvent(QString events); |
| 141 |
|
| 142 |
|
| 143 |
CSOUND* getCurrentCsound(); |
| 144 |
double getSampleRate(int index = -1); |
| 145 |
int getKsmps(int index = -1); |
| 146 |
int getNumChannels(int index = -1); |
| 147 |
MYFLT *getTableArray(int ftable, int index = -1); |
| 148 |
|
| 149 |
void evaluateCsound(QString code=QString()); |
| 150 |
|
| 151 |
|
| 152 |
|
| 153 |
|
| 154 |
|
| 155 |
|
| 156 |
|
| 157 |
|
| 158 |
|
| 159 |
|
| 160 |
|
| 161 |
|
| 162 |
|
| 163 |
void registerProcessCallback(QString func, int skipPeriods = 0, int index = -1); |
| 164 |
|
| 165 |
private: |
| 166 |
CsoundQt *m_qcs; |
| 167 |
MYFLT **m_tablePtr; |
| 168 |
}; |
| 169 |
|
| 170 |
#endif |