Skip to content

Commit

Permalink
feat: Only require the composition (Audio.ogg) itself - no extra step…
Browse files Browse the repository at this point in the history
…s needed
  • Loading branch information
SebiAi committed Feb 5, 2024
1 parent 456ce57 commit fb4f04b
Show file tree
Hide file tree
Showing 10 changed files with 324 additions and 142 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,26 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

# Build and install TagLib dependency
- name: Cache TagLib build
id: cache-taglib
uses: actions/cache@v4
with:
path: taglib
key: taglib-${{ runner.os }}-${{ hashFiles('.github/workflows/build-linux.yml') }}
- name: Build TagLib
if: ${{ steps.cache-taglib.outputs.cache-hit != 'true' }}
run: |
git clone --depth 1 --branch v2.0 https://github.com/taglib/taglib.git
cd taglib
git submodule update --init
cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_SHARED_LIBS=ON -DWITH_ZLIB=OFF -DCMAKE_BUILD_TYPE=Release -S . -B build
cmake --build build --config Release
cd ..
shell: bash
- name: Install TagLib
run: sudo cmake --install taglib/build

# Update project version
- name: Cache Node modules
uses: actions/cache@v4
Expand Down
25 changes: 24 additions & 1 deletion .github/workflows/build-macOS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,26 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

# Build and install TagLib dependency
- name: Cache TagLib build
id: cache-taglib
uses: actions/cache@v4
with:
path: taglib
key: taglib-${{ runner.os }}-${{ hashFiles('.github/workflows/build-macOS.yml') }}
- name: Build TagLib
if: ${{ steps.cache-taglib.outputs.cache-hit != 'true' }}
run: |
git clone --depth 1 --branch v2.0 https://github.com/taglib/taglib.git
cd taglib
git submodule update --init
cmake -G Ninja -DBUILD_SHARED_LIBS=ON -DWITH_ZLIB=OFF -DCMAKE_BUILD_TYPE=Release -S . -B build
cmake --build build --config Release
cd ..
shell: bash
- name: Install TagLib
run: sudo cmake --install taglib/build

# Update project version
- name: Cache Node modules
uses: actions/cache@v4
Expand All @@ -52,7 +72,10 @@ jobs:
# Package with macdeployqt
- name: Package with macdeployqt
run: |
cd build && macdeployqt GlyphVisualizer.app -dmg && cd ..
cd build
cp taglib/build/libtag.dylib GlyphVisualizer.app/Contents/Frameworks/
macdeployqt GlyphVisualizer.app -dmg
cd ..
- name: Move and rename executable
run: mv build/GlyphVisualizer.dmg GlyphVisualizer-$(cat .version)_macOS-12-x64.dmg

Expand Down
23 changes: 22 additions & 1 deletion .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,25 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

# Build and install TagLib dependency
- name: Cache TagLib build
id: cache-taglib
uses: actions/cache@v4
with:
path: taglib
key: taglib-${{ runner.os }}-${{ hashFiles('.github/workflows/build-windows.yml') }}
- name: Build TagLib
if: ${{ steps.cache-taglib.outputs.cache-hit != 'true' }}
run: |
git clone --depth 1 --branch v2.0 https://github.com/taglib/taglib.git
cd taglib
git submodule update --init
cmake -G Ninja -DBUILD_SHARED_LIBS=ON -DWITH_ZLIB=OFF -DCMAKE_BUILD_TYPE=Release -S . -B build
cmake --build build --config Release
cd ..
- name: Install TagLib
run: cmake --install taglib/build

# Update project version
- name: Cache Node modules
uses: actions/cache@v4
Expand All @@ -54,7 +73,9 @@ jobs:
# TODO: Use NSIS to create an installer (Extract files, silently install vc_redist.x64.exe, create start menu entry, etc.)
- name: Package with windeployqt and zip
run: |
mkdir GlyphVisualizer-$((Get-Content .version))_windows-x64-portable && mv build\GlyphVisualizer.exe GlyphVisualizer-$((Get-Content .version))_windows-x64-portable && windeployqt --release GlyphVisualizer-$((Get-Content .version))_windows-x64-portable\GlyphVisualizer.exe
mkdir GlyphVisualizer-$((Get-Content .version))_windows-x64-portable && mv build\GlyphVisualizer.exe GlyphVisualizer-$((Get-Content .version))_windows-x64-portable
copy taglib/build/taglib/Release/tag.dll GlyphVisualizer-$((Get-Content .version))_windows-x64-portable
windeployqt --release GlyphVisualizer-$((Get-Content .version))_windows-x64-portable\GlyphVisualizer.exe
Compress-Archive -Path GlyphVisualizer-$((Get-Content .version))_windows-x64-portable -DestinationPath GlyphVisualizer-$((Get-Content .version))_windows-x64-portable.zip
# Calculate the checksum
Expand Down
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Svg)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Multimedia)
# Include TagLib
find_package(TagLib 2.0.0 REQUIRED)

set(PROJECT_SOURCES
src/main.cpp
Expand Down Expand Up @@ -57,6 +59,8 @@ endif()
target_link_libraries(GlyphVisualizer PRIVATE Qt${QT_VERSION_MAJOR}::Widgets)
target_link_libraries(GlyphVisualizer PRIVATE Qt${QT_VERSION_MAJOR}::Svg)
target_link_libraries(GlyphVisualizer PRIVATE Qt${QT_VERSION_MAJOR}::Multimedia)
# Include TagLib
target_link_libraries(GlyphVisualizer PRIVATE TagLib::tag)

# Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1.
# If you are developing for iOS or macOS you should consider setting an
Expand Down
55 changes: 45 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
# :grey_question: What is this? Why would I need that?
This is a tool that is meant to be used in combination with my [custom-nothing-glyph-tools](https://github.com/SebiAi/custom-nothing-glyph-tools/) scripts (*GlyphTranslator*, *GlyphModder*). When you create a custom ringtone or notification tone with these scripts, you want to test them as often as possible. You can use this tool to visualize your composition and rapidly iterate on it - no file transfer to your phone is needed.

And apart from that, you can use it if you want to view the composition without having access to a Nothing Phone.
**And apart from that, you can use it if you want to view the composition without having access to a Nothing Phone.**

***

Expand All @@ -89,12 +89,33 @@ You can find the full roadmap [here](https://github.com/users/SebiAi/projects/5)

<!-- TOC --><a name="heading-rocket-how-to-use"></a>
# :rocket: How to use
For now, you need to use the [custom-nothing-glyph-tools](https://github.com/SebiAi/custom-nothing-glyph-tools/) to extract the light data (csv/glypha) from the audio file:
1. Download and extract the custom-nothing-glyph-tools: [Download](https://github.com/SebiAi/custom-nothing-glyph-tools/archive/refs/heads/main.zip)
2. Install the requirements for custom-nothing-glyph-tools: [Tutorial](https://github.com/SebiAi/custom-nothing-glyph-tools#memo-requirements)
3. Use the *GlyphModder* script to extract the light data: [Tutorial](https://github.com/SebiAi/custom-nothing-glyph-tools#read-from-an-audio-file)

Now pass the original composition audio and the extracted light data to the software and it will play it back.
## Audio only (Recommended)
Only the composition itself is needed:
1. Open *GlyphVisualizer*
2. Go to *File*->*Open Composition* OR press <kbd>CTRL</kbd> + <kbd>O</kbd>
3. Make sure ***Audio file (ogg)*** is selected
4. Select your composition and hit *Open*

## Audio file and Light data file
This is mode is for composition creators which use the [custom-nothing-glyph-tools](https://github.com/SebiAi/custom-nothing-glyph-tools/):

1. Export your Audio from Audacity with the opus codec and change the extension from `.opus` to `.ogg` (Make sure that you show [File name extensions](https://www.howtogeek.com/205086/beginner-how-to-make-windows-show-file-extensions/) on Windows!)
2. Export your Label file from Audacity
3. Use the *GlyphTranslator.py* script to get the `.glypha` file
4. Open *GlyphVisualizer*
5. Go to *File*->*Open Composition* OR press <kbd>CTRL</kbd> + <kbd>O</kbd>
6. Make sure ***Audio file (ogg) + Light data file (glypha)*** is selected
7. Select your Audio, your `.glypha` file and hit *Open*

> [!TIP]
> If your Audio file and your `.glypha` file are
> * in the same directory and
> * have the same name
>
> then *GlyphVisualizer* will automatically fill in the path for the `.glypha` file.
## Audio file and Audacity Label file
This mode is **not implemented yet**. Please wait for an update.

***

Expand Down Expand Up @@ -130,11 +151,12 @@ Now pass the original composition audio and the extracted light data to the soft
# :construction: Compilation
<!-- TOC --><a name="heading-nut_and_bolt-build-dependencies"></a>
## :nut_and_bolt: Build Dependencies
You can use the Qt Online Installer to install all the build dependencies.
* [Qt 6.6.0](https://www.qt.io/download)
You can use the Qt Online Installer to install Qt, Ninja, CMake and a C++ compiler
* [Qt 6.6.0](https://www.qt.io/download-open-source#hs_cos_wrapper_widget_1567539130992)
* [Ninja](https://ninja-build.org/)
* [CMake](https://cmake.org/)
* A compiler like g++ or MSVC depending on your OS
* [TagLib 2.0](https://github.com/taglib/taglib/tree/v2.0) **without** ZLIB

<!-- TOC --><a name="heading-hammer_and_pick-build"></a>
## :hammer_and_pick: Build
Expand All @@ -143,12 +165,17 @@ Clone the repo
git clone https://github.com/SebiAi/GlyphVisualizer.git
cd GlyphVisualizer
```
Set `DCMAKE_PREFIX_PATH` to the Qt location and build the application
Set `DCMAKE_PREFIX_PATH` to the Qt location and build the application (This command assumes that the libraries like *TagLib* are properly installed and can be found by CMake)
```bash
cmake -G Ninja "-DCMAKE_PREFIX_PATH=/path/to/qt" "-DCMAKE_BUILD_TYPE:STRING=Release" -S . -B build && cmake --build build --config Release
```
The built application is now in the `build` directory.

> [!WARNING]
> The built application might not open right out of the box because dynamically linked libraries are not available without proper setup.
>
> See [:package: Package up](#heading-package-package-up) to fix that.
<!-- TOC --><a name="heading-package-package-up"></a>
## :package: Package up
The application itself may not execute because it is not finding the linked libraries. Packaging guarantees that the application finds them and runs as expected.
Expand All @@ -159,6 +186,10 @@ Move the application to its own directory
mkdir GlyphVisualizer-main_windows-x64-portable
move build/GlyphVisualizer GlyphVisualizer-main_windows-x64-portable
```
Copy the built *TagLib* dll into the directory
```batch
copy C:\path\to\tag.dll GlyphVisualizer-main_windows-x64-portable
```
Use [windeployqt](https://doc.qt.io/qt-6/windows-deployment.html)
```batch
windeployqt --release GlyphVisualizer-main_windows-x64-portable\GlyphVisualizer.exe
Expand Down Expand Up @@ -189,6 +220,10 @@ Navigate to the build folder
```bash
cd build
```
Copy the built *TagLib* into the directory
```batch
copy /path/to/libtag.dylib GlyphVisualizer.app/Contents/Frameworks/
```
Use [macdeployqt](https://doc.qt.io/qt-6/macos-deployment.html#the-mac-deployment-tool)
```bash
macdeployqt GlyphVisualizer.app -dmg
Expand Down
Loading

0 comments on commit fb4f04b

Please sign in to comment.