Skip to content

Commit

Permalink
Fixes #4 - Add Mac OSX volume setting
Browse files Browse the repository at this point in the history
  • Loading branch information
thesoulless committed Oct 1, 2016
1 parent 4aaed5a commit bc91151
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CodeChampion.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
1 change: 1 addition & 0 deletions CodeChampion.sublime-settings
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
"min_span": 100, // millisecond
"win": "Random",
"fail": "Random",
"mac_osx_volume": 0.8,
}
39 changes: 38 additions & 1 deletion Main.sublime-menu
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
]
}
]
}
]
}
]

0 comments on commit bc91151

Please sign in to comment.