Unicode Question

David Bovill david at openpartnership.net
Sun Feb 4 10:37:30 EST 2007


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



More information about the use-livecode mailing list