UnitDatabase Class Reference

#include <UnitDatabase.h>

Collaboration diagram for UnitDatabase:

Collaboration graph
[legend]
List of all members.

Detailed Description

Definition at line 29 of file UnitDatabase.h.

Signals

void unitDatabaseChanged ()

Public Member Functions

QStringList getKnownUnits () const
void registerUnit (QString unit)
int getUnitId (QString unit, bool registerNew=true)
 Return the reference id for a given unit name.
QString getUnitById (int id)

Static Public Member Functions

static UnitDatabasegetInstance ()

Protected Types

typedef std::map< QString,
int > 
UnitMap

Protected Member Functions

 UnitDatabase ()

Protected Attributes

UnitMap m_units
int m_nextId

Static Protected Attributes

static UnitDatabase m_instance


Member Typedef Documentation

typedef std::map<QString, int> UnitDatabase::UnitMap [protected]

Definition at line 54 of file UnitDatabase.h.


Constructor & Destructor Documentation

UnitDatabase::UnitDatabase (  )  [protected]

Definition at line 27 of file UnitDatabase.cpp.


Member Function Documentation

UnitDatabase * UnitDatabase::getInstance (  )  [static]

Definition at line 22 of file UnitDatabase.cpp.

References m_instance.

Referenced by PropertyContainer::convertPropertyStrings(), TimeValueLayer::getPropertyRangeAndValue(), NoteLayer::getPropertyRangeAndValue(), MainWindow::MainWindow(), PropertyBox::PropertyBox(), PropertyBox::propertyControllerChanged(), TimeValueLayer::setProperty(), NoteLayer::setProperty(), SparseValueModel< TimeValuePoint >::setScaleUnits(), and PropertyBox::updatePropertyEditor().

QStringList UnitDatabase::getKnownUnits (  )  const

Definition at line 33 of file UnitDatabase.cpp.

References m_units.

Referenced by PropertyBox::updatePropertyEditor().

void UnitDatabase::registerUnit ( QString  unit  ) 

Definition at line 43 of file UnitDatabase.cpp.

References m_nextId, m_units, and unitDatabaseChanged().

Referenced by getUnitId(), MainWindow::MainWindow(), and SparseValueModel< TimeValuePoint >::setScaleUnits().

int UnitDatabase::getUnitId ( QString  unit,
bool  registerNew = true 
)

Return the reference id for a given unit name.

If registerNew is true and the unit is not known, register it and return its new id. If register is false and the unit is not known, return -1.

Definition at line 52 of file UnitDatabase.cpp.

References m_units, and registerUnit().

Referenced by PropertyContainer::convertPropertyStrings(), TimeValueLayer::getPropertyRangeAndValue(), and NoteLayer::getPropertyRangeAndValue().

QString UnitDatabase::getUnitById ( int  id  ) 

Definition at line 62 of file UnitDatabase.cpp.

References m_units.

Referenced by PropertyBox::updatePropertyEditor().

void UnitDatabase::unitDatabaseChanged (  )  [signal]

Referenced by registerUnit().


Member Data Documentation

UnitMap UnitDatabase::m_units [protected]

Definition at line 55 of file UnitDatabase.h.

Referenced by getKnownUnits(), getUnitById(), getUnitId(), and registerUnit().

int UnitDatabase::m_nextId [protected]

Definition at line 56 of file UnitDatabase.h.

Referenced by registerUnit().

UnitDatabase UnitDatabase::m_instance [static, protected]

Definition at line 58 of file UnitDatabase.h.

Referenced by getInstance().


The documentation for this class was generated from the following files:
Generated on Wed Feb 20 15:45:37 2008 for SonicVisualiser by  doxygen 1.5.1