|
hydrogen 1.1.1
|
Timeline class storing and handling all TempoMarkers and Tags. More...
#include <Timeline.h>
Data Structures | |
| struct | Tag |
| Tag specifies a note added to a certain position in the Song. More... | |
| struct | TagComparator |
| struct | TempoMarker |
| TempoMarker specifies a change in speed during the Song. More... | |
| struct | TempoMarkerComparator |
Public Member Functions | |
| Timeline () | |
| ~Timeline () | |
| void | addTempoMarker (int nBar, float fBpm) |
| void | deleteTempoMarker (int nBar) |
| void | deleteAllTempoMarkers () |
| float | getTempoAtBar (int nBar, bool bSticky) const |
| Returns the tempo of the Song at a given bar. More... | |
| const std::vector< std::shared_ptr< const TempoMarker > > | getAllTempoMarkers () const |
| void | addTag (int nBar, QString sTag) |
| void | deleteTag (int nBar) |
| void | deleteAllTags () |
| const QString | getTagAtBar (int nBar, bool bSticky) const |
| Returns the tag of the Song at a given bar. More... | |
| const std::vector< std::shared_ptr< const Tag > > | getAllTags () const |
Public Member Functions inherited from Object | |
| ~Object () | |
| destructor More... | |
| Object (const Object &obj) | |
| copy constructor More... | |
| Object (const char *class_name) | |
| constructor More... | |
| const char * | class_name () const |
| return the class name More... | |
| virtual QString | toQString (const QString &sPrefix, bool bShort=true) const |
| Formatted string version for debugging purposes. More... | |
| void | Print (bool bShort=true) const |
| Prints content of toQString() via DEBUGLOG. More... | |
Private Member Functions | |
| void | sortTempoMarkers () |
| void | sortTags () |
Private Attributes | |
| std::vector< std::shared_ptr< const TempoMarker > > | m_tempoMarkers |
| std::vector< std::shared_ptr< const Tag > > | m_tags |
Additional Inherited Members | |
Static Public Member Functions inherited from Object | |
| static void | set_count (bool flag) |
| enable/disable class instances counting More... | |
| static bool | count_active () |
| return true if class instances counting is enabled More... | |
| static unsigned | objects_count () |
| return the number of objects More... | |
| static void | write_objects_map_to (std::ostream &out) |
| output the full objects map to a given ostream More... | |
| static void | write_objects_map_to_cerr () |
| output objects map to stderr More... | |
| static int | bootstrap (Logger *logger, bool count=false) |
| must be called before any Object instantiation ! More... | |
| static Logger * | logger () |
| return the logger instance More... | |
Static Public Attributes inherited from Object | |
| static QString | sPrintIndention = " " |
| String used to format the debugging string output of some core classes. More... | |
Static Protected Attributes inherited from Object | |
| static Logger * | __logger = nullptr |
| logger instance pointer More... | |
Timeline class storing and handling all TempoMarkers and Tags.
All methods altering the TempoMarker and Tag are members of this class and the former are added as const structs to m_tempoMarkers or m_tags. To alter one of them, one has to delete it and add a new, altered version.
| Timeline | ( | ) |
| ~Timeline | ( | ) |
| void addTag | ( | int | nBar, |
| QString | sTag | ||
| ) |
| nBar | Position of the Timeline to query for a tag. |
| sTag | New tag in beats per minute. |
| void addTempoMarker | ( | int | nBar, |
| float | fBpm | ||
| ) |
| nBar | Position of the Timeline to query for a tempo marker. |
| fBpm | New tempo in beats per minute. All values below 30 and above 500 will be cut. |
|
inline |
|
inline |
| void deleteTag | ( | int | nBar | ) |
| nBar | Position of the Timeline to delete the tag at (if one is present). |
| void deleteTempoMarker | ( | int | nBar | ) |
| nBar | Position of the Timeline to delete the tempo marker at (if one is present). |
|
inline |
|
inline |
| const QString getTagAtBar | ( | int | nBar, |
| bool | bSticky | ||
| ) | const |
Returns the tag of the Song at a given bar.
| nBar | Position of the Timeline to query for a tag. |
| bSticky | If set to true either the tag at nBar or - if none is present - the nearest previous tag is returned. If set to false, only the precise position nBar is taken into account. |
The function returns "" if the bar is positioned before the first tag or none is present at all.
| float getTempoAtBar | ( | int | nBar, |
| bool | bSticky | ||
| ) | const |
Returns the tempo of the Song at a given bar.
| nBar | Position of the Timeline to query for a tempo marker. |
| bSticky | If set to true either the tempo marker at nBar or - if none is present - the nearest previous tempo marker is returned. If set to false, only the precise position nBar is taken into account. |
TODO: For now the function returns 0 if the bar is positioned before the first tempo marker. The calling routine Hydrogen::getTimelineBpm() will take care of this and replaces it with pSong->__bpm. This will be taken care of with #854.
|
private |
|
private |
|
private |
|
private |