Relacs Core Library  0.9.8
Public Slots | Public Member Functions | Static Public Member Functions | Protected Slots | Protected Member Functions | List of all members
MetaData Class Reference

#include <metadata.h>

Inheritance diagram for MetaData:
Inheritance graph
[legend]
Collaboration diagram for MetaData:
Collaboration graph
[legend]

Public Slots

int dialog (void)
 
void presetDialog (void)
 

Public Member Functions

 MetaData (RELACSWidget *rw)
 
 ~MetaData (void)
 
virtual void notify (void)
 
void update (void)
 
void add (const string &title="", const Options &opts=Options())
 
void remove (void)
 
void save (void)
 
ostream & saveXML (ostream &str, int level=0, const string &name="")
 
void clear (void)
 
void add (ConfigClass *opt)
 
void lock (void) const
 
void unlock (void) const
 
QMutex * mutex (void)
 
void addActions (QMenu *menu)
 
int saveFlags (void) const
 
void setSaveFlags (int flags)
 
void addSaveFlags (int flags)
 
void delSaveFlags (int flags)
 

Static Public Member Functions

static int dialogFlag (void)
 
static int presetDialogFlag (void)
 
static int configFlag (void)
 
static int standardFlag (void)
 

Protected Slots

void dialogClosed (int r)
 

Protected Member Functions

virtual void customEvent (QEvent *qe)
 
void setSectionName (Options *opt, const string &name)
 

Detailed Description

Manages meta data describing a recording session.

Author
Jan Benda

Meta data are loaded from both the relacs.cfg and the relacsplugins.cfg file (after Control::initialize() and before Control::initDevices() is called) via two instances of the MetaDataGroup class.

Never add options to MetaData within a Control constructor, since these get cleared right before the meta data are loaded from the configuration files!

With the dialogFlag() and the presetDialogFlag() meta data can be selected that are displayed in the dialog() or presetDialog(), respectively.

The "Recording" section is always created by MetaData and contains a few standard properties. A couple of predifined properties are defined in the Recording section:

The values of the standard options are set appropriately in save() right before they are saved to the info file of the session.

If you really want you can remove individual standard options in Control::config() by doing something like

metaData( "Recording" ).erase( "File" );

Constructor & Destructor Documentation

References MetaData::clear().

~MetaData ( void  )

Member Function Documentation

void notify ( void  )
virtual

React to changes in the meta data sections. This function calls notifyMetaData() in all RELACSPlugins.

References RELACSWidget::notifyMetaData().

void update ( void  )
void add ( const string &  title = "",
const Options opts = Options() 
)

Add the meta data opts with title title as a section to the meta data, if both of them are not empty.

See Also
remove()

References MetaData::lock(), MetaData::saveFlags(), and MetaData::unlock().

Referenced by MetaDataGroup::readConfig(), and RELACSWidget::stopSession().

void remove ( void  )

Remove an added section from the metadata.

See Also
update()

References MetaData::lock(), and MetaData::unlock().

Referenced by RELACSWidget::stopSession().

void save ( void  )

Saves the meta data of all sections into the info file of the session.

References SaveFiles::addPath(), ConfigDialog::lock(), MetaData::lock(), MetaData::saveFlags(), ConfigClass::text(), ConfigDialog::unlock(), and MetaData::unlock().

Referenced by RELACSWidget::stopSession().

ostream & saveXML ( ostream &  str,
int  level = 0,
const string &  name = "" 
)

Write meta data that have saveFlags() set in their flags() in XML format to output stream.

Parameters
[in]strthe output stream
[in]levelthe level of indentation
[in]namethe name prefix for the name tag of the section.
Returns
the output stream str

References MetaData::lock(), MetaData::saveFlags(), MetaData::setSectionName(), and MetaData::unlock().

Referenced by SaveFiles::ODMLFiles::close().

void clear ( void  )
void add ( ConfigClass opt)
void lock ( void  ) const
void unlock ( void  ) const
QMutex * mutex ( void  )

The mutex of the meta data.

Referenced by RELACSPlugin::metaDataMutex().

void addActions ( QMenu *  menu)

Add actions to the RELACS menu.

References MetaData::presetDialog().

Referenced by RELACSWidget::RELACSWidget().

int dialogFlag ( void  )
static

The flag that is used to mark meta data options for the dialog.

Referenced by MetaData::dialog(), MetaData::presetDialog(), and MetaDataGroup::readConfig().

int presetDialogFlag ( void  )
static

The flag that is used to mark meta data options for the preset dialog.

Referenced by MetaData::presetDialog().

int configFlag ( void  )
static

The flag that is used by MetaDataGroup::readConfig() to mark meta data options loaded from the config file.

Referenced by MetaDataGroup::configSize(), MetaDataGroup::MetaDataGroup(), MetaDataGroup::readConfig(), and MetaDataGroup::saveConfig().

int standardFlag ( void  )
static

The flag that is used to mark the standard options.

Referenced by SaveFiles::addFile(), and MetaDataGroup::addRecordingOptions().

int saveFlags ( void  ) const

The flags that are used to select meta-data Options to be saved in the info file of the session (default (=0) selects all).

Referenced by MetaData::add(), MetaData::save(), and MetaData::saveXML().

void setSaveFlags ( int  flags)

Set the flags that are used to select meta-data Options to be saved in the info file of the session to flags. Setting flags to 0 selects all (default).

void addSaveFlags ( int  flags)

Add flags to the flags that are used to select meta-data Options to be saved in the info file of the session.

void delSaveFlags ( int  flags)

Delete the bits set in flags from the flags that are used to select meta-data Options to be saved in the info file of the session.

int dialog ( void  )
slot

Launches a dialog at stopTheSession(). It should return 1 to stop and safe the data, 0 to stop and discard the data, and -1 to continue the session. If -1000 is returned, then the dialog() functions should be called again at a later time, because the MetaData are currently locked.

References OptDialog::Accept, OptDialog::addButton(), OptDialog::addOptions(), OptWidget::BoldSectionsStyle, OptDialog::Defaults, MetaData::dialogClosed(), MetaData::dialogFlag(), OptDialog::exec(), OptDialog::NoAction, OptDialog::setCaption(), OptDialog::setRejectCode(), and MetaData::unlock().

Referenced by Session::doStopTheSession().

void presetDialog ( void  )
slot
void dialogClosed ( int  r)
protectedslot

Informs MetaData that the dialog window is closed.

Referenced by MetaData::dialog(), and MetaData::presetDialog().

void customEvent ( QEvent *  qe)
protectedvirtual
void setSectionName ( Options opt,
const string &  name 
)
protected

Referenced by MetaData::saveXML().


The documentation for this class was generated from the following files: