├── .gitignore ├── .travis.yml ├── CONTRIBUTING.md ├── Cask ├── ChangeLog.md ├── LICENSE ├── Makefile ├── README.md ├── addons ├── Dockerfile └── github.sh ├── circle.yml ├── dionysos-backend-mpd.el ├── dionysos-backend-mplayer.el ├── dionysos-backend-vlc.el ├── dionysos-backend.el ├── dionysos-custom.el ├── dionysos-fs-mode.el ├── dionysos-io.el ├── dionysos-mode.el ├── dionysos-mpd-mode.el ├── dionysos-notify.el ├── dionysos-process.el ├── dionysos-ui.el ├── dionysos-version.el ├── dionysos-volume.el ├── dionysos.el ├── dionysos.png ├── dionysos.svg ├── test ├── dionysos-backend-mpd-test.el ├── dionysos-backend-mplayer-test.el ├── dionysos-backend-test.el ├── dionysos-backend-vlc-test.el ├── dionysos-io-test.el ├── dionysos-process-test.el ├── dionysos-version-test.el ├── resources │ ├── France.mp3 │ ├── Roulement_tambour-01.flac │ ├── Roulement_tambour-01.mp3 │ ├── Roulement_tambour-01.ogg │ └── Theatre_coup_avt_leve_rideau.mp3 └── test-helper.el └── var ├── dionysos-fs-0.6.png └── dionysos-mpd-0.3.png /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *\#*\# 3 | *.\#* 4 | *.elc 5 | .cask 6 | elpa 7 | .depend 8 | marcopolo-pkg.el 9 | packages/* 10 | TAGS 11 | .DS_STORE 12 | dist 13 | .vagrant/ 14 | test/sandbox/ 15 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | ### 2 | ### Notes 3 | ### 4 | ### The travis web interface may choke silently and fail to 5 | ### update when there are issues with the .travis.yml file. 6 | ### 7 | ### The "travis-lint" command-line tool does not catch all 8 | ### errors which may lead to silent failure. 9 | ### 10 | ### Shell-style comments in this file must have "#" as the 11 | ### *first* character of the line. 12 | ### 13 | 14 | ### 15 | ### language 16 | ### 17 | 18 | language: emacs-lisp 19 | 20 | ### 21 | ### defining the build matrix 22 | ### 23 | ### ===> <=== 24 | ### ===> each variation in env/matrix will be built and tested <=== 25 | ### ===> <=== 26 | ### 27 | ### variables under env/global are available to the build process 28 | ### but don't cause the creation of a separate variation 29 | ### 30 | 31 | env: 32 | # - EMACS=emacs-23.4-bin METHOD=evm 33 | # - EMACS=emacs-24.1-bin METHOD=evm 34 | # - EMACS=emacs-24.2-bin METHOD=evm 35 | # - EMACS=emacs-24.3-bin METHOD=evm 36 | - EMACS=emacs-24.4-bin METHOD=evm 37 | # - EMACS=emacs24 METHOD=manual 38 | - EMACS=emacs-snapshot METHOD=manual 39 | 40 | ### 41 | ### allowing build failures 42 | ### 43 | 44 | # matrix: 45 | # fast_finish: true 46 | # allow_failures: 47 | # - env: EMACS=emacs-23.4-bin METHOD=evm 48 | 49 | ### 50 | ### limit build attempts to defined branches 51 | ### 52 | ### notes 53 | ### 54 | ### This controls which branches are built. 55 | ### 56 | ### You can also control which branches affect the web badge, by 57 | ### appending "?branch=master,staging,production" to the end of the 58 | ### image URL (replacing "master,staging,production" with a 59 | ### comma-separated list of branches to be reflected in the badge). 60 | ### 61 | # 62 | # branches: 63 | # only: 64 | # - master 65 | # 66 | 67 | ### 68 | ### runtime initialization 69 | ### 70 | ### notes 71 | ### 72 | ### emacs22 is extracted manually from Ubuntu Maverick. 73 | ### 74 | ### emacs23 is the stock default, but is updated anyway to 75 | ### a GUI-capable version, which will have certain additional 76 | ### functions compiled in. 77 | ### 78 | ### emacs24 (current stable release) is obtained from the 79 | ### cassou PPA: http://launchpad.net/~cassou/+archive/emacs 80 | ### 81 | ### emacs-snapshot (trunk) is obtained from the Ubuntu Emacs Lisp PPA: 82 | ### https://launchpad.net/~ubuntu-elisp/+archive/ppa 83 | ### For the emacs-snapshot build, bleeding-edge versions 84 | ### of all test dependencies are also used. 85 | ### 86 | 87 | before_install: 88 | - sudo apt-get update 89 | - sudo apt-get install vlc mplayer 90 | 91 | install: 92 | - if [ "$METHOD" = 'evm' ]; then 93 | sudo mkdir /usr/local/evm && 94 | sudo chown travis:travis /usr/local/evm && 95 | sudo add-apt-repository -y ppa:cassou/emacs && 96 | sudo apt-get update -qq && 97 | sudo apt-get build-dep -qq emacs24 && 98 | curl -fsSkL https://raw.github.com/rejeep/evm/master/go | bash && 99 | export PATH="~/.evm/bin:$PATH" && 100 | chmod +x ~/.evm/bin/evm && 101 | ~/.evm/bin/evm install $EMACS && 102 | ~/.evm/bin/evm use $EMACS && 103 | FULL_EMACS_PATH="/usr/local/evm/$EMACS/bin/emacs" && 104 | export EMACS="$FULL_EMACS_PATH" && 105 | EMACS="$FULL_EMACS_PATH"; 106 | fi 107 | - if [ "$EMACS" = 'emacs24' ]; then 108 | sudo add-apt-repository -y ppa:cassou/emacs && 109 | sudo apt-get -qq update && 110 | sudo apt-get -qq -f install && 111 | sudo apt-get -qq install emacs24 emacs24-el; 112 | fi 113 | - if [ "$EMACS" = 'emacs-snapshot' ]; then 114 | sudo add-apt-repository -y ppa:ubuntu-elisp/ppa && 115 | sudo apt-get -qq update && 116 | sudo apt-get -qq -f install && 117 | sudo apt-get -qq install emacs-snapshot && 118 | sudo apt-get -qq install emacs-snapshot-el; 119 | fi 120 | - curl -fsSkL https://raw.github.com/cask/cask/master/go | python 121 | - export PATH="${HOME}/.cask/bin:$PATH" 122 | 123 | 124 | before_script: 125 | # - if [ "$EMACS" = 'emacs-snapshot' ]; then 126 | # make downloads-latest; 127 | # else 128 | # make downloads; 129 | # fi 130 | 131 | ### 132 | ### the actual build/test command 133 | ### 134 | ### Use "make test-batch" to test without byte-compiling. 135 | ### The default command avoids byte-compiling on Emacs 22. 136 | ### 137 | 138 | script: 139 | echo "Method is $METHOD " && $EMACS --version && EMACS="$EMACS" make init test 140 | 141 | ### 142 | ### settings 143 | ### 144 | 145 | # notifications: 146 | # email: false 147 | 148 | # 149 | # Emacs 150 | # 151 | # Local Variables: 152 | # indent-tabs-mode: nil 153 | # coding: utf-8 154 | # End: 155 | # 156 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | If you discover issues, have ideas for improvements or new features, or 4 | want to contribute a new module, please report them to the 5 | [issue tracker][1] of the repository or submit a pull request. Please, 6 | try to follow these guidelines when you do so. 7 | 8 | ## Issue reporting 9 | 10 | * Check that the issue has not already been reported. 11 | * Check that the issue has not already been fixed in the latest code 12 | (a.k.a. `develop`). 13 | * Be clear, concise and precise in your description of the problem. 14 | * Open an issue with a descriptive title and a summary in grammatically correct, 15 | complete sentences. 16 | * Include any relevant code to the issue summary. 17 | 18 | ## Pull requests 19 | 20 | * Read [how to properly contribute to open source projects on Github][2]. 21 | * Use a topic branch to easily amend a pull request later, if necessary. 22 | (based on *develop* branch) 23 | * Write [good commit messages][3]. 24 | * Use the same coding conventions as the rest of the project. 25 | * Verify your Emacs Lisp code with `checkdoc`. 26 | * Open a [pull request][4] that relates to *only* one subject with a clear title 27 | and description in grammatically correct, complete sentences. 28 | 29 | 30 | [1]: https://github.com/nlamirault/dionysos/issues 31 | [2]: http://gun.io/blog/how-to-github-fork-branch-and-pull-request 32 | [3]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html 33 | [4]: https://help.github.com/articles/using-pull-requests 34 | -------------------------------------------------------------------------------- /Cask: -------------------------------------------------------------------------------- 1 | ;;; Dionysos Cask file 2 | 3 | ;; Copyright (C) 2015-2016 Nicolas Lamirault 4 | 5 | ;; This program is free software; you can redistribute it and/or 6 | ;; modify it under the terms of the GNU General Public License 7 | ;; as published by the Free Software Foundation; either version 2 8 | ;; of the License, or (at your option) any later version. 9 | 10 | ;; This program is distributed in the hope that it will be useful, 11 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ;; GNU General Public License for more details. 14 | 15 | ;; You should have received a copy of the GNU General Public License 16 | ;; along with this program; if not, write to the Free Software 17 | ;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 18 | ;; 02110-1301, USA. 19 | 20 | (source "melpa" "http://melpa.org/packages/") 21 | (source "gnu" "http://elpa.gnu.org/packages/") 22 | 23 | (package-file "dionysos.el") 24 | (files "dionysos*.el" (:exclude ".dir-locals.el")) 25 | 26 | ;; Development 27 | (development 28 | (depends-on "libmpdee" "2.1.0") 29 | (depends-on "alert" "1.2") 30 | (depends-on "f" "0.18.2") 31 | (depends-on "s" "1.11.0") 32 | (depends-on "dash" "2.12.1") 33 | (depends-on "ansi" "0.4.0") 34 | (depends-on "pkg-info" "0.5.0") 35 | (depends-on "ert") 36 | (depends-on "ert-runner" "0.6.4") 37 | (depends-on "undercover" "0.4.0")) 38 | -------------------------------------------------------------------------------- /ChangeLog.md: -------------------------------------------------------------------------------- 1 | Dionysos ChangeLog 2 | ============================ 3 | 4 | # Version 0.6.0 (08/10/2016) 5 | 6 | - Refactoring *fs-mode* UI 7 | - Add *pause* command to the VLC backend 8 | - `FIX` Start process and callback after finish 9 | - Extract ID3 tags from mp3 file using *id3* 10 | 11 | # Version 0.5.0 (08/08/2016) 12 | 13 | - Add *fs-mode* 14 | - Update dependencies 15 | - [#9][https://github.com/nlamirault/dionysos/pull/9]: Use s-trim instead of string-trim. Use cl-lib always. (Thanks Syohei YOSHIDA) 16 | - Add contributing guide 17 | 18 | # Version 0.4.0 (10/12/2015) 19 | 20 | - Setup continuous integration 21 | - Add notification system 22 | 23 | # Version 0.3.0 (03/20/2015) 24 | 25 | - Add MPD mode to display current playlist 26 | - Add MPD backend 27 | 28 | # Version 0.2.0 (02/03/2015) 29 | 30 | - [#6][https://github.com/nlamirault/dionysos/issues/6]: Manage volume 31 | - [#2][https://github.com/nlamirault/dionysos/issues/2]: MPlayer backend 32 | 33 | # Version 0.1.0 (01/15/2015) 34 | 35 | - Init files mode (directory listing) 36 | - [#1][https://github.com/nlamirault/dionysos/issues/1]: Add VLC backend 37 | - Add [TravisCI][https://travis-ci.org/nlamirault/dionysos] and [Drone.io][https://drone.io/github.com/nlamirault/dionysos] for continuous integration 38 | - Init project 39 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | {description} 294 | Copyright (C) {year} {fullname} 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | {signature of Ty Coon}, 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015-2016 Nicolas Lamirault 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation, either version 3 of the License, or 6 | # (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program. If not, see . 15 | 16 | APP = dionysos 17 | 18 | SHELL = /bin/bash 19 | 20 | EMACS ?= emacs 21 | EMACSFLAGS = -L . 22 | CASK = cask 23 | VAGRANT = vagrant 24 | 25 | VERSION=$(shell \ 26 | grep Version dionysos.el \ 27 | |awk -F':' '{print $$2}' \ 28 | |sed -e "s/[^0-9.]//g") 29 | 30 | PACKAGE_FOLDER=$(APP)-$(VERSION) 31 | ARCHIVE=$(PACKAGE_FOLDER).tar 32 | 33 | ELS = $(shell find . -name "*.el") 34 | OBJECTS = $(ELS:.el=.elc) 35 | 36 | NO_COLOR=\033[0m 37 | OK_COLOR=\033[32;01m 38 | ERROR_COLOR=\033[31;01m 39 | WARN_COLOR=\033[33;01m 40 | 41 | all: help 42 | 43 | help: 44 | @echo -e "$(OK_COLOR)==== $(APP) [$(VERSION)]====$(NO_COLOR)" 45 | @echo -e "$(WARN_COLOR)- init$(NO_COLOR) : initialize development environment" 46 | @echo -e "$(WARN_COLOR)- build$(NO_COLOR) : build project" 47 | @echo -e "$(WARN_COLOR)- test$(NO_COLOR) : launch unit tests" 48 | @echo -e "$(WARN_COLOR)- clean$(NO_COLOR) : cleanup" 49 | @echo -e "$(WARN_COLOR)- package$(NO_COLOR) : packaging" 50 | 51 | init: 52 | @echo -e "$(OK_COLOR)[$(APP)] Initialize environment$(NO_COLOR)" 53 | @$(CASK) --dev install 54 | 55 | elpa: 56 | @echo -e "$(OK_COLOR)[$(APP)] Build$(NO_COLOR)" 57 | @$(CASK) install 58 | @$(CASK) update 59 | @touch $@ 60 | 61 | .PHONY: build 62 | build : elpa $(OBJECTS) 63 | 64 | test: build 65 | @echo -e "$(OK_COLOR)[$(APP)] Unit tests$(NO_COLOR)" 66 | @$(CASK) exec ert-runner 67 | 68 | .PHONY: virtual-test 69 | virtual-test: check-env 70 | @$(VAGRANT) up 71 | @$(VAGRANT) ssh -c "source /tmp/.emacs-dionysos.rc && make -C /vagrant EMACS=$(EMACS) clean init test" 72 | 73 | .PHONY: virtual-clean 74 | virtual-clean: 75 | @$(VAGRANT) destroy 76 | 77 | .PHONY: clean 78 | clean : 79 | @echo -e "$(OK_COLOR)[$(APP)] Cleanup$(NO_COLOR)" 80 | @rm -fr $(OBJECTS) elpa $(APP)-pkg.el $(APP)-pkg.elc $(ARCHIVE).gz 81 | 82 | reset : clean 83 | @rm -rf .cask 84 | 85 | pkg-file: 86 | $(CASK) pkg-file 87 | 88 | pkg-el: pkg-file 89 | $(CASK) package 90 | 91 | package: clean pkg-el 92 | @echo -e "$(OK_COLOR)[$(APP)] Packaging$(NO_COLOR)" 93 | cp dist/$(ARCHIVE) . 94 | gzip $(ARCHIVE) 95 | rm -fr dist 96 | 97 | %.elc : %.el 98 | @$(CASK) exec $(EMACS) --no-site-file --no-site-lisp --batch \ 99 | $(EMACSFLAGS) \ 100 | -f batch-byte-compile $< 101 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Dionysos 2 | 3 | [![License GPL 2][badge-license]][LICENSE] 4 | 5 | * Master : [![MELPA Stable](https://stable.melpa.org/packages/dionysos-badge.svg)](https://stable.melpa.org/#/dionysos) [![Circle CI](https://circleci.com/gh/nlamirault/dionysos/tree/master.svg?style=svg)](https://circleci.com/gh/nlamirault/dionysos/tree/master) [![Coverage Status](https://coveralls.io/repos/nlamirault/dionysos/badge.png?branch=master)](https://coveralls.io/r/nlamirault/dionysos?branch=master) 6 | * Develop: [![Melpa Status](https://melpa.org/packages/dionysos-badge.svg)](https://melpa.org/#/dionysos) [![Circle CI](https://circleci.com/gh/nlamirault/dionysos/tree/develop.svg?style=svg)](https://circleci.com/gh/nlamirault/dionysos/tree/develop) [![Coverage Status](https://coveralls.io/repos/nlamirault/dionysos/badge.png?branch=develop)](https://coveralls.io/r/nlamirault/dionysos?branch=develop) 7 | 8 | ![dionysos](dionysos.png) 9 | 10 | A simple music player for Emacs. 11 | 12 | Backends available are : 13 | * [vlc][] 14 | * [mplayer][] 15 | * [mpd][] 16 | 17 | Tools used : 18 | * [id3][] 19 | 20 | ## Installation 21 | 22 | The recommended way to install ``dionysos`` is via [MELPA][]: 23 | 24 | M-x package-install dionysos 25 | 26 | or [Cask][]: 27 | 28 | (depends-on "dionysos") 29 | 30 | 31 | ## Customization 32 | 33 | ```lisp 34 | (setq dionysos-backend 'vlc 35 | dionysos-notify-p t 36 | dionysos-volume-cmd 'pamixer) 37 | ``` 38 | 39 | ## Backend 40 | 41 | You could use this backends : **vlc**, **mplayer** and **mpd**. 42 | Setup your backend : 43 | 44 | ```lisp 45 | (setq dionysos-backend 'vlc) 46 | ``` 47 | 48 | ## Modes 49 | 50 | ### Filesystem 51 | 52 | Listen to music files in a directory : 53 | 54 | M-x dionysos-fs-list 55 | 56 | Keybinding | Description 57 | ---------------------|------------------------------------------------------------ 58 | c | start playing current position 59 | SPACE | stop music player 60 | n | play next song 61 | p | play previous song 62 | + | raise volume 63 | - | lower volume 64 | q | quit 65 | 66 | ![Filesystem](var/dionysos-fs-0.6.png) 67 | 68 | ### MPD 69 | 70 | You could play songs from MPD playlist : 71 | 72 | M-x dionysos-mpd-playlist 73 | 74 | ![MPD](var/dionysos-mpd-0.3.png) 75 | 76 | In this mode, you could use manage MPD : 77 | 78 | Keybinding | Description 79 | ---------------------|------------------------------------------------------------ 80 | n | Go to the next song 81 | n | Go to the previous song 82 | c | Play song from current position 83 | s | Start playing 84 | SPC | Stop playing 85 | + | Raise volume 86 | - | Decrease volume 87 | q | quit 88 | 89 | ## Development 90 | 91 | ### Cask 92 | 93 | ``dionysos`` use [Cask][] for dependencies management. Install it and retrieve 94 | dependencies : 95 | 96 | $ curl -fsSkL https://raw.github.com/cask/cask/master/go | python 97 | $ export PATH="$HOME/.cask/bin:$PATH" 98 | $ cask 99 | 100 | ### Testing 101 | 102 | * Launch unit tests from shell 103 | 104 | $ make clean test 105 | 106 | * Using [overseer][] : 107 | 108 | Keybinding | Description 109 | ---------------------|------------------------------------------------------------ 110 | C-c , t | launch unit tests from buffer 111 | C-c , b | launch unit tests 112 | C-c , g | launch unit tests with tag (find, regexp, ...) 113 | 114 | * Tips: 115 | 116 | If you want to launch a single unit test, add a specify tag : 117 | 118 | ```lisp 119 | (ert-deftest test-foobar () 120 | :tags '(current) 121 | ``` 122 | 123 | And launch it using : C-c , g and specify tag : *current* 124 | 125 | 126 | ## Support / Contribute 127 | 128 | See [here](CONTRIBUTING.md) 129 | 130 | 131 | ## Changelog 132 | 133 | A changelog is available [here](ChangeLog.md). 134 | 135 | 136 | ## License 137 | 138 | See [LICENSE](LICENSE). 139 | 140 | 141 | ## Contact 142 | 143 | Nicolas Lamirault 144 | 145 | 146 | 147 | [dionysos]: https://github.com/nlamirault/dionysos 148 | [badge-license]: https://img.shields.io/badge/license-GPL_2-green.svg?style=flat 149 | [LICENSE]: https://github.com/nlamirault/dionysos/blob/master/LICENSE 150 | [Issue tracker]: https://github.com/nlamirault/dionysos/issues 151 | 152 | [GNU Emacs]: https://www.gnu.org/software/emacs/ 153 | [MELPA]: https://melpa.org 154 | [Cask]: http://cask.github.io/ 155 | [Overseer]: https://github.com/tonini/overseer.el 156 | 157 | [vlc]: http://www.videolan.org/vlc/ 158 | [mplayer]: http://www.mplayerhq.hu/design7/news.html 159 | [mpd]: https://www.musicpd.org/ 160 | [id3]: https://github.com/squell/id3] 161 | -------------------------------------------------------------------------------- /addons/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.3 2 | RUN go get github.com/aktau/github-release 3 | RUN mkdir -p /src/dionysos 4 | VOLUME ["/src/dionysos"] 5 | -------------------------------------------------------------------------------- /addons/github.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (C) 2015 Nicolas Lamirault 4 | 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | 18 | set -e 19 | if [ -z "$1" ]; then 20 | echo -e "\033[31;01m[dionysos] Pass the version number as the first arg. E.g.: $0 1.2.3 \033[0m" 21 | exit 1 22 | fi 23 | if [ -z "$GITHUB_TOKEN" ]; then 24 | echo -e "\033[31;01m[dionysos] GITHUB_TOKEN must be set for github-release \033[0m" 25 | exit 1 26 | fi 27 | 28 | VERSION=$1 29 | 30 | git tag $VERSION 31 | git push --tags 32 | 33 | echo -e "\033[32;01m[dionysos] Build image \033[0m" 34 | docker build -t dionysos/release addons 35 | 36 | echo -e "\033[32;01m[dionysos] Make release \033[0m" 37 | docker run --rm -e GITHUB_TOKEN dionysos/release \ 38 | github-release release \ 39 | --user nlamirault \ 40 | --repo dionysos \ 41 | --tag $VERSION \ 42 | --name $VERSION \ 43 | --description "" 44 | # --pre-release \ 45 | 46 | echo -e "\033[32;01m[dionysos] Upload archive \033[0m" 47 | PKG="dionysos-$VERSION.tar.gz" 48 | docker run --rm -e GITHUB_TOKEN -v `pwd`:/src/dionysos \ 49 | dionysos/release github-release upload \ 50 | --user nlamirault \ 51 | --repo dionysos \ 52 | --tag $VERSION \ 53 | --name $PKG \ 54 | --file /src/dionysos/$PKG 55 | -------------------------------------------------------------------------------- /circle.yml: -------------------------------------------------------------------------------- 1 | machine: 2 | services: 3 | - docker 4 | 5 | dependencies: 6 | pre: 7 | - sudo add-apt-repository -y ppa:cassou/emacs 8 | - sudo add-apt-repository -y ppa:ubuntu-elisp/ppa 9 | - sudo apt-get update -qq 10 | - sudo apt-get install -qq emacs24-nox emacs-snapshot-nox 11 | - curl -fsSkL "https://raw.github.com/cask/cask/master/go" | python 12 | - sudo apt-get install vlc mpg123 mplayer 13 | test: 14 | override: 15 | - PATH="${HOME}/.cask/bin:$PATH" make test 16 | -------------------------------------------------------------------------------- /dionysos-backend-mpd.el: -------------------------------------------------------------------------------- 1 | ;;; dionysos-backend-mpd.el --- Dionysos MPD backend 2 | 3 | ;; Copyright (C) 2015-2016 Nicolas Lamirault 4 | 5 | ;; This program is free software; you can redistribute it and/or 6 | ;; modify it under the terms of the GNU General Public License 7 | ;; as published by the Free Software Foundation; either version 2 8 | ;; of the License, or (at your option) any later version. 9 | 10 | ;; This program is distributed in the hope that it will be useful, 11 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ;; GNU General Public License for more details. 14 | 15 | ;; You should have received a copy of the GNU General Public License 16 | ;; along with this program; if not, write to the Free Software 17 | ;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 18 | ;; 02110-1301, USA. 19 | 20 | ;;; Commentary: 21 | 22 | ;;; Code: 23 | 24 | (require 'libmpdee) 25 | 26 | (require 'dionysos-backend) 27 | (require 'dionysos-custom) 28 | (require 'dionysos-notify) 29 | (require 'dionysos-process) 30 | 31 | (dionysos--define-backend mpd 32 | :name "MPD" 33 | :command nil 34 | :filter '("ogg" "mp3" "wav" "flac") 35 | :start 'dionysos--mpd-start 36 | :pause 'dionysos--mpd-pause 37 | :stop 'dionysos--mpd-stop) 38 | 39 | 40 | ;; Customization 41 | 42 | (defcustom dionysos-mpd-host "localhost" 43 | "Host running mpd." 44 | :type 'string 45 | :group 'dionysos-mpd) 46 | 47 | (defcustom dionysos-mpd-port 6600 48 | "Port to connect to." 49 | :type 'integer 50 | :group 'dionysos-mpd) 51 | 52 | (defvar dionysos--mpd-con nil 53 | "The MPD connection.") 54 | 55 | 56 | ;; Core 57 | 58 | (defmacro with-mpd (&rest body) 59 | `(progn 60 | (unless (equal 'ready dionysos--mpd-con) 61 | (dionysos--mpd-connect)) 62 | ,@body)) 63 | 64 | (defun dionysos--mpd-connect () 65 | (setq dionysos--mpd-con (mpd-conn-new dionysos-mpd-host dionysos-mpd-port))) 66 | 67 | 68 | (defun dionysos--mpd-status () 69 | (with-mpd 70 | (mpd-get-status dionysos--mpd-con))) 71 | 72 | 73 | (defun dionysos--mpd-start (&optional song-id) 74 | "Start MPD playing music. 75 | `SONG-ID' is to specify a song." 76 | (with-mpd 77 | (dionysos--mpd-connect) 78 | (if song-id 79 | (mpd-play dionysos--mpd-con song-id t) 80 | (mpd-play dionysos--mpd-con)) 81 | (let ((song (mpd-get-current-song dionysos--mpd-con))) 82 | (message "[dionysos-mpd] Start %s" song) 83 | (dionysos--notify 84 | (format "%s\n%s" 85 | (dionysos--plist-get song 'Title) 86 | (dionysos--plist-get song 'Artist)) 87 | 'info)))) 88 | 89 | 90 | (defun dionysos--mpd-stop () 91 | "Stop MPD playing song." 92 | (with-mpd 93 | (message "[dionysos-mpd] Stop") 94 | (mpd-stop dionysos--mpd-con))) 95 | 96 | 97 | (defun dionysos--mpd-pause () 98 | "Pause MPD playing song." 99 | (with-mpd 100 | (message "[dionysos-mpd] Pause"))) 101 | 102 | 103 | (defun dionysos--mpd-prev () 104 | "Read previous song." 105 | (with-mpd 106 | (message "[dionysos-mpd] Previous") 107 | (mpd-prev dionysos--mpd-con))) 108 | 109 | 110 | (defun dionysos--mpd-next () 111 | "Read next song." 112 | (with-mpd 113 | (message "[dionysos-mpd] Next") 114 | (mpd-next dionysos--mpd-con))) 115 | 116 | 117 | (defun dionysos--mpd-songs () 118 | "Retrieve all songs from MPD." 119 | (with-mpd 120 | ;;(mpd-get-directory-songs dionysos--mpd-con))) 121 | (mpd-get-songs dionysos--mpd-con "listallinfo"))) 122 | 123 | 124 | (defun dionysos--mpd-playlist () 125 | "Return the MPD playlist." 126 | (with-mpd 127 | ;;(mpd-get-playlist dionysos--mpd-con))) 128 | (mpd-get-songs dionysos--mpd-con "playlistinfo"))) 129 | 130 | 131 | (defun dionysos--mpd-current-song () 132 | "Return the current song." 133 | (with-mpd 134 | (mpd-get-current-song dionysos--mpd-con))) 135 | 136 | 137 | (defun dionysos--plist-get (plist prop) 138 | "Extract a value from the property list or return an empty string. 139 | `PLIST' is the property list 140 | `PROP' is the key" 141 | (let ((data (plist-get plist prop))) 142 | (if data 143 | data 144 | ""))) 145 | 146 | 147 | (provide 'dionysos-backend-mpd) 148 | ;;; dionysos-backend-mpd.el ends here 149 | -------------------------------------------------------------------------------- /dionysos-backend-mplayer.el: -------------------------------------------------------------------------------- 1 | ;;; dionysos-backend-mplayer.el --- Dionysos MPlayer backend 2 | 3 | ;; Copyright (C) 2015-2016 Nicolas Lamirault 4 | 5 | ;; This program is free software; you can redistribute it and/or 6 | ;; modify it under the terms of the GNU General Public License 7 | ;; as published by the Free Software Foundation; either version 2 8 | ;; of the License, or (at your option) any later version. 9 | 10 | ;; This program is distributed in the hope that it will be useful, 11 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ;; GNU General Public License for more details. 14 | 15 | ;; You should have received a copy of the GNU General Public License 16 | ;; along with this program; if not, write to the Free Software 17 | ;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 18 | ;; 02110-1301, USA. 19 | 20 | ;;; Commentary: 21 | 22 | ;;; Code: 23 | 24 | (require 'dionysos-backend) 25 | (require 'dionysos-process) 26 | 27 | (dionysos--define-backend mplayer 28 | :name "MPlayer" 29 | :command "mplayer" 30 | :filter '("ogg" "mp3" "wav" "flac") 31 | :start 'dionysos--mplayer-start 32 | :stop 'dionysos--mplayer-stop) 33 | 34 | 35 | (defun dionysos--mplayer-start (filename &optional arguments) 36 | (dionysos--create-process dionysos--process-name 37 | dionysos-mplayer-command 38 | (append '("-quiet" "-really-quiet") (list filename)))) 39 | 40 | (defun dionysos--mplayer-stop () 41 | (dionysos--kill-process dionysos--process-name)) 42 | 43 | (provide 'dionysos-backend-mplayer) 44 | ;;; dionysos-backend-mplayer.el ends here 45 | -------------------------------------------------------------------------------- /dionysos-backend-vlc.el: -------------------------------------------------------------------------------- 1 | ;;; dionysos-backend-vlc.el --- Dionysos VLC backend 2 | 3 | ;; Copyright (C) 2015-2016 Nicolas Lamirault 4 | 5 | ;; This program is free software; you can redistribute it and/or 6 | ;; modify it under the terms of the GNU General Public License 7 | ;; as published by the Free Software Foundation; either version 2 8 | ;; of the License, or (at your option) any later version. 9 | 10 | ;; This program is distributed in the hope that it will be useful, 11 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ;; GNU General Public License for more details. 14 | 15 | ;; You should have received a copy of the GNU General Public License 16 | ;; along with this program; if not, write to the Free Software 17 | ;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 18 | ;; 02110-1301, USA. 19 | 20 | ;;; Commentary: 21 | 22 | ;;; Code: 23 | 24 | (require 'dionysos-backend) 25 | (require 'dionysos-notify) 26 | (require 'dionysos-process) 27 | 28 | (dionysos--define-backend vlc 29 | :name "VLC" 30 | :command "vlc" 31 | :filter '("ogg" "mp3" "wav" "flac") 32 | :start 'dionysos--vlc-start 33 | :pause 'dionysos--vlc-pause 34 | :stop 'dionysos--vlc-stop) 35 | 36 | 37 | (defun dionysos--vlc-start (filename &optional hook) 38 | "Start playing music. 39 | `FILENAME' using VLC. 40 | `HOOK' is for next action." 41 | (message "[dionysos-vlc] Start %s Next %s" filename hook) 42 | (dionysos--notify 43 | (format "%s\n" (file-name-base filename))'info) 44 | (dionysos--create-process dionysos--process-name 45 | dionysos-vlc-command 46 | (append '("--intf" "rc") (list filename) '("vlc://quit")) 47 | hook)) 48 | 49 | 50 | (defun dionysos--vlc-stop () 51 | "Stop VLC process." 52 | (message "[dionysos-vlc] Stop") 53 | (dionysos--kill-process dionysos--process-name)) 54 | 55 | 56 | (defun dionysos--vlc-pause () 57 | "Pause VLC process." 58 | (message "[dionysos-vlc] Pause") 59 | (dionysos--send-process dionysos--process-name "pause")) 60 | 61 | 62 | (defun dionysos--vlc-seek-to (val) 63 | "Send a seek to command to VLC process." 64 | (message "[dionysos-vlc] Seek to %s" val) 65 | (dionysos--send-process dionysos--process-name (format "seek %d\n" val))) 66 | 67 | 68 | 69 | (provide 'dionysos-backend-vlc) 70 | ;;; dionysos-backend-vlc.el ends here 71 | -------------------------------------------------------------------------------- /dionysos-backend.el: -------------------------------------------------------------------------------- 1 | ;;; dionysos-backend.el --- Dionysos music backend 2 | 3 | ;; Copyright (C) 2015-2016 Nicolas Lamirault 4 | 5 | ;; This program is free software; you can redistribute it and/or 6 | ;; modify it under the terms of the GNU General Public License 7 | ;; as published by the Free Software Foundation; either version 2 8 | ;; of the License, or (at your option) any later version. 9 | 10 | ;; This program is distributed in the hope that it will be useful, 11 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ;; GNU General Public License for more details. 14 | 15 | ;; You should have received a copy of the GNU General Public License 16 | ;; along with this program; if not, write to the Free Software 17 | ;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 18 | ;; 02110-1301, USA. 19 | 20 | ;;; Commentary: 21 | 22 | ;;; Code: 23 | 24 | 25 | (defvar dionysos-backends '() 26 | "List of available music backends.") 27 | 28 | (defvar dionysos-backend nil 29 | "The currently music backend.") 30 | 31 | (defconst dionysos--process-name "dionysos" 32 | "Name of the Dionysos music player process.") 33 | 34 | (defmacro dionysos--define-backend (name &rest options) 35 | "Macro which define a new music backend. 36 | `NAME' is for display 37 | `OPTIONS' specify backend arguements." 38 | (let* ((group-backend-name 39 | (intern (format "dionysos-%s" name))) 40 | (command-name (plist-get options :command)) 41 | (command-start (plist-get options :start)) 42 | (command-pause (plist-get options :pause)) 43 | (command-stop (plist-get options :stop)) 44 | (command (eval command-name)) 45 | (command-name-variable 46 | (intern (format "dionysos-%s-command" name)))) 47 | `(progn 48 | (defgroup ,group-backend-name nil 49 | ,(format "The %s Dionysos backend." name) 50 | :prefix ,(format "dionysos-%s-" name) 51 | :group 'dionysos) 52 | (defcustom ,command-name-variable ,command 53 | ,(format "The name of the `%s' executable." name) 54 | :type 'string 55 | :group ',group-backend-name) 56 | ;;(add-to-list 'dionysos-backends ',name t)))) 57 | (add-to-list 'dionysos-backends 58 | (cons ',name 59 | (list (cons 'start ,command-start) 60 | (cons 'pause ,command-pause) 61 | (cons 'stop ,command-stop))))))) 62 | 63 | 64 | (defun dionysos--get-backend (name) 65 | "Retrieve backend from available backends. 66 | `NAME' identify the backend." 67 | (assoc name dionysos-backends)) 68 | 69 | 70 | (defun dionysos--backend-start (name) 71 | "Start playing song using backend identified by `NAME'." 72 | (let ((backend (dionysos--get-backend name))) 73 | (when backend 74 | (cdr (assoc 'start backend))))) 75 | 76 | 77 | (defun dionysos--backend-stop (name) 78 | "Stop playing song using backend identified by `NAME'." 79 | (let ((backend (dionysos--get-backend name))) 80 | (when backend 81 | (cdr (assoc 'stop backend))))) 82 | 83 | (defun dionysos--backend-pause (name) 84 | "Pause playing song using backend identified by `NAME'." 85 | (let ((backend (dionysos--get-backend name))) 86 | (when backend 87 | (cdr (assoc 'pause backend))))) 88 | 89 | 90 | (defmacro dionysos--with-backend (&rest body) 91 | `(if dionysos-backend 92 | (progn 93 | ,@body) 94 | (message "Dionysos: no backend specify."))) 95 | 96 | 97 | 98 | (provide 'dionysos-backend) 99 | ;;; dionysos-backend.el ends here 100 | -------------------------------------------------------------------------------- /dionysos-custom.el: -------------------------------------------------------------------------------- 1 | ;;; dionysos-custom.el --- Customization group of Dionysos 2 | 3 | ;; Copyright (C) 2015-2016 Nicolas Lamirault 4 | 5 | ;; This program is free software; you can redistribute it and/or 6 | ;; modify it under the terms of the GNU General Public License 7 | ;; as published by the Free Software Foundation; either version 2 8 | ;; of the License, or (at your option) any later version. 9 | 10 | ;; This program is distributed in the hope that it will be useful, 11 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ;; GNU General Public License for more details. 14 | 15 | ;; You should have received a copy of the GNU General Public License 16 | ;; along with this program; if not, write to the Free Software 17 | ;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 18 | ;; 02110-1301, USA. 19 | 20 | ;;; Commentary: 21 | 22 | ;;; Code: 23 | 24 | (defgroup dionysos nil 25 | "A music player for Emacs." 26 | :group 'applications 27 | :link '(url-link :tag "Github" "https://github.com/nlamirault/dionysos") 28 | :link '(emacs-commentary-link :tag "Commentary" "dionysos")) 29 | 30 | 31 | (provide 'dionysos-custom) 32 | ;;; dionysos-custom.el ends here 33 | -------------------------------------------------------------------------------- /dionysos-fs-mode.el: -------------------------------------------------------------------------------- 1 | ;;; dionysos-fs-mode.el --- Dionysos Filesystem mode 2 | 3 | ;; Copyright (C) 2015-2016 Nicolas Lamirault 4 | 5 | ;; This program is free software; you can redistribute it and/or 6 | ;; modify it under the terms of the GNU General Public License 7 | ;; as published by the Free Software Foundation; either version 2 8 | ;; of the License, or (at your option) any later version. 9 | 10 | ;; This program is distributed in the hope that it will be useful, 11 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ;; GNU General Public License for more details. 14 | 15 | ;; You should have received a copy of the GNU General Public License 16 | ;; along with this program; if not, write to the Free Software 17 | ;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 18 | ;; 02110-1301, USA. 19 | 20 | ;;; Commentary: 21 | 22 | ;;; Code: 23 | 24 | 25 | (require 'widget) 26 | (require 'cl-lib) 27 | 28 | (require 'f) 29 | 30 | (require 'dionysos-io) 31 | (require 'dionysos-custom) 32 | (require 'dionysos-backend-vlc) 33 | (require 'dionysos-mode) 34 | (require 'dionysos-volume) 35 | 36 | ;; ------------------ 37 | ;; Customization 38 | ;; ------------------ 39 | 40 | (defgroup dionysos-fs-mode nil 41 | "Customization group for `dionysos-fs-mode'." 42 | :prefix "dionysos-fs-mode-" 43 | :tag "Dionysos Filesystem Mode" 44 | :group 'dionysos) 45 | 46 | (defcustom dionysos-fs-mode-buffer "*dionysos-fs*" 47 | "The Dionysos buffer name." 48 | :type 'string 49 | :group 'dionysos-fs-mode) 50 | 51 | (defcustom dionysos-fs-mode-padding 2 52 | "The number of columns used for padding on the left side of the buffer." 53 | :type 'integer 54 | :group 'dionysos-fs-mode) 55 | 56 | ;; ;; ------------------ 57 | ;; ;; Faces 58 | ;; ;; ------------------ 59 | 60 | (defgroup dionysos-fs-mode-faces '((dionysos-fs-mode custom-group)) 61 | "Customization group for the faces of `dionysos-fs-mode'." 62 | :prefix "dionysos-fs-mode-" 63 | :tag "Dionysos filesystem-mode faces" 64 | :group 'dionysos-fs-mode) 65 | 66 | (defface dionysos-fs-mode-song-file 67 | '((t :weight bold :inherit font-lock-warning-name-face)) 68 | "Face used on the song render in the Dionysos buffer." 69 | :group 'dionysos-fs-mode-faces) 70 | 71 | (defface dionysos-fs-mode-song-title 72 | '((t :weight bold :inherit font-lock-warning-name-face)) 73 | "Face used on the song render in the Dionysos buffer." 74 | :group 'dionysos-fs-mode-faces) 75 | 76 | (defface dionysos-fs-mode-song-artist 77 | '((t :inherit font-lock-comment-face)) 78 | "Face used on the song render in the Dionysos buffer" 79 | :group 'dionysos-fs-mode-faces) 80 | 81 | (defface dionysos-fs-mode-song-album 82 | '((t :inherit font-lock-string-face)) 83 | "Face used on the song render in the Dionysos buffer" 84 | :group 'dionysos-fs-mode-faces) 85 | 86 | (defface dionysos-fs-mode-song-track 87 | '((t :inherit font-lock-function-name-face)) 88 | "Face used on the song render in the Dionysos buffer" 89 | :group 'dionysos-fs-mode-faces) 90 | 91 | (defface dionysos-fs-mode-song-type 92 | '((t :inherit font-lock-comment-face)) 93 | "Face used on the song render in the Dionysos buffer" 94 | :group 'dionysos-fs-mode-faces) 95 | 96 | ;; ;; ------------------ 97 | ;; ;; Backend I/O 98 | ;; ;; ------------------ 99 | 100 | (defun dionysos--fs-mode-start () 101 | "Start playing song." 102 | (interactive) 103 | (let ((song (dionysos--mode-current-media))) 104 | (if song 105 | (dionysos--with-backend 106 | (funcall (dionysos--backend-start dionysos-backend) 107 | (s-trim song) 108 | 'dionysos--fs-mode-next-action)) 109 | (message "[dionysos-fs] No song available")))) 110 | 111 | (defun dionysos--fs-mode-stop () 112 | "Stop playing song." 113 | (interactive) 114 | (dionysos--with-backend 115 | (funcall (dionysos--backend-stop dionysos-backend)))) 116 | 117 | (defun dionysos--fs-mode-next () 118 | "Play next song." 119 | (interactive) 120 | (dionysos--with-backend 121 | (dionysos--mode-next-media) 122 | (dionysos--fs-mode-stop) 123 | (dionysos--fs-mode-start))) 124 | 125 | (defun dionysos--fs-mode-previous () 126 | "Play previous song." 127 | (interactive) 128 | (dionysos--with-backend 129 | (dionysos--mode-prev-media) 130 | (dionysos--fs-mode-stop) 131 | (dionysos--fs-mode-start))) 132 | 133 | (defun dionysos--fs-mode-pause () 134 | "Pause playing song." 135 | (interactive) 136 | (dionysos--with-backend 137 | (funcall (dionysos--backend-pause dionysos-backend)))) 138 | 139 | (defun dionysos--fs-mode-quit () 140 | "Stop player and exit." 141 | (interactive) 142 | (dionysos--with-backend 143 | (dionysos--fs-mode-stop)) 144 | (kill-buffer dionysos-fs-mode-buffer)) 145 | 146 | (defun dionysos--fs-mode-next-action () 147 | "Next action after process end." 148 | (dionysos--fs-mode-next) 149 | (dionysos--fs-mode-start)) 150 | 151 | 152 | ;; ;; ------------------ 153 | ;; ;; UI 154 | ;; ;; ------------------ 155 | 156 | 157 | (defun dionysos--fs-mode-width () 158 | "Return the width of the renderable content." 159 | (- (/ (frame-width) 2) (* dionysos-fs-mode-padding 2))) 160 | 161 | 162 | (defun dionysos--fs-mode-horizontal-rule () 163 | "Insert a horizontal rule into the buffer." 164 | (widget-insert 165 | (concat (make-string dionysos-fs-mode-padding ?\s) 166 | (make-string (- (dionysos--fs-mode-width) dionysos-fs-mode-padding) ?-) 167 | (make-string dionysos-fs-mode-padding ?\s) 168 | "\n"))) 169 | 170 | (defun dionysos--fs-mode-render-row (left right &optional width-right) 171 | "Render a row with a `LEFT' and a `RIGHT' part. 172 | Optional argument `WIDTH-RIGHT' is the width of the right argument." 173 | (widget-insert (format "[%s] %s\n" right left))) 174 | 175 | (defun dionysos--fs-mode-render-multilines-row (left right left-2 right-2 &optional width-right) 176 | "Render a row with a `LEFT' and a `RIGHT' part. 177 | Optional argument `WIDTH-RIGHT' is the width of the right argument." 178 | (widget-insert (format "> %s - %s\n%s / %s\n" left right left-2 right-2))) 179 | 180 | (defun dionysos--fs-mode-render-song (song) 181 | "Render a `SONG' to the Dionysos buffer." 182 | (message "Song: %s" song) 183 | (if (executable-find "id3") 184 | (let* ((tags (dionysos--id3-tag-info song)) 185 | (track (gethash "Track" tags)) 186 | (title (gethash "Title" tags)) 187 | (artist (gethash "Artist" tags)) 188 | (album (gethash "Album" tags))) 189 | (dionysos--fs-mode-render-multilines-row 190 | (if track 191 | (format "%s" (propertize track 'face 'dionysos-fs-mode-song-track)) 192 | "") 193 | (if title 194 | (format "%s" (propertize title 'face 'dionysos-fs-mode-song-title)) 195 | (format "%s" (propertize (file-name-base song) 'face 'dionysos-fs-mode-song-type))) 196 | (if artist 197 | (format "%s" (propertize artist 'face 'dionysos-fs-mode-song-artist)) 198 | "") 199 | (if album 200 | (format "%s" (propertize album 'face 'dionysos-fs-mode-song-album)) 201 | ""))) 202 | (dionysos--fs-mode-render-row 203 | (format "%s" (propertize (file-name-base song) 'face 'dionysos-fs-mode-song-file)) 204 | (format "%s" (propertize (file-name-extension song) 'face 'dionysos-fs-mode-song-type))))) 205 | 206 | 207 | (defun dionysos--fs-mode-render (songs) 208 | "Render `SONGS'." 209 | (let ((start (point))) 210 | ;;(dionysos--horizontal-rule) 211 | (cl-loop 212 | for n from 1 to (length songs) 213 | do (let ((song (elt songs (- n 1))) 214 | (start (point))) 215 | (dionysos--fs-mode-render-song song) 216 | (put-text-property start (point) :dionysos-media song))) 217 | (widget-insert "\n"))) 218 | 219 | 220 | 221 | ;; ;; ------------------ 222 | ;; ;; Mode 223 | ;; ;; ------------------ 224 | 225 | (defmacro dionysos--fs-mode-with-widget (title &rest body) 226 | `(progn 227 | (set-buffer (get-buffer-create dionysos-fs-mode-buffer)) 228 | (switch-to-buffer-other-window dionysos-fs-mode-buffer) 229 | (kill-all-local-variables) 230 | (let ((inhibit-read-only t)) 231 | (erase-buffer) 232 | (remove-overlays) 233 | (widget-insert (format "\n[%s]\n\n" ,title)) 234 | ,@body) 235 | (use-local-map widget-keymap) 236 | (widget-setup) 237 | (dionysos--fs-mode) 238 | (widget-minor-mode) 239 | (goto-char 0))) 240 | 241 | (defvar dionysos--fs-mode-hook nil) 242 | 243 | (defvar dionysos--fs-mode-map 244 | (let ((map (make-keymap))) 245 | (define-key map (kbd "p") 'dionysos--fs-mode-previous) 246 | (define-key map (kbd "n") 'dionysos--fs-mode-next) 247 | (define-key map (kbd "s") 'dionysos--fs-mode-start) 248 | (define-key map (kbd "SPC") 'dionysos--fs-mode-stop) 249 | (define-key map (kbd "P") 'dionysos--fs-mode-pause) 250 | (define-key map (kbd "q") 'dionysos--fs-mode-quit) 251 | (define-key map (kbd "+") 'dionysos-volume-raise) 252 | (define-key map (kbd "-") 'dionysos-volume-decrease) 253 | 254 | 255 | map) 256 | "Keymap for `dionysos--fs-mode' major mode.") 257 | 258 | (define-derived-mode dionysos--fs-mode tabulated-list-mode 259 | "Dionysos Filesysteme mode" 260 | "Major mode for Dionysos." 261 | :group 'dionysos 262 | ) 263 | 264 | 265 | ;; ;; ------------------ 266 | ;; ;; API 267 | ;; ;; ------------------ 268 | 269 | (defvar dionysos--fs-mode-history nil) 270 | 271 | 272 | ;;;###autoload 273 | (defun dionysos-fs-list (directory) 274 | "Show music files in `DIRECTORY'." 275 | (interactive 276 | (list (read-from-minibuffer "Music directory : " 277 | (car dionysos--fs-mode-history) 278 | nil 279 | nil 280 | 'dionysos--fs-mode-history))) 281 | (dionysos--fs-mode-with-widget 282 | (propertize "Playlist") 283 | (dionysos--fs-mode-render 284 | (dionysos--list-directory directory '("ogg" "mp3" "wav" "flac"))))) 285 | 286 | 287 | (provide 'dionysos-fs-mode) 288 | ;;; dionysos-fs-mode.el ends here 289 | -------------------------------------------------------------------------------- /dionysos-io.el: -------------------------------------------------------------------------------- 1 | ;;; dionysos-io.el --- Dionysos input/output tools 2 | 3 | ;; Copyright (C) 2015-2016 Nicolas Lamirault 4 | 5 | ;; This program is free software; you can redistribute it and/or 6 | ;; modify it under the terms of the GNU General Public License 7 | ;; as published by the Free Software Foundation; either version 2 8 | ;; of the License, or (at your option) any later version. 9 | 10 | ;; This program is distributed in the hope that it will be useful, 11 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ;; GNU General Public License for more details. 14 | 15 | ;; You should have received a copy of the GNU General Public License 16 | ;; along with this program; if not, write to the Free Software 17 | ;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 18 | ;; 02110-1301, USA. 19 | 20 | ;;; Commentary: 21 | 22 | ;;; Code: 23 | 24 | (require 'f) 25 | (require 's) 26 | 27 | 28 | (defun dionysos--list-directory (directory-name &optional filter) 29 | "Insert a new directory `DIRECTORY-NAME' into the dionysos buffer. 30 | `FILTER' is used to remove some files." 31 | (interactive (list (expand-file-name 32 | (read-directory-name 33 | "Insert directory: " default-directory nil t)))) 34 | (when (not (file-directory-p directory-name)) 35 | (error "Not a directory: %s" directory-name)) 36 | (if (eql 'nil filter) 37 | (f-files directory-name nil t) 38 | (f-files directory-name 39 | (lambda (file) 40 | (member (f-ext file) filter)) 41 | t))) 42 | 43 | 44 | (defun dionysos--id3-tag-info (filename) 45 | "Extract ID3 tags from MP3 file using `FILENAME' into an hashtable.." 46 | (let ((tags (make-hash-table :test 'equal))) 47 | (mapc (lambda (kv) 48 | (let ((data (split-string kv ":"))) 49 | (puthash (first data) (s-trim (second data)) tags))) 50 | (split-string 51 | (shell-command-to-string (s-concat "id3 " filename)) "\n" t)) 52 | tags)) 53 | 54 | 55 | 56 | (provide 'dionysos-io) 57 | ;;; dionysos-io.el ends here 58 | -------------------------------------------------------------------------------- /dionysos-mode.el: -------------------------------------------------------------------------------- 1 | ;;; dionysos-mode.el --- Dionysos mode 2 | 3 | ;; Copyright (C) 2015-2016 Nicolas Lamirault 4 | 5 | ;; This program is free software; you can redistribute it and/or 6 | ;; modify it under the terms of the GNU General Public License 7 | ;; as published by the Free Software Foundation; either mode 2 8 | ;; of the License, or (at your option) any later mode. 9 | 10 | ;; This program is distributed in the hope that it will be useful, 11 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ;; GNU General Public License for more details. 14 | 15 | ;; You should have received a copy of the GNU General Public License 16 | ;; along with this program; if not, write to the Free Software 17 | ;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 18 | ;; 02110-1301, USA. 19 | 20 | ;;; Commentary: 21 | 22 | ;;; Code: 23 | 24 | (defvar dionysos-mode-map 25 | (let ((map (make-sparse-keymap))) 26 | map) 27 | "Keymap used in Dionysos buffers.") 28 | 29 | (defvar dionysos-mode-hook nil 30 | "Hook run when entering Dionysos mode.") 31 | 32 | (defun dionysos-mode () 33 | "Parent major mode for Dionysos buffers." 34 | (setq buffer-read-only t) 35 | (setq major-mode 'dionysos-mode) 36 | (setq mode-name "Dionysos") 37 | (run-mode-hooks 'dionysos-mode-hook)) 38 | 39 | (defun dionysos--mode-current-media () 40 | "Return the current track at point." 41 | (get-text-property (point) :dionysos-media)) 42 | 43 | (defun dionysos--mode-next-media () 44 | "Move point to the next track." 45 | (interactive) 46 | (let ((pos (next-single-property-change (point) :dionysos-media))) 47 | (when pos 48 | (goto-char pos) 49 | (unless (dionysos--mode-current-media) 50 | (let ((pos (next-single-property-change pos :dionysos-media))) 51 | (if pos (goto-char pos))))))) 52 | 53 | (defun dionysos--mode-prev-media () 54 | "Move point to the next track." 55 | (interactive) 56 | (let ((pos (previous-single-property-change (point) :dionysos-media))) 57 | (when pos 58 | (goto-char pos) 59 | (unless (dionysos--mode-current-media) 60 | (let ((pos (previous-single-property-change pos :dionysos-media))) 61 | (if pos (goto-char pos))))))) 62 | 63 | 64 | (provide 'dionysos-mode) 65 | ;;; dionysos-mode.el ends here 66 | -------------------------------------------------------------------------------- /dionysos-mpd-mode.el: -------------------------------------------------------------------------------- 1 | ;;; dionysos-mpd-mode.el --- Dionysos MPD mode 2 | 3 | ;; Copyright (C) 2015-2016 Nicolas Lamirault 4 | 5 | ;; This program is free software; you can redistribute it and/or 6 | ;; modify it under the terms of the GNU General Public License 7 | ;; as published by the Free Software Foundation; either version 2 8 | ;; of the License, or (at your option) any later version. 9 | 10 | ;; This program is distributed in the hope that it will be useful, 11 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ;; GNU General Public License for more details. 14 | 15 | ;; You should have received a copy of the GNU General Public License 16 | ;; along with this program; if not, write to the Free Software 17 | ;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 18 | ;; 02110-1301, USA. 19 | 20 | ;;; Commentary: 21 | 22 | ;;; Code: 23 | 24 | 25 | (require 'widget) 26 | (require 'cl-lib) 27 | 28 | (require 'f) 29 | 30 | (require 'dionysos-custom) 31 | (require 'dionysos-backend-mpd) 32 | (require 'dionysos-volume) 33 | 34 | ;; Customization 35 | 36 | (defgroup dionysos-mpd-mode nil 37 | "Customization group for `dionysos-mpd-mode'." 38 | :prefix "dionysos-mpd-mode-" 39 | :tag "Dionysos MPD Mode" 40 | :group 'dionysos) 41 | 42 | (defcustom dionysos-buffer "*dionysos*" 43 | "The Dionysos buffer name." 44 | :type 'string 45 | :group 'dionysos-mpd-mode) 46 | 47 | (defcustom dionysos-padding 2 48 | "The number of columns used for padding on the left side of the buffer." 49 | :type 'integer 50 | :group 'dionysos-mpd-mode) 51 | 52 | ;; Faces 53 | 54 | (defgroup dionysos-mpd-mode-faces '((dionysos-mpd-mode custom-group)) 55 | "Customization group for the faces of `dionysos-mpd-mode'." 56 | :prefix "dionysos-mpd-mode-" 57 | :tag "Dionysos MPD Mode Faces" 58 | :group 'dionysos-mpd-mode) 59 | 60 | (defface dionysos-song-title 61 | '((t :weight bold :inherit font-lock-string-name-face)) 62 | "Face used on the song render in the Dionysos buffer." 63 | :group 'dionysos-mpd-mode-faces) 64 | 65 | (defface dionysos-song-artist 66 | '((t :inherit font-lock-comment-face)) 67 | "Face used on the song render in the Dionysos buffer" 68 | :group 'dionysos-mpd-mode-faces) 69 | 70 | (defface dionysos-song-album 71 | '((t :inherit font-lock-string-face)) 72 | "Face used on the song render in the Dionysos buffer" 73 | :group 'dionysos-mpd-mode-faces) 74 | 75 | (defface dionysos-song-length 76 | '((t :weight bold :inherit default)) 77 | "Face used on the song render in the Dionysos buffer" 78 | :group 'dionysos-mpd-mode-faces) 79 | 80 | (defface dionysos-song-track 81 | '((t :inherit font-lock-warning-face)) 82 | "Face used on the song render in the Dionysos buffer" 83 | :group 'dionysos-mpd-mode-faces) 84 | 85 | 86 | ;; 87 | ;; MPD mode I/O 88 | ;; 89 | 90 | (defun dionysos--mpd-mode-start () 91 | "Start listening music." 92 | (interactive) 93 | (dionysos--mpd-start)) 94 | 95 | 96 | (defun dionysos--mpd-mode-stop () 97 | "Stop listening music." 98 | (interactive) 99 | (dionysos--mpd-stop)) 100 | 101 | (defun dionysos--mpd-mode-previous () 102 | "Listen previous song." 103 | (interactive) 104 | (dionysos--mpd-prev)) 105 | 106 | (defun dionysos--mpd-mode-next () 107 | "Listen next song." 108 | (interactive) 109 | (dionysos--mpd-next)) 110 | 111 | 112 | ;; UI 113 | 114 | (defun dionysos--width () 115 | "Return the width of the renderable content." 116 | (- (/ (frame-width) 2) (* dionysos-padding 2))) 117 | 118 | 119 | (defun dionysos--horizontal-rule () 120 | "Insert a horizontal rule into the buffer." 121 | (widget-insert 122 | (concat (make-string dionysos-padding ?\s) 123 | (make-string (- (dionysos--width) dionysos-padding) ?-) 124 | (make-string dionysos-padding ?\s) 125 | "\n"))) 126 | 127 | (defun dionysos--render-row (left right &optional width-right) 128 | "Render a row with a `LEFT' and a `RIGHT' part. 129 | Optional argument `WIDTH-RIGHT' is the width of the right argument." 130 | (let* ((width-right (or width-right (length (or right "")))) 131 | (width-left (- (dionysos--width) 132 | (- width-right 1) 133 | (* 2 dionysos-padding))) 134 | (padding (make-string dionysos-padding ?\s))) 135 | (widget-insert (format 136 | (format "%s%%-%s.%ss %%%s.%ss%s\n" 137 | padding 138 | width-left width-left 139 | width-right width-right 140 | padding) 141 | left right)))) 142 | 143 | 144 | (defun dionysos--render-song (song) 145 | "Render a `SONG' to the Dionysos buffer." 146 | ;;(message "Song: %s" song) 147 | (dionysos--render-row 148 | (format "%s %s" 149 | (propertize (number-to-string (dionysos--plist-get song 'Id)) 150 | 'face 'dionysos-song-track) 151 | (propertize (dionysos--plist-get song 'Title) 152 | 'face 'dionysos-song-title)) 153 | (propertize (dionysos--plist-get song 'Length) 154 | 'face 'dionysos-song-length)) 155 | (dionysos--render-row 156 | (format "%s / %s" 157 | (propertize (dionysos--plist-get song 'Artist) 158 | 'face 'dionysos-song-artist) 159 | (propertize (dionysos--plist-get song 'Album) 160 | 'face 'dionysos-song-album)) 161 | (dionysos--plist-get song 'Filename))) 162 | 163 | 164 | (defun dionysos--render (songs) 165 | "Render `SONGS'." 166 | (let ((start (point))) 167 | ;;(dionysos--horizontal-rule) 168 | (cl-loop 169 | for n from 1 to (length songs) 170 | do (let ((song (elt songs (- n 1))) 171 | (start (point))) 172 | (dionysos--render-song song) 173 | (put-text-property start (point) :dionysos-media song))) 174 | (widget-insert "\n"))) 175 | 176 | 177 | ;; Mode 178 | 179 | 180 | (defun dionysos-kill-buffer () 181 | "Kill the `dionysos-buffer' and delete the current window." 182 | (interactive) 183 | (let ((buffer (get-buffer dionysos-buffer))) 184 | (when (equal buffer (current-buffer)) 185 | (delete-window)) 186 | (when buffer 187 | (kill-buffer buffer))) 188 | (dionysos--mpd-stop)) 189 | 190 | (defun dionysos-current-media () 191 | "Return the current track at point." 192 | (get-text-property (point) :dionysos-media)) 193 | 194 | 195 | (defun dionysos-next-media () 196 | "Move point to the next track." 197 | (interactive) 198 | (let ((pos (next-single-property-change (point) :dionysos-media))) 199 | (when pos 200 | (goto-char pos) 201 | (unless (dionysos-current-media) 202 | (let ((pos (next-single-property-change pos :dionysos-media))) 203 | (if pos (goto-char pos))))))) 204 | 205 | 206 | (defun dionysos-prev-media () 207 | "Move point to the next track." 208 | (interactive) 209 | (let ((pos (previous-single-property-change (point) :dionysos-media))) 210 | (when pos 211 | (goto-char pos) 212 | (unless (dionysos-current-media) 213 | (let ((pos (previous-single-property-change pos :dionysos-media))) 214 | (if pos (goto-char pos))))))) 215 | 216 | 217 | (defun dionysos-play-media () 218 | "Play current song." 219 | (interactive) 220 | (let ((song (dionysos-current-media))) 221 | (when song 222 | (dionysos--mpd-start (dionysos--plist-get song 'Id))))) 223 | 224 | 225 | (defmacro dionysos-with-widget (title &rest body) 226 | `(progn 227 | (set-buffer (get-buffer-create dionysos-buffer)) 228 | (switch-to-buffer-other-window dionysos-buffer) 229 | (kill-all-local-variables) 230 | (let ((inhibit-read-only t)) 231 | (erase-buffer) 232 | (remove-overlays) 233 | (widget-insert (format "\n [%s]\n\n" ,title)) 234 | ,@body) 235 | (use-local-map widget-keymap) 236 | (widget-setup) 237 | (dionysos--mpd-mode) 238 | (widget-minor-mode) 239 | (goto-char 0))) 240 | 241 | (defvar dionysos--mpd-mode-hook nil) 242 | 243 | (defvar dionysos--mpd-mode-map 244 | (let ((map (make-keymap))) 245 | (define-key map (kbd "i") 'dionysos-song-info) 246 | (define-key map (kbd "p") 'dionysos-prev-media) 247 | (define-key map (kbd "n") 'dionysos-next-media) 248 | (define-key map (kbd "c") 'dionysos-play-media) 249 | (define-key map (kbd "q") 'dionysos-kill-buffer) 250 | (define-key map (kbd "+") 'dionysos-volume-raise) 251 | (define-key map (kbd "-") 'dionysos-volume-decrease) 252 | (define-key map (kbd "s") 'dionysos--mpd-mode-start) 253 | (define-key map (kbd "SPC") 'dionysos--mpd-mode-stop) 254 | map) 255 | "Keymap for `dionysos--mpd-mode' major mode.") 256 | 257 | (define-derived-mode dionysos--mpd-mode tabulated-list-mode 258 | "Dionysos MPD mode" 259 | "Major mode for Dionysos using MPD." 260 | :group 'dionysos 261 | ) 262 | 263 | ;; API 264 | 265 | ;;;###autoload 266 | (defun dionysos-mpd-playlist () 267 | "Show music files from MPD playlist." 268 | (interactive) 269 | (dionysos-with-widget 270 | (propertize "Playlist") 271 | (dionysos--render (dionysos--mpd-playlist)))) 272 | 273 | 274 | ;; ;;;###autoload 275 | ;; (defun dionysos-mpd-songs () 276 | ;; "Show music files from MPD." 277 | ;; (interactive) 278 | ;; ;; (pop-to-buffer "*Dionysos*" nil) 279 | ;; ;;(dionysos--mpd-mode) 280 | ;; (dionysos-with-widget 281 | ;; (propertize "Songs") 282 | ;; (dionysos--render (dionysos--mpd-songs)))) 283 | 284 | 285 | (provide 'dionysos-mpd-mode) 286 | ;;; dionysos-mpd-mode.el ends here 287 | -------------------------------------------------------------------------------- /dionysos-notify.el: -------------------------------------------------------------------------------- 1 | ;;; dionysos-notify.el --- Dionysos notifications system 2 | 3 | ;; Copyright (C) 2015-2016 Nicolas Lamirault 4 | 5 | ;; This program is free software; you can redistribute it and/or 6 | ;; modify it under the terms of the GNU General Public License 7 | ;; as published by the Free Software Foundation; either version 2 8 | ;; of the License, or (at your option) any later version. 9 | 10 | ;; This program is distributed in the hope that it will be useful, 11 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ;; GNU General Public License for more details. 14 | 15 | ;; You should have received a copy of the GNU General Public License 16 | ;; along with this program; if not, write to the Free Software 17 | ;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 18 | ;; 02110-1301, USA. 19 | 20 | ;;; Commentary: 21 | 22 | ;;; Code: 23 | 24 | 25 | (require 'alert) 26 | 27 | (require 'dionysos-custom) 28 | 29 | (defcustom dionysos-notify-p t 30 | "Send notifications or not." 31 | :type 'boolean 32 | :group 'dionysos) 33 | 34 | 35 | (cond 36 | ((eq system-type 'gnu/linux) 37 | (setq alert-default-style 'libnotify)) 38 | ((eq system-type 'darwin) 39 | (setq alert-default-style 'notifier))) 40 | 41 | 42 | (defun dionysos--notify (message category) 43 | "Send a notification. 44 | Content is `MESSAGE'. 45 | `CATEGORY' is used to classify notifications." 46 | (when dionysos-notify-p 47 | (alert message 48 | :title "Dionysos" 49 | :style 'libnotify 50 | :category category))) 51 | 52 | 53 | 54 | (provide 'dionysos-notify) 55 | ;;; dionysos-notify.el ends here 56 | -------------------------------------------------------------------------------- /dionysos-process.el: -------------------------------------------------------------------------------- 1 | ;;; dionysos-process.el --- some tools -*- lexical-binding: t; -*- 2 | 3 | ;; Copyright (C) 2015-2016 Nicolas Lamirault 4 | 5 | ;; This program is free software; you can redistribute it and/or 6 | ;; modify it under the terms of the GNU General Public License 7 | ;; as published by the Free Software Foundation; either version 2 8 | ;; of the License, or (at your option) any later version. 9 | 10 | ;; This program is distributed in the hope that it will be useful, 11 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ;; GNU General Public License for more details. 14 | 15 | ;; You should have received a copy of the GNU General Public License 16 | ;; along with this program; if not, write to the Free Software 17 | ;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 18 | ;; 02110-1301, USA. 19 | 20 | ;;; Commentary: 21 | 22 | ;;; Code: 23 | 24 | ;; required for lexical-let 25 | (require 'cl) 26 | 27 | 28 | (defun dionysos--process-sentinel (process event hook-fn) 29 | (when (memq (process-status process) 30 | '(exit signal)) 31 | (message "[dionysos-process] Process %s event:%s status:%s" 32 | (process-name process) event (process-exit-status process)) 33 | (when (= 0 (process-exit-status process)) 34 | (message "[dionysos-process] Next: %s" hook-fn) 35 | (when hook-fn 36 | (funcall hook-fn))))) 37 | 38 | (defun dionysos--create-process (process-name command arguments &optional hook) 39 | "Create a new asynchronous process. 40 | `PROCESS-NAME' is used to identify this process 41 | `COMMAND' correspond to the program running 42 | `ARGUMENTS' are arguments passed to the program. 43 | `HOOK' is called when process is finished." 44 | (message "[dionysos-process] Create %s %s %s %s" 45 | process-name command arguments hook) 46 | (let ((status (dionysos--status-process process-name))) 47 | (message "[dionysos-process] Status : %s" status) 48 | (unless (equal 'run status) 49 | (lexical-let ((hook hook)) 50 | (let ((process (apply 'start-process process-name nil command arguments))) 51 | (set-process-sentinel 52 | process 53 | (lambda (process event) 54 | (dionysos--process-sentinel process event hook)))))))) 55 | 56 | (defun dionysos--kill-process (process-name) 57 | "Stop a process identified by `PROCESS-NAME'." 58 | (let ((process (get-process process-name))) 59 | (when process 60 | (kill-process process) 61 | (sleep-for 1)))) 62 | 63 | 64 | (defun dionysos--status-process (process-name) 65 | "Retrieve the status of the process identified by `PROCESS-NAME'." 66 | (let ((process (get-process process-name))) 67 | (when process 68 | (process-status process)))) 69 | 70 | 71 | (defun dionysos--send-process (process-name message) 72 | "Send `MESSAGE' to a process identified by `PROCESS-NAME'." 73 | (let ((process (get-process process-name))) 74 | (when process 75 | (process-send-string process-name "pause\n")))) 76 | 77 | 78 | (provide 'dionysos-process) 79 | ;;; dionysos-process.el ends here 80 | -------------------------------------------------------------------------------- /dionysos-ui.el: -------------------------------------------------------------------------------- 1 | ;;; dionysos-ui.el --- Dionysos UI tools 2 | 3 | ;; Copyright (C) 2015-2016 Nicolas Lamirault 4 | 5 | ;; This program is free software; you can redistribute it and/or 6 | ;; modify it under the terms of the GNU General Public License 7 | ;; as published by the Free Software Foundation; either version 2 8 | ;; of the License, or (at your option) any later version. 9 | 10 | ;; This program is distributed in the hope that it will be useful, 11 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ;; GNU General Public License for more details. 14 | 15 | ;; You should have received a copy of the GNU General Public License 16 | ;; along with this program; if not, write to the Free Software 17 | ;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 18 | ;; 02110-1301, USA. 19 | 20 | ;;; Commentary: 21 | 22 | ;;; Code: 23 | 24 | 25 | ;; to display faces in IELM : 26 | ;; ELISP (list-faces-display "dionysos") 27 | ;; 28 | 29 | ;; Faces 30 | 31 | (defface dionysos--title 32 | '((((class color) (background light)) :foreground "red" :weight semi-bold) 33 | (((class color) (background dark)) :foreground "green" :weight semi-bold)) 34 | "face of Dionysos information" 35 | :group 'dionysos) 36 | 37 | (defface dionysos--gray-face 38 | '((((class color)) :foreground "#b1b6b6")) 39 | "Gray color." 40 | :group 'dionysos) 41 | 42 | (defface dionysos--cyan-face 43 | '((((class color)) :foreground "#00ffff")) 44 | "Cyan color." 45 | :group 'dionysos) 46 | 47 | (defface dionysos--yellow-face 48 | '((((class color)) :foreground "#e5e500")) 49 | "Yellow color." 50 | :group 'dionysos) 51 | 52 | (defface dionysos--orange-face 53 | '((((class color)) :foreground "#ff5500")) 54 | "Orange color." 55 | :group 'dionysos) 56 | 57 | (defface dionysos--red-face 58 | '((((class color)) :foreground "#cd4d40")) 59 | "Red color." 60 | :group 'dionysos) 61 | 62 | (defface dionysos--green-face 63 | '((((class color)) :foreground "#61b361")) 64 | "Green color." 65 | :group 'dionysos) 66 | 67 | 68 | (defun colorize-term (term color) 69 | "Colorize `TERM' using `COLOR'." 70 | (cond 71 | ((eql color 'red) 72 | (propertize term 'face 'dionysos--red-face)) 73 | ((eql color 'green) 74 | (propertize term 'face 'dionysos--green-face)) 75 | (t term))) 76 | 77 | 78 | ;; (defun colorize-dot (color) 79 | ;; (cond 80 | ;; ((string= color "red") 81 | ;; (propertize "●" 'face 'dionysos--red-face)) 82 | ;; ((string= color "yellow") 83 | ;; (propertize "●" 'face 'dionysos--yellow-face)) 84 | ;; ((string= color "green") 85 | ;; (propertize "●" 'face 'dionysos--green-face)) 86 | ;; (t (concat "Unknown: " "'" color "' ")))) 87 | 88 | (provide 'dionysos-ui) 89 | ;;; dionysos-ui.el ends here 90 | -------------------------------------------------------------------------------- /dionysos-version.el: -------------------------------------------------------------------------------- 1 | ;;; dionysos-version.el --- Dionysos version 2 | 3 | ;; Copyright (C) 2015-2016 Nicolas Lamirault 4 | 5 | ;; This program is free software; you can redistribute it and/or 6 | ;; modify it under the terms of the GNU General Public License 7 | ;; as published by the Free Software Foundation; either version 2 8 | ;; of the License, or (at your option) any later version. 9 | 10 | ;; This program is distributed in the hope that it will be useful, 11 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ;; GNU General Public License for more details. 14 | 15 | ;; You should have received a copy of the GNU General Public License 16 | ;; along with this program; if not, write to the Free Software 17 | ;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 18 | ;; 02110-1301, USA. 19 | 20 | ;;; Commentary: 21 | 22 | ;;; Code: 23 | 24 | (require 'dash) 25 | (require 'pkg-info) 26 | 27 | 28 | (defun dionysos--library-version () 29 | "Get the version in the emacs-dionysos client header." 30 | (-when-let (version (pkg-info-library-version 'dionysos)) 31 | (pkg-info-format-version version))) 32 | 33 | ;;;###autoload 34 | (defun dionysos-version (&optional show-version) 35 | "Get the dionysos version as string. 36 | If called interactively or if SHOW-VERSION is non-nil, show the 37 | version in the echo area and the messages buffer. 38 | The returned string includes both, the version from package.el 39 | and the library version, if both a present and different. 40 | If the version number could not be determined, signal an error, 41 | if called interactively, or if SHOW-VERSION is non-nil, otherwise 42 | just return nil." 43 | (interactive (list (not (or executing-kbd-macro noninteractive)))) 44 | (let* ((version (dionysos--library-version))) 45 | (unless version 46 | (error "Could not find out dionysos version")) 47 | (message "dionysos %s" version) 48 | version)) 49 | 50 | 51 | 52 | (provide 'dionysos-version) 53 | ;;; dionysos-version.el ends here 54 | -------------------------------------------------------------------------------- /dionysos-volume.el: -------------------------------------------------------------------------------- 1 | ;;; dionysos-volume.el --- Dionysos volume management 2 | 3 | ;; Copyright (C) 2015-2016 Nicolas Lamirault 4 | 5 | ;; This program is free software; you can redistribute it and/or 6 | ;; modify it under the terms of the GNU General Public License 7 | ;; as published by the Free Software Foundation; either version 2 8 | ;; of the License, or (at your option) any later version. 9 | 10 | ;; This program is distributed in the hope that it will be useful, 11 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ;; GNU General Public License for more details. 14 | 15 | ;; You should have received a copy of the GNU General Public License 16 | ;; along with this program; if not, write to the Free Software 17 | ;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 18 | ;; 02110-1301, USA. 19 | 20 | ;;; Commentary: 21 | 22 | ;;; Code: 23 | 24 | 25 | (require 'dionysos-process) 26 | 27 | ;; ------------------ 28 | ;; Customization 29 | ;; ------------------ 30 | 31 | (defgroup dionysos-volume nil 32 | "Customization group for `dionysos-volume'." 33 | :prefix "dionysos-volume-" 34 | :tag "Dionysos volume management" 35 | :group 'dionysos) 36 | 37 | 38 | (defcustom dionysos-volume-cmd 'pamixer 39 | "Command to control the mixer." 40 | :group 'dionysos-volume 41 | :type '(choice 42 | (const :tag "amixer" amixer) 43 | (const :tag "pamixer" pamixer))) 44 | 45 | 46 | ;; ------------------ 47 | ;; Intern 48 | ;; ------------------ 49 | 50 | 51 | (defconst dionysos--volume-process "dionysos-volume" 52 | "The process name for Dionysos volume management process.") 53 | 54 | (defconst dionysos--volume-amixer-increase-args 55 | (list "-q" "sset" "Master" "5%+") 56 | "Arguments to increase volume for amixer.") 57 | 58 | (defconst dionysos--volume-amixer-decrease-args 59 | (list "-q" "sset" "Master" "5%-") 60 | "Arguments to decrease volume for amixer.") 61 | 62 | (defconst dionysos--volume-pamixer-increase-args 63 | (list "-i" "5") 64 | "Arguments to increase volume for pamixer.") 65 | 66 | (defconst dionysos--volume-pamixer-decrease-args 67 | (list "-d" "5") 68 | "Arguments to decrease volume for pamixer.") 69 | 70 | 71 | ;; ------------------ 72 | ;; API 73 | ;; ------------------ 74 | 75 | 76 | (defun dionysos-volume-raise () 77 | "Raise volume." 78 | (interactive) 79 | (cond ((eql 'amixer dionysos-volume-cmd) 80 | (dionysos--create-process dionysos--volume-process 81 | "amixer" 82 | dionysos--volume-amixer-increase-args)) 83 | ((eql 'pamixer dionysos-volume-cmd) 84 | (dionysos--create-process dionysos--volume-process 85 | "pamixer" 86 | dionysos--volume-pamixer-increase-args)) 87 | (t (message "No volume command available.")))) 88 | 89 | 90 | (defun dionysos-volume-decrease () 91 | "Decrease volume." 92 | (interactive) 93 | (cond ((eql 'amixer dionysos-volume-cmd) 94 | (dionysos--create-process dionysos--volume-process 95 | "amixer" 96 | dionysos--volume-amixer-decrease-args)) 97 | ((eql 'pamixer dionysos-volume-cmd) 98 | (dionysos--create-process dionysos--volume-process 99 | "pamixer" 100 | dionysos--volume-pamixer-decrease-args)) 101 | (t (message "No volume command available.")))) 102 | 103 | 104 | (provide 'dionysos-volume) 105 | ;;; dionysos-volume.el ends here 106 | -------------------------------------------------------------------------------- /dionysos.el: -------------------------------------------------------------------------------- 1 | ;;; dionysos.el --- Dionysos, a music player for Emacs 2 | 3 | ;; Author: Nicolas Lamirault 4 | ;; URL: https://github.com/nlamirault/dionysos 5 | ;; Version: 0.6.0 6 | ;; Keywords: music 7 | 8 | ;; Package-Requires: ((libmpdee "2.1.0") (alert "1.2") (s "1.11.0") (dash "2.12.1") (pkg-info "0.5.0") (cl-lib "0.5")) 9 | 10 | ;; Copyright (C) 2015-2016 Nicolas Lamirault 11 | 12 | ;; This program is free software; you can redistribute it and/or 13 | ;; modify it under the terms of the GNU General Public License 14 | ;; as published by the Free Software Foundation; either version 2 15 | ;; of the License, or (at your option) any later version. 16 | 17 | ;; This program is distributed in the hope that it will be useful, 18 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | ;; GNU General Public License for more details. 21 | 22 | ;; You should have received a copy of the GNU General Public License 23 | ;; along with this program; if not, write to the Free Software 24 | ;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | ;; 02110-1301, USA. 26 | 27 | ;;; Commentary: 28 | 29 | ;; Provides a music player for Emacs. 30 | 31 | ;;; Installation: 32 | 33 | ;; dionysos is available on the two major community maintained repositories 34 | ;; Melpa stable (https://stable.melpa.org), and Melpa (https://melpa.org) 35 | ;; 36 | ;; (add-to-list 'package-archives 37 | ;; '("melpa" . "https://melpa.org/packages/") t) 38 | ;; 39 | ;; M-x package-install dionysos 40 | 41 | ;;; Usage: 42 | ;; 43 | ;; M-x dionysos-fs-list 44 | 45 | ;;; Code: 46 | 47 | ;; Customization 48 | 49 | (require 'dionysos-custom) 50 | (require 'dionysos-version) 51 | (require 'dionysos-io) 52 | (require 'dionysos-notify) 53 | (require 'dionysos-process) 54 | (require 'dionysos-ui) 55 | (require 'dionysos-backend) 56 | (require 'dionysos-backend-vlc) 57 | (require 'dionysos-backend-mplayer) 58 | (require 'dionysos-backend-mpd) 59 | (require 'dionysos-volume) 60 | (require 'dionysos-mode) 61 | (require 'dionysos-fs-mode) 62 | (require 'dionysos-mpd-mode) 63 | 64 | (provide 'dionysos) 65 | ;;; dionysos.el ends here 66 | -------------------------------------------------------------------------------- /dionysos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nlamirault/dionysos/0aac21caadabc5a7f09e18a9dcb02f3dec26588b/dionysos.png -------------------------------------------------------------------------------- /dionysos.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 20 | 22 | 40 | 42 | 43 | 45 | image/svg+xml 46 | 48 | 49 | 50 | 51 | 52 | 56 | 200 | 201 | 202 | -------------------------------------------------------------------------------- /test/dionysos-backend-mpd-test.el: -------------------------------------------------------------------------------- 1 | ;;; dionysos-backend-mpd-test.el --- Tests for Dionysos MPD backend 2 | 3 | ;; Copyright (C) 2015-2016 Nicolas Lamirault 4 | 5 | ;; This program is free software; you can redistribute it and/or 6 | ;; modify it under the terms of the GNU General Public License 7 | ;; as published by the Free Software Foundation; either version 2 8 | ;; of the License, or (at your option) any later version. 9 | 10 | ;; This program is distributed in the hope that it will be useful, 11 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ;; GNU General Public License for more details. 14 | 15 | ;; You should have received a copy of the GNU General Public License 16 | ;; along with this program; if not, write to the Free Software 17 | ;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 18 | ;; 02110-1301, USA. 19 | 20 | ;;; Commentary: 21 | 22 | ;;; Code: 23 | 24 | (ert-deftest test-dionysos-backend-mpd () 25 | :tags '(backend mpd) 26 | (with-test-sandbox 27 | (should (dionysos--get-backend 'mpd)) 28 | (should (string-equal "localhost" dionysos-mpd-host)) 29 | (should (= 6600 dionysos-mpd-port)))) 30 | 31 | (ert-deftest test-dionysos-backend-mpd-start-process () 32 | :tags '(backend mpd) 33 | (with-test-sandbox 34 | (should (eql 'dionysos--mpd-start (dionysos--backend-start 'mpd))))) 35 | 36 | (ert-deftest test-dionysos-backend-mpd-stop-process () 37 | :tags '(backend mpd) 38 | (with-test-sandbox 39 | (should (equal 'dionysos--mpd-stop (dionysos--backend-stop 'mpd))))) 40 | 41 | (ert-deftest test-dionysos-backend-mpd-pause-process () 42 | :tags '(backend mpd) 43 | (with-test-sandbox 44 | (should (equal 'dionysos--mpd-pause (dionysos--backend-pause 'mpd))))) 45 | 46 | 47 | (provide 'dionysos-backend-mpd-test) 48 | ;;; dionysos-backend-mpd-test.el ends here 49 | -------------------------------------------------------------------------------- /test/dionysos-backend-mplayer-test.el: -------------------------------------------------------------------------------- 1 | ;;; dionysos-backend-mplayer-test.el --- Tests for Dionysos MPlayer backend 2 | 3 | ;; Copyright (C) 2015-2016 Nicolas Lamirault 4 | 5 | ;; This program is free software; you can redistribute it and/or 6 | ;; modify it under the terms of the GNU General Public License 7 | ;; as published by the Free Software Foundation; either version 2 8 | ;; of the License, or (at your option) any later version. 9 | 10 | ;; This program is distributed in the hope that it will be useful, 11 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ;; GNU General Public License for more details. 14 | 15 | ;; You should have received a copy of the GNU General Public License 16 | ;; along with this program; if not, write to the Free Software 17 | ;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 18 | ;; 02110-1301, USA. 19 | 20 | ;;; Commentary: 21 | 22 | ;;; Code: 23 | 24 | (ert-deftest test-dionysos-backend-mplayer () 25 | :tags '(backend mplayer) 26 | (with-test-sandbox 27 | (should (dionysos--get-backend 'mplayer)) 28 | (should (custom-variable-p 'dionysos-mplayer-command)) 29 | (should (string= "mplayer" dionysos-mplayer-command)))) 30 | 31 | 32 | (ert-deftest test-dionysos-backend-mplayer-play-mp3 () 33 | :tags '(backend mplayer) 34 | (with-test-sandbox 35 | (when (executable-find "mplayer") 36 | (with-music-file 37 | "resources/Roulement_tambour-01.mp3" 38 | (dionysos--mplayer-start file) 39 | (should (equal 'run (dionysos--status-process dionysos--process-name))) 40 | (dionysos--mplayer-stop) 41 | (should (equal nil (dionysos--status-process dionysos--process-name))))))) 42 | 43 | 44 | (provide 'dionysos-backend-mplayer-test) 45 | ;;; dionysos-backend-mplayer-test.el ends here 46 | -------------------------------------------------------------------------------- /test/dionysos-backend-test.el: -------------------------------------------------------------------------------- 1 | ;;; dionysos-backend-test.el --- Tests for Dionysos backend 2 | 3 | ;; Copyright (C) 2015-2016 Nicolas Lamirault 4 | 5 | ;; This program is free software; you can redistribute it and/or 6 | ;; modify it under the terms of the GNU General Public License 7 | ;; as published by the Free Software Foundation; either version 2 8 | ;; of the License, or (at your option) any later version. 9 | 10 | ;; This program is distributed in the hope that it will be useful, 11 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ;; GNU General Public License for more details. 14 | 15 | ;; You should have received a copy of the GNU General Public License 16 | ;; along with this program; if not, write to the Free Software 17 | ;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 18 | ;; 02110-1301, USA. 19 | 20 | ;;; Commentary: 21 | 22 | ;;; Code: 23 | 24 | (ert-deftest test-dionysos-backend-default-player () 25 | :tags '(backend) 26 | (with-test-sandbox 27 | (should (equal nil dionysos-backend)))) 28 | 29 | (ert-deftest test-dionysos-backend-foobar () 30 | (with-test-sandbox 31 | (dionysos--define-backend foo 32 | :name "foo" 33 | :command "/usr/local/bin/foo" 34 | :filter '("ogg" "mp3") 35 | :start 'dyonisis--foo-start-player) 36 | (should (dionysos--get-backend 'foo)) 37 | ;;(should (equal '(vlc mplayer foo) dionysos-backends)) 38 | (should (custom-variable-p 'dionysos-foo-command)))) 39 | 40 | 41 | (provide 'dionysos-backend-test) 42 | ;;; dionysos-backend-test.el ends here 43 | -------------------------------------------------------------------------------- /test/dionysos-backend-vlc-test.el: -------------------------------------------------------------------------------- 1 | ;;; dionysos-backend-vlc-test.el --- Tests for Dionysos VLC backend 2 | 3 | ;; Copyright (C) 2015-2016 Nicolas Lamirault 4 | 5 | ;; This program is free software; you can redistribute it and/or 6 | ;; modify it under the terms of the GNU General Public License 7 | ;; as published by the Free Software Foundation; either version 2 8 | ;; of the License, or (at your option) any later version. 9 | 10 | ;; This program is distributed in the hope that it will be useful, 11 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ;; GNU General Public License for more details. 14 | 15 | ;; You should have received a copy of the GNU General Public License 16 | ;; along with this program; if not, write to the Free Software 17 | ;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 18 | ;; 02110-1301, USA. 19 | 20 | ;;; Commentary: 21 | 22 | ;;; Code: 23 | 24 | (ert-deftest test-dionysos-backend-vlc () 25 | :tags '(backend vlc) 26 | (with-test-sandbox 27 | (should (dionysos--get-backend 'vlc)) 28 | (should (custom-variable-p 'dionysos-vlc-command)) 29 | (should (string= "vlc" dionysos-vlc-command)))) 30 | 31 | 32 | (ert-deftest test-dionysos-backend-vlc-start-process () 33 | :tags '(backend vlc) 34 | (with-test-sandbox 35 | (should (eql 'dionysos--vlc-start (dionysos--backend-start 'vlc))))) 36 | 37 | (ert-deftest test-dionysos-backend-vlc-stop-process () 38 | :tags '(backend vlc) 39 | (with-test-sandbox 40 | (should (equal 'dionysos--vlc-stop (dionysos--backend-stop 'vlc))))) 41 | 42 | (ert-deftest test-dionysos-backend-vlc-pause-process () 43 | :tags '(backend vlc) 44 | (with-test-sandbox 45 | (should (equal 'dionysos--vlc-pause (dionysos--backend-pause 'vlc))))) 46 | 47 | (ert-deftest test-dionysos-backend-vlc-play-mp3 () 48 | :tags '(backend vlc) 49 | (with-test-sandbox 50 | (with-music-file 51 | "resources/Roulement_tambour-01.mp3" 52 | (dionysos--vlc-start file) 53 | (should (equal 'run (dionysos--status-process dionysos--process-name))) 54 | (dionysos--vlc-stop) 55 | (should (equal nil (dionysos--status-process dionysos--process-name)))))) 56 | 57 | 58 | (provide 'dionysos-backend-vlc-test) 59 | ;;; dionysos-backend-vlc-test.el ends here 60 | -------------------------------------------------------------------------------- /test/dionysos-io-test.el: -------------------------------------------------------------------------------- 1 | ;;; dionysos-io-test.el --- Tests for io information 2 | 3 | ;; Copyright (C) 2015-2016 Nicolas Lamirault 4 | 5 | ;; This program is free software; you can redistribute it and/or 6 | ;; modify it under the terms of the GNU General Public License 7 | ;; as published by the Free Software Foundation; either io 2 8 | ;; of the License, or (at your option) any later io. 9 | 10 | ;; This program is distributed in the hope that it will be useful, 11 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ;; GNU General Public License for more details. 14 | 15 | ;; You should have received a copy of the GNU General Public License 16 | ;; along with this program; if not, write to the Free Software 17 | ;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 18 | ;; 02110-1301, USA. 19 | 20 | ;;; Commentary: 21 | 22 | ;;; Code: 23 | 24 | (ert-deftest test-dionysos-list-directory () 25 | :tags '(io) 26 | (with-test-sandbox 27 | (let ((files (dionysos--list-directory 28 | (f-join dionysos-testsuite-dir "resources")))) 29 | (should (= 5 (length files)))))) 30 | 31 | (ert-deftest test-dionysos-list-directory-simple-filter () 32 | :tags '(io) 33 | (with-test-sandbox 34 | (let ((files (dionysos--list-directory 35 | (f-join dionysos-testsuite-dir "resources") 36 | '("mp3")))) 37 | (should (= 3 (length files)))))) 38 | 39 | (ert-deftest test-dionysos-list-directory-multiple-filters () 40 | :tags '(io) 41 | (with-test-sandbox 42 | (let ((files (dionysos--list-directory 43 | (f-join dionysos-testsuite-dir "resources") 44 | '("mp3" "ogg")))) 45 | (should (= 4 (length files)))))) 46 | 47 | 48 | (provide 'dionysos-io-test) 49 | ;;; dionysos-io-test.el ends here 50 | -------------------------------------------------------------------------------- /test/dionysos-process-test.el: -------------------------------------------------------------------------------- 1 | ;;; dionysos-process-test.el --- Tests for process information 2 | 3 | ;; Copyright (C) 2015-2016 Nicolas Lamirault 4 | 5 | ;; This program is free software; you can redistribute it and/or 6 | ;; modify it under the terms of the GNU General Public License 7 | ;; as published by the Free Software Foundation; either process 2 8 | ;; of the License, or (at your option) any later process. 9 | 10 | ;; This program is distributed in the hope that it will be useful, 11 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ;; GNU General Public License for more details. 14 | 15 | ;; You should have received a copy of the GNU General Public License 16 | ;; along with this program; if not, write to the Free Software 17 | ;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 18 | ;; 02110-1301, USA. 19 | 20 | ;;; Commentary: 21 | 22 | ;;; Code: 23 | 24 | (ert-deftest test-dionysos-process-cant-create-multiple-process () 25 | :tags '(process) 26 | (with-test-sandbox 27 | (with-music-file 28 | "resources/France.mp3" 29 | (dionysos--create-process 30 | dionysos--process-name "mpg123" (list file) (lambda () (message "ok"))) 31 | (dionysos--create-process 32 | dionysos--process-name "mpg123" (list file) (lambda () (message "ok"))) 33 | (message "Process multiple : %s" (process-list)) 34 | (should (= 1 (length (process-list)))) 35 | (dionysos--kill-process dionysos--process-name) 36 | (should (equal nil (process-list)))))) 37 | 38 | 39 | (ert-deftest test-dionysos-process-can-start-process () 40 | :tags '(process) 41 | (with-test-sandbox 42 | (with-music-file 43 | "resources/Roulement_tambour-01.mp3" 44 | (dionysos--create-process 45 | dionysos--process-name "mpg123" (list file) (lambda () (message "ok"))) 46 | (should (equal 'run (dionysos--status-process dionysos--process-name))) 47 | (dionysos--kill-process dionysos--process-name) 48 | (should (equal nil (process-list)))))) 49 | 50 | 51 | 52 | (provide 'dionysos-process-test) 53 | ;;; dionysos-process-test.el ends here 54 | -------------------------------------------------------------------------------- /test/dionysos-version-test.el: -------------------------------------------------------------------------------- 1 | ;;; dionysos-version-test.el --- Tests for version information 2 | 3 | ;; Copyright (C) 2015-2016 Nicolas Lamirault 4 | 5 | ;; This program is free software; you can redistribute it and/or 6 | ;; modify it under the terms of the GNU General Public License 7 | ;; as published by the Free Software Foundation; either version 2 8 | ;; of the License, or (at your option) any later version. 9 | 10 | ;; This program is distributed in the hope that it will be useful, 11 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ;; GNU General Public License for more details. 14 | 15 | ;; You should have received a copy of the GNU General Public License 16 | ;; along with this program; if not, write to the Free Software 17 | ;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 18 | ;; 02110-1301, USA. 19 | 20 | ;;; Commentary: 21 | 22 | ;;; Code: 23 | 24 | (require 'pkg-info) 25 | 26 | (setq current-version "0.6.0") 27 | 28 | 29 | (ert-deftest test-dionysos-library-version () 30 | :tags '(version) 31 | (with-test-sandbox 32 | (should (string= current-version (dionysos--library-version))))) 33 | 34 | (ert-deftest test-dionysos-version () 35 | :tags '(version) 36 | (with-test-sandbox 37 | (should (string= current-version (dionysos-version))))) 38 | 39 | 40 | (provide 'dionysos-version-test) 41 | ;;; dionysos-version-test.el ends here 42 | -------------------------------------------------------------------------------- /test/resources/France.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nlamirault/dionysos/0aac21caadabc5a7f09e18a9dcb02f3dec26588b/test/resources/France.mp3 -------------------------------------------------------------------------------- /test/resources/Roulement_tambour-01.flac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nlamirault/dionysos/0aac21caadabc5a7f09e18a9dcb02f3dec26588b/test/resources/Roulement_tambour-01.flac -------------------------------------------------------------------------------- /test/resources/Roulement_tambour-01.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nlamirault/dionysos/0aac21caadabc5a7f09e18a9dcb02f3dec26588b/test/resources/Roulement_tambour-01.mp3 -------------------------------------------------------------------------------- /test/resources/Roulement_tambour-01.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nlamirault/dionysos/0aac21caadabc5a7f09e18a9dcb02f3dec26588b/test/resources/Roulement_tambour-01.ogg -------------------------------------------------------------------------------- /test/resources/Theatre_coup_avt_leve_rideau.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nlamirault/dionysos/0aac21caadabc5a7f09e18a9dcb02f3dec26588b/test/resources/Theatre_coup_avt_leve_rideau.mp3 -------------------------------------------------------------------------------- /test/test-helper.el: -------------------------------------------------------------------------------- 1 | ;; test-helper.el --- Test helpers for dionysos.el 2 | 3 | ;; Copyright (C) 2015-2016 Nicolas Lamirault 4 | 5 | ;; Author: Nicolas Lamirault 6 | ;; Homepage: https://github.com/nlamirault/dionysos 7 | 8 | ;;; License: 9 | 10 | ;; This file is NOT part of GNU Emacs. 11 | 12 | ;; This program is free software; you can redistribute it and/or modify 13 | ;; it under the terms of the GNU General Public License as published by 14 | ;; the Free Software Foundation, either version 3 of the License, or 15 | ;; (at your option) any later version. 16 | 17 | ;; This program is distributed in the hope that it will be useful, 18 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | ;; GNU General Public License for more details. 21 | 22 | ;; You should have received a copy of the GNU General Public License 23 | ;; along with this program. If not, see . 24 | 25 | ;;; Commentary: 26 | 27 | ;;; Code: 28 | 29 | (require 'ansi) 30 | (require 'cl-lib) 31 | (require 'ert) 32 | (require 'f) 33 | (require 'undercover) 34 | 35 | (setq debugger-batch-max-lines (+ 50 max-lisp-eval-depth) 36 | debug-on-error t) 37 | 38 | (defvar username (getenv "HOME")) 39 | 40 | (defconst dionysos-testsuite-dir 41 | (f-parent (f-this-file)) 42 | "The testsuite directory.") 43 | 44 | (defconst dionysos-source-dir 45 | (f-parent dionysos-testsuite-dir) 46 | "The dionysos.el source directory.") 47 | 48 | (defconst dionysos-sandbox-path 49 | (f-expand "sandbox" dionysos-testsuite-dir) 50 | "The sandbox path for dionysos.") 51 | 52 | (defun cleanup-load-path () 53 | "Remove home directory from 'load-path." 54 | (message (ansi-green "[dionysos] Cleanup path")) 55 | (mapc #'(lambda (path) 56 | (when (string-match (s-concat username "/.emacs.d") path) 57 | (message (ansi-yellow "Suppression path %s" path)) 58 | (setq load-path (delete path load-path)))) 59 | load-path) 60 | (add-to-list 'load-path default-directory)) 61 | 62 | (defun load-library (file) 63 | "Load current library from FILE." 64 | (let ((path (s-concat dionysos-source-dir file))) 65 | (message (ansi-yellow "[dionysos] Load library from %s" path)) 66 | (undercover "*.el" (:exclude "*-test.el")) 67 | (require 'dionysos path))) 68 | 69 | 70 | (defun setup-dionysos () 71 | "Setup Dionysos." 72 | ) 73 | 74 | (defmacro with-music-file (filename &rest body) 75 | `(let ((file (f-join dionysos-testsuite-dir ,filename))) 76 | ,@body)) 77 | 78 | 79 | (defmacro with-test-sandbox (&rest body) 80 | "Evaluate BODY in an empty sandbox directory." 81 | `(unwind-protect 82 | (condition-case nil ;ex 83 | (let ((default-directory dionysos-source-dir)) 84 | (cleanup-load-path) 85 | (load-library "/dionysos.el") 86 | (setup-dionysos) 87 | ,@body)))) 88 | 89 | ;;; test-helper.el ends here 90 | -------------------------------------------------------------------------------- /var/dionysos-fs-0.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nlamirault/dionysos/0aac21caadabc5a7f09e18a9dcb02f3dec26588b/var/dionysos-fs-0.6.png -------------------------------------------------------------------------------- /var/dionysos-mpd-0.3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nlamirault/dionysos/0aac21caadabc5a7f09e18a9dcb02f3dec26588b/var/dionysos-mpd-0.3.png --------------------------------------------------------------------------------