ACMX 2.139.0
Dual-Backend Real-Time GPU Video Synthesis
Loading...
Searching...
No Matches
library-builder.hpp
Go to the documentation of this file.
1#ifndef LIBRARY_BUILDER_HPP
2#define LIBRARY_BUILDER_HPP
3
4/**
5 * @file library-builder.hpp
6 * @brief Dialog for assembling portable shader libraries.
7 */
8
9#include "backend.hpp"
10#include <QDialog>
11#include <QStringList>
12
13class QCheckBox;
14class QLabel;
15class QListWidget;
16class QPushButton;
17
18/**
19 * @brief Builds an ordered library from fragment and compute shader files.
20 */
21class LibraryBuilderDialog : public QDialog {
22 Q_OBJECT
23
24 public:
25 explicit LibraryBuilderDialog(acmx2::Backend backend, QWidget *parent = nullptr);
26 /// @brief Return the backend whose source format this dialog exports.
28
29 signals:
30 /// @brief Emitted after a complete library has been exported successfully.
31 void libraryExported(const QString &directory);
32
33 private slots:
34 void addFiles();
35 void addFolder();
36 void openLibrary();
37 void removeSelected();
38 void clearShaders();
39 void exportLibrary();
40 void updateControls();
41
42 private:
43 bool addShader(const QString &filePath, bool showErrors = true);
44 int addShaderFiles(const QStringList &filePaths);
45 QString shaderFilter() const;
46 QStringList selectedSourcePaths() const;
47
48 QListWidget *shaderList = nullptr;
49 QLabel *summaryLabel = nullptr;
50 QCheckBox *recursiveCheck = nullptr;
51 QPushButton *removeButton = nullptr;
52 QPushButton *exportButton = nullptr;
53 bool exportInProgress = false;
55};
56
57#endif
bool addShader(const QString &filePath, bool showErrors=true)
QString shaderFilter() const
acmx2::Backend selectedBackend() const
Return the backend whose source format this dialog exports.
void libraryExported(const QString &directory)
Emitted after a complete library has been exported successfully.
QStringList selectedSourcePaths() const
int addShaderFiles(const QStringList &filePaths)
LibraryBuilderDialog(acmx2::Backend backend, QWidget *parent=nullptr)
Backend
Definition backend.hpp:8