#include <bcore.h>
Definition at line 25 of file bcore.h.
Public Slots | |
void | addDock (QDockWidget *dock) |
Receives the QDockWidget from a plugin and signals that a new dock is available. | |
bool | isDockVisible (QDialog *dlog) |
void | addConfigTab (QWidget *tab) |
void | pluginLoadFile (const QString filename) |
Given a filename this will try to load a plugin, and add to the list. | |
void | pluginUnloadFile (const QString filename) |
Given a filename this will try to unload a plugin. | |
void | savePluginSettings () |
Goes through all plugins and calls SaveSettings(). | |
void | pluginRescan () |
Rescans the plugin directory for files not previously loaded, and adds to the plugin list. | |
void | status (const QString message) |
Receives a message to display as the current app status. | |
void | BitBus (const int FromID, const int DestID, const int bit) |
Send a BusMessage to a Bus ID. | |
void | ByteBus (const int FromID, const int DestID, const int byte) |
Send a BusMessage to a Bus ID. | |
void | StringBus (const int FromID, const int DestID, const QString str) |
Send a BusMessage to a Bus ID. | |
Signals | |
void | newDock (QDockWidget *dock) |
Gets connected to a QMainWindow when a dock widget is ready. | |
void | newConfigTab (QWidget *tab) |
Gets connected to the config tab when a widget is ready. | |
void | newPlugin (QObject *plugin) |
Used by the plugin manager to show a new plugin. | |
void | sigPluginChanged () |
Used by the plugin manager to know when a plugin has unloaded/reloaded. | |
void | StatusBar (QString Message, int Timeout) |
Sends a message with timeout to the windows status bar. | |
Public Member Functions | |
BCore (QWidget *parent=0) | |
BCore handles program settings through QSettings. | |
void | init (QSplashScreen *splash) |
Finds and scans plugin directory, and loads plugins. | |
int | BusByName (const QString name) |
Given a bus name this will return the number of a bus, or -1 if not found. | |
QString | BusName (const int ID) |
Given a Bus ID, returns the name of the bus. | |
bool | pluginLoaded (const QString name) |
Given a filename this looks through the plugin list and checks if it's loaded. | |
void | connectChannels (BBoB_Channel *sender, BBoB_Channel *receiver) |
Connect channels and maintain connection list for saving. | |
void | connectChannelCue (BBoB_Channel *sender, const BBoB_Cue *receiver) |
Connect a channel to a cue trigger and maintain connection list for saving. | |
void | loadConnections () |
Read settings file and make ChanConnections. | |
void | saveConnections () |
Save Connections to settings file. | |
void | loadCues (QSplashScreen *splash) |
Loads Cue list and updates the splash screen. | |
void | saveCues () |
Saves the Cue list. | |
void | RenameCue (QString current, QString newname) |
Rename a Cue in the list. | |
QList< BBoB_Module * > | listModules () |
Return pointers to all modules in all plugins. | |
BBoB_Module * | findModule (QString name) |
Returns a pointer to a Module by name. | |
QStringList | findOutputs (QString modName, QString input) |
Returns a list of output names connected to module/input. | |
QStringList | findOutputs (QString cue) |
Returns a list of output names connected to a cue. | |
BBoB_Channel * | findChannel (QString mod, QString chan) |
Search all plugins for mod name and chan name. | |
Public Attributes | |
QString | Args |
QLinkedList < QPluginLoader * > | PluginList |
QLinkedList< QDialog * > | PluginConfigs |
QDir | pluginsDir |
QStringList | pluginFileNames |
QObject * | Buses [255] |
List of modules with buses. | |
QTime * | timecode |
Global timecode, just a common buffer, requires update from outside bcore. | |
BBoB_Settings * | settings |
This needs be set by the application, then referenced by plugins. | |
BBoB_Settings * | cueSettings |
This needs be set by the application, then BCore can load/save cues. | |
BBoB_Settings * | connectionSettings |
This needs be set by the application, then BCore can load/save connections (portmap). | |
QMap< QString, BBoB_Cue * > | Cues |
Holds a list of cues. | |
Private Member Functions | |
void | pluginPath () |
Finds OS dependant path for loading plugins. | |
void | loadPlugins (QSplashScreen *splash) |
Search OS specific directory for plugins. | |
void | BroadcastBitBus (const int FromID, const int msg) |
Send a BusMessage to all Bus IDs. | |
void | BroadcastByteBus (const int FromID, const int msg) |
Send a BusMessage to all Bus IDs. | |
void | BroadcastStringBus (const int FromID, const QString msg) |
Send a BusMessage to all Bus IDs. | |
Private Attributes | |
QMultiMap< QString, QString > | ChanConnections |
List of connected channels (input, output) to be saved/loaded. | |
QMultiMap< QString, QString > | CueConnections |
BCore::BCore | ( | QWidget * | parent = 0 |
) |
BCore handles program settings through QSettings.
Loads/Unloads plugins, lists and finds modules in plugins, lists and finds channels in modules, and loads and manages cues.
Definition at line 24 of file bcore.cpp.
References QMap::clear(), Cues, and timecode.
void BCore::init | ( | QSplashScreen * | splash | ) |
Finds and scans plugin directory, and loads plugins.
Definition at line 39 of file bcore.cpp.
References loadPlugins(), and pluginPath().
Referenced by Qonsole::Qonsole(), and bbobdThread::run().
int BCore::BusByName | ( | const QString | name | ) |
Given a bus name this will return the number of a bus, or -1 if not found.
Plugins communicate by number, but the number could be different with every load. They should save Bus Names and lookup the name in init().
Definition at line 702 of file bcore.cpp.
References Buses, and MessageBusInterface::BusName().
QString BCore::BusName | ( | const int | ID | ) |
Given a Bus ID, returns the name of the bus.
Plugins communicate by number, but the number could be different with every load. They should save Bus Names and lookup the name in init().
Definition at line 724 of file bcore.cpp.
References Buses, and MessageBusInterface::BusName().
Referenced by BusConsolePlugin::DlogIdChanged(), BusConsolePlugin::getDock(), and BusConsolePlugin::remote_data().
bool BCore::pluginLoaded | ( | const QString | name | ) |
Given a filename this looks through the plugin list and checks if it's loaded.
Definition at line 510 of file bcore.cpp.
References QDir::absoluteFilePath(), QLinkedList::constBegin(), QLinkedList::constEnd(), PluginList, and pluginsDir.
void BCore::connectChannels | ( | BBoB_Channel * | sender, | |
BBoB_Channel * | receiver | |||
) |
Connect channels and maintain connection list for saving.
Only objects are passed, as Output() signal will always be connected to Input() slot.
Definition at line 60 of file bcore.cpp.
References ChanConnections, BBoB_Channel::getModName(), BBoB_Channel::getName(), and QMultiMap::insert().
Referenced by DragDropTree::dropEvent(), and loadConnections().
void BCore::connectChannelCue | ( | BBoB_Channel * | sender, | |
const BBoB_Cue * | receiver | |||
) |
Connect a channel to a cue trigger and maintain connection list for saving.
Only objects are passed, as Output() signal will always be connected to Trigger() slot.
Definition at line 74 of file bcore.cpp.
References CueConnections, BBoB_Channel::getModName(), BBoB_Channel::getName(), QMultiMap::insert(), BBoB_Cue::Name, and QString::toAscii().
Referenced by DragDropTree::dropEvent(), and loadConnections().
void BCore::loadConnections | ( | ) |
Read settings file and make ChanConnections.
Connect channels and maintain connection list for saving.
Only objects are passed, as Output() signal will always be connected to Input() slot.
Definition at line 212 of file bcore.cpp.
References connectChannelCue(), connectChannels(), Cues, findChannel(), BBoB_Settings::getList(), BBoB_Settings::getValue(), QString::isEmpty(), BBoB_Settings::setList(), settings, QString::split(), and QVariant::toString().
Referenced by Qonsole::Qonsole(), and bbobdThread::run().
void BCore::saveConnections | ( | ) |
Save Connections to settings file.
Save Connection state of channels.
Definition at line 269 of file bcore.cpp.
References ChanConnections, CueConnections, QMapIterator::hasNext(), QMapIterator::key(), QMapIterator::next(), settings, BBoB_Settings::setValue(), and QMapIterator::value().
Referenced by Qonsole::SaveSettings().
void BCore::loadCues | ( | QSplashScreen * | splash | ) |
Loads Cue list and updates the splash screen.
Definition at line 85 of file bcore.cpp.
References BBoB_Cue::Channels, QMap::clear(), Cues, cueSettings, findChannel(), findModule(), BBoB_Settings::getGroups(), BBoB_Settings::getListValue(), BBoB_Channel::getModName(), BBoB_Channel::getName(), BBoB_Module_Base::getName(), BBoB_Settings::getValues(), QMap::insert(), BBoB_Cue::Modules, name, BBoB_Settings::setList(), QSplashScreen::showMessage(), QMap::size(), QString::split(), QString::toAscii(), and QVariant::toString().
Referenced by Qonsole::Qonsole(), and bbobdThread::run().
void BCore::saveCues | ( | ) |
Saves the Cue list.
Save the list of Cues to the Cue settings file.
A Cue without any modules or parameters will be deleted from the file
Definition at line 172 of file bcore.cpp.
References BBoB_Cue::Channels, QMap::count(), Cues, cueSettings, BBoB_Channel::getModName(), BBoB_Channel::getName(), BBoB_Module_Base::getName(), QMap::keys(), BBoB_Cue::Modules, BBoB_Cue::Name, BBoB_Settings::removeValues(), BBoB_Settings::setList(), QMap::value(), QMap::values(), and BBoB_Settings::writeList().
Referenced by Qonsole::SaveSettings().
Rename a Cue in the list.
Definition at line 201 of file bcore.cpp.
References Cues, QMap::insert(), QMap::take(), and QMap::value().
Referenced by Config_Cues::cueNameChanged().
QList< BBoB_Module * > BCore::listModules | ( | ) |
Return pointers to all modules in all plugins.
Definition at line 394 of file bcore.cpp.
References QLinkedList::constBegin(), QLinkedList::constEnd(), QList::last(), CoreInterface::ModuleList(), CoreInterface::ModulePointer(), and PluginList.
Referenced by findModule(), Config_Cues::selectChannel(), and Config_Cues::selectModule().
BBoB_Module * BCore::findModule | ( | QString | name | ) |
Returns a pointer to a Module by name.
Definition at line 373 of file bcore.cpp.
References QList::at(), QList::count(), BBoB_Module_Base::getName(), listModules(), and QString::toAscii().
Referenced by loadCues().
QStringList BCore::findOutputs | ( | QString | modName, | |
QString | input | |||
) |
Returns a list of output names connected to module/input.
Definition at line 462 of file bcore.cpp.
References ChanConnections, and QMultiMap::contains().
Referenced by Config_Portmap::addModules(), and Config_Portmap::populateTreeCue().
QStringList BCore::findOutputs | ( | QString | cue | ) |
Returns a list of output names connected to a cue.
Definition at line 474 of file bcore.cpp.
References QMultiMap::contains(), and CueConnections.
BBoB_Channel * BCore::findChannel | ( | QString | mod, | |
QString | chan | |||
) |
Search all plugins for mod name and chan name.
Definition at line 432 of file bcore.cpp.
References CoreInterface::ChannelPointer(), QLinkedList::constBegin(), QLinkedList::constEnd(), BBoB_Channel::name, PluginList, and QString::toAscii().
Referenced by loadConnections(), loadCues(), and Config_Cues::selectChannel().
void BCore::pluginPath | ( | ) | [private] |
Finds OS dependant path for loading plugins.
Definition at line 488 of file bcore.cpp.
References QDir::cd(), QDir::cdUp(), QDir::dirName(), PLUGIN_DIR_UNIX, and pluginsDir.
Referenced by init().
void BCore::loadPlugins | ( | QSplashScreen * | splash | ) | [private] |
Search OS specific directory for plugins.
Tries to load all files in this directory.
Definition at line 295 of file bcore.cpp.
References QDir::absoluteFilePath(), Buses, CoreInterface::CoreInit(), QLinkedList::count(), QDir::entryList(), QLinkedList::last(), MessageBusInterface::loadBus(), newPlugin(), pluginFileNames, PluginList, pluginsDir, QByteArray::setNum(), QSplashScreen::showMessage(), and QString::toAscii().
Referenced by init().
void BCore::BroadcastBitBus | ( | const int | FromID, | |
const int | msg | |||
) | [private] |
Send a BusMessage to all Bus IDs.
Definition at line 663 of file bcore.cpp.
References MessageBusInterface::BitBus(), and Buses.
Referenced by BitBus().
void BCore::BroadcastByteBus | ( | const int | FromID, | |
const int | msg | |||
) | [private] |
Send a BusMessage to all Bus IDs.
Definition at line 675 of file bcore.cpp.
References Buses, and MessageBusInterface::ByteBus().
Referenced by ByteBus().
void BCore::BroadcastStringBus | ( | const int | FromID, | |
const QString | msg | |||
) | [private] |
Send a BusMessage to all Bus IDs.
Definition at line 686 of file bcore.cpp.
References Buses, and MessageBusInterface::StringBus().
Referenced by StringBus().
void BCore::addDock | ( | QDockWidget * | dock | ) | [slot] |
Receives the QDockWidget from a plugin and signals that a new dock is available.
For a QMainWindow app, this signal should be connected to a slot with addDockWidget(). For a console base app, this signal can be ignored.
Definition at line 749 of file bcore.cpp.
References newDock(), and QDockWidget::widget().
Referenced by UdpPlugin::getDock(), TimeCodePlugin::getDock(), TestPlugin::getDock(), TcpPlugin::getDock(), SoundPlugin::getDock(), SerialPlugin::getDock(), SDLPlugin::getDock(), PluginViewerPlugin::getDock(), LiveUpdatePlugin::getDock(), LightTreePlugin::getDock(), GlExamplePlugin::getDock(), FmodSystemPlugin::getDock(), FaderBlockPlugin::getDock(), ButtonBlockPlugin::getDock(), and BusConsolePlugin::getDock().
bool BCore::isDockVisible | ( | QDialog * | dlog | ) | [slot] |
Definition at line 755 of file bcore.cpp.
Referenced by SerialPlugin::SaveSettings(), SDLPlugin::SaveSettings(), PluginViewerPlugin::SaveSettings(), LightTreePlugin::SaveSettings(), FmodSystemPlugin::SaveSettings(), FaderBlockPlugin::SaveSettings(), and ButtonBlockPlugin::SaveSettings().
void BCore::addConfigTab | ( | QWidget * | tab | ) | [slot] |
Definition at line 765 of file bcore.cpp.
References newConfigTab().
Referenced by TimeCodePlugin::CoreInit(), LightTreePlugin::CoreInit(), and FmodSystemPlugin::CoreInit().
void BCore::pluginLoadFile | ( | const QString | filename | ) | [slot] |
Given a filename this will try to load a plugin, and add to the list.
Definition at line 530 of file bcore.cpp.
References QDir::absoluteFilePath(), QLinkedList::constBegin(), QLinkedList::constEnd(), PluginList, pluginsDir, sigPluginChanged(), and QString::toAscii().
void BCore::pluginUnloadFile | ( | const QString | filename | ) | [slot] |
Given a filename this will try to unload a plugin.
Definition at line 571 of file bcore.cpp.
References QDir::absoluteFilePath(), QLinkedList::constBegin(), QLinkedList::constEnd(), PluginList, pluginsDir, sigPluginChanged(), and QString::toAscii().
void BCore::savePluginSettings | ( | ) | [slot] |
Goes through all plugins and calls SaveSettings().
Definition at line 356 of file bcore.cpp.
References QLinkedList::constBegin(), QLinkedList::constEnd(), PluginList, and CoreInterface::SaveSettings().
Referenced by Qonsole::SaveSettings().
void BCore::pluginRescan | ( | ) | [slot] |
Rescans the plugin directory for files not previously loaded, and adds to the plugin list.
Definition at line 599 of file bcore.cpp.
References sigPluginChanged().
void BCore::status | ( | const QString | message | ) | [slot] |
Receives a message to display as the current app status.
Passes a QString to signal StatusBar(message, 10000).
That signal can be connected to the MainWindow for a StatusBar, or printed to STDOUT.
Definition at line 50 of file bcore.cpp.
References StatusBar().
void BCore::BitBus | ( | const int | FromID, | |
const int | DestID, | |||
const int | bit | |||
) | [slot] |
Send a BusMessage to a Bus ID.
Handles bus messages from a plugin, and passes to intended plugin.
Definition at line 614 of file bcore.cpp.
References MessageBusInterface::BitBus(), BroadcastBitBus(), and Buses.
void BCore::ByteBus | ( | const int | FromID, | |
const int | DestID, | |||
const int | byte | |||
) | [slot] |
Send a BusMessage to a Bus ID.
Handles bus messages from a plugin, and passes to intended plugin.
Definition at line 631 of file bcore.cpp.
References BroadcastByteBus(), Buses, and MessageBusInterface::ByteBus().
void BCore::StringBus | ( | const int | FromID, | |
const int | DestID, | |||
const QString | str | |||
) | [slot] |
Send a BusMessage to a Bus ID.
Handles bus messages from a plugin, and passes to intended plugin.
Definition at line 648 of file bcore.cpp.
References BroadcastStringBus(), Buses, and MessageBusInterface::StringBus().
Referenced by TimeCodePlugin::setTime().
void BCore::newDock | ( | QDockWidget * | dock | ) | [signal] |
void BCore::newConfigTab | ( | QWidget * | tab | ) | [signal] |
void BCore::newPlugin | ( | QObject * | plugin | ) | [signal] |
void BCore::sigPluginChanged | ( | ) | [signal] |
Used by the plugin manager to know when a plugin has unloaded/reloaded.
Referenced by pluginLoadFile(), pluginRescan(), and pluginUnloadFile().
void BCore::StatusBar | ( | QString | Message, | |
int | Timeout | |||
) | [signal] |
Definition at line 31 of file bcore.h.
Referenced by LiveUpdatePlugin::Module(), Qonsole::Qonsole(), and bbobdThread::run().
Definition at line 34 of file bcore.h.
Referenced by findChannel(), PluginDialog::findPlugins(), listModules(), loadPlugins(), Config_Portmap::on_RefreshButton_clicked(), pluginLoaded(), pluginLoadFile(), pluginUnloadFile(), and savePluginSettings().
Definition at line 43 of file bcore.h.
Referenced by PluginDialog::findPlugins(), loadPlugins(), Config_Portmap::on_RefreshButton_clicked(), pluginLoaded(), pluginLoadFile(), pluginPath(), and pluginUnloadFile().
Definition at line 46 of file bcore.h.
Referenced by PluginDialog::findPlugins(), and loadPlugins().
QObject* BCore::Buses[255] |
List of modules with buses.
Definition at line 49 of file bcore.h.
Referenced by BitBus(), BroadcastBitBus(), BroadcastByteBus(), BroadcastStringBus(), BusByName(), BusName(), ByteBus(), loadPlugins(), and StringBus().
Global timecode, just a common buffer, requires update from outside bcore.
Definition at line 52 of file bcore.h.
Referenced by BCore(), and TimeCodePlugin::CoreInit().
This needs be set by the application, then referenced by plugins.
Definition at line 61 of file bcore.h.
Referenced by loadConnections(), Qonsole::loadDesks(), Qonsole::LoadForStartup(), UdpPlugin::LoadSettings(), TimeCodePlugin::LoadSettings(), TcpPlugin::LoadSettings(), SoundPlugin::LoadSettings(), SerialPlugin::LoadSettings(), SDLPlugin::LoadSettings(), PluginViewerPlugin::LoadSettings(), LightTreePlugin::LoadSettings(), GlExamplePlugin::LoadSettings(), FmodSystemPlugin::LoadSettings(), FaderBlockPlugin::LoadSettings(), ButtonBlockPlugin::LoadSettings(), BusConsolePlugin::LoadSettings(), bbobdThread::run(), UdpPlugin::saveChannels(), TcpPlugin::saveChannels(), SoundPlugin::saveChannels(), SerialPlugin::saveChannels(), SDLPlugin::saveChannels(), LightTreePlugin::saveChannels(), GlExamplePlugin::saveChannels(), BusConsolePlugin::saveChannels(), saveConnections(), Qonsole::saveDesks(), Qonsole::SaveSettings(), UdpPlugin::SaveSettings(), TimeCodePlugin::SaveSettings(), TestPlugin::SaveSettings(), TcpPlugin::SaveSettings(), SoundPlugin::SaveSettings(), SerialPlugin::SaveSettings(), SDLPlugin::SaveSettings(), PluginViewerPlugin::SaveSettings(), LiveUpdatePlugin::SaveSettings(), LightTreePlugin::SaveSettings(), GlExamplePlugin::SaveSettings(), FmodSystemPlugin::SaveSettings(), FaderBlockPlugin::SaveSettings(), ButtonBlockPlugin::SaveSettings(), and BusConsolePlugin::SaveSettings().
This needs be set by the application, then BCore can load/save cues.
Definition at line 64 of file bcore.h.
Referenced by loadCues(), Qonsole::LoadForStartup(), bbobdThread::run(), saveCues(), and Qonsole::SaveSettings().
This needs be set by the application, then BCore can load/save connections (portmap).
Definition at line 67 of file bcore.h.
Referenced by Qonsole::LoadForStartup(), bbobdThread::run(), and Qonsole::SaveSettings().
Holds a list of cues.
Definition at line 84 of file bcore.h.
Referenced by Config_Cues::addChan(), Config_Cues::addCue(), Config_Cues::addModParam(), BCore(), Config_Cues::ChanChanged(), Config_Cues::cueSelected(), loadConnections(), loadCues(), Config_Cues::ModParamChanged(), Config_Portmap::on_RefreshButton_clicked(), Config_Cues::RefreshChans(), Config_Cues::RefreshCues(), Config_Cues::RefreshMods(), Config_Cues::removeChan(), Config_Cues::removeCue(), Config_Cues::removeModParam(), RenameCue(), saveCues(), and Config_Cues::showCueMenu().
QMultiMap<QString, QString> BCore::ChanConnections [private] |
List of connected channels (input, output) to be saved/loaded.
Definition at line 112 of file bcore.h.
Referenced by connectChannels(), findOutputs(), and saveConnections().
QMultiMap<QString, QString> BCore::CueConnections [private] |
Definition at line 113 of file bcore.h.
Referenced by connectChannelCue(), findOutputs(), and saveConnections().