diff --git a/io/path.cpp b/io/path.cpp index fe8a813f0..b90e13345 100644 --- a/io/path.cpp +++ b/io/path.cpp @@ -7,14 +7,8 @@ QString real_app_dir; -QString get_effects_dir() { - QString env_path(qgetenv("OLIVE_EFFECTS_PATH")); - if (!env_path.isEmpty()) return env_path; - return get_app_dir() + "/effects"; -} - QString get_app_dir() { - if (real_app_dir.isEmpty()) { + if (real_app_dir.isEmpty()) { QString app_path = QCoreApplication::applicationFilePath(); real_app_dir = app_path.left(app_path.lastIndexOf('/')); } diff --git a/io/path.h b/io/path.h index b53476693..31ff1e651 100644 --- a/io/path.h +++ b/io/path.h @@ -5,6 +5,5 @@ QString get_app_dir(); QString get_data_path(); -QString get_effects_dir(); #endif // PATH_H diff --git a/olive.pro b/olive.pro index 3cfcd8ff8..5a78cb671 100644 --- a/olive.pro +++ b/olive.pro @@ -227,6 +227,17 @@ unix:!mac { RESOURCES += \ icons/icons.qrc +unix:!mac:isEmpty(PREFIX) { + PREFIX = /usr/local +} + +unix:!mac:target.path = $$PREFIX/bin + +effects.files = $$PWD/effects/*.frag $$PWD/effects/*.xml $$PWD/effects/*.vert +unix:!mac:effects.path = $$PREFIX/share/olive-editor/effects + +INSTALLS += target effects + unix:!mac { metainfo.files = $$PWD/packaging/linux/org.olivevideoeditor.Olive.appdata.xml metainfo.path = $$PREFIX/share/metainfo @@ -251,4 +262,4 @@ unix:!mac { icon1024.files = $$PWD/packaging/linux/icons/1024x1024/org.olivevideoeditor.Olive.png icon1024.path = $$PREFIX/share/icons/hicolor/1024x1024/apps INSTALLS += metainfo desktop mime icon16 icon32 icon48 icon64 icon128 icon256 icon512 icon1024 -} +} \ No newline at end of file diff --git a/panels/effectcontrols.cpp b/panels/effectcontrols.cpp index aa576ec64..56107ecf3 100644 --- a/panels/effectcontrols.cpp +++ b/panels/effectcontrols.cpp @@ -41,7 +41,7 @@ EffectControls::EffectControls(QWidget *parent) : ui->effects_area->header = ui->headers; ui->keyframeView->header = ui->headers; - ui->label_2->setVisible(false); + ui->lblMultipleClipsSelected->setVisible(false); connect(ui->horizontalScrollBar, SIGNAL(valueChanged(int)), ui->headers, SLOT(set_scroll(int))); connect(ui->horizontalScrollBar, SIGNAL(resize_move(double)), ui->keyframeView, SLOT(resize_move(double))); @@ -219,7 +219,7 @@ void EffectControls::clear_effects(bool clear_cache) { item->widget()->setParent(NULL); disconnect(static_cast(item->widget()), SIGNAL(deselect_others(QWidget*)), this, SLOT(deselect_all_effects(QWidget*))); } - ui->label_2->setVisible(false); + ui->lblMultipleClipsSelected->setVisible(false); ui->vcontainer->setVisible(false); ui->acontainer->setVisible(false); ui->headers->setVisible(false); @@ -247,7 +247,7 @@ void EffectControls::open_effect(QVBoxLayout* layout, Effect* e) { } void EffectControls::load_effects() { - ui->label_2->setVisible(multiple); + ui->lblMultipleClipsSelected->setVisible(multiple); if (!multiple) { // load in new clips @@ -319,19 +319,19 @@ void EffectControls::set_clips(QVector& clips, int m) { load_effects(); } -void EffectControls::on_add_video_effect_button_clicked() { +void EffectControls::on_btnAddVideoEffect_clicked() { show_effect_menu(EFFECT_TYPE_EFFECT, EFFECT_TYPE_VIDEO); } -void EffectControls::on_add_audio_effect_button_clicked() { +void EffectControls::on_btnAddAudioEffect_clicked() { show_effect_menu(EFFECT_TYPE_EFFECT, EFFECT_TYPE_AUDIO); } -void EffectControls::on_add_video_transition_button_clicked() { +void EffectControls::on_btnAddVideoTransition_clicked() { show_effect_menu(EFFECT_TYPE_TRANSITION, EFFECT_TYPE_VIDEO); } -void EffectControls::on_add_audio_transition_button_clicked() { +void EffectControls::on_btnAddAudioTransition_clicked() { show_effect_menu(EFFECT_TYPE_TRANSITION, EFFECT_TYPE_AUDIO); } diff --git a/panels/effectcontrols.h b/panels/effectcontrols.h index 6e2bdb807..68d3e6861 100644 --- a/panels/effectcontrols.h +++ b/panels/effectcontrols.h @@ -52,12 +52,13 @@ public slots: void update_keyframes(); private slots: void menu_select(QAction* q); - void on_add_video_effect_button_clicked(); - void on_add_audio_effect_button_clicked(); - void deselect_all_effects(QWidget*); - void on_add_video_transition_button_clicked(); - void on_add_audio_transition_button_clicked(); + void on_btnAddVideoEffect_clicked(); + void on_btnAddAudioEffect_clicked(); + void on_btnAddVideoTransition_clicked(); + void on_btnAddAudioTransition_clicked(); + + void deselect_all_effects(QWidget*); protected: void resizeEvent(QResizeEvent *event); private: diff --git a/panels/effectcontrols.ui b/panels/effectcontrols.ui index 587946d5a..934fc26ef 100644 --- a/panels/effectcontrols.ui +++ b/panels/effectcontrols.ui @@ -151,7 +151,7 @@ 0 - + Add Video Effect @@ -166,7 +166,7 @@ - + Qt::Horizontal @@ -179,7 +179,7 @@ - + 0 @@ -200,7 +200,7 @@ - + Qt::Horizontal @@ -213,7 +213,7 @@ - + Add Video Transition @@ -296,7 +296,7 @@ 0 - + Add Audio Effect @@ -311,7 +311,7 @@ - + Qt::Horizontal @@ -324,7 +324,7 @@ - + 0 @@ -345,7 +345,7 @@ - + Qt::Horizontal @@ -358,7 +358,7 @@ - + Add Audio Transition @@ -400,7 +400,7 @@ - + (Multiple clips selected) diff --git a/project/effect.cpp b/project/effect.cpp index 8c049801e..0f75405b2 100644 --- a/project/effect.cpp +++ b/project/effect.cpp @@ -156,48 +156,57 @@ void load_internal_effects() { } void load_shader_effects() { - QString effects_path = get_effects_dir(); - QDir effects_dir(effects_path); - if (effects_dir.exists()) { - QList entries = effects_dir.entryList(QStringList("*.xml"), QDir::Files); - for (int i=0;i effects_paths; + effects_paths.append(get_app_dir() + "/effects"); + effects_paths.append(get_app_dir() + "/../share/olive-editor/effects"); + QString env_path(qgetenv("OLIVE_EFFECTS_PATH")); + if (!env_path.isEmpty()) effects_paths.append(env_path); - QXmlStreamReader reader(&file); - while (!reader.atEnd()) { - if (reader.name() == "effect") { - QString effect_name = ""; - QString effect_cat = ""; - const QXmlStreamAttributes attr = reader.attributes(); - for (int j=0;j entries = effects_dir.entryList(QStringList("*.xml"), QDir::Files); + for (int i=0;isetText(em->name); if (!em->filename.isEmpty()) { - QFile effect_file(get_effects_dir() + "/" + em->filename); + QFile effect_file(em->filename); if (effect_file.open(QFile::ReadOnly)) { QXmlStreamReader reader(&effect_file); @@ -401,7 +410,7 @@ Effect::Effect(Clip* c, const EffectMeta *em) : fragPath = attr.value().toString(); } } - } else if (reader.name() == "superimpose" && reader.isStartElement()) { + }/* else if (reader.name() == "superimpose" && reader.isStartElement()) { enable_superimpose = true; const QXmlStreamAttributes& attributes = reader.attributes(); for (int i=0;iaddShaderFromSourceFile(QOpenGLShader::Vertex, get_effects_dir() + "/" + vertPath); - if (!fragPath.isEmpty()) glslProgram->addShaderFromSourceFile(QOpenGLShader::Fragment, get_effects_dir() + "/" + fragPath); + if (!vertPath.isEmpty()) glslProgram->addShaderFromSourceFile(QOpenGLShader::Vertex, meta->path + "/" + vertPath); + if (!fragPath.isEmpty()) glslProgram->addShaderFromSourceFile(QOpenGLShader::Fragment, meta->path + "/" + fragPath); glslProgram->link(); isOpen = true; } diff --git a/project/effect.h b/project/effect.h index 572baf7a9..6f8b35fc1 100644 --- a/project/effect.h +++ b/project/effect.h @@ -29,6 +29,7 @@ struct EffectMeta { QString name; QString category; QString filename; + QString path; int internal; int type; int subtype;