Browse Source

shairport: improve config and init script (disabled, respawn, err file, meta dir, audio output options).

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Álvaro Fernández Rojas 10 years ago
parent
commit
f78cd57ee4

+ 1
- 1
multimedia/shairport/Makefile View File

@@ -8,7 +8,7 @@
8 8
 include $(TOPDIR)/rules.mk
9 9
 
10 10
 PKG_NAME:=shairport
11
-PKG_VERSION:=2014-08-22
11
+PKG_VERSION:=2014-10-28
12 12
 PKG_RELEASE:=$(PKG_SOURCE_VERSION)
13 13
 
14 14
 PKG_SOURCE_PROTO:=git

+ 21
- 3
multimedia/shairport/files/shairport.config View File

@@ -1,12 +1,16 @@
1 1
 config shairport main
2
+	option disabled '1'
3
+	option respawn '1'
2 4
 	option bname 'AirPort'
3 5
 	option password ''
4 6
 	option port '5002'
5
-	option buffer '256'
6
-	option log ''
7
+	option buffer ''
8
+	option log_file ''
9
+	option err_file ''
10
+	option meta_dir ''
7 11
 	option cmd_start ''
8 12
 	option cmd_stop ''
9
-	option cmd_wait ''
13
+	option cmd_wait '0'
10 14
 	option audio_output 'alsa'
11 15
 	option mdns 'avahi'
12 16
 
@@ -16,3 +20,17 @@ config shairport main
16 20
 	option mixer_type ''
17 21
 	option mixer_control ''
18 22
 	option mixer_index ''
23
+
24
+	# options for ao output
25
+	option ao_driver ''
26
+	option ao_name ''
27
+	option ao_id ''
28
+	option ao_options ''
29
+
30
+	# options for pipe output
31
+	option output_fifo ''
32
+
33
+	# options for pulse output
34
+	option pulse_server ''
35
+	option pulse_sink ''
36
+	option pulse_appname ''

+ 35
- 4
multimedia/shairport/files/shairport.init View File

@@ -28,16 +28,21 @@ append_bool() {
28 28
 
29 29
 start_instance() {
30 30
 	local cfg="$1"
31
-	local ao dev
31
+	local ao dev aux
32
+
33
+	config_get_bool aux "$cfg" 'disabled' '0'
34
+	[ "$aux" = 1 ] && return 1
32 35
 
33 36
 	procd_open_instance
34 37
 
35 38
 	procd_set_param command /usr/bin/shairport
36 39
 
37 40
 	append_arg "$cfg" bname "-a" "AirPort"
38
-	append_arg "$cfg" log "-l"
39
-	append_arg "$cfg" buffer "-b" "256"
40
-	append_arg "$cfg" port "-p" "5002"
41
+	append_arg "$cfg" log_file "-l"
42
+	append_arg "$cfg" err_file "-e"
43
+	append_arg "$cfg" meta_dir "-M"
44
+	append_arg "$cfg" buffer "-b"
45
+	append_arg "$cfg" port "-p"
41 46
 	append_arg "$cfg" password "-k"
42 47
 	append_arg "$cfg" mdns "-m"
43 48
 
@@ -58,8 +63,34 @@ start_instance() {
58 63
 			append_arg "$cfg" mixer_control "-c"
59 64
 			append_arg "$cfg" mixer_index "-i"
60 65
 		fi
66
+	elif [ "$ao" = "ao" ]; then
67
+		config_get dev "$cfg" ao_driver ""
68
+		if [ -n "$dev" ]; then
69
+			procd_append_param command "--"
70
+			append_arg "$cfg" ao_driver "-d"
71
+			append_arg "$cfg" ao_id "-i"
72
+			append_arg "$cfg" ao_name "-n"
73
+			append_arg "$cfg" ao_options "-o"
74
+		fi
75
+	elif [ "$ao" = "pipe" ]; then
76
+		config_get dev "$cfg" output_fifo ""
77
+		if [ -n "$dev" ]; then
78
+			procd_append_param command "--"
79
+			append_arg "$cfg" output_fifo ""
80
+		fi
81
+	elif [ "$ao" = "pulse" ]; then
82
+		config_get dev "$cfg" pulse_server ""
83
+		if [ -n "$dev" ]; then
84
+			procd_append_param command "--"
85
+			append_arg "$cfg" pulse_server "-a"
86
+			append_arg "$cfg" pulse_sink "-s"
87
+			append_arg "$cfg" pulse_appname "-n"
88
+		fi
61 89
 	fi
62 90
 
91
+	config_get_bool aux "$cfg" 'respawn' '0'
92
+	[ "$aux" = 1 ] && procd_set_param respawn
93
+
63 94
 	procd_close_instance
64 95
 }
65 96