00001 #include "timecodeplugin.h"
00002
00003
00004
00005
00006
00007 void TimeCodePlugin::CoreInit(const BCore* core)
00008 {
00009 qDebug("TimeCodePlugin-> CoreInit()");
00010 bcore = (BCore*) core;
00011
00012
00013 timecode = bcore->timecode;
00014
00015
00016 TimeDlog = NULL;
00017
00018
00019 messages = new QMultiHash<QString, QString>();
00020
00021 Frames = 33;
00022
00023 timer = new QTimer(this);
00024 connect(timer, SIGNAL(timeout()), this, SLOT(setTime()));
00025 timer->start(Frames);
00026
00027 *timecode = QTime::currentTime();
00028
00029
00030 LoadSettings();
00031
00032 bcore->addConfigTab(getConfig());
00033 }
00034
00035
00036
00037 void TimeCodePlugin::SaveSettings()
00038 {
00039
00040 if(NULL == TimeDlog) TimeD = false;
00041 else TimeD = true;
00042
00043
00044 bcore->settings->setValue("TimeCodePlugin", "TimeDialog_Open", TimeD );
00045 }
00046
00047
00048
00049 void TimeCodePlugin::LoadSettings()
00050 {
00051
00052 if(bcore->settings->getValue("TimeCodePlugin", "TimeDialog_Open", false ).toBool())
00053 getDock(commands()[1]);
00054 }
00055
00056 void TimeCodePlugin::Module(const QString name, const QStringList params)
00057 {
00058 if (!Modules.contains(name))
00059 Modules[name] = new BBoB_Module((QWidget*) this, name);
00060
00061
00062 QStringList::const_iterator constIterator;
00063 for (constIterator = params.constBegin(); constIterator != params.constEnd(); ++constIterator)
00064 {
00065 QString param = (*constIterator);
00066 ++constIterator;
00067 QString value = (*constIterator);
00068 Modules[name]->setParam(param, value);
00069 }
00070 }
00071