diff --git a/CodeChampion.py b/CodeChampion.py index 1382125..9749eb9 100644 --- a/CodeChampion.py +++ b/CodeChampion.py @@ -26,9 +26,10 @@ def play(self): @thread def osx_play(self): if(self.is_playing == False): + volume = sublime.load_settings(SETTING_NAME).get('mac_osx_volume') self.is_playing = True soundFilePath = self.get_sound_file_path(self.soundType) - call(["afplay", "-v", str(1), soundFilePath]) + call(["afplay", "-v", str(volume), soundFilePath]) self.is_playing = False @thread def windows_play(self): diff --git a/CodeChampion.sublime-settings b/CodeChampion.sublime-settings index 2b826c0..82ae88b 100644 --- a/CodeChampion.sublime-settings +++ b/CodeChampion.sublime-settings @@ -2,4 +2,5 @@ "min_span": 100, // millisecond "win": "Random", "fail": "Random", + "mac_osx_volume": 0.8, } diff --git a/Main.sublime-menu b/Main.sublime-menu index c6d530a..d142de5 100644 --- a/Main.sublime-menu +++ b/Main.sublime-menu @@ -172,4 +172,41 @@ }, ] }] -}] +}, +{ + "caption": "Preferences", + "id": "preferences", + "mnemonic": "n", + "children": + [ + { + "caption": "Package Settings", + "id": "package-settings", + "mnemonic": "P", + "children": + [ + { + "caption": "Code Champion", + "children": + [ + { + "caption": "Settings – Default", + "command": "open_file", "args": + { + "file": "${packages}/Code Champion/CodeChampion.sublime-settings" + } + }, + { + "caption": "Settings – User", + "command": "open_file", "args": + { + "file": "${packages}/User/CodeChampion.sublime-settings" + } + } + ] + } + ] + } + ] +} +]