/*******************************************************************************
**
** The source file for the Jahshaka effect module
** The Jahshaka Project
** Copyright (C) 2000-2005 The Jahshaka Project
** Released under the GNU General Public License
**
*******************************************************************************/

#include "tracker.h"
#include <qslider.h>

void GLTracker::updateSliders()
{   
    JahLayer* jah_layer = getActiveJahLayer();
    motionNode* slider_value = jah_layer->layernodes->m_node;

    m_x_position_slider->setValue(int( slider_value->rx ));
    m_y_position_slider->setValue(int( slider_value->ry ));
    m_point_radius_slider->setValue(int( slider_value->rz ));
    m_point_search_radius_slider->setValue(int( slider_value->tx ));
    m_point_sensitivity_slider->setValue(int( slider_value->ty ));
    m_point_checksum_tolerance_slider->setValue(int( slider_value->tz ));

    updateUiOptions();
    updateUiSettings();

}

void GLTracker::updateUiOptions()
{
    hideOptions(numUiOptions-1);
}

void GLTracker::updateUiSettings()
{
    JahModuleOption[0]->setChecked(getActiveJahLayer()->option1);
    JahModuleOption[1]->setChecked(getActiveJahLayer()->option2);
    JahModuleOption[2]->setChecked(getActiveJahLayer()->option3);
    JahModuleOption[3]->setChecked(getActiveJahLayer()->option4);
}


void GLTracker::setOption1(void)
{
    getActiveJahLayer()->option1 = JahModuleOption[0]->isChecked();
    updateEffects();
}

void GLTracker::setOption2(void)
{
    getActiveJahLayer()->option2 = JahModuleOption[1]->isChecked();
    updateEffects();
}

void GLTracker::setOption3(void)
{
    getActiveJahLayer()->option3 = JahModuleOption[2]->isChecked();
    updateEffects();
}

void GLTracker::setOption4(void)
{
    getActiveJahLayer()->option4 = JahModuleOption[3]->isChecked();
    updateEffects();
}


