From a7c8880230ec07ee5bd17ffb7bdffe39bc088e6d Mon Sep 17 00:00:00 2001 From: Matteo Cypriani Date: Fri, 22 Sep 2017 16:58:29 -0400 Subject: [PATCH] Split multimedia into audio and graphics Also to mimic pkgsrc categories. While there: - Convert the READMEs to MarkDown to make forges happier. - Split French README section to audio/README-fr.md. - Rewrap READMEs at 80 characters. --- audio/README-fr.md | 43 +++++ audio/README.md | 105 ++++++++++++ {multimedia => audio}/just-play-something.sh | 0 {multimedia => audio}/metaflac-field2field.sh | 0 {multimedia => audio}/mp3car.sh | 0 bin/apply-exif-orientation | 2 +- bin/just-play-something | 2 +- bin/metaflac-field2field | 2 +- bin/mp3car | 2 +- graphics/README.md | 14 ++ .../apply-exif-orientation.sh | 0 multimedia/README | 151 ------------------ 12 files changed, 166 insertions(+), 155 deletions(-) create mode 100644 audio/README-fr.md create mode 100644 audio/README.md rename {multimedia => audio}/just-play-something.sh (100%) rename {multimedia => audio}/metaflac-field2field.sh (100%) rename {multimedia => audio}/mp3car.sh (100%) create mode 100644 graphics/README.md rename {multimedia => graphics}/apply-exif-orientation.sh (100%) delete mode 100644 multimedia/README diff --git a/audio/README-fr.md b/audio/README-fr.md new file mode 100644 index 0000000..507941f --- /dev/null +++ b/audio/README-fr.md @@ -0,0 +1,43 @@ +metflac-field2field.sh +====================== + +`metaflac-field2field.sh` utilise metaflac pour effectuer des actions de copie +ou déplacement de champ à champ sur les fichiers FLAC. + +Invocation du script : + + metaflac-field2field.sh \ + [ [...] ] + +`` est l'action à effectuer sur les champs, parmi « copy », « move », +« rmcopy » et « mvcopy » : + +- **copy** : chaque occurrence de `SRC_FIELD` est dupliquée pour créer une + occurrence de `DST_FIELD` ; toutes les occurrences existantes de `SRC_FIELD` + et de `DST_FIELD` sont conservées. + +- **move** : chaque occurrence de `SRC_FIELD` est déplacée pour créer une + occurrence de `DST_FIELD` ; les occurrences existantes de `DST_FIELD` sont + conservées. + +- **rmcopy** : les occurrences existantes de `DST_FIELD` sont supprimées, puis + chaque occurrence de `SRC_FIELD` est dupliquée pour créer une occurrence de + `DST_FIELD` ; les occurrences de `SRC_FIELD` sont conservées. + +- **rmmove** : les occurrences existantes de `DST_FIELD` sont supprimées, puis + chaque occurrence de `SRC_FIELD` est déplacée pour créer une occurrence de + `DST_FIELD`. + +`` est le champ source de l'action. + +`` est le champ de destination de l'action. + +On spécifie ensuite un ou plusieurs fichier sur lequel ou lesquels effectuer +l'action. + +À noter que vous devriez toujours employer des noms de champs en lettres +MAJUSCULES ; les champs en minuscules ne sont pas gérés, et le comportement du +programme est indéfini si vous les employez. Par exemple, si vous essayez de +renommer un champ en minuscules (exemple : `metaflac-field2field move DATE +date`), le champ sera simplement supprimé, car `metaflac --remove-tag` ne +tient pas compte de la casse. diff --git a/audio/README.md b/audio/README.md new file mode 100644 index 0000000..cf438e4 --- /dev/null +++ b/audio/README.md @@ -0,0 +1,105 @@ +just-play-something.sh +====================== + +As its name indicates, the main goal of `just-play-something.sh` is to put some +music on. Anything. What the name doesn't indicate is that the music is played +by MPD. + +Its use case is to be binded to a physical button of my router (which is also +my music box), so that I don't have to start a device with an MPD client to +start music (this is especially useful when I first wake up in the morning). +Therefore, it is written with portability in mind and tries to not use any +utility that might not be present on embedded systems. + +Here are the required dependencies (beside MPD itself): + +- `mpc` (MPD's command-line client) +- time +- ps +- date +- md5sum +- sed + +What this script will do for you: + +- first of all, if the MPD daemon looks down, it will be restarted; then, +- if there are songs in the playlist but the playback is paused, it will + unpause; +- if there are songs in the playlist but the playback is stopped, it will + start playing the playlist from the begining; +- if there are no songs in the playlist, it will add a random album from your + library and play it; +- if music is already playing, it will be paused. + +Tips: + +- You can bind a short button press to `just-play-something`, and a long press + (or another button) to `mpc clear ; just-play-something`, so that if you + don't like what is currently in the playlist, you can force playing a random + album with a long press. +- Running this script from another host works just fine by setting the + `MPD_HOST` variable (and possibly `MPD_PORT`), for example: + MPD_HOST=192.168.0.254 just-play-something + + +metflac-field2field.sh +====================== + +*Français: voir README-fr.md.* + +`metaflac-field2field.sh` uses metaflac to process field to field copy/move on +FLAC file metadatas. + +Invocation: + + metaflac-field2field.sh \ + [ [...] ] + +`` is the action to perform on the fields, amongst “copy”, “move”, +“rmcopy” and “mvcopy”: + +- **copy**: each occurrence of `SRC_FIELD` is duplicated to create an + occurrence of `DST_FIELD`; all the existing occurrences of `SRC_FIELD` and + `DST_FIELD` are kept. + +- **move**: each occurrence of `SRC_FIELD` is moved to create an occurrence of + `DST_FIELD`; the existing occurrences of `DST_FIELD` are kept. + +- **rmcopy**: the existing occurrences of `DST_FIELD` are deleted, then each + occurrence of `SRC_FIELD` is duplicated to create an occurrence of + `DST_FIELD`; the occurrences of `SRC_FIELD` are kept. + +- **rmmove**: the existing occurrences of `DST_FIELD` are deleted, then each + occurrence of `SRC_FIELD` is moved to create an occurrence of `DST_FIELD`. + +`` is the action's source field. + +`` is the action's destination field. + +Finally, the file(s) on which the action has to be run are specified at the end +of the command line. + +Please note that you should always use UPPERCASE fields; lowercase fields are +*not* supported, and the behaviour is undefined. For example, if you try to +lowercase a field with the move command (e.g. `metaflac-field2field move DATE +date`), the field will just be deleted. This is because `metaflac --remove-tag` +is case-insensitive. + + +mp3car.sh +========= + +`mp3car.sh` uses the pacpl (Perl Audio Converter) multi-purpose audio converter +to convert audio files in any format to low-quality MP3s suitable for listening +in a car. The goal is to maximise the number of albums that can be contained in +a CD-ROM (or USB stick). The default encoding parameters are variable bitrate +(VBR) from 32 to 128 kbps, in joint stereo. + +Usage: just call the script with one or more files or directories, and they +will be converted recursively and put in the target directory (`~/tmp/mp3car/` +by default, edit the script to change that). + +You must have installed pacpl and lame for this script to work. + +Note: if you want to burn all these converted audio files to CD-ROMs, you may +be interested in the `dirpacker.py` script provided in this repository. diff --git a/multimedia/just-play-something.sh b/audio/just-play-something.sh similarity index 100% rename from multimedia/just-play-something.sh rename to audio/just-play-something.sh diff --git a/multimedia/metaflac-field2field.sh b/audio/metaflac-field2field.sh similarity index 100% rename from multimedia/metaflac-field2field.sh rename to audio/metaflac-field2field.sh diff --git a/multimedia/mp3car.sh b/audio/mp3car.sh similarity index 100% rename from multimedia/mp3car.sh rename to audio/mp3car.sh diff --git a/bin/apply-exif-orientation b/bin/apply-exif-orientation index ce48ed4..fcc9a8d 120000 --- a/bin/apply-exif-orientation +++ b/bin/apply-exif-orientation @@ -1 +1 @@ -../multimedia/apply-exif-orientation.sh \ No newline at end of file +../graphics/apply-exif-orientation.sh \ No newline at end of file diff --git a/bin/just-play-something b/bin/just-play-something index 51eff03..556954f 120000 --- a/bin/just-play-something +++ b/bin/just-play-something @@ -1 +1 @@ -../multimedia/just-play-something.sh \ No newline at end of file +../audio/just-play-something.sh \ No newline at end of file diff --git a/bin/metaflac-field2field b/bin/metaflac-field2field index e7cc283..e43b2d2 120000 --- a/bin/metaflac-field2field +++ b/bin/metaflac-field2field @@ -1 +1 @@ -../multimedia/metaflac-field2field.sh \ No newline at end of file +../audio/metaflac-field2field.sh \ No newline at end of file diff --git a/bin/mp3car b/bin/mp3car index f0e16eb..69db903 120000 --- a/bin/mp3car +++ b/bin/mp3car @@ -1 +1 @@ -../multimedia/mp3car.sh \ No newline at end of file +../audio/mp3car.sh \ No newline at end of file diff --git a/graphics/README.md b/graphics/README.md new file mode 100644 index 0000000..8eda36a --- /dev/null +++ b/graphics/README.md @@ -0,0 +1,14 @@ +apply-exif-orientation.sh +========================= + +`apply-exif-orientation.sh` retrieves the Orientation EXIF tag from an image +file and rotates the actual image data according to the said orientation. The +EXIF Orientation tag is deleted in the process. The goal is to allow the image +to be displayed correctly by tools that don't handle EXIF metadata (such as +ImageMagick's display). + +EXIF information is manipulated using exiftool, shipped with the +`Image::ExifTool` Perl module (Debian package: `libimage-exiftool-perl`). +Image is rotated using ImageMagick's `convert`. + +**Warning**: no backup of the original file is made! diff --git a/multimedia/apply-exif-orientation.sh b/graphics/apply-exif-orientation.sh similarity index 100% rename from multimedia/apply-exif-orientation.sh rename to graphics/apply-exif-orientation.sh diff --git a/multimedia/README b/multimedia/README deleted file mode 100644 index fe30241..0000000 --- a/multimedia/README +++ /dev/null @@ -1,151 +0,0 @@ -# apply-exif-orientation.sh # - -apply-exif-orientation.sh retrieves the Orientation EXIF tag from an -image file and rotates the actual image data according to the said -orientation. The EXIF Orientation tag is deleted in the process. The -goal is to allow the image to be displayed correctly by tools that don't -handle EXIF metadata (such as ImageMagick's display). - -EXIF information is manipulated using exiftool, shipped with the -Image::ExifTool Perl module (Debian package: libimage-exiftool-perl). -Image is rotated using ImageMagick's convert. - -Warning: no backup of the original file is made! - - -# just-play-something.sh # - -As its name indicates, the main goal of just-play-something.sh is to put -some music on. Just anything. What the name doesn't indicate is that the -music is played by MPD. - -Its use case is to be binded to a physical button of my router (which is -also my music box), so that I don't have to start a device with an MPD -client to start music (this is especially useful when I first wake up in -the morning). Therefore, it is written with portability in mind and -doesn't use any utility that might not be present on embedded systems. -Here are the required dependencies (beside MPD itself and its -command-like client, mpc): -- time -- ps -- date -- md5sum -- sed - -What this script will do for you: -- first of all, if the MPD daemon looks down, it will be restarted; - then, -- if there are songs in the playlist but the playback is paused, it will - unpause; -- if there are songs in the playlist but the playback is stopped, it - will start playing the playlist from the begining; -- if there are no songs in the playlist, it will add a random album from - your library and play it; -- if music is already playing, it will be paused. - -Tips: -- You can bind a short button press to 'just-play-something', and a long - press (or another button) to 'mpc clear ; just-play-something', so - that if you don't like what is currently in the playlist, you can - force playing a random album with a long press. -- Running this script from another host works just fine by setting the - MPD_HOST variable (and possibly MPD_PORT), for example: - MPD_HOST=192.168.0.254 just-play-something - - -# metflac-field2field.sh # - -[Français ci-dessous.] - -metaflac-field2field.sh uses metaflac to process field to field -copy/move on FLAC file metadatas. - -Invocation: - - metaflac-field2field.sh \ - [ [...] ] - - is the action to perform on the fields, amongst “copy”, “move”, -“rmcopy” and “mvcopy”: -- copy: each occurrence of SRC_FIELD is duplicated to create an - occurrence of DST_FIELD; all the existing occurrences of SRC_FIELD and - DST_FIELD are kept. -- move: each occurrence of SRC_FIELD is moved to create an occurrence of - DST_FIELD; the existing occurrences of DST_FIELD are kept. -- rmcopy: the existing occurrences of DST_FIELD are deleted, then each - occurrence of SRC_FIELD is duplicated to create an occurrence of - DST_FIELD; the occurrences of SRC_FIELD are kept. -- rmmove: the existing occurrences of DST_FIELD are deleted, then each - occurrence of SRC_FIELD is moved to create an occurrence of DST_FIELD. - - is the action's source field. - - is the action's destination field. - -Finally, the file(s) on which the action has to be run are specified at -the end of the command line. - -Please note that you should always use UPPERCASE fields; lowercase -fields are *not* supported, and the behaviour is undefined. For example, -if you try to lowercase a field with the move command (e.g. -metaflac-field2field move DATE date), the field will just be deleted. -This is because metaflac --remove-tag is case-insensitive. - ----- - -metaflac-field2field.sh utilise metaflac pour effectuer des actions de -copie ou déplacement de champ à champ sur les fichiers FLAC. - -Invocation du script : - - metaflac-field2field.sh \ - [ [...] ] - - est l'action à effectuer sur les champs, parmi « copy », -« move », « rmcopy » et « mvcopy » : -- copy : chaque occurrence de SRC_FIELD est dupliquée pour créer une - occurrence de DST_FIELD ; toutes les occurrences existantes de - SRC_FIELD et de DST_FIELD sont conservées. -- move : chaque occurrence de SRC_FIELD est déplacée pour créer une - occurrence de DST_FIELD ; les occurrences existantes de DST_FIELD sont - conservées. -- rmcopy : les occurrences existantes de DST_FIELD sont supprimées, puis - chaque occurrence de SRC_FIELD est dupliquée pour créer une occurrence - de DST_FIELD ; les occurrences de SRC_FIELD sont conservées. -- rmmove : les occurrences existantes de DST_FIELD sont supprimées, puis - chaque occurrence de SRC_FIELD est déplacée pour créer une occurrence - de DST_FIELD. - - est le champ source de l'action. - - est le champ de destination de l'action. - -On spécifie ensuite un ou plusieurs fichier sur lequel ou lesquels -effectuer l'action. - -À noter que vous devriez toujours employer des noms de champs en -lettres MAJUSCULES ; les champs en minuscules ne sont pas gérés, et le -comportement du programme est indéfini si vous les employez. Par -exemple, si vous essayez de renommer un champ en minuscules (exemple : -metaflac-field2field move DATE date), le champ sera simplement supprimé, -car metaflac --remove-tag ne tient pas compte de la casse. - - -# mp3car.sh # - -mp3car.sh uses the pacpl (Perl Audio Converter) multi-purpose audio -converter to convert audio files in any format to low-quality MP3s -suitable for listening in a car. The goal is to maximise the number of -albums that can be contained in a CD-ROM (or USB stick). The default -encoding parameters are variable bitrate (VBR) from 32 to 128 kbps, in -joint stereo. - -Usage: just call the script with one or more files or directories, and -they will be converted recursively and put in the target directory -(~/tmp/mp3car/ by default, edit the script to change that). - -You must have installed pacpl and lame for this script to work. - -Note: if you want to burn all these converted audio files to CD-ROMs, -you might be interested in the dirpacker.py script provided in this -repository.