AbstractOperatingSystem.st
changeset 25303 77286c5f6f36
parent 25272 bf1e69fc36c5
child 25305 4f2e03fce6a7
equal deleted inserted replaced
25302:3ab39726c023 25303:77286c5f6f36
    16 "{ NameSpace: Smalltalk }"
    16 "{ NameSpace: Smalltalk }"
    17 
    17 
    18 Object subclass:#AbstractOperatingSystem
    18 Object subclass:#AbstractOperatingSystem
    19 	instanceVariableNames:''
    19 	instanceVariableNames:''
    20 	classVariableNames:'ConcreteClass DefaultVoice ErrorSignal LastErrorNumber LocaleInfo
    20 	classVariableNames:'ConcreteClass DefaultVoice ErrorSignal LastErrorNumber LocaleInfo
    21 		OSSignals PipeFailed Resources VoiceMapping ConsoleOutputEncoder'
    21 		OSSignals PipeFailed Resources VoiceMapping
       
    22 		BestVoiceForLanguageMapping ConsoleOutputEncoder'
    22 	poolDictionaries:''
    23 	poolDictionaries:''
    23 	category:'System-Support'
    24 	category:'System-Support'
    24 !
    25 !
    25 
    26 
    26 Object subclass:#PrinterInfo
    27 Object subclass:#PrinterInfo
  7009 !AbstractOperatingSystem class methodsFor:'sound & voice'!
  7010 !AbstractOperatingSystem class methodsFor:'sound & voice'!
  7010 
  7011 
  7011 bestVoiceForLanguage:lang
  7012 bestVoiceForLanguage:lang
  7012     "OS specific - to be redefined for linux, windows and OSX"
  7013     "OS specific - to be redefined for linux, windows and OSX"
  7013 
  7014 
       
  7015     BestVoiceForLanguageMapping notNil ifTrue:[
       
  7016         ^ BestVoiceForLanguageMapping at:lang ifAbsent:nil
       
  7017     ].
  7014     ^ nil
  7018     ^ nil
  7015 
  7019 
  7016     "Created: / 23-07-2019 / 10:21:08 / Claus Gittinger"
  7020     "Created: / 23-07-2019 / 10:21:08 / Claus Gittinger"
  7017 !
  7021 !
  7018 
  7022 
  7094 
  7098 
  7095 playSound:fileName mode:modeInteger
  7099 playSound:fileName mode:modeInteger
  7096     "this is an obsolete interface"
  7100     "this is an obsolete interface"
  7097 
  7101 
  7098     self playSound:fileName
  7102     self playSound:fileName
       
  7103 !
       
  7104 
       
  7105 setVoice:voiceName forLanguage:lang
       
  7106     "remember a preference"
       
  7107 
       
  7108     BestVoiceForLanguageMapping isNil ifTrue:[
       
  7109         BestVoiceForLanguageMapping := Dictionary new
       
  7110     ].
       
  7111     BestVoiceForLanguageMapping at:lang put:voiceName
       
  7112 
       
  7113     "
       
  7114      OperatingSystem bestVoiceForLanguage:'fr'
       
  7115      OperatingSystem setVoice:'Andrea' forLanguage:'fr'
       
  7116      OperatingSystem bestVoiceForLanguage:'fr'
       
  7117     "
       
  7118 
       
  7119     "Created: / 23-07-2019 / 10:21:08 / Claus Gittinger"
  7099 !
  7120 !
  7100 
  7121 
  7101 speak:aString
  7122 speak:aString
  7102     "say something in the default voice"
  7123     "say something in the default voice"
  7103 
  7124