Commit graph

147 commits

Author SHA1 Message Date
20aadc09e6 Rewrite the response handlers.
There is now only one response handler which can still call a closure on the parsed message.
MPD status is now stored in a persistant variable which is updated when receiving idle interruptions.
2011-07-06 19:35:04 +09:00
75a7a9936b Fix the error parsing.
`last' returns a list, not the last element, so `string-match' wouldn't work properly.
2011-07-06 19:33:02 +09:00
8c79f3f95b define empc-response-regexp as a const 2011-07-06 11:48:50 +09:00
8a5f604c8a Rearrange the feedback functions. 2011-07-06 11:47:42 +09:00
cee47ba827 When receiving player' notification, retreive the currently playing song and notify it using the notify-send' program. 2011-07-04 12:12:50 +09:00
df960f5b75 Leave idle state, if not already, right before sending a command. 2011-07-04 11:59:19 +09:00
fb88125743 Fix `empc-define-toggle-command' macro.
A bug that would generate improper commands if defined without optional parameters.
2011-06-30 17:20:12 +09:00
b4df92fb83 Add an idle state.
After every command, empc enters an idle state where it waits for notifications from the server.
2011-06-30 17:17:28 +09:00
596b9e7ae3 rewrite comment 2011-06-30 17:15:24 +09:00
aee4d2b2e9 Fixed malformed `empc-with-updated-status' macro definition. 2011-06-30 17:07:02 +09:00
f592fa65a0 Rearrange commands definition in topics (file layout).
Also add several simple commands like `setvol' or `clear'.
2011-06-30 13:21:21 +09:00
409c488b50 Add function `empc-initialize' which (for now) implements sending password and retrieving available commands. 2011-06-30 13:16:48 +09:00
47fb757d7c Put command definitions together 2011-06-30 12:22:12 +09:00
dcdeeb8ead May specify an argument to simple commands 2011-06-30 12:21:23 +09:00
e650be5d5b Rewrite macro empc-define-toggle-command' and empc-toggle-pause' to use it.
May now specify a body to `empc-define-toggle-command' to add genericity to be
able to define more complex toggling commands.
Also define several toggle commands : consume, random, repeat, single and crossfade.
2011-06-29 20:14:21 +09:00
da317ac699 Delete the old `ido-mpc.el' which is now completely useless. 2011-06-29 16:13:31 +09:00
69b5534971 Make the simple and toggle commands interactive. 2011-06-29 16:11:21 +09:00
cbfee5dc22 Add some feedback to the status command. 2011-06-29 16:10:52 +09:00
d49f03fba2 Rewrite some comments. 2011-06-29 16:10:19 +09:00
aa1dd377e0 Rename define-simple-command' and define-toggle-command' and prefixed them with `empc-' 2011-06-29 16:08:59 +09:00
721e74fb4e define a sentinel for the streaming process which pauses mpd if the process has been killed. 2011-06-29 16:03:37 +09:00
4ff4ce020c Replace empc-send-pause' with empc-toggle-pause'.
uses the new macro `empc-with-updated-status' and starts the streaming process upon success.
2011-06-29 16:00:03 +09:00
0fae4b3bba Replace the function empc-update-status' with a macro empc-with-updated-status'. 2011-06-29 15:55:47 +09:00
825a25626e generic response parser that echoes the message and call a closure on it. 2011-06-29 15:49:52 +09:00
0a62d68f12 Rewrite `empc-response-parse-line' 2011-06-29 15:41:08 +09:00
6edac266cf Rename empc-response-message' as empc-echo-response' and trim the trailing `\n' 2011-06-29 15:40:16 +09:00
3bc81272e2 permute closure and fn in empc-send' function to match tq-enqueue's call 2011-06-29 10:58:27 +09:00
9039e052eb comment out the definition of the toggle commands. 2011-06-28 20:53:08 +09:00
45c588eb50 whitespace 2011-06-28 20:53:08 +09:00
e2cc39a1cc Add a function to run the streaming program if the sent command is successful. 2011-06-28 20:53:08 +09:00
dd9c4decfb Add a command to toggle pause by requesting first the server status. 2011-06-28 20:53:01 +09:00
e7e51bf5d3 may call a closure after parsing the response of the `status' command. 2011-06-28 20:51:30 +09:00
188c35c775 Function to parse the server's status. 2011-06-28 17:46:17 +09:00
8fa0aa1213 Function to parse the server's response. 2011-06-28 17:45:21 +09:00
c620cd8838 begin to write the function to parse response 2011-06-23 19:25:57 +09:00
4520162ab1 cleanly close the transfert queue upon deconnection 2011-06-23 19:22:39 +09:00
0b775d7cf2 connect when updating state 2011-06-23 12:28:19 +09:00
bbe44445aa trying to define a parser to retrieve status 2011-06-22 19:46:57 +09:00
72274a3962 new option defining the default crossfade when toggled 2011-06-22 19:44:57 +09:00
b94981a996 defining simple and toggling commands 2011-06-22 19:44:25 +09:00
2e9f7f265c macro defining toggling commands 2011-06-22 19:44:00 +09:00
ccc41ce02c cleanly close connection before trying to reconnect. 2011-06-22 19:40:32 +09:00
d2eb2389e6 Add a macro to generate simple commands.
But it won't be really useful, I'm afraid…
2011-06-20 19:32:03 +09:00
60863cb36f New version that doesn't use libmpdee 2011-06-17 19:15:30 +09:00
8e3c7952c1 when connection breaks, tries to reconnect and updates the state variable 2011-06-17 18:14:04 +09:00
b292f91902 empty readme, push to github 2011-06-16 19:07:00 +09:00
770e3339cb first commit
Only play / pause are available.
streaming is also available as at very simple stage.
2011-06-16 18:58:15 +09:00