1%
2% anyremote configuration file for decibel-audio-player (http://decibel.silent-blade.org/) (Server-mode)
3%
4
5% STATUS nonstable
6% TODO shuffle works strange;repeat do not works,RWD&FF works badly,playlist-add do not works,choose item from playlist do not works (seems these are decibel bugs)
7% XTEST no
8% SOUND mixer
9% ENV no
10% DEF_PLAYER
11% ALL_IN_ONE
12% MEDIACENTER audio
13% FBROWSER v.4i
14
15GuiAppName=Decibel
16GuiAppBinary=decibel-audio-player
17GuiAppRun=echo 'A=`ps -ef|grep decibel-audio-player|grep -v grep`; if [ "x$A" = "x" ]; then echo NOK; else echo OK; fi'|sh -s
18GuiAppIcon=decibel-audio-player.png
19GuiAppType=Application
20GuiAppProtocols=Server
21GuiAppDesc=Decibel Audio Player is a GTK+ open-source (GPL license) audio player designed for GNU/Linux, which aims at being very straightforward to use by mean of a very clean and user friendly interface.
22
23[Protocol]=Server
24
25(Init)=\
26	Include($(CfgDir)/Utils/aliases-server.cfg);\
27    Include($(CfgDir)/Utils/aliases-server-fbrowser-v4i.cfg);\
28	Macro(TEST_DBUS_SEND);\
29	Macro(SETUP_DEFAULT_MIXER);\
30	Macro(FBROWSER_IC_INIT);\
31	Make(var,player_name,by_value,Decibel);\
32	Make(var,decibel_get,by_value,\
33	     dbus-send --type=method_call --print-reply --dest=org.mpris.dap /Player);\
34	Make(var,decibel_metadata,by_value,\
35	     $(decibel_get) org.freedesktop.MediaPlayer.GetMetadata);\
36	Include($(CfgDir)/Utils/aliases-server-player.cfg);\
37	Make(var,cover_size,by_value,);\
38	Make(var,decibel_layout,\
39	     V=`$(CfgDir)/Utils/registry.sh $(TmpDir) get decibel_layout`;\
40	     if [ "x$V" = "x" ]; then echo "5x1"; else echo $V; fi);
41
42(Exit)=\
43	Macro(FBROWSER_IC_EXIT);\
44	Exec($(CfgDir)/Utils/registry.sh $(TmpDir) set decibel_layout $(decibel_layout));
45
46(Connect)=\
47	Make(mode,decibel_$(decibel_layout));
48
49[Mode]=decibel_general
50
51% Volume control and 0-9,*,# assignments by Utils/aliases-server-player.cfg
52%decibel-audio-player-remote volume 100
53
54GETPOS=\
55        Make(var,dap_pos,$(decibel_get) org.freedesktop.MediaPlayer.PositionGet|tail -1|grep int|tr -s ' '|cut -f 3 -d ' ');
56
57SETPOS=\
58	Exec(dbus-send --type=method_call --dest=org.mpris.dap /Player org.freedesktop.MediaPlayer.PositionSet uint32:$(dap_pos_set));
59
60% 'decibel-audio-player-remote play' does not resume playing after pause
61PLAY=\
62	Exec(decibel-audio-player-remote pause);\
63	Macro(DECIBEL_TITLE);\
64	Timer(DECIBEL_TITLE,$(UpdateTimeout),0);
65
66%RWD=Emulate(key,Left);
67%FF=Emulate(key,Right);
68
69RWD=\
70	Macro(GETPOS);\
71	Make(var,dap_pos_set,expr $(dap_pos) - 5000);\
72	Macro(SETPOS);
73
74FF=\
75	Macro(GETPOS);\
76	Make(var,dap_pos_set,expr $(dap_pos) + 5000);\
77	Macro(SETPOS);
78
79PREV=\
80	Exec(decibel-audio-player-remote prev);\
81	Macro(DECIBEL_TITLE);
82
83STOP=\
84	Timer(DECIBEL_TITLE,cancel);\
85	Exec(decibel-audio-player-remote stop);
86
87NEXT=\
88	Exec(decibel-audio-player-remote next);\
89	Macro(DECIBEL_TITLE);
90
91PAUSE=\
92	Exec(decibel-audio-player-remote pause);
93
94RUN_IF_NEED=\
95	Exec(P=`ps -ef|grep decibel-audio-player|grep -v grep`;\
96	     if [ "x$P" = "x" ]; then decibel-audio-player 2> /dev/null & fi);
97
98RUN_OR_QUIT=\
99	Exec(P=`ps -ef|grep decibel-audio-player|grep -v grep`; \
100	     if [ "x$P" = "x" ]; then \
101	         decibel-audio-player 2> /dev/null & \
102	     else \
103	         pkill -f "python.*decibel-audio-player"; \
104	     fi);
105
106APP_QUIT=\
107	Timer(APLAYER_TITLE,cancel);\
108	Exec(pkill -f "python.*decibel-audio-player");
109
110DECIBEL_TITLE_GENERAL=\
111        Make(var,dap_artist,$(decibel_metadata)|awk '/.*string "artist".*/{getline;print}'|grep string|cut -f 2 -d '"');\
112        Make(var,dap_album,$(decibel_metadata)|awk '/.*string "album".*/{getline;print}'|grep string|cut -f 2 -d '"');\
113        Make(var,dap_title,$(decibel_metadata)|awk '/.*string "title".*/{getline;print}'|grep string|cut -f 2 -d '"');\
114	Set(title,$(dap_artist) - $(dap_album));\
115	Set(status,$(dap_title));
116
117Shuffle=\
118	Exec(decibel-audio-player-remote shuffle);
119
120Repeat=\
121	Exec(P=`$(decibel_get) org.freedesktop.MediaPlayer.GetStatus|awk '/.*struct.*/{getline;getline;getline;getline;print}'|grep int|tr -s ' '|cut -f 3 -d ' '`; \
122		if [ "x$P" != "x1" ]; \
123		then \
124		    dbus-send --type=method_call --dest=org.mpris.dap /TrackList org.freedesktop.MediaPlayer.SetLoop boolean:true & \
125		else \
126		    dbus-send --type=method_call --dest=org.mpris.dap /TrackList org.freedesktop.MediaPlayer.SetLoop boolean:false & \
127		fi);
128
129Playlist=\
130	Make(mode,decibel_playlist);
131
132APP_PLAY_STATUS=\
133	Make(var,decibel_status,$(decibel_get) org.freedesktop.MediaPlayer.GetStatus|awk '/.*struct.*/{getline;print}'|grep int|tr -s ' '|cut -f 3 -d ' ');\
134	Make(var,app_status,if [ "x$(decibel_status)" = "x0" ]; then echo playing; else echo paused; fi);
135
136Layout 3x4=\
137	Make(mode,decibel_3x4);
138
139Layout 7x1=\
140	Make(mode,decibel_7x1);
141
142Layout 5x1=\
143	Make(mode,decibel_5x1);
144
145[ModeEnd]
146
147[Mode]=decibel_3x4 : decibel_general, default_player
148
149% (EnterMode) by Utils/aliases-server-player.cfg
150
151APP_MENU=\
152	Set(menu,replace,Playlist,Shuffle,Repeat,Layout 5x1,Layout 7x1,PowerMgmt);\
153	Macro(ALLIN1MENU);\
154	Macro(MEDIACENTER_MENU);
155
156APP_POST_SETUP=\
157	Make(var,decibel_layout,by_value,3x4);
158
159DECIBEL_TITLE=\
160	Macro(DECIBEL_TITLE_GENERAL);
161
162[ModeEnd]
163
164[Mode]=decibel_cover
165
166DECIBEL_TITLE=\
167	Macro(DECIBEL_TITLE_GENERAL);\
168	Macro(APP_COVER, if [ "x$(cover_size)" = "x" ]; then echo 1; else echo 0; fi);
169
170APP_COVER=\
171	Make(var,media_file,\
172	     $(decibel_metadata)|awk '/.*string "location".*/{getline;print}'|grep string|cut -f 2 -d '"'|cut -f 2 -d ':'|sed 's/"$//;s/^\/\/\//\//');\
173	Macro(DEFAULT_COVER);
174
175[ModeEnd]
176
177[Mode]=decibel_7x1 : decibel_general, default_player_7x1, decibel_cover
178
179% (EnterMode) by Utils/aliases-server-player.cfg
180
181% Mute, Next Cover,Previous Cover,Update Cover, PowerMgmt by Utils/aliases-server-player.cfg
182APP_MENU=\
183	Set(menu,replace,Playlist,Shuffle,Repeat,Mute,Next Cover,Previous Cover,Update Cover,Layout 3x4,Layout 5x1,Help,PowerMgmt);\
184	Macro(ALLIN1MENU);\
185	Macro(MEDIACENTER_MENU);
186
187APP_POST_SETUP=\
188	Make(var,decibel_layout,by_value,7x1);
189
190[ModeEnd]
191
192[Mode]=decibel_5x1 : decibel_general, default_player_5x1, decibel_cover
193
194% (EnterMode) by Utils/aliases-server-player.cfg
195
196% Mute, Next Cover,Previous Cover,Update Cover, PowerMgmt by Utils/aliases-server-player.cfg
197APP_MENU=\
198	Set(menu,replace,Playlist,Shuffle,Repeat,Mute,Next Cover,Previous Cover,Update Cover,Layout 3x4,Layout 7x1,Help,PowerMgmt);\
199	Macro(ALLIN1MENU);\
200	Macro(MEDIACENTER_MENU);
201
202APP_POST_SETUP=\
203	Make(var,decibel_layout,by_value,5x1);
204
205% not timer
206PLAY=\
207	Exec(decibel-audio-player-remote pause);\
208	Macro(DECIBEL_TITLE);
209
210APP_TITLE=\
211	Macro(DECIBEL_TITLE);
212
213[ModeEnd]
214
215[Mode]=decibel_nobutton
216
217% bug-prone :)
2181=Make(mode,decibel_$(decibel_layout));
2192=Make(mode,decibel_$(decibel_layout));
2203=Make(mode,decibel_$(decibel_layout));
2214=Make(mode,decibel_$(decibel_layout));
2225=Make(mode,decibel_$(decibel_layout));
2236=Make(mode,decibel_$(decibel_layout));
2247=Make(mode,decibel_$(decibel_layout));
2258=Make(mode,decibel_$(decibel_layout));
2269=Make(mode,decibel_$(decibel_layout));
227*=Make(mode,decibel_$(decibel_layout));
2280=Make(mode,decibel_$(decibel_layout));
229#=Make(mode,decibel_$(decibel_layout));
230
231[ModeEnd]
232
233[Mode]=decibel_playlist : decibel_nobutton
234
235%playlist-add do not works in Decibel v0.09
236
237(EnterMode)=\
238	ExecAndSet(list,replace,Playlist,$(CfgDir)/Utils/getPlayList.sh org.mpris.dap);\
239  	ExecAndSet(list,select,expr 1 + `dbus-send --type=method_call --print-reply --dest=org.mpris.dap /TrackList org.freedesktop.MediaPlayer.GetCurrentTrack|tail -1|grep int|tr -s ' '|cut -f 3 -d ' '`);\
240	Set(menu,replace,Choose,Delete);
241
242Push($$)=\
243	Macro(Choose($$))
244
245% no such method
246%Choose($$)=\
247%	Exec();
248
249Delete($$)=\
250	Exec(dbus-send --type=method_call --dest=org.mpris.dap /TrackList org.freedesktop.MediaPlayer.DelTrack `expr $(Index) - 1`);
251
252Back($$)=\
253	Set(list,close);\
254	Make(mode,decibel_$(decibel_layout));
255
256[ModeEnd]
257
258%UpdateMenu=Set(menu,replace,GoTo,Add,Go Home);
259%Add to playlist=Macro(FBROWSER_IC_FILL_LIST);Macro(UpdateMenu);
260%GoTo    =Macro(FBROWSER_IC_GO_TO);
261%Go Home =Macro(FBROWSER_IC_GO_HOME);
262%Push($$) use from aliases-server-fbrowser-v4i.cfg
263
264%Add($$)=Set(list,close);\
265%	Exec(decibel-audio-player-remote pl-add "$(fbrowser_dir)/$(Param)");\
266%	Macro(APP_MENU);
267
268[End]
269