MuseScore/libmscore/stafftext.h

75 lines
3 KiB
C
Raw Normal View History

2012-05-26 14:26:10 +02:00
//=============================================================================
// MuseScore
// Music Composition & Notation
//
// Copyright (C) 2002-2011 Werner Schweer
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2
// as published by the Free Software Foundation and appearing in
// the file LICENCE.GPL
//=============================================================================
#ifndef __STAFFTEXT_H__
#define __STAFFTEXT_H__
#include "text.h"
#include "part.h"
Implementation of text swing (step1) added swing tab swing settings tab in staff text properties Implemented step 2 of swing implementation using staff texts Added call for updateSwing in stafftextproperties Initial page for dialog changed System flag enabled for swing parameters saving and loading with text specified swing implemented removed extra print statement fixed formatting Added groupbox to make the default behavior to no change in swing fixed indentation in stafftextproperties fixing conflicts in staff.h Removed writing of setSwing to file Removed SwingParameter member from staff and fixed layout of swing tab in dialog fixed the issue with disabled controls Added tests for staff text implementation of swing playback cleaned up the code Swing playback using staff texts implemented, facilitating local control over swing parameters and tests for the same added Cleaned up code Cleaned up code further Swing Playback using staff texts implemented Cleaned up code further Cleaning up code further Using MScore::division in place of 480 as ticks Modified test files according to new usage of MScore::division Removed unwanted printf statements Using strings to write to xml rather than doubles for swingUnit Replaced 240 and 120 in terms of MScore::division in stafftext:write Using TDuration to write to xml Replaced string literals by TDuration for style parameters Replaced "off" with "" in style.cpp Set defaults for unit and ratio in constructors Removed usage of two structs for SwingParameters Changed order of assignments in setSwingParameters Swing playback using staff-texts implemented and tests added
2014-07-24 20:09:49 +02:00
#include "staff.h"
2012-05-26 14:26:10 +02:00
2013-05-13 18:49:17 +02:00
namespace Ms {
2012-05-26 14:26:10 +02:00
//---------------------------------------------------------
// ChannelActions
//---------------------------------------------------------
struct ChannelActions {
int channel;
QStringList midiActionNames;
};
//---------------------------------------------------------
2012-07-25 11:49:34 +02:00
// @@ StaffText
2012-05-26 14:26:10 +02:00
//---------------------------------------------------------
class StaffText final : public TextBase {
2012-05-26 14:26:10 +02:00
QString _channelNames[4];
QList<ChannelActions> _channelActions;
Implementation of text swing (step1) added swing tab swing settings tab in staff text properties Implemented step 2 of swing implementation using staff texts Added call for updateSwing in stafftextproperties Initial page for dialog changed System flag enabled for swing parameters saving and loading with text specified swing implemented removed extra print statement fixed formatting Added groupbox to make the default behavior to no change in swing fixed indentation in stafftextproperties fixing conflicts in staff.h Removed writing of setSwing to file Removed SwingParameter member from staff and fixed layout of swing tab in dialog fixed the issue with disabled controls Added tests for staff text implementation of swing playback cleaned up the code Swing playback using staff texts implemented, facilitating local control over swing parameters and tests for the same added Cleaned up code Cleaned up code further Swing Playback using staff texts implemented Cleaned up code further Cleaning up code further Using MScore::division in place of 480 as ticks Modified test files according to new usage of MScore::division Removed unwanted printf statements Using strings to write to xml rather than doubles for swingUnit Replaced 240 and 120 in terms of MScore::division in stafftext:write Using TDuration to write to xml Replaced string literals by TDuration for style parameters Replaced "off" with "" in style.cpp Set defaults for unit and ratio in constructors Removed usage of two structs for SwingParameters Changed order of assignments in setSwingParameters Swing playback using staff-texts implemented and tests added
2014-07-24 20:09:49 +02:00
SwingParameters _swingParameters;
2017-01-20 11:05:52 +01:00
bool _setAeolusStops { false };
int aeolusStops[4] { 0, 0, 0, 0 };
bool _swing { false };
2012-05-26 14:26:10 +02:00
public:
StaffText(Score* = 0);
2018-03-21 14:05:33 +01:00
StaffText(SubStyleId, Score* = 0);
2017-01-20 11:05:52 +01:00
virtual StaffText* clone() const { return new StaffText(*this); }
virtual ElementType type() const { return ElementType::STAFF_TEXT; }
2017-05-23 16:52:04 +02:00
virtual void write(XmlWriter& xml) const override;
virtual void read(XmlReader&) override;
virtual bool readProperties(XmlReader&) override;
2018-03-21 14:05:33 +01:00
virtual int subtype() const { return (int) subStyleId(); }
2016-08-25 09:49:19 +02:00
virtual void layout() override;
2017-01-16 20:51:12 +01:00
virtual QString subtypeName() const { return "??"; }
2018-03-27 15:36:00 +02:00
virtual QVariant propertyDefault(Pid id) const override;
2016-08-25 17:34:25 +02:00
2016-08-25 15:35:37 +02:00
Segment* segment() const;
2012-05-26 14:26:10 +02:00
QString channelName(int voice) const { return _channelNames[voice]; }
void setChannelName(int v, const QString& s) { _channelNames[v] = s; }
Implementation of text swing (step1) added swing tab swing settings tab in staff text properties Implemented step 2 of swing implementation using staff texts Added call for updateSwing in stafftextproperties Initial page for dialog changed System flag enabled for swing parameters saving and loading with text specified swing implemented removed extra print statement fixed formatting Added groupbox to make the default behavior to no change in swing fixed indentation in stafftextproperties fixing conflicts in staff.h Removed writing of setSwing to file Removed SwingParameter member from staff and fixed layout of swing tab in dialog fixed the issue with disabled controls Added tests for staff text implementation of swing playback cleaned up the code Swing playback using staff texts implemented, facilitating local control over swing parameters and tests for the same added Cleaned up code Cleaned up code further Swing Playback using staff texts implemented Cleaned up code further Cleaning up code further Using MScore::division in place of 480 as ticks Modified test files according to new usage of MScore::division Removed unwanted printf statements Using strings to write to xml rather than doubles for swingUnit Replaced 240 and 120 in terms of MScore::division in stafftext:write Using TDuration to write to xml Replaced string literals by TDuration for style parameters Replaced "off" with "" in style.cpp Set defaults for unit and ratio in constructors Removed usage of two structs for SwingParameters Changed order of assignments in setSwingParameters Swing playback using staff-texts implemented and tests added
2014-07-24 20:09:49 +02:00
void setSwingParameters(int unit, int ratio) { _swingParameters.swingUnit = unit; _swingParameters.swingRatio = ratio; }
2012-05-26 14:26:10 +02:00
const QList<ChannelActions>* channelActions() const { return &_channelActions; }
QList<ChannelActions>* channelActions() { return &_channelActions; }
const SwingParameters* swingParameters() const { return &_swingParameters; }
2012-05-26 14:26:10 +02:00
void clearAeolusStops();
void setAeolusStop(int group, int idx, bool val);
bool getAeolusStop(int group, int idx) const;
2016-08-25 09:49:19 +02:00
void setSetAeolusStops(bool val) { _setAeolusStops = val; }
void setSwing(bool checked) { _swing = checked; }
bool setAeolusStops() const { return _setAeolusStops; }
bool swing() const { return _swing; }
2012-05-26 14:26:10 +02:00
};
2013-05-13 18:49:17 +02:00
} // namespace Ms
2012-05-26 14:26:10 +02:00
#endif