Skip to content

Commit ccfa0e7

Browse files
committed
#13: Allow separate images when song has no album art vs. when no song is playing [implement proposal C]
1 parent 92fcbcf commit ccfa0e7

16 files changed

Lines changed: 495 additions & 558 deletions

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "nuget"
4+
directory: "/WinampNowPlayingToFile"
5+
schedule:
6+
interval: "weekly"

Readme.md

Lines changed: 36 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -20,27 +20,27 @@ This is a plugin for [Winamp](http://www.winamp.com/) that saves text informatio
2020

2121
I was broadcasting video game streams on [my Twitch.tv channel](https://twitch.tv/aldaviva), in which I also play music in the background. I wanted viewers to be able to tell which song I was playing at any given time in case they liked it and wanted to find it for themselves. I started using the [Advanced mIRC Integration Plug-In (AMIP)](http://amip.tools-for.net/wiki/), which is generally used for showing your Now Playing status in IRC using [mIRC](https://www.mirc.com/). It also lets you save the status to a text file, which I added as a Text Source in [OBS](https://obsproject.com/).
2222

23-
Unfortunately, AMIP only supports encoding the text using ANSI, OEM (DOS), FIDO, or KOI8 character encodings, none of which are UTF-8, which OBS requires. For example, `Jävla Sladdar` by [Etnoscope](https://www.discogs.com/Etnoscope-Way-Over-Deadline/master/284523) was being shown in the video stream as `J�vla Sladdar`, because even though AMIP was saving `ä` using ANSI (`0xe4`), OBS was decoding the file with UTF-8, so the character was not properly decoded. In UTF-8, `ä` is supposed to be encoded as `0xc3 0xa4` because `0xe4` is greater than `0x7f` (i.e. `0x34` requires more than 7 bits to represent), so it spills over into a second code unit (byte).
23+
Unfortunately, AMIP only supports encoding the text using ANSI, OEM (DOS), FIDO, or KOI8 character encodings, none of which are UTF-8, which OBS requires. For example, [Jävla Sladdar](https://www.youtube.com/watch?v=zaCZ9VkJ-so) was being shown in the video stream as `J�vla Sladdar`, because even though AMIP was saving `ä` using ANSI (`0xe4`), OBS was decoding the file with UTF-8, so the character was not properly decoded. In UTF-8, `ä` is supposed to be encoded as `0xc3 0xa4` because `0xe4` is greater than `0x7f` (i.e. `0x34` requires more than 7 bits to represent), so it spills over into a second code unit (byte).
2424

2525
## Solution
2626

2727
I wrote my own Winamp plugin to save information about the currently playing song to a UTF-8 text file, and the song's album art to an image file.
2828

2929
## Installation
3030

31-
1. Ensure you have the [Microsoft .NET Framework 4.7.2](https://dotnet.microsoft.com/download/dotnet-framework) Runtime or later installed. This is included in Windows 10 version 1803 and later.
32-
1. Download `WinampNowPlayingToFile.zip` from the [latest release](https://github.com/Aldaviva/WinampNowPlayingToFile/releases) (not the source code ZIP file).
31+
1. Ensure you have [Microsoft .NET Framework 4.7.2](https://dotnet.microsoft.com/download/dotnet-framework) Runtime or later installed. This is included in Windows 10 version 1803 and later.
32+
1. Exit Winamp if it's already running.
33+
1. Download [**`WinampNowPlayingToFile.zip`**](https://github.com/Aldaviva/WinampNowPlayingToFile/releases/latest/download/WinampNowPlayingToFile.zip) from the [latest release](https://github.com/Aldaviva/WinampNowPlayingToFile/releases) (not the source code ZIP file).
3334
1. Extract the archive to your Winamp installation directory.
3435
```
35-
C:\Program Files (x86)\Winamp
36-
├── plugins
37-
│ └── gen_WinampNowPlayingToFile.dll
38-
├── WinampNowPlayingToFile.dll
39-
├── Daniel15.Sharpamp.dll
40-
└── mustache-sharp.dll
41-
└── taglib-sharp.dll
36+
📁 C:\Program Files (x86)\Winamp
37+
├── 📁 plugins
38+
│ └── 📄 gen_WinampNowPlayingToFile.dll
39+
├── 📄 WinampNowPlayingToFile.dll
40+
├── 📄 Daniel15.Sharpamp.dll
41+
└── 📄 mustache-sharp.dll
42+
└── 📄 taglib-sharp.dll
4243
```
43-
1. Restart Winamp if it's already running.
4444
4545
## Configuration
4646
@@ -50,13 +50,13 @@ Configuration of this plugin is performed in Winamp.
5050
1. Go to Options › Preferences › Plug-ins › General Purpose.
5151
1. Configure the Now Playing to File plugin.
5252
53-
Changes are saved to the registry in `HKCU\Software\WinampNowPlayingToFile`.
54-
5553
![configuration](.github/images/configuration.png)
5654
55+
*Changes are saved to the registry in `HKCU\Software\WinampNowPlayingToFile`.*
56+
5757
### Text
5858
59-
By default, this plugin saves textual information about the currently playing song to `winamp_now_playing.txt` in your temporary directory (`%TEMP%`), and the file contains the track Artist, Title, and Album (if applicable), for example
59+
By default, this plugin saves textual information about the currently playing song to `winamp_now_playing.txt` in your user's temporary directory (`%TEMP%`), and the file contains the track Artist, Title, and Album (if applicable), for example
6060
```text
6161
U2 - Exit - The Joshua Tree
6262
```
@@ -79,11 +79,23 @@ When Winamp is not playing a song, this text file will be truncated to 0 bytes.
7979

8080
This plugin also copies the currently playing song's album art from the song metadata or folder. By default, it is copied to `%TEMP%\winamp_now_playing.png`.
8181

82-
Note that the file extension is not changed, even if the album art has a file type different from PNG, to make it easier to refer to this file from other programs like OBS without having to deal with multiple possible file extensions. This means that this file may be a JPEG with a `.png` file extension. Most programs, including OBS, can handle this case just fine, but it is a little silly looking.
82+
Note that the file extension is not changed, even if the album art has a file type different from PNG, to make it easier to refer to this file from other programs like OBS without having to deal with multiple possible file extensions. This means that this file may be a JPEG with a `.png` file extension. Most programs, including OBS, can handle this case just fine, but the mismatch is a little silly. Feel free to change the file extension using the preferences.
8383

8484
You can customize the album art filename and path using **Save album art as** in the same plugin configuration dialog as the text file above.
8585

86-
When Winamp is playing a song with no album art, or when Winamp is paused, stopped, or closed, the image file will be replaced with a 1px × 1px opaque black PNG. To override this, save your desired image file as `emptyAlbumArt.png` in the Winamp installation directory.
86+
#### Fallback artwork
87+
88+
When there is no album art, the copied files will be deleted. However, this may be undesirable because it can leave dependent interfaces in a weird-looking state (like an OBS layout with a big transparent gap where the album art would normally be), and it will also trigger the Missing Files warning dialog box each time you launch OBS.
89+
90+
To resolve this, you can specify custom image files that will be copied instead when there is no album art. Here are some sample [black](https://placehold.co/128x128/000f/0000.png) and [transparent](https://placehold.co/128x128/0000/0000.png) images to get started, or you can use your own. There are no requirements for the format or dimensions of these images besides what your downstream consumer like OBS accepts.
91+
92+
##### Missing artwork
93+
94+
When Winamp is playing a song with no album art, the image file will be deleted. To override this, save your desired image file as `emptyAlbumArt.png` in the Winamp installation directory.
95+
96+
##### Playback stopped
97+
98+
When Winamp is paused, stopped, or closed, the image file will be deleted. To override this, save your desired image file as `stoppedAlbumArt.png` in the Winamp installation directory.
8799

88100
## Integration
89101

@@ -102,12 +114,13 @@ When Winamp is playing a song with no album art, or when Winamp is paused, stopp
102114
1. Select the Now Playing to File plugin, then click the Uninstall Selected Plug-In button.
103115
1. Delete all the files you extracted to the Winamp installation directory when installing this plugin.
104116
```
105-
C:\Program Files (x86)\Winamp
106-
├── plugins
107-
│ └── gen_WinampNowPlayingToFile.dll
108-
├── WinampNowPlayingToFile.dll
109-
├── Daniel15.Sharpamp.dll
110-
├── mustache-sharp.dll
111-
└── taglib-sharp.dll
117+
📁 C:\Program Files (x86)\Winamp
118+
├── 📁 plugins
119+
│ └── 📄 gen_WinampNowPlayingToFile.dll
120+
├── 📄 WinampNowPlayingToFile.dll
121+
├── 📄 Daniel15.Sharpamp.dll
122+
└── 📄 mustache-sharp.dll
123+
└── 📄 taglib-sharp.dll
112124
```
113125
1. Delete the song information files (by default, `winamp_now_playing.txt` and `winamp_now_playing.png` in `%TEMP%`).
126+
1. Delete the plugin settings registry key `HKCU\Software\WinampNowPlayingToFile`.

0 commit comments

Comments
 (0)