Skip to content
Permalink
Browse files

Merge pull request #4000 from Jojo-Schmitz/plugins

fix #175726: first step at getting plugins to work in master
  • Loading branch information...
anatoly-os committed Oct 25, 2018
2 parents 2efabba + 98207a4 commit 44b28b73a2d1a59fb2b1ba2ae2710fcfd6fef2a5
@@ -316,10 +316,10 @@ class Movements : public std::vector<MasterScore*> {

//---------------------------------------------------------------------------------------
// @@ Score
// @P composer string composer of the score (read only)
//// @P composer string composer of the score (read only)
// @P duration int duration of score in seconds (read only)
// @P excerpts array[Excerpt] the list of the excerpts (linked parts)
// @P firstMeasure Measure the first measure of the score (read only)
//// @P excerpts array[Excerpt] the list of the excerpts (linked parts)
//// @P firstMeasure Measure the first measure of the score (read only)
// @P firstMeasureMM Measure the first multi-measure rest measure of the score (read only)
// @P harmonyCount int number of harmony items (read only)
// @P hasHarmonies bool score has chord symbols (read only)
@@ -329,13 +329,14 @@ class Movements : public std::vector<MasterScore*> {
// @P lastMeasureMM Measure the last multi-measure rest measure of the score (read only)
// @P lastSegment Segment the last score segment (read-only)
// @P lyricCount int number of lyric items (read only)
// @P name string name of the score
//// @P name string name of the score
// @P nmeasures int number of measures (read only)
// @P npages int number of pages (read only)
// @P nstaves int number of staves (read only)
// @P ntracks int number of tracks (staves * 4) (read only)
// not to be documented?
// @P parts array[Part] the list of parts (read only)
//// @P parts array[Part] the list of parts (read only)
// @P mscoreVersion QString MuseScore version the score was last saved with (read only)
// @P mscoreRevision QString MuseScore revision the score was last saved with (read only)
//
// a Score has always an associated MasterScore
//---------------------------------------------------------------------------------------
@@ -20,12 +20,12 @@
import QtQuick 2.1
import QtQuick.Dialogs 1.0
import QtQuick.Controls 1.0
import MuseScore 1.0
import FileIO 1.0
import MuseScore 3.0
import FileIO 3.0

MuseScore {
menuPath: "Plugins.ABC Import"
version: "2.0"
version: "3.0"
description: qsTr("This plugin imports ABC text from a file or the clipboard. Internet connection is required.")
requiresScore: false
pluginType: "dialog"
@@ -16,7 +16,7 @@ import QtQuick 2.2
import MuseScore 3.0

MuseScore {
version: "1.0"
version: "3.0"
description: qsTr("This plugin colors notes in the selection depending on their pitch as per the Boomwhackers convention")
menuPath: "Plugins.Notes.Color Notes"

@@ -46,7 +46,7 @@ MuseScore {
var endStaff;
var endTick;
var fullScore = false;
if (!cursor.segment) { // no selection
if (!cursor.segment()) { // no selection
fullScore = true;
startStaff = 0; // start with 1st staff
endStaff = curScore.nstaves - 1; // and end with last
@@ -74,16 +74,16 @@ MuseScore {
if (fullScore)
cursor.rewind(0) // if no selection, beginning of score

while (cursor.segment && (fullScore || cursor.tick < endTick)) {
if (cursor.element && cursor.element.type === Element.CHORD) {
var graceChords = cursor.element.graceNotes;
while (cursor.segment() && (fullScore || cursor.tick < endTick)) {
if (cursor.element() && cursor.element().type === Ms.CHORD) {
var graceChords = cursor.element().graceNotes;
for (var i = 0; i < graceChords.length; i++) {
// iterate through all grace chords
var graceNotes = graceChords[i].notes;
for (var j = 0; j < graceNotes.length; j++)
func(graceNotes[j]);
}
var notes = cursor.element.notes;
var notes = cursor.element().notes;
for (var k = 0; k < notes.length; k++) {
var note = notes[k];
func(note);
@@ -96,24 +96,24 @@ MuseScore {
}

function colorNote(note) {
if (note.color == black)
note.color = colors[note.pitch % 12];
if (note.get("color") === black)
note.set("color", colors[note.pitch % 12]);
else
note.color = black;
note.set("color", black);

if (note.accidental) {
if (note.accidental.color == black)
note.accidental.color = colors[note.pitch % 12];
else
note.accidental.color = black;
//if (note.accidental.get("color") === black)
//note.accidental.set("color", colors[note.pitch % 12]);
//else
note.accidental.set("color", black);
}

for (var i = 0; i < note.dots.length; i++) {
if (note.dots[i]) {
if (note.dots[i].color == black)
note.dots[i].color = colors[note.pitch % 12];
else
note.dots[i].color = black;
//if (note.dots[i].get("color") === black)
//note.dots[i].set("color", colors[note.pitch % 12]);
//else
note.dots[i].set("color", black);
}
}
}
@@ -1,8 +1,8 @@
import QtQuick 2.0
import MuseScore 1.0
import MuseScore 3.0

MuseScore {
version: "2.0"
version: "3.0"
description: "This demo plugin creates a new score."
menuPath: "Plugins.createscore"
requiresScore: false
@@ -1,10 +1,10 @@
import QtQuick 2.0
import MuseScore 1.0
import MuseScore 3.0


MuseScore {
menuPath: "Plugins.helloQml"
version: "2.0"
version: "3.0"
description: qsTr("This demo plugin shows some basic tasks.")
pluginType: "dialog"

@@ -26,10 +26,10 @@ MuseScore {
while (segment) {
var element
element = segment.elementAt(0)
if (element && element.type == Element.CHORD) {
if (element() && element().type == Ms.CHORD) {
console.log(qsTr(" element"))
console.log(element.beamMode)
if (element.beamMode == BeamMode.NO)
console.log(element().beamMode)
if (element().beamMode == BeamMode.NO)
console.log(" beam no")
}
segment = segment.next()
@@ -15,10 +15,10 @@
//=============================================================================

import QtQuick 2.0
import MuseScore 1.0
import MuseScore 3.0

MuseScore {
version: "2.0"
version: "3.0"
description: qsTr("This plugin names notes as per your language setting")
menuPath: "Plugins.Notes." + qsTr("Note Names") // this does not work, why?

@@ -124,7 +124,7 @@ MuseScore {
var endTick;
var fullScore = false;
cursor.rewind(1);
if (!cursor.segment) { // no selection
if (!cursor.segment()) { // no selection
fullScore = true;
startStaff = 0; // start with 1st staff
endStaff = curScore.nstaves - 1; // and end with last
@@ -153,11 +153,11 @@ MuseScore {
if (fullScore) // no selection
cursor.rewind(0); // beginning of score

while (cursor.segment && (fullScore || cursor.tick < endTick)) {
if (cursor.element && cursor.element.type === Element.CHORD) {
var text = newElement(Element.STAFF_TEXT);
while (cursor.segment() && (fullScore || cursor.tick < endTick)) {
if (cursor.element() && cursor.element().type === Ms.CHORD) {
var text = newElement(Ms.STAFF_TEXT);

var graceChords = cursor.element.graceNotes;
var graceChords = cursor.element().graceNotes;
for (var i = 0; i < graceChords.length; i++) {
// iterate through all grace chords
var graceNotes = graceChords[i].notes;
@@ -174,10 +174,10 @@ MuseScore {

cursor.add(text);
// new text for next element
text = newElement(Element.STAFF_TEXT);
text = newElement(Ms.STAFF_TEXT);
}

var notes = cursor.element.notes;
var notes = cursor.element().notes;
nameChord(notes, text);

switch (voice) {
@@ -1,10 +1,10 @@
import QtQuick 2.0
import MuseScore 1.0
import MuseScore 3.0


MuseScore {
menuPath: "Plugins.panel"
version: "2.0"
version: "3.0"
description: "This demo plugin creates a GUI panel."
requiresScore: false

@@ -1,8 +1,8 @@
import QtQuick 2.1
import MuseScore 1.0
import MuseScore 3.0

MuseScore {
version: "2.1"
version: "3.0"
description: "Create random score."
menuPath: "Plugins.random"
requiresScore: false
@@ -1,10 +1,10 @@
import QtQuick 2.1
import MuseScore 1.0
import MuseScore 3.0
import QtQuick.Controls 1.0
import QtQuick.Layouts 1.0

MuseScore {
version: "2.1"
version: "3.0"
description: "Create random score."
menuPath: "Plugins.random2"
requiresScore: false
@@ -23,11 +23,11 @@
//=============================================================================

import QtQuick 2.0
import MuseScore 1.0
import MuseScore 3.0

MuseScore {
menuPath: "Plugins.run"
version: "2.0"
version: "3.0"
description: "This demo plugin runs an external command. Probably this will only work on Linux."
requiresScore: false

@@ -1,10 +1,10 @@
import QtQuick 2.0
import MuseScore 1.0
import MuseScore 3.0


MuseScore {
menuPath: "Plugins.scorelist"
version: "2.0"
version: "3.0"
description: "This test plugin iterates through the score list."
pluginType: "dialog"

@@ -1,8 +1,8 @@
import QtQuick 2.0
import MuseScore 1.0
import MuseScore 3.0

MuseScore {
version: "1.0"
version: "3.0"
description: "Demo plugin to demonstrate the use of a ScoreView"
menuPath: "Plugins.ScoreView"
pluginType: "dialog"
@@ -34,7 +34,7 @@ MuseScore {
var e = cursor.element();
if (e) {
console.log("type: " + e.name + " (" + e.type + ") at tick: " + e.tick + " color " + e.get("color"));
if (e.type == Ms.REST) {
if (e.type === Ms.REST) {
var d = e.get("duration");
console.log(" duration " + d.numerator + "/" + d.denominator);
}

0 comments on commit 44b28b7

Please sign in to comment.
You can’t perform that action at this time.