This repository has been archived by the owner on Jun 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added mute command; make it work with .net 3.5
- Loading branch information
1 parent
5e7ad3f
commit c508fa1
Showing
13 changed files
with
158 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Wox.Plugin.Volume | ||
Control the system volume with [Wox](http://www.getwox.com/). | ||
|
||
## Usage | ||
Keyword: `vol` | ||
|
||
Type `+` to increase the volume, `-` to decrease the volume, and `m` to mute. If you type something like `++-`, it will increase twice, and decrease once! | ||
The increase/decrease step, and the keys to control the volume can be configured: just edit the `config.json` file and restart Wox. | ||
|
||
You can also change the style: default style (`percent`) shows a percentage; `bar` will show a ASCII volume bar. | ||
|
||
## Gift | ||
Feel free to offer me some nice icons :) | ||
|
||
## Disclaimer | ||
I don't have sound keys at work.. |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using CoreAudio; | ||
|
||
namespace Wox.Plugin.Volume | ||
{ | ||
class Manager | ||
{ | ||
private MMDevice playbackDevice; | ||
|
||
public Manager() | ||
{ | ||
playbackDevice = (new MMDeviceEnumerator()).GetDefaultAudioEndpoint(EDataFlow.eRender, ERole.eMultimedia); | ||
} | ||
|
||
public int GetVolume() | ||
{ | ||
return (int)(playbackDevice.AudioEndpointVolume.MasterVolumeLevelScalar * 100); | ||
} | ||
|
||
public void SetVolume(int volume) | ||
{ | ||
if (volume < 0) | ||
{ | ||
volume = 0; | ||
} | ||
else if (volume > 100) | ||
{ | ||
volume = 100; | ||
} | ||
|
||
playbackDevice.AudioEndpointVolume.MasterVolumeLevelScalar = volume / 100.0f; | ||
} | ||
|
||
public void ToggleMute() | ||
{ | ||
playbackDevice.AudioEndpointVolume.Mute = !IsMute(); | ||
} | ||
|
||
public bool IsMute() | ||
{ | ||
return playbackDevice.AudioEndpointVolume.Mute; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
{ | ||
"step": 5, | ||
"up": "+", | ||
"down": "-" | ||
"down": "-", | ||
"mute": "m", | ||
"style": "percent", | ||
"applyOnDelete": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="Wox.Plugin" version="1.1.1.295" targetFramework="net452" /> | ||
<package id="Wox.Plugin" version="1.1.0" targetFramework="net35" /> | ||
</packages> |