Changed audio profile setting to more selective audio_mode

master
xSmurf 10 years ago
parent 3c920c4fc1
commit 82d96c2648

@ -44,15 +44,22 @@ type Profile struct {
Networking NetworkProfile Networking NetworkProfile
} }
type AudioMode string
const (
PROFILE_AUDIO_NONE AudioMode = "none"
PROFILE_AUDIO_SPEAKER AudioMode = "speaker"
PROFILE_AUDIO_FULL AudioMode = "full"
)
type XServerConf struct { type XServerConf struct {
Enabled bool Enabled bool
TrayIcon string `json:"tray_icon"` TrayIcon string `json:"tray_icon"`
WindowIcon string `json:"window_icon"` WindowIcon string `json:"window_icon"`
EnableTray bool `json:"enable_tray"` EnableTray bool `json:"enable_tray"`
UseDBUS bool `json:"use_dbus"` UseDBUS bool `json:"use_dbus"`
UsePulseAudio bool `json:"use_pulse_audio"` UsePulseAudio bool `json:"use_pulse_audio"`
DisableClipboard bool `json:"disable_clipboard"` DisableClipboard bool `json:"disable_clipboard"`
DisableAudio bool `json:"disable_audio"` AudioMode AudioMode `json:"audio_mode"`
} }
type WhitelistItem struct { type WhitelistItem struct {
@ -97,7 +104,7 @@ func NewDefaultProfile() *Profile {
EnableTray: false, EnableTray: false,
UseDBUS: false, UseDBUS: false,
UsePulseAudio: false, UsePulseAudio: false,
DisableAudio: true, AudioMode: PROFILE_AUDIO_NONE,
}, },
} }
} }

@ -10,7 +10,6 @@
"enabled": true "enabled": true
, "enable_tray": true , "enable_tray": true
, "tray_icon":"/usr/share/icons/hicolor/48x48/apps/evince.png" , "tray_icon":"/usr/share/icons/hicolor/48x48/apps/evince.png"
, "disable_audio": true
, "use_pulse_audio": false , "use_pulse_audio": false
} }
, "networking":{ , "networking":{

@ -9,7 +9,6 @@
"enabled": true "enabled": true
, "enable_tray": true , "enable_tray": true
, "tray_icon":"/usr/share/icons/gnome-colors-common/scalable/apps/gajim.svg" , "tray_icon":"/usr/share/icons/gnome-colors-common/scalable/apps/gajim.svg"
, "disable_audio":true
} }
, "networking":{ , "networking":{
"type":"empty" "type":"empty"

@ -4,7 +4,6 @@
"enabled": true "enabled": true
, "enable_tray": true , "enable_tray": true
, "tray_icon": "/usr/share/icons/hicolor/scalable/apps/icedove.svg" , "tray_icon": "/usr/share/icons/hicolor/scalable/apps/icedove.svg"
, "disable_audio": true
} }
, "networking":{ , "networking":{
"type":"bridge" "type":"bridge"

@ -22,8 +22,6 @@
, "enable_tray": true , "enable_tray": true
, "tray_icon":"/usr/share/icons/gnome/scalable/apps/libreoffice-startcenter.svg" , "tray_icon":"/usr/share/icons/gnome/scalable/apps/libreoffice-startcenter.svg"
, "window_icon":"/usr/share/icons/gnome/scalable/apps/libreoffice-startcenter.svg" , "window_icon":"/usr/share/icons/gnome/scalable/apps/libreoffice-startcenter.svg"
, "disable_audio": true
, "use_pulse_audio": false
} }
, "networking":{ , "networking":{
"type":"empty" "type":"empty"

@ -5,7 +5,6 @@
, "enable_tray": true , "enable_tray": true
, "tray_icon":"/usr/share/icons/gnome-colors-common/scalable/apps/office-mail.svg" , "tray_icon":"/usr/share/icons/gnome-colors-common/scalable/apps/office-mail.svg"
, "window_icon":"/usr/share/icons/gnome-colors-common/scalable/apps/office-mail.svg" , "window_icon":"/usr/share/icons/gnome-colors-common/scalable/apps/office-mail.svg"
, "disable_audio": true
, "use_pulse_audio": false , "use_pulse_audio": false
} }
, "networking":{ , "networking":{

@ -4,7 +4,6 @@
, "xserver": { , "xserver": {
"enabled": true "enabled": true
, "enable_tray": true , "enable_tray": true
, "disable_audio": true
, "disable_clipboard": false , "disable_clipboard": false
, "tray_icon":"/usr/share/pixmaps/torbrowser80.xpm" , "tray_icon":"/usr/share/pixmaps/torbrowser80.xpm"
} }

@ -4,7 +4,6 @@
"enabled": true "enabled": true
, "enable_tray": true , "enable_tray": true
, "tray_icon": "/usr/share/icons/gnome-colors-common/scalable/apps/xchat.svg" , "tray_icon": "/usr/share/icons/gnome-colors-common/scalable/apps/xchat.svg"
, "disable_audio": true
} }
, "networking":{ , "networking":{
"type":"empty" "type":"empty"

@ -51,9 +51,12 @@ func getDefaultArgs(config *oz.XServerConf) []string {
args = append(args, "--clipboard") args = append(args, "--clipboard")
} }
if config.DisableAudio { switch config.AudioMode {
case oz.PROFILE_AUDIO_NONE, "":
args = append(args, "--no-microphone", "--no-speaker") args = append(args, "--no-microphone", "--no-speaker")
} else { case oz.PROFILE_AUDIO_SPEAKER:
args = append(args, "--no-microphone", "--speaker")
case oz.PROFILE_AUDIO_FULL:
args = append(args, "--microphone", "--speaker") args = append(args, "--microphone", "--speaker")
} }

Loading…
Cancel
Save