Accessing measure in plugin framework

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Accessing measure in plugin framework

lasconic
Administrator
Hi,
I wanted to write a plugin to put a line break every X measure. So
far, there is no way to access measure objects in the plugin
framework.
So I took a look. I wrote scmeasure.h and scmeasure.cpp relying on
schord with a property "lineBreak". It should be ok.

Then I tried to figure out a way to go through the measures.
My first guess was using score->measures() and try to mimic
topNotes/note(idx)/notes.
The function note(idx) is not very effective but hell, on a chord (max
5 notes) it's ok. Doing the same on measures, it's not good I guess.

Morever score->measures()  sends back MeasureBaseList so Vbox and HBox
as well. Should I filter to have only Measure or not ? If not how do I
do the cast ?

Second thought was making a scCursorMeasure, similar to SCursor for
chords. I created this and I commited it. It seems to work but it
looks heavy.
Please review. Maybe there is  a simpler way to have the same feature?
A demo plugin named break4.js is also commited in r1816

Lasconic

------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer
Reply | Threaded
Open this post in threaded view
|

Re: Accessing measure in plugin framework

wschweer
Administrator
My suggestion would be to extend the Cursor class:

        - new function measure() which returns the current measure
        - new function nextMeasure() which moves the cursor to the first
      chord/rest of the next measure

On Sunday 10 May 2009 01:02:46 Lasconic wrote:

> Hi,
> I wanted to write a plugin to put a line break every X measure. So
> far, there is no way to access measure objects in the plugin
> framework.
> So I took a look. I wrote scmeasure.h and scmeasure.cpp relying on
> schord with a property "lineBreak". It should be ok.
>
> Then I tried to figure out a way to go through the measures.
> My first guess was using score->measures() and try to mimic
> topNotes/note(idx)/notes.
> The function note(idx) is not very effective but hell, on a chord (max
> 5 notes) it's ok. Doing the same on measures, it's not good I guess.
>
> Morever score->measures()  sends back MeasureBaseList so Vbox and HBox
> as well. Should I filter to have only Measure or not ? If not how do I
> do the cast ?
>
> Second thought was making a scCursorMeasure, similar to SCursor for
> chords. I created this and I commited it. It seems to work but it
> looks heavy.
> Please review. Maybe there is  a simpler way to have the same feature?
> A demo plugin named break4.js is also commited in r1816
>
> Lasconic
>
> ---------------------------------------------------------------------------
>--- The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
> production scanning environment may not be a perfect world - but thanks to
> Kodak, there's a perfect scanner to get the job done! With the NEW KODAK
> i700 Series Scanner you'll get full speed at 300 dpi even with all image
> processing features enabled. http://p.sf.net/sfu/kodak-com
> _______________________________________________
> Mscore-developer mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/mscore-developer


------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer
Reply | Threaded
Open this post in threaded view
|

Re: Accessing measure in plugin framework

lasconic
Administrator
Thanks a lot for the guidance! Why didn't I think about it myself...
It's in r1821.

2009/5/10 Werner Schweer <[hidden email]>:

> My suggestion would be to extend the Cursor class:
>
>        - new function measure() which returns the current measure
>        - new function nextMeasure() which moves the cursor to the first
>      chord/rest of the next measure
>
> On Sunday 10 May 2009 01:02:46 Lasconic wrote:
>> Hi,
>> I wanted to write a plugin to put a line break every X measure. So
>> far, there is no way to access measure objects in the plugin
>> framework.
>> So I took a look. I wrote scmeasure.h and scmeasure.cpp relying on
>> schord with a property "lineBreak". It should be ok.
>>
>> Then I tried to figure out a way to go through the measures.
>> My first guess was using score->measures() and try to mimic
>> topNotes/note(idx)/notes.
>> The function note(idx) is not very effective but hell, on a chord (max
>> 5 notes) it's ok. Doing the same on measures, it's not good I guess.
>>
>> Morever score->measures()  sends back MeasureBaseList so Vbox and HBox
>> as well. Should I filter to have only Measure or not ? If not how do I
>> do the cast ?
>>
>> Second thought was making a scCursorMeasure, similar to SCursor for
>> chords. I created this and I commited it. It seems to work but it
>> looks heavy.
>> Please review. Maybe there is  a simpler way to have the same feature?
>> A demo plugin named break4.js is also commited in r1816
>>
>> Lasconic
>>
>> ---------------------------------------------------------------------------
>>--- The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
>> production scanning environment may not be a perfect world - but thanks to
>> Kodak, there's a perfect scanner to get the job done! With the NEW KODAK
>> i700 Series Scanner you'll get full speed at 300 dpi even with all image
>> processing features enabled. http://p.sf.net/sfu/kodak-com
>> _______________________________________________
>> Mscore-developer mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/mscore-developer
>
>
> ------------------------------------------------------------------------------
> The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
> production scanning environment may not be a perfect world - but thanks to
> Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
> Series Scanner you'll get full speed at 300 dpi even with all image
> processing features enabled. http://p.sf.net/sfu/kodak-com
> _______________________________________________
> Mscore-developer mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/mscore-developer
>

------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer
Reply | Threaded
Open this post in threaded view
|

Re: Accessing measure in plugin framework

lasconic
Administrator
Apparently you implemented it yourself as well in r1822... we have a
problem ... nextMeasure() and measure() are double in sccursor.h and
sccursor.cpp. Can you take a look and resolve the conflict ?

2009/5/11 Lasconic <[hidden email]>:

> Thanks a lot for the guidance! Why didn't I think about it myself...
> It's in r1821.
>
> 2009/5/10 Werner Schweer <[hidden email]>:
>> My suggestion would be to extend the Cursor class:
>>
>>        - new function measure() which returns the current measure
>>        - new function nextMeasure() which moves the cursor to the first
>>      chord/rest of the next measure
>>
>> On Sunday 10 May 2009 01:02:46 Lasconic wrote:
>>> Hi,
>>> I wanted to write a plugin to put a line break every X measure. So
>>> far, there is no way to access measure objects in the plugin
>>> framework.
>>> So I took a look. I wrote scmeasure.h and scmeasure.cpp relying on
>>> schord with a property "lineBreak". It should be ok.
>>>
>>> Then I tried to figure out a way to go through the measures.
>>> My first guess was using score->measures() and try to mimic
>>> topNotes/note(idx)/notes.
>>> The function note(idx) is not very effective but hell, on a chord (max
>>> 5 notes) it's ok. Doing the same on measures, it's not good I guess.
>>>
>>> Morever score->measures()  sends back MeasureBaseList so Vbox and HBox
>>> as well. Should I filter to have only Measure or not ? If not how do I
>>> do the cast ?
>>>
>>> Second thought was making a scCursorMeasure, similar to SCursor for
>>> chords. I created this and I commited it. It seems to work but it
>>> looks heavy.
>>> Please review. Maybe there is  a simpler way to have the same feature?
>>> A demo plugin named break4.js is also commited in r1816
>>>
>>> Lasconic
>>>
>>> ---------------------------------------------------------------------------
>>>--- The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
>>> production scanning environment may not be a perfect world - but thanks to
>>> Kodak, there's a perfect scanner to get the job done! With the NEW KODAK
>>> i700 Series Scanner you'll get full speed at 300 dpi even with all image
>>> processing features enabled. http://p.sf.net/sfu/kodak-com
>>> _______________________________________________
>>> Mscore-developer mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/mscore-developer
>>
>>
>> ------------------------------------------------------------------------------
>> The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
>> production scanning environment may not be a perfect world - but thanks to
>> Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
>> Series Scanner you'll get full speed at 300 dpi even with all image
>> processing features enabled. http://p.sf.net/sfu/kodak-com
>> _______________________________________________
>> Mscore-developer mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/mscore-developer
>>
>

------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer
Reply | Threaded
Open this post in threaded view
|

Re: Accessing measure in plugin framework

lasconic
Administrator
Thank you :)

2009/5/12 Lasconic <[hidden email]>:

> Apparently you implemented it yourself as well in r1822... we have a
> problem ... nextMeasure() and measure() are double in sccursor.h and
> sccursor.cpp. Can you take a look and resolve the conflict ?
>
> 2009/5/11 Lasconic <[hidden email]>:
>> Thanks a lot for the guidance! Why didn't I think about it myself...
>> It's in r1821.
>>
>> 2009/5/10 Werner Schweer <[hidden email]>:
>>> My suggestion would be to extend the Cursor class:
>>>
>>>        - new function measure() which returns the current measure
>>>        - new function nextMeasure() which moves the cursor to the first
>>>      chord/rest of the next measure
>>>
>>> On Sunday 10 May 2009 01:02:46 Lasconic wrote:
>>>> Hi,
>>>> I wanted to write a plugin to put a line break every X measure. So
>>>> far, there is no way to access measure objects in the plugin
>>>> framework.
>>>> So I took a look. I wrote scmeasure.h and scmeasure.cpp relying on
>>>> schord with a property "lineBreak". It should be ok.
>>>>
>>>> Then I tried to figure out a way to go through the measures.
>>>> My first guess was using score->measures() and try to mimic
>>>> topNotes/note(idx)/notes.
>>>> The function note(idx) is not very effective but hell, on a chord (max
>>>> 5 notes) it's ok. Doing the same on measures, it's not good I guess.
>>>>
>>>> Morever score->measures()  sends back MeasureBaseList so Vbox and HBox
>>>> as well. Should I filter to have only Measure or not ? If not how do I
>>>> do the cast ?
>>>>
>>>> Second thought was making a scCursorMeasure, similar to SCursor for
>>>> chords. I created this and I commited it. It seems to work but it
>>>> looks heavy.
>>>> Please review. Maybe there is  a simpler way to have the same feature?
>>>> A demo plugin named break4.js is also commited in r1816
>>>>
>>>> Lasconic
>>>>
>>>> ---------------------------------------------------------------------------
>>>>--- The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
>>>> production scanning environment may not be a perfect world - but thanks to
>>>> Kodak, there's a perfect scanner to get the job done! With the NEW KODAK
>>>> i700 Series Scanner you'll get full speed at 300 dpi even with all image
>>>> processing features enabled. http://p.sf.net/sfu/kodak-com
>>>> _______________________________________________
>>>> Mscore-developer mailing list
>>>> [hidden email]
>>>> https://lists.sourceforge.net/lists/listinfo/mscore-developer
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
>>> production scanning environment may not be a perfect world - but thanks to
>>> Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
>>> Series Scanner you'll get full speed at 300 dpi even with all image
>>> processing features enabled. http://p.sf.net/sfu/kodak-com
>>> _______________________________________________
>>> Mscore-developer mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/mscore-developer
>>>
>>
>

------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer