Noah Vogt 2 vuotta sitten
vanhempi
sitoutus
8969e93e7f
5 muutettua tiedostoa jossa 23 lisäystä ja 8 poistoa
  1. 19 4
      README.md
  2. 2 2
      config/default_config.py
  3. BIN
      media/infodisplay.jpg
  4. BIN
      media/titlebar.jpg
  5. 2 2
      slides/classic_song_slide.py

+ 19 - 4
README.md

@@ -98,15 +98,15 @@ Now for explanation of the individual entries.
 
 #### File Format and Naming
 
-`IMAGE_FORMAT` forces a specific file format when writing the files in formats accepted by ImageMagick. The individual slides get named in this form: `${IMAGE_FORMAT}${SLIDE_NUMBER}${FILE_EXTENSION}`. Hence with the default config of
+`IMAGE_FORMAT` forces a specific file format when writing the files in formats accepted by ImageMagick. The individual slides get named in this form: `${FILE_NAMEING}${SLIDE_NUMBER}${FILE_EXTENSION}`. Hence with the default config of
 
 ```python
 IMAGE_FORMAT = "jpeg"
 FILE_EXTENSION = "jpg"
-FILE_NAMEING = "slide"
+FILE_NAMEING = "slide-"
 ```
 
-the slides would be named `slide1.jpg`, `slide2.jpg`, `slide3.jpg` etc.
+the slides would be named `slide-1.jpg`, `slide-2.jpg`, `slide-3.jpg` etc.
 
 #### Dimensions
 
@@ -139,6 +139,22 @@ TITLE_HEIGHT = 160
 TITLEBAR_Y = 65
 ```
 
+Both `TITLEBAR_Y` and `TITLE_HEIGHT` are transformations given in pixels as shown in the following image. THE `TITLE_COLOR` gives a color of the song title (in this example, *"Amazing Grace"*) in the accepted color format of ImageMagick, same for the font sizes. More in detail, the `MAX_TITLE_FONT_SIZE` is applied when the song title is not too long, but when is the case, slidegen automatically shrinks down the font size in steps of `TITLE_FONT_SIZE_STEP` until it reaches the minimum font size specified by `MIN_TITLE_FONT_SIZE`.
+
+![Titlebar Explanation](media/titlebar.jpg)
+
+#### Infodisplay
+
+```python
+INFODISPLAY_FONT_SIZE = 25
+INFODISPLAY_ITEM_WIDTH = 20
+INFODISPLAY_X = 1650
+INFODISPLAY_Y = 1000
+```
+
+`INFODISPLAY_X` and `INFODISPLAY_Y` are the coordinates given as pixels which define where the top-left pixel of the infodisplay is located on the song slides. `INFODISPLAY_FONT_SIZE` just gives the font size in a format acceptable by ImageMagick. Closely related, `INFODISPLAY_ITEM_WIDTH` gives the width in pixels of both the letter of a structure element in the infodisplay and the whitespace that follows before the next structure to the right.
+
+![Infodisplay Explanation](media/infodisplay.jpg)
 
 ## Roadmap
 
@@ -151,7 +167,6 @@ These are some issues and possible changes that will be addressed or at least co
 - asynchronous slide generation
 - use caching, with checksum checks for changes in the source file and the `PROMPT_INPUT`
 - provide ssync with the song structure, display it to the user and prevent him from entering a prompt that would slidegen cause to terminate unsuccessfully
-- better packaging and modularisation
 - add more optional metadata strings
 - use a more typical commandline argument system
 - add more documentation, especially explaining the slide generation and its configuration

+ 2 - 2
config/default_config.py

@@ -33,6 +33,8 @@ TITLEBAR_Y = 65
 
 INFODISPLAY_FONT_SIZE = 25
 INFODISPLAY_ITEM_WIDTH = 20
+INFODISPLAY_X = 1650
+INFODISPLAY_Y = 1000
 
 PLAYER_WIDTH = 560
 PLAYER_HEIGHT = 315
@@ -61,8 +63,6 @@ TEXT_CANVAS_X = 160
 TEXT_CANVAS_Y = 400
 TEXT_CANVAS_WIDTH = 1600
 TEXT_CANVAS_HEIGHT = 600
-STRUCTURE_X = 1650
-STRUCTURE_Y = 1000
 MAX_CANVAS_FONT_SIZE = 55
 MIN_CANVAS_FONT_SIZE = 35
 CANVAS_FONT_SIZE_STEP = 5

BIN
media/infodisplay.jpg


BIN
media/titlebar.jpg


+ 2 - 2
slides/classic_song_slide.py

@@ -52,8 +52,8 @@ class ClassicSongSlide(SongSlide):
             )
         bg_img.composite(
             self.get_structure_info_display(song_structure, index),
-            top=const.STRUCTURE_Y,
-            left=const.STRUCTURE_X,
+            top=const.INFODISPLAY_Y,
+            left=const.INFODISPLAY_X,
         )
         return bg_img.clone()