Skip to content

Commit c07239c

Browse files
committed
Add notification sound
#47
1 parent cf7af99 commit c07239c

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

electron_app/src/StableDiffusion.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import { send_to_py } from "./py_vue_bridge.js"
77
import {get_tokens} from './clip_tokeniser/clip_encoder.js'
88
9+
let notification_sound = new Audio(require('@/assets/notification.mp3'))
910
1011
function remove_non_ascii(str) {
1112
@@ -87,6 +88,9 @@ export default {
8788
// }
8889
// }
8990
if(msg_code == "nwim"){
91+
if (this.$parent.app_state.app_data.settings.notification_sound == true) {
92+
notification_sound.play();
93+
}
9094
let impath = msg.substring(5).trim()
9195
if(this.attached_cbs){
9296
if(this.attached_cbs.on_img)
2.79 KB
Binary file not shown.

electron_app/src/components/Settings.vue

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,25 @@
44
<div v-if="!is_custom_model_loading">
55
<h1>Settings</h1>
66
<br>
7-
<!-- <h2>General Settings</h2>
7+
<h2>General Settings</h2>
88
<br>
99
<div class="setting_box">
1010
<div class="settings_left">
11+
<h2>Notification sound</h2>
12+
<p>Allows to start a sound when the generation of an image is completed</p>
13+
</div>
14+
<hr>
15+
<div style="float:right;margin-right: 9px;align-self: center;" >
16+
<label class="switch">
17+
<input type="checkbox" v-model="app_state.app_data.settings.notification_sound" checked>
18+
<span class="toggle round"></span>
19+
</label>
20+
</div>
21+
</div>
22+
<hr>
23+
<!--
24+
<div class="setting_box">
25+
<div class="settings_left">
1126
<h2>Allow NSFW Content</h2>
1227
<p>Allows image generation considered NSFW</p>
1328
</div>

0 commit comments

Comments
 (0)