home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 106 / EnigmaAmiga106CD.iso / software / sviluppo / ahisrc / device / localize.c < prev    next >
Encoding:
C/C++ Source or Header  |  1999-09-11  |  4.0 KB  |  155 lines

  1. /* $Id: localize.c,v 4.3 1999/09/11 22:02:28 lcs Exp $
  2. * $Log: localize.c,v $
  3. * Revision 4.3  1999/09/11 22:02:28  lcs
  4. * *** empty log message ***
  5. *
  6. * Revision 4.2  1999/01/15 22:40:25  lcs
  7. * Fixed a couple of warnings.
  8. *
  9. * Revision 4.1  1997/04/02 22:29:53  lcs
  10. * Bumped to version 4
  11. *
  12. * Revision 1.1  1997/02/03 16:22:45  lcs
  13. * Initial revision
  14. *
  15. */
  16. /****************************************************************
  17.    This file was created automatically by `FlexCat 1.9'
  18.    from "./ahi.cd".
  19.  
  20.    Do NOT edit by hand!
  21. ****************************************************************/
  22.  
  23. #include "ahi_def.h"
  24.  
  25. #include <libraries/locale.h>
  26. #include <proto/locale.h>
  27.  
  28.  
  29. static LONG ahi_Version = 4;
  30. static const STRPTR ahi_BuiltInLanguage = (STRPTR) "english";
  31.  
  32. struct FC_Type
  33. {   LONG   ID;
  34.     STRPTR Str;
  35. };
  36.  
  37.  
  38. const struct FC_Type _msgDefault = { 0, "Default" };
  39. const struct FC_Type _msgMenuControl = { 1, "\000\000Control" };
  40. const struct FC_Type _msgMenuLastMode = { 2, "L\000Last Mode" };
  41. const struct FC_Type _msgMenuNextMode = { 3, "N\000Next Mode" };
  42. const struct FC_Type _msgMenuPropertyList = { 4, "?\000Property List..." };
  43. const struct FC_Type _msgMenuRestore = { 5, "R\000Restore" };
  44. const struct FC_Type _msgMenuOK = { 6, "O\000OK" };
  45. const struct FC_Type _msgMenuCancel = { 7, "C\000Cancel" };
  46. const struct FC_Type _msgUnknown = { 8, "UNKNOWN:Audio ID 0x%08lx" };
  47. const struct FC_Type _msgReqOK = { 9, "OK" };
  48. const struct FC_Type _msgReqCancel = { 10, "Cancel" };
  49. const struct FC_Type _msgReqFrequency = { 11, "Frequency" };
  50. const struct FC_Type _msgDefaultMode = { 12, "Default audio mode" };
  51. const struct FC_Type _msgReqInfoTitle = { 13, "Mode Properties" };
  52. const struct FC_Type _msgReqInfoAudioID = { 14, "Audio mode ID: 0x%08lx" };
  53. const struct FC_Type _msgReqInfoResolution = { 15, "Resolution: %ld bit %s" };
  54. const struct FC_Type _msgReqInfoMono = { 16, "mono" };
  55. const struct FC_Type _msgReqInfoStereo = { 17, "stereo" };
  56. const struct FC_Type _msgReqInfoStereoPan = { 18, "stereo with panning" };
  57. const struct FC_Type _msgReqInfoChannels = { 19, "Channels: %ld" };
  58. const struct FC_Type _msgReqInfoMixrate = { 20, "Mixing rates: %ld-%ld Hz" };
  59. const struct FC_Type _msgReqInfoHiFi = { 21, "HiFi mixing" };
  60. const struct FC_Type _msgReqInfoRecordHalf = { 22, "Record in half duplex" };
  61. const struct FC_Type _msgReqInfoRecordFull = { 23, "Record in full duplex" };
  62.  
  63.  
  64. static struct Catalog *ahi_Catalog = NULL;
  65.  
  66. void OpenahiCatalog(struct Locale *loc, STRPTR language)
  67. {
  68.   LONG tag, tagarg;
  69.  
  70.   if(LocaleBase != NULL  &&  ahi_Catalog == NULL)
  71.   {
  72.     if(language == NULL)
  73.     {
  74.       tag = TAG_IGNORE;
  75.     }
  76.     else
  77.     {
  78.       tag = OC_Language;
  79.       tagarg = (LONG) language;
  80.     }
  81.  
  82.     ahi_Catalog = OpenCatalog(loc, (STRPTR) "ahi.catalog",
  83.         OC_BuiltInLanguage, (ULONG) ahi_BuiltInLanguage,
  84.         tag, tagarg,
  85.         OC_Version, ahi_Version,
  86.         TAG_DONE);
  87.   }
  88. }
  89.  
  90. struct Catalog *ExtOpenCatalog(struct Locale *loc, STRPTR language)
  91. {
  92.   LONG tag, tagarg;
  93.  
  94.   if(LocaleBase != NULL)
  95.   {
  96.     if(language == NULL)
  97.     {
  98.       tag = TAG_IGNORE;
  99.     }
  100.     else
  101.     {
  102.       tag = OC_Language;
  103.       tagarg = (LONG) language;
  104.     }
  105.  
  106.     return OpenCatalog(loc, (STRPTR) "ahi.catalog",
  107.         OC_BuiltInLanguage, (ULONG) ahi_BuiltInLanguage,
  108.         tag, tagarg,
  109.         OC_Version, ahi_Version,
  110.         TAG_DONE);
  111.   }
  112.   return NULL;
  113. }
  114.  
  115. void CloseahiCatalog(void)
  116. {
  117.   if (LocaleBase != NULL)
  118.   {
  119.     CloseCatalog(ahi_Catalog);
  120.   }
  121.   ahi_Catalog = NULL;
  122. }
  123.  
  124. void ExtCloseCatalog(struct Catalog *catalog)
  125. {
  126.   if (LocaleBase != NULL)
  127.   {
  128.     CloseCatalog(catalog);
  129.   }
  130. }
  131.  
  132. STRPTR GetahiString(APTR fcstr)
  133. {
  134.   STRPTR defaultstr;
  135.   LONG strnum;
  136.  
  137.   strnum = ((struct FC_Type *) fcstr)->ID;
  138.   defaultstr = ((struct FC_Type *) fcstr)->Str;
  139.  
  140.   return(ahi_Catalog ? GetCatalogStr(ahi_Catalog, strnum, defaultstr) :
  141.               defaultstr);
  142. }
  143.  
  144. STRPTR GetString(APTR fcstr, struct Catalog *catalog)
  145. {
  146.   STRPTR defaultstr;
  147.   LONG strnum;
  148.  
  149.   strnum = ((struct FC_Type *) fcstr)->ID;
  150.   defaultstr = ((struct FC_Type *) fcstr)->Str;
  151.  
  152.   return(catalog ? GetCatalogStr(catalog, strnum, defaultstr) :
  153.               defaultstr);
  154. }
  155.