Skip to content

Commit fbe8a86

Browse files
committed
Last Changes
1 parent 167c45c commit fbe8a86

File tree

5 files changed

+37
-13
lines changed

5 files changed

+37
-13
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 0.0.4
2+
* UPDATE Readme.md
3+
* Added ```setListenToThisDevice``` method
4+
* Added ```setPlaybackThroughDevice``` method
5+
16
## 0.0.3
27
* UPDATE Readme.md
38

README.md

+23-6
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ https://www.nirsoft.net/utils/sound_volume_view.html
99
## Getting started
1010
Supported platforms:
1111

12-
Windows [ X ]
12+
Windows [ ]
1313

14-
MacOS [ ]
14+
MacOS [ ]
1515

16-
Linux [ ]
16+
Linux [ ]
1717

18-
Android [ ]
18+
Android [ ]
1919

20-
iOS [ ]
20+
iOS [ ]
2121

2222
## Usage
2323
SoftwarePatch should indicate the folder where you have the executable ```SoundVolumeView.exe```..
@@ -26,18 +26,35 @@ SoftwarePatch should indicate the folder where you have the executable ```SoundV
2626
SoundVolumeView soundVolumeView = SoundVolumeView(softwarePath: 'C:\\Program Files\\Sound\\');
2727
```
2828

29-
#### Get list of input and output devices
29+
#### First to get the devices you must call: ```soundVolumeView.getDevices;```
3030
```dart
3131
List<Device> devices = await soundVolumeView.getDevices;
3232
```
3333

34+
### Once you have obtained the devices you will also have a separate list for each type.
35+
```dart
36+
/// [captureDevices] You only get the capture devices
37+
soundVolumeView.captureDevices;
38+
39+
/// [outputDevices] You only get the output devices
40+
soundVolumeView.outputDevices;
41+
42+
/// [applicationDevices] You only get the application devices
43+
soundVolumeView.applicationDevices;
44+
```
45+
3446
#### Set UnMute / Mute
3547
```dart
3648
await soundVolumeView.unMute( devices[index] );
3749
3850
await soundVolumeView.mute( devices[index] );
3951
```
4052

53+
#### Set Volume: Range [0-100] int
54+
```dart
55+
await soundVolumeView.setVolume(soundVolumeView.captureDevices[index], 100);
56+
```
57+
4158
#### You can also listen to the capture sound.
4259
```dart
4360
await soundVolumeView.setListenToThisDevice(devices[index], listen: true);

lib/src/core/initial.dart

+8-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class SoundVolumeView {
3030
/// [outputDevices] You only get the output devices
3131
List<Device> outputDevices = <Device>[];
3232

33-
/// [applicationDevices]
33+
/// [applicationDevices] You only get the application devices
3434
List<Device> applicationDevices = <Device>[];
3535

3636
/// [getDevices] getDevices gets all input, output, and application devices
@@ -73,6 +73,13 @@ class SoundVolumeView {
7373
return [];
7474
}
7575
}
76+
77+
/// [setVolume] Will lower or raise the volume to the indicated device - 0% to 100%
78+
Future<void> setVolume( Device device, int volume ) async {
79+
String path = join(softwarePath, _softwareName);
80+
final Shell shell = Shell();
81+
await shell.run('$path /SetVolume ${device.name} $volume');
82+
}
7683

7784
/// [mute] mute the device
7885
Future<void> mute ( Device device ) async {

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: sound_volume_view
22
description: SoundVolumeView that displays general information and the current volume level for all active sound components in your system, and allows you to instantly mute and unmute them.
33
homepage: https://github.com/DomingoMG/sound_volume_view
44
repository: https://github.com/DomingoMG/sound_volume_view
5-
version: 0.0.3
5+
version: 0.0.4
66

77
environment:
88
sdk: ">=2.16.0 <3.0.0"

test/sound_volume_view_test.dart

-5
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@ const String softwareName = 'SoundVolumeView.exe';
1010

1111
Future<void> main() async {
1212
await checkSoftware();
13-
List<Device> devices = await getDevices();
14-
for ( Device device in devices ){
15-
print(device.toJson());
16-
}
17-
1813
}
1914

2015
// CHECK SOFTWARE EXIST

0 commit comments

Comments
 (0)