David, thanks for the reply - it's actually both questions.
I like the style of interface using set/getprops, and will probably
do exactly what you suggest.
However, the unicode problem is that in an ID3 tag, text information
(that the library will extract from the tag) may be encoded as
unicode or not, and it isn't necessarily consistent within a tag ie.
some strings are, some aren't. So I need to figure out how best to
let the user of the library know what kind of string is being delivered.
Best,
Mark
On 4 Feb 2007, at 15:37, David Bovill wrote:
I hope I got your question right - it is more abot an interface
style to a
library than auto-detecting whether which format the data is in?
If so - arrays are a good bet, but in my opinion the most user
friendly
approach is to create a "model" which deals with the functions and
commands
for getting and setting the ID3 data from the file, and then a set of
simpler getprop and setprop interfaces that users would use with a
Rev based
control. In your case it would look something like:
--> Model
-
function id3_GetArray someFile
...
end id3_GetArray someFile
on id3_SetArray someFile, id3Array
...
end id3_SetArray someFile
--> Interface
-
getprop id3_UnicodeText
put the filename of the target into someFile
put id3_GetArray(someFile) into id3Array
return id3Array ["unicode"]
end id3_UnicodeText
And so forth for the various elements of the model you want to
expose in a
friendly way to the user. They can then just set the filename of
the player
to a mp3 file and use:
put the id3_UnicodeText of player 1
If there are too many interfaces you can use the array type sytax:
put the id3_Data ["unicode"] of player 1
With and getprop handler like:
getprop id3_Data [someKey]
put the filename of the target into someFile
put id3_GetArray(someFile) into id3Array
return id3Array [someKey]
end id3_Data
_______________________________________________
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
_______________________________________________
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution