timecodeplugin-core.cpp

Go to the documentation of this file.
00001 #include "timecodeplugin.h"
00002 
00003 
00004 /** Called by BCore Initialize -
00005  ** Sets variables, loads classes for message bus, and loads saved settings.
00006  **/
00007 void TimeCodePlugin::CoreInit(const BCore* core)
00008 {
00009     qDebug("TimeCodePlugin-> CoreInit()");
00010     bcore = (BCore*) core;
00011 
00012     // Pointer to global timecode
00013     timecode = bcore->timecode;
00014 
00015     // Make sure all dialogs are NULL for saving
00016     TimeDlog = NULL;
00017 
00018     // Load classes for message bus functions
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     // Load settings and saved dialog states
00030     LoadSettings();
00031 
00032     bcore->addConfigTab(getConfig());
00033 }
00034 
00035 /** Saves state of all dialogs and any other settings this plugin needs.
00036  **/
00037 void TimeCodePlugin::SaveSettings()
00038 {
00039     // set dialog states for saving
00040     if(NULL == TimeDlog) TimeD = false;
00041     else TimeD = true;
00042 
00043     // Save dialog states
00044     bcore->settings->setValue("TimeCodePlugin", "TimeDialog_Open", TimeD );
00045 }
00046 
00047 /** Loads state of all dialogs and any other settings this plugin needs.
00048  **/
00049 void TimeCodePlugin::LoadSettings()
00050 {
00051     // get dialog states and load dialogs if needed
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     // Process parameters
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 

Generated on Sun Oct 28 22:51:29 2007 for BBoB by  doxygen 1.5.3