Plugin break 5,6 ...

• 13 Nov. 2009 - 07:50

Re bonjour
voici le contenu de fichier à mettre dans le dossier usr/share/mscore-0.9/plugins pour obtenir le plugin break5 qui permet de mettre 5 mesures par système. Le fichier est à nommer break5.js
On fera de même pour break6 etc...
Est-il prévu un plugin qui nous demande le nombre voulu de mesures par système?
Merci
Beber1er

//=============================================================================
// MuseScore
// Linux Music Score Editor
// $Id:$
//
// Color notehead plugin
// Noteheads are colored according to pitch. User can change to color by
// modifying the colors array. First element is C, second C# etc...
//
// Copyright (C)2008 Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//=============================================================================

//
// This is ECMAScript code (ECMA-262 aka "Java Script")
//

//---------------------------------------------------------
// init
// this function will be called on startup of mscore
//---------------------------------------------------------

function init()
{
// print("test script init");
}

//-------------------------------------------------------------------
// run
// this function will be called when activating the
// plugin menu entry
//
// global Variables:
// pluginPath - contains the plugin path; file separator is "/"
//-------------------------------------------------------------------

function run()
{
print("break5");

var cursor = new Cursor(curScore);
cursor.staff = 0;
cursor.voice = 0;
cursor.rewind(); // set cursor to first chord/rest

var i = 1;
while (!cursor.eos()) {
var m = cursor.measure();
if (i % 5 == 0) {
m.lineBreak = true;
}
else {
m.lineBreak = false;
}
cursor.nextMeasure();
i++;
}
}

//---------------------------------------------------------
// menu: defines were the function will be placed
// in the MuseScore menu structure
//---------------------------------------------------------

var mscorePlugin = {
menu: 'Plugins.Break 5',
init: init,
run: run
};

mscorePlugin;


Commentaires

Je peux le coder. Si tu penses que c'est utile.
J'attendais d'avoir accès à la sélection pour coder un plugin qui pose un break toutes les X mesures dans la sélection.

En réponse à par Beber1_

C'est dans les préversions de la 0.9.6 seulement.

For David: I know there is something in the trunk. But it's not the same. The plugin put a real break every X measure.
The build in feature in SVN tricks the layout internally to have X measures per system. I'm not sure if it's better to have it in the code on the layout or in a plugin with line breaks. Maybe we should discuss this in the issue tracker?

Do you still have an unanswered question? Please log in first to post your question.