Commit graph

120 commits

Author SHA1 Message Date
92959c5cb5 Add a `\n' at the end of command when sent without argument. 2011-08-05 15:30:50 +09:00
4575a05167 Allow the call of multiple closures when getting the server response.
Each closure is called in turn with the parsed data as argument.
2011-08-05 15:29:10 +09:00
08b12abc1a Code Layout. 2011-08-05 12:43:03 +09:00
8961e871fb Revert to :file field if :artist or :title doesn't exist when notifying songs. 2011-08-04 19:03:03 +09:00
1dabcb7d52 Playlist number starts at 1 2011-08-03 14:03:12 +09:00
b17f0abbab Always echoes notification in the echo area 2011-08-03 14:02:45 +09:00
10db6dd0c9 Fix a typo in a function call 2011-07-25 13:40:33 +09:00
74a0f27342 Play the streaming program when sending `play' command 2011-07-20 18:08:54 +09:00
35de475aaf Change the song notify format string. 2011-07-20 15:10:41 +09:00
eb30f79e2e Change the way the playlist is stored.
Store the playlist as a hash table using songid as keys.
Keep also an avector to store the songs order in the playlist.
2011-07-20 15:07:37 +09:00
074727bdbc Add several commands declarations and use them throughout the code.
Also append a `\n' to the commands directly inside the macro.
2011-07-20 15:04:27 +09:00
b574ab150e Fix playlist parsing.
songs informations are delimited by the `id' keyword.
songs may specify several times the same keyword (if this keyword is not :time, :track, :date, :pos or :id).
2011-07-20 10:25:59 +09:00
853fe33bc7 Fix currently playing song notify. 2011-07-20 09:41:41 +09:00
4e414e55f9 Rewrite `empc-update-status' to report (correctly) only the relevant messages 2011-07-19 19:13:42 +09:00
b8f31a51b9 destroy all variables upon disconnection 2011-07-19 19:12:35 +09:00
542736ffd5 Fix simple commands generation. 2011-07-15 13:14:15 +09:00
82a48de6b5 Modify `empc-update-status' to better report changes in status. (still not satisfied…) 2011-07-14 15:57:14 +09:00
5668530e28 Fix pause/stop notification 2011-07-13 19:35:10 +09:00
4930d5ec1e Check the differences between stored status and newly retrieved status.
Use the status to determine the current song.
Notify pause, stop and the current song if applicable.
2011-07-13 16:07:53 +09:00
b9867d635e Modify `empc-echo-notify' to only accept already formated strings 2011-07-13 16:06:37 +09:00
87590d529e Fix `empc-response-get-playlist' when the playlist is empty 2011-07-13 16:02:48 +09:00
3603fe6f01 Change empc-echo-notify' to use start-process' instead of shell-command' and be compatible with empc-response-handle'. 2011-07-12 18:36:06 +09:00
2faf27501d Store playlist as a vector. 2011-07-12 18:34:11 +09:00
949a4cb920 Rewrite `empc-response-get-playlist' to convert some attributes to integer. 2011-07-07 18:50:26 +09:00
1ad38c8e2d Rewrite `empc-response-get-status' to use a temporary variable to store the new status. 2011-07-07 18:49:38 +09:00
e2806e442c Allow `empc-define-simple-command' to specify a closure. 2011-07-07 13:21:46 +09:00
8aa872423d Retrieve the playlist. 2011-07-07 12:35:15 +09:00
ee81ed6e0f Modify `empc-current-status' format.
Using symbols as plist keys.
2011-07-07 12:30:43 +09:00
4198ec323b Fix empc-initialize' which used the old form of empc-send' 2011-07-07 11:41:54 +09:00
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
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