Debian Codegraph @

src/csoundhtmlwrapper.h

raw symbols SCIP
1 /*
2 Copyright (C) 2008-2016 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 CsoundHtmlWrapper_H
24 #define CsoundHtmlWrapper_H
25
26 #include <QObject>
27 #include <QDebug>
28 #include <thread>
29 #include "csoundengine.h"
30
31 class CsoundHtmlView;
32
33 class CsoundHtmlWrapper : public QObject
34 {
35 Q_OBJECT
36 public:
37 explicit CsoundHtmlWrapper(QObject *parent = 0);
38 void setCsoundHtmlView(CsoundHtmlView *csoundHtmlView);
39 public slots:
40 CSOUND *getCsound();
41 CsoundPerformanceThread *getThread();
42 CsoundUserData *getUserData();
43 void setCsoundEngine(CsoundEngine *csEngine); // necessay to get CsoundEngine::isPlaying()
44 int compileCsd(const QString &filename);
45 int compileCsdText(const QString &text);
46 int compileOrc(const QString &text);
47 double evalCode(const QString &text);
48 double get0dBFS();
49 int getApiVersion();
50 double getControlChannel(const QString &name);
51 qint64 getCurrentTimeSamples();
52 QString getEnv(const QString &name);
53 int getKsmps();
54 int getNchnls();
55 int getNchnlsInput();
56 QString getOutputName();
57 double getScoreOffsetSeconds();
58 double getScoreTime();
59 int getSr();
60 QString getStringChannel(const QString &name);
61 int getVersion();
62 bool isPlaying();
63 int isScorePending();
64 void message(const QString &text);
65 int perform();
66 int readScore(const QString &text);
67 void reset();
68 void rewindScore();
69 int runUtility(const QString &command, int argc, char **argv);
70 int scoreEvent(char type, const double *pFields, long numFields);
71 void setControlChannel(const QString &name, double value);
72 int setGlobalEnv(const QString &name, const QString &value);
73 void setInput(const QString &name);
74 // Dummy for now.
75 void setMessageCallback(QObject *callback);
76 int setOption(const QString &name);
77 void setOutput(const QString &name, const QString &type, const QString &format);
78 void setScoreOffsetSeconds(double value);
79 void setScorePending(bool value);
80 void setStringChannel(const QString &name, const QString &value);
81 int start();
82 void stop();
83 double tableGet(int table_number, int index);
84 int tableLength(int table_number);
85 void tableSet(int table_number, int index, double value);
86 public:
87 static void csoundMessageCallback_(CSOUND *csound,
88 int attributes,
89 const char *format,
90 va_list args);
91 void csoundMessageCallback(int attributes,
92 const char *format,
93 va_list args);
94 private:
95 QString csoundMessageBuffer;
96 CsoundHtmlView *csoundHtmlView;
97 CsoundEngine *m_csoundEngine;
98 QObject *message_callback;
99 };
100
101 #endif // CsoundHtmlWrapper_H