This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Disabling the rendering of the effects in the monitor

Tags: None
(comma "," separated)
alexmartinmerino
Registered Member
Posts
4
Karma
0
Hi,

i've recently started developing in Kdenlive, as i have been asking to implement the function for https://bugs.kdenlive.org/view.php?id=2513, disabling the rendering of the effects in the timeline, without disabling the effects.

I'm taking as a base the function
Code: Select all
void CollapsibleEffect::slotDisable(bool disable, bool emitInfo)
{
    title->setEnabled(!disable);
    enabledButton->blockSignals(true);
    enabledButton->setChecked(disable);
    enabledButton->blockSignals(false);
    enabledButton->setIcon(disable ? KIcon("layer-visible-off") : KIcon("layer-visible-on"));
    m_effect.setAttribute("disable", disable ? 1 : 0);
    if (!disable || KdenliveSettings::disable_effect_parameters()) {
        widgetFrame->setEnabled(!disable);
    }
    if (emitInfo) emit effectStateChanged(disable, effectIndex(), isActive() && needsMonitorEffectScene());
}

trying to omit the disabling part, and trying to apply it to all the tracks and clips in the timeline.

For now, i'm trying to disable the effects from the tracks, trying to select them as the active ones, so i can access to the CollapsibleEffects in their EffectStacks, and use the modification i've created from their slotDisable(bool,bool)

The code that goes through the tracks and effects:
Code: Select all
    int nTracks=m_activeDocument->tracksCount();
    QList<TrackInfo> tInfo = m_activeDocument->tracksList();

    QList<CollapsibleEffect*> cEffects;
    TrackInfo infoData;

    for(int i=0;i<nTracks;i++) {
        infoData=tInfo.at(i);
        m_effectStack->slotTrackItemSelected(i,infoData);
        cEffects=m_effectStack->getCollapsibleList();
        for (int j=0;j<cEffects.count();j++) {
            CollapsibleEffect *effect=cEffects.at(j);
            effect->toggleEffects(disabled);
        }
    }


where toggleEffects(bool) is
Code: Select all
void CollapsibleEffect::toggleEffects(bool disable,bool emitInfo)
{
    if(m_effect.attribute("disable")==0) {
        if (emitInfo) emit effectStateChanged(disable, effectIndex(), isActive() && needsMonitorEffectScene());
    }
}

but it doesn't work, maybe because it's not accesing properly to the tracks. Should i access to those tracks through this method i mentioned, through
Code: Select all
        QDomElement mlt = m_activeDocument->getDocument().firstChildElement("mlt");
        QDomElement tractor = mlt.firstChildElement("tractor");
        QDomNodeList tracks = tractor.elementsByTagName("track");

or is there any other way?

As for the clips, i haven't found any array or QLIst that storages the ClipItems in the timeline, so they can be used in a similar way as the tracks. I know that in the ClipManager exists a parameter that storages a list of DocClipBase, but in order to get the ClipItems from them i would have to create new ClipItems, and the point is obtaining the existing ones, not creating more. Could they be obtained as in the second approach for the tracks, but using a different TagName as "clip" or something similar, or is there any other way to obtain those ClipItems?

I'm sorry if I bother you with this simple problems, but i think it would be easier to go on after that.

Thanks to all in advance,

Alex
alexmartinmerino
Registered Member
Posts
4
Karma
0
Found the render functions for enabling and disabling effects
Code: Select all
/** @brief Enable / disable clip effects.
     * @param track The track where the clip is
     * @param position The start position of the clip
     * @param effectIndexes The list of effect indexes to enable / disable
     * @param disable True if effects should be disabled, false otherwise */
    bool mltEnableEffects(int track, const GenTime &position, const QList<int> &effectIndexes, bool disable);
    /** @brief Enable / disable track effects.
     * @param track The track where the effect is
     * @param effectIndexes The list of effect indexes to enable / disable
     * @param disable True if effects should be disabled, false otherwise */
    bool mltEnableTrackEffects(int track, const QList<int> &effectIndexes, bool disable);

but still not working, i guess it's still due to the track indexes.

If anyone can give me a lead for that i would really appreciate it.

Alex
alexmartinmerino
Registered Member
Posts
4
Karma
0
Working for tracks, but still lacking the info about the clips

Alex
alexmartinmerino
Registered Member
Posts
4
Karma
0


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot]