Enumerating Methods

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

Enumerating Methods

Martin Marris
Is there a way to enumerate the Methods used in a plugin? I looked at the
Plugin object but it seems that you can only reach a Method if you already
know its name.


_______________________________________________
Plugin-dev mailing list
[hidden email]
http://avid-listsrv1.avid.com/mailman/listinfo/plugin-dev
Reply | Threaded
Open this post in threaded view
|

Re: Enumerating Methods

Bob Zawalich
Not that I know of.

I was pondering writing a plugin that would extract the method headers from
plugin text files. I would think it should not be too hard. Only useful for
MS programmers, though, so I kind of doubt it would even get published.

They look like this:

        QuickSort "(array, left, length, fShowProgress, strPluginName,
strMethodCompare) {

With a "( and a {, but I suspect they could end up split across lines, and
could have more or less white space.

One would probably have to play with variants of formatting to get it to
work, but it should not be rocket science.

Do you have a more that one-time need for such a thing? For one time, a
manual search should suffice.

Bob

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Martin Marris
Sent: Monday, October 05, 2015 3:14 AM
To: 'A mailing list for Sibelius plug-in developers'
Subject: [Plugin-dev] Enumerating Methods

Is there a way to enumerate the Methods used in a plugin? I looked at the
Plugin object but it seems that you can only reach a Method if you already
know its name.


_______________________________________________
Plugin-dev mailing list
[hidden email]
http://avid-listsrv1.avid.com/mailman/listinfo/plugin-dev

_______________________________________________
Plugin-dev mailing list
[hidden email]
http://avid-listsrv1.avid.com/mailman/listinfo/plugin-dev
Reply | Threaded
Open this post in threaded view
|

Re: Enumerating Methods

Bob Zawalich
Here are the methods in the utils.plg plugin, found just by doing a regular
expression search in my text editor and sorting on the name column.  I have
not checked to see if any headers have weird formatting and were missed, but
this should certainly be most of them.

C:\Users\Bob\AppData\Roaming\Avid\Sibelius
7.5\Plugins\Other\utils.plg(1350): AbsoluteValue "(x) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius
7.5\Plugins\Other\utils.plg(1382): AddFractions "(first, second) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius
7.5\Plugins\Other\utils.plg(1454): BinaryString "(num) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius
7.5\Plugins\Other\utils.plg(1053): CapableOfDeletion "() {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius
7.5\Plugins\Other\utils.plg(1009): DeleteStaff "(s, nthStaff,
retainSelection) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius
7.5\Plugins\Other\utils.plg(1475): DenaryValue "(binary) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius
7.5\Plugins\Other\utils.plg(1396): DivideFractions "(first,second) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius
7.5\Plugins\Other\utils.plg(1439): FractionAsDecimal "(array) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius
7.5\Plugins\Other\utils.plg(1449): FractionDenominator "(fraction) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius
7.5\Plugins\Other\utils.plg(1434): FractionNumerator "(fraction) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius
7.5\Plugins\Other\utils.plg(1560): GetBoolFromArray "(arr, index,
defaultVal) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius
7.5\Plugins\Other\utils.plg(1035): GetSibeliusPluginsFolder "() {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius
7.5\Plugins\Other\utils.plg(1788): GetUserSibFolderName "() {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius
7.5\Plugins\Other\utils.plg(1335): GreatestCommonDivisor "(m, n) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius
7.5\Plugins\Other\utils.plg(1543): Increment "(number) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius
7.5\Plugins\Other\utils.plg(1056): IsNumeric "(str, fIntegerOnly) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius
7.5\Plugins\Other\utils.plg(1005): IsVersion5OrLater "() {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius
7.5\Plugins\Other\utils.plg(1781): IsVersion7OrLater "() {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius
7.5\Plugins\Other\utils.plg(1360): MakeFraction "(num,den) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius
7.5\Plugins\Other\utils.plg(1415): MultiplyFractions "(first,second) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius
7.5\Plugins\Other\utils.plg(1303): NumberLess "(strA,strB) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius
7.5\Plugins\Other\utils.plg(1109): QuickSort "(array, left, length,
fShowProgress, strPluginName, strMethodCompare) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius
7.5\Plugins\Other\utils.plg(1580): QuickSortSparse "(array, left,
length, fShowProgress, strPluginName, strMethodCompare) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius
7.5\Plugins\Other\utils.plg(1567): RaisePower "(a,b) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius
7.5\Plugins\Other\utils.plg(1498): RoundToNDecimalPlaces
"(number,precision) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius
7.5\Plugins\Other\utils.plg(1220): SortArray "(array, fShowProgress) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius
7.5\Plugins\Other\utils.plg(1310): SortArrayCustom "(array,
fShowProgress,  strPluginName, strMethodCompare) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius
7.5\Plugins\Other\utils.plg(1283): SortArrayNumeric "(array,
fShowProgress) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius
7.5\Plugins\Other\utils.plg(1691): SortSparseArrayCustom "(array,
fShowProgress,  strPluginName, strMethodCompare) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius
7.5\Plugins\Other\utils.plg(1493): SplitTuplet "(tuplet,splitPoint) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius
7.5\Plugins\Other\utils.plg(1241): StringLess "(strA,strB) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius
7.5\Plugins\Other\utils.plg(1430): SubtractFractions "(first, second) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius
7.5\Plugins\Other\utils.plg(1778): TrimBlanks "(strOrig) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius
7.5\Plugins\Other\utils.plg(1716): TrimBlanksLeading "(strOrig,
fLeadingOnly) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(88):
CaseInsensitiveComparison "(s1, s2) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(223):
CastToBool "(b) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(235):
CastToInt "(x) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(229):
CastToStr "(x) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(241):
CombineArraysOfBool "(arr1, arr2) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(382):
CombineArraysOfInt "(arr1, arr2) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(365):
CombineArraysOfString "(arr1, arr2) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(992):
CopyTextFile "(source, dest) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(433):
CreateArrayBlanket "(val, size) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(958):
ExtractFileName "(FileName) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(791):
FindHitPoint "(HitPoints, Label) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(604):
Fmt "(s, vals) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(639):
Format "(s, p0, p1, p2, p3, p4, p5, p6, p7) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(655):
FormatTime "(t) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(800):
GetAppDir "() {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(445):
GetArrayIndex "(arr, val) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(168):
GetBitList "(x, nBits, MSBFirst) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(143):
GetBits "(x) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(824):
GetGlobalApplicationDataDir "() {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(676):
GetLocationTime "(s, barnumLoc, positionLoc) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(660):
GetMillisecondsFromTime "(t) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(663):
GetMinutesFromTime "(t) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(120):
GetNextPowerOf2 "(x) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(986):
GetNumberOfBarsInScore "(s) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(667):
GetObjectTime "(s, obj) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(781):
GetSecondsFromTime "(t) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(953):
GetSibMajorVersion "() {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(3):
Initialize "() {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(441):
IsInArray "(arr, val) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(822):
IsMac "() {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(504):
IsQuote "(c) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(72):
LowerCase "(str) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(785):
MakeNDigitNumber "(x, nDigits) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(102):
PatternCount "(pattern, str) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(592):
PluginExists "(FileName) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(487):
Pos "(pattern, str) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(961):
PosReverse "(pattern, str) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(460):
Replace "(InStr, Find, Replace, ReplaceAll) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(206):
ReverseArrayOfBool "(arr) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(416):
ReverseArrayOfInt "(arr) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(399):
ReverseArrayOfStr "(arr) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(50):
SetDefaultIfNotInArray "(value, arr, DefaultIndex) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(859):
StartComponentManager "(ComponentName, callback) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(349):
UpperCase "(str) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(322):
bwAND "(x, y) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(301):
bwOR "(x, y) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(272):
bwXOR "(x, y) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(258):
max "(x, y) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(265):
min "(x, y) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(135):
shl "(x, y) {
C:\Users\Bob\AppData\Roaming\Avid\Sibelius 7.5\Plugins\Other\utils.plg(127):
shr "(x, y) {



-----Original Message-----
From: Bob Zawalich [mailto:[hidden email]]
Sent: Monday, October 05, 2015 9:41 AM
To: 'A mailing list for Sibelius plug-in developers'
Subject: RE: [Plugin-dev] Enumerating Methods

Not that I know of.

I was pondering writing a plugin that would extract the method headers from
plugin text files. I would think it should not be too hard. Only useful for
MS programmers, though, so I kind of doubt it would even get published.

They look like this:

        QuickSort "(array, left, length, fShowProgress, strPluginName,
strMethodCompare) {

With a "( and a {, but I suspect they could end up split across lines, and
could have more or less white space.

One would probably have to play with variants of formatting to get it to
work, but it should not be rocket science.

Do you have a more that one-time need for such a thing? For one time, a
manual search should suffice.

Bob

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Martin Marris
Sent: Monday, October 05, 2015 3:14 AM
To: 'A mailing list for Sibelius plug-in developers'
Subject: [Plugin-dev] Enumerating Methods

Is there a way to enumerate the Methods used in a plugin? I looked at the
Plugin object but it seems that you can only reach a Method if you already
know its name.


_______________________________________________
Plugin-dev mailing list
[hidden email]
http://avid-listsrv1.avid.com/mailman/listinfo/plugin-dev


_______________________________________________
Plugin-dev mailing list
[hidden email]
http://avid-listsrv1.avid.com/mailman/listinfo/plugin-dev
Reply | Threaded
Open this post in threaded view
|

Re: Enumerating Methods

Martin Marris
In reply to this post by Bob Zawalich
>>Do you have a more that one-time need for such a thing?<<

No. As you guessed, all I wanted was an enumeration of the Methods in
"utils" and you've provided that now!

I only asked because I thought there might be a really easy way to so it
with MS....

_______________________________________________
Plugin-dev mailing list
[hidden email]
http://avid-listsrv1.avid.com/mailman/listinfo/plugin-dev
Reply | Threaded
Open this post in threaded view
|

Re: Enumerating Methods

Bob Zawalich
Nope. Enumeration is not the point of the Plugin methods; they exist only so
you can determine if one exists in a plugin before you try to call it,
because calling a non existing method will crash sib.

-----Original Message-----
From: Martin Marris [mailto:[hidden email]]
Sent: Monday, October 05, 2015 10:04 AM
To: [hidden email]; 'A mailing list for Sibelius plug-in developers'
Subject: RE: [Plugin-dev] Enumerating Methods

>>Do you have a more that one-time need for such a thing?<<

No. As you guessed, all I wanted was an enumeration of the Methods in
"utils" and you've provided that now!

I only asked because I thought there might be a really easy way to so it
with MS....


_______________________________________________
Plugin-dev mailing list
[hidden email]
http://avid-listsrv1.avid.com/mailman/listinfo/plugin-dev