diff --git a/effects/crossdissolvetransition.cpp b/effects/internal/crossdissolvetransition.cpp similarity index 94% rename from effects/crossdissolvetransition.cpp rename to effects/internal/crossdissolvetransition.cpp index 990c2d6d8..4f88dff21 100644 --- a/effects/crossdissolvetransition.cpp +++ b/effects/internal/crossdissolvetransition.cpp @@ -1,4 +1,4 @@ -#include "transition.h" +#include "../transition.h" #include diff --git a/effects/internal/linearfadetransition.cpp b/effects/internal/linearfadetransition.cpp index 6cf1edf7e..58d63d843 100644 --- a/effects/internal/linearfadetransition.cpp +++ b/effects/internal/linearfadetransition.cpp @@ -1,4 +1,4 @@ -#include "transition.h" +#include "../transition.h" LinearFadeTransition::LinearFadeTransition() : Transition(AUDIO_LINEAR_FADE_TRANSITION) {} diff --git a/olive.pro b/olive.pro index e7f5c1184..c410bc8c8 100644 --- a/olive.pro +++ b/olive.pro @@ -52,7 +52,6 @@ SOURCES += \ ui/labelslider.cpp \ dialogs/preferencesdialog.cpp \ effects/transition.cpp \ - effects/crossdissolvetransition.cpp \ ui/audiomonitor.cpp \ project/undo.cpp \ ui/scrollarea.cpp \ @@ -80,7 +79,8 @@ SOURCES += \ effects/internal/audionoiseeffect.cpp \ effects/internal/paneffect.cpp \ effects/internal/toneeffect.cpp \ - effects/internal/volumeeffect.cpp + effects/internal/volumeeffect.cpp \ + effects/internal/crossdissolvetransition.cpp HEADERS += \ mainwindow.h \ diff --git a/panels/effectcontrols.cpp b/panels/effectcontrols.cpp index 9d3c071c9..59866e70d 100644 --- a/panels/effectcontrols.cpp +++ b/panels/effectcontrols.cpp @@ -97,6 +97,8 @@ void EffectControls::delete_selected_keyframes() { } void EffectControls::show_effect_menu(bool video, bool transitions) { + + /*video_menu = video; transition_menu = transitions; @@ -144,65 +146,99 @@ void EffectControls::show_effect_menu(bool video, bool transitions) { effects_menu.exec(QCursor::pos());*/ - effects_loaded.lock(); + video_menu = video; + transition_menu = transitions; - video_menu = video; - transition_menu = transitions; + if (transition_menu) { + // TODO old effect/transition code grandfathered in, to be updated - QVector& effect_list = (video) ? video_effects : audio_effects; - QMenu effects_menu(this); - for (int i=0;isetText(em.name); - action->setData(reinterpret_cast(&em)); + int lim; + QVector* effect_names; + if (video) { + lim = VIDEO_TRANSITION_COUNT; + effect_names = &video_transition_names; + } else { + lim = AUDIO_TRANSITION_COUNT; + effect_names = &audio_transition_names; + } + QMenu effects_menu(this); + for (int i=0;isetText(effect_names->at(i)); + action->setData(i); - QMenu* parent = &effects_menu; - if (!em.category.isEmpty()) { - bool found = false; - for (int j=0;jmenu() != NULL) { - if (action->menu()->title() == em.category) { - parent = action->menu(); - found = true; - break; - } - } - } - if (!found) { - parent = new QMenu(&effects_menu); - parent->setTitle(em.category); + // sort alphabetically + bool added = false; + for (int j=0;jtext() > effect_names->at(i)) { + effects_menu.insertAction(comp_action, action); + added = true; + break; + } + } + if (!added) effects_menu.addAction(action); + } + connect(&effects_menu, SIGNAL(triggered(QAction*)), this, SLOT(menu_select(QAction*))); + effects_menu.exec(QCursor::pos()); + } else { + effects_loaded.lock(); + QVector& effect_list = (video) ? video_effects : audio_effects; + QMenu effects_menu(this); + for (int i=0;isetText(em.name); + action->setData(reinterpret_cast(&em)); + + QMenu* parent = &effects_menu; + if (!em.category.isEmpty()) { bool found = false; - for (int i=0;itext() > em.category) { - effects_menu.insertMenu(comp_action, parent); - found = true; - break; + for (int j=0;jmenu() != NULL) { + if (action->menu()->title() == em.category) { + parent = action->menu(); + found = true; + break; + } } } - if (!found) effects_menu.addMenu(parent); - } - } + if (!found) { + parent = new QMenu(&effects_menu); + parent->setTitle(em.category); - bool found = false; - for (int i=0;iactions().size();i++) { - QAction* comp_action = parent->actions().at(i); - if (comp_action->text() > action->text()) { - parent->insertAction(comp_action, action); - found = true; - break; + bool found = false; + for (int i=0;itext() > em.category) { + effects_menu.insertMenu(comp_action, parent); + found = true; + break; + } + } + if (!found) effects_menu.addMenu(parent); + } } + + bool found = false; + for (int i=0;iactions().size();i++) { + QAction* comp_action = parent->actions().at(i); + if (comp_action->text() > action->text()) { + parent->insertAction(comp_action, action); + found = true; + break; + } + } + if (!found) parent->addAction(action); } - if (!found) parent->addAction(action); + + effects_loaded.unlock(); + + connect(&effects_menu, SIGNAL(triggered(QAction*)), this, SLOT(menu_select(QAction*))); + effects_menu.exec(QCursor::pos()); } - - effects_loaded.unlock(); - - connect(&effects_menu, SIGNAL(triggered(QAction*)), this, SLOT(menu_select(QAction*))); - effects_menu.exec(QCursor::pos()); } void EffectControls::clear_effects(bool clear_cache) {