Skip to content

Commit

Permalink
Merge pull request musescore#1987 from heuchi/scripting-actual-duration
Browse files Browse the repository at this point in the history
expose globalDuration to scripting
  • Loading branch information
wschweer committed Oct 28, 2015
2 parents b3af623 + 227c825 commit 299c1a8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libmscore/duration.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ class Spanner;
// @@ DurationElement
/// Virtual base class for Chord, Rest and Tuplet.
//
// @P duration int duration in ticks
// @P duration Fraction duration (as written)
// @P globalDuration Fraction played duration
//---------------------------------------------------------

class DurationElement : public Element {
Expand All @@ -37,9 +38,11 @@ class DurationElement : public Element {
#ifdef SCRIPT_INTERFACE
Q_OBJECT
Q_PROPERTY(FractionWrapper* duration READ durationW WRITE setDurationW)
Q_PROPERTY(FractionWrapper* globalDuration READ globalDurW)

void setDurationW(FractionWrapper* f) { _duration = f->fraction(); }
FractionWrapper* durationW() const { return new FractionWrapper(_duration); }
FractionWrapper* globalDurW() const { return new FractionWrapper(globalDuration()); }
#endif

public:
Expand Down

0 comments on commit 299c1a8

Please sign in to comment.