2 #include <Process/GenericProcessFactory.hpp>
3 #include <Process/WidgetLayer/WidgetProcessFactory.hpp>
5 #include <Control/DefaultEffectItem.hpp>
6 #include <Effect/EffectFactory.hpp>
7 #include <Pd/Inspector/PdInspectorWidget.hpp>
8 #include <Pd/PdProcess.hpp>
71 QPointer<const ProcessModel> m_model;
72 std::shared_ptr<Pd::Instance> m_instance;
75 , m_instance{proc.m_instance}
77 setGeometry(0, 0, 0, 0);
81 &QWidget::deleteLater);
82 const auto& bin = locatePdBinary();
85 libpd_set_instance(m_instance->instance);
86 libpd_start_gui(locatePdResourceFolder().toUtf8().constData());
87 m_instance->ui_open =
true;
92 QString locatePdResourceFolder() noexcept
94 #if defined(__linux__)
96 {
"/usr/lib64/puredata",
"/usr/lib64/pd",
"/usr/lib/puredata",
"/usr/lib/pd"})
97 if(QFile::exists(path))
100 return QFileInfo{locatePdBinary()}.absolutePath();
103 void closeEvent(QCloseEvent* event)
override
105 QPointer<UiWrapper> p(
this);
107 if(m_instance->ui_open)
109 m_instance->ui_open =
false;
110 libpd_set_instance(m_instance->instance);
116 const_cast<QWidget*&
>(m_model->externalUI) =
nullptr;
117 m_model->externalUIVisible(
false);
122 QWidget::closeEvent(event);
128 if(m_instance->ui_open)
130 m_instance->ui_open =
false;
131 libpd_set_instance(m_instance->instance);
137 const_cast<QWidget*&
>(m_model->externalUI) =
nullptr;
138 m_model->externalUIVisible(
false);
142 void timerEvent(QTimerEvent* event)
override
144 libpd_set_instance(m_instance->instance);
void identified_object_destroying(IdentifiedObjectAbstract *o)
To be called by subclasses.
Definition: PdProcess.hpp:40
Definition: DefaultEffectItem.hpp:26
Definition: EffectFactory.hpp:66
Definition: PdLayer.hpp:70
Definition: DocumentContext.hpp:18