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
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);
Definition DocumentContext.hpp:18