hmp3-ng 2.7.1 → 2.7.3
raw patch · 5 files changed
+74/−141 lines, 5 files
Files
- Lexer.hs +1/−1
- README.md +0/−89
- UI.hs +8/−5
- Utils.hs +4/−3
- hmp3-ng.cabal +61/−43
Lexer.hs view
@@ -1,6 +1,6 @@ -- -- Copyright (c) 2005-2008 Don Stewart - http://www.cse.unsw.edu.au/~dons--- Copyright (c) 2008 Galen Huntington+-- Copyright (c) 2008, 2019 Galen Huntington -- -- This program is free software; you can redistribute it and/or -- modify it under the terms of the GNU General Public License as
− README.md
@@ -1,89 +0,0 @@--## hmp3-ng--The `hmp3` music player, written in Haskell, dates to 2005, and has a-curses-based interface which can be used in an ordinary text terminal.-But it has become abandonware: the last update was in June 2008,-and it no longer builds with today's Haskell and standard libraries.--This repository is a work in progress to resurrect this software.--The original Darcs repo has vanished from the Internet. However, I-have a copy I checked out in 2008 (to hack on!) with all the patches-through version 1.5.1 (the latest is 1.5.2.1, which I had at one point-but cannot find), and Hackage hosts tarballs for several versions.--* I used [darcs-to-git](https://github.com/purcell/darcs-to-git)-to port to Git.--* I added commits for the changes in the two later published versions.-These were fairly small, the bulk being the regeneration of the-`configure` file using a newer version of GNU `autoconf`.--* I updated the code to compile under modern GHC (8.6.5 as of this-writing) and libraries. Some code could not be directly ported,-mainly low-level optimizations, and so was replaced.--* There is a GitHub issue tracker to cover other problems and-planned changes.--* I have added support for building with Stack.--* All C code is removed. There is still some use of the FFI.--* Work on other features and changes, and documentation, is ongoing.--I have also made a few changes and additions to the key bindings per-my preference.--I am still working out the flaws. Let me know if there are problems.---## Installation--Either `cabal install` or `stack install` will build a binary.-You will need to have `mpg321` installed, which is free software-and widely available in package managers. Alternatively, `mpg123`-can be used by compiling with the `-DMPG123` option, but, while your-mileage may vary, in my experience it doesn't work as well.--The build depends on the package `hscurses`, which in turn requires-curses dev files. In Ubuntu/Debian, for example, these can be gotten-by installing `libncurses5-dev`.---## Use--The `hmp3` executable is called with arguments containing a list of mp3-files or directories of mp3 files. With no arguments, it will use the-playlist from the last time it was run, which is stored in `~/.hmp3db`.--```-$ hmp3 ~/Music ~/Downloads/La-La.mp3-$ hmp3-```--Once running, `hmp3` is controlled by fairly intuitive key commands.-`h` shows a help menu, and `q` quits.--A color scheme can be specified by writing out a `Config { .. }`-value in `~/.hmp3`. See `Style.hs` for the definition. The `l`-command reloads this configuration.---## Original authorship list--```-License:- GPL--Author:- Don Stewart, Tue Jan 15 15:16:55 PST 2008--Contributors:- Samuel Bronson- Stefan Wehr- Tomasz Zielonka- David Himmelstrup-```-
UI.hs view
@@ -428,10 +428,12 @@ PlayModes modes = draw a b c d PVersion ver = draw a b c d - gap = x - padding - P.length inf - modlen - P.length time - P.length ver- gapl = gap `div` 2- gapr = gap - gapl- padding = 3+ lsize = 1 + P.length inf+ rsize = 2 + P.length time + P.length ver+ side = (x - modlen) `div` 2+ gap = x - modlen - lsize - rsize+ gapl = 1 `max` ((side - lsize) `min` gap)+ gapr = 1 `max` (gap - gapl) modlen = length modes space = spaces 1 hl = titlebar . config $ c@@ -683,7 +685,8 @@ if P.null (id3title ti) then [] else [": ", id3title ti]- x -> [P.pack $ show x]+ Paused -> ["paused"]+ Stopped -> ["stopped"] displayWidth :: String -> Int displayWidth = sum . map charWidth
Utils.hs view
@@ -49,6 +49,7 @@ import System.IO.Unsafe (unsafePerformIO) import Text.Printf (printf)+import Control.Monad.Fail as Fail ------------------------------------------------------------------------ @@ -159,10 +160,10 @@ ------------------------------------------------------------------------ -- | 'readM' behaves like read, but catches failure in a monad.-readM :: (Monad m, Read a) => String -> m a+readM :: (MonadFail m, Read a) => String -> m a readM s = case [x | (x,t) <- {-# SCC "Serial.readM.reads" #-} reads s -- bad! , ("","") <- lex t] of [x] -> return x- [] -> fail "Serial.readM: no parse"- _ -> fail "Serial.readM: ambiguous parse"+ [] -> Fail.fail "Serial.readM: no parse"+ _ -> Fail.fail "Serial.readM: ambiguous parse"
hmp3-ng.cabal view
@@ -1,50 +1,68 @@-cabal-version: >= 1.6+cabal-version: 1.12 -name: hmp3-ng-version: 2.7.1-homepage: https://github.com/galenhuntington/hmp3-ng-license: GPL-license-file: LICENSE-author: Don Stewart, Galen Huntington-maintainer: Galen Huntington-category: Sound-synopsis: A 2019 fork of an ncurses mp3 player written in Haskell-description:- An mp3 player with a curses frontend. Playlists are populated by- passing directory names on the commandline, and saved to the- ~/.hmp3db database. Type 'h' to display the help page. Colours may- be configured at runtime by editing the "~/.hmp3" file.-build-type: Simple-extra-source-files: Keymap.hs-boot README.md+-- This file has been generated from package.yaml by hpack version 0.31.2.+--+-- see: https://github.com/sol/hpack+--+-- hash: ba3e589b15902bfca771494be6b3c4a6bf552465aae7c116b6296d23b31a887e +name: hmp3-ng+version: 2.7.3+synopsis: A 2019 fork of an ncurses mp3 player written in Haskell+description: An mp3 player with a curses frontend. Playlists are populated by+ passing directory names on the commandline, and saved to the+ ~/.hmp3db database. Type 'h' to display the help page. Colours may+ be configured at runtime by editing the "~/.hmp3" file.+category: Sound+homepage: https://github.com/galenhuntington/hmp3-ng#readme+bug-reports: https://github.com/galenhuntington/hmp3-ng/issues+author: Don Stewart, Galen Huntington+maintainer: Galen Huntington+license: GPL+license-file: LICENSE+build-type: Simple+ source-repository head type: git location: https://github.com/galenhuntington/hmp3-ng executable hmp3- build-depends: unix >= 2.7,- zlib >= 0.4,- binary >= 0.4,- pcre-light >= 0.3,- mersenne-random >= 1.0.0.1,- base >= 4 && < 5,- bytestring >= 0.10,- containers,- array,- clock,- directory,- process,- utf8-string,- hscurses,- mtl,- monad-extras-- ghc-options: -Wall -funbox-strict-fields -threaded -Wno-unused-do-bind- main-is: Main.hs- other-modules: Config Core FastIO Keymap- Lexer Lexers State Style Syntax Tree UI Utils- Paths_hmp3_ng-- extensions: ScopedTypeVariables, OverloadedStrings,- BlockArguments, BangPatterns- extra-libraries: ncursesw+ main-is: Main.hs+ other-modules:+ Config+ Core+ FastIO+ Keymap+ Lexer+ Lexers+ State+ Style+ Syntax+ Tree+ UI+ Utils+ Paths_hmp3_ng+ hs-source-dirs:+ ./.+ default-extensions: BangPatterns BlockArguments NondecreasingIndentation OverloadedStrings ScopedTypeVariables+ ghc-options: -Wall -funbox-strict-fields -threaded -Wno-unused-do-bind+ extra-libraries:+ ncursesw+ build-depends:+ array+ , base >=4 && <5+ , binary >=0.4+ , bytestring >=0.10+ , clock+ , containers+ , directory+ , hscurses+ , mersenne-random >=1.0.0.1+ , monad-extras+ , mtl+ , pcre-light >=0.3+ , process+ , unix >=2.7+ , utf8-string+ , zlib >=0.4+ default-language: Haskell2010