Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New cross platform GUI using GTK4 #118

Draft
wants to merge 25 commits into
base: net-6
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
85e417d
A few changes to WinForms stuff
PlatinumLucario Sep 4, 2022
ccdf3a9
Added GTK3 project
PlatinumLucario Sep 4, 2022
7d54bf9
Added MenuBar and methods
PlatinumLucario Sep 9, 2022
566ac66
Added Buttons, SpinButton and Scales
PlatinumLucario Sep 11, 2022
6a5c7b7
Added TreeListView, sequences kinda working, but still needs more work
PlatinumLucario Sep 12, 2022
b6b7b07
Using Gir.Core to make a GTK4 UI
PlatinumLucario Jul 4, 2023
4bec866
Removed SDL2-CS and portaudio-sharp projects.
PlatinumLucario Jul 8, 2023
f90058c
MP2K Engine is now useable in GTK4 GUI
PlatinumLucario Aug 3, 2023
277c1e7
Pause and Stop buttons are now usable
PlatinumLucario Aug 5, 2023
24a950a
A few adjustments
PlatinumLucario Aug 25, 2023
5c13c54
Sync with net-6 branch
PlatinumLucario Nov 19, 2023
037dccb
Merging conflicts
PlatinumLucario Nov 19, 2023
f274d74
Another sync with net-6 branch (didn't realise it wasn't up to date)
PlatinumLucario Nov 19, 2023
2b9db7c
Merge branch 'new-gui-experimental' of https://github.com/PlatinumLuc…
PlatinumLucario Nov 19, 2023
b3e547b
Merged the changes from the net-6 branch properly this time
PlatinumLucario Nov 19, 2023
8a7b7b8
Repairing changes, fixing repo and updating code for new GUI
PlatinumLucario Nov 19, 2023
b0d14fb
[MP2K] Sonic Advance 2
Kermalis Feb 5, 2024
f2c0375
Updated nuget packages
PlatinumLucario Feb 28, 2024
22c6051
Merged changes with upstream net6 branch
PlatinumLucario Feb 28, 2024
56ec3fb
Added PortAudio backend
PlatinumLucario Feb 28, 2024
33b2443
PortAudio buffers are now functional
PlatinumLucario Jul 12, 2024
9e3fdc7
Merged new audio backend (PortAudio)
PlatinumLucario Jul 12, 2024
d245937
Repaired GTK4 GUI
PlatinumLucario Jul 13, 2024
f2a0276
Some fixes
PlatinumLucario Jul 19, 2024
e220aea
Some minor updates and experiments
PlatinumLucario Sep 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -259,4 +259,30 @@ paket-files/

# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
*.pyc
/VG Music Studio - GTK4/share/
/VG Music Studio - Core/GBA/AlphaDream/AlphaDreamChannel.cs
/VG Music Studio - Core/GBA/AlphaDream/Commands.cs
/VG Music Studio - Core/GBA/AlphaDream/Enums.cs
/VG Music Studio - Core/GBA/AlphaDream/Structs.cs
/VG Music Studio - Core/GBA/AlphaDream/Track.cs
/VG Music Studio - Core/GBA/MP2K/Channel.cs
/VG Music Studio - Core/GBA/MP2K/Commands.cs
/VG Music Studio - Core/GBA/MP2K/Enums.cs
/VG Music Studio - Core/GBA/MP2K/Structs.cs
/VG Music Studio - Core/GBA/MP2K/Track.cs
/VG Music Studio - Core/GBA/MP2K/Utils.cs
/VG Music Studio - Core/NDS/DSE/Channel.cs
/VG Music Studio - Core/NDS/DSE/Commands.cs
/VG Music Studio - Core/NDS/DSE/Enums.cs
/VG Music Studio - Core/NDS/DSE/Track.cs
/VG Music Studio - Core/NDS/DSE/Utils.cs
/VG Music Studio - Core/NDS/SDAT/Channel.cs
/VG Music Studio - Core/NDS/SDAT/Commands.cs
/VG Music Studio - Core/NDS/SDAT/Enums.cs
/VG Music Studio - Core/NDS/SDAT/FileHeader.cs
/VG Music Studio - Core/NDS/SDAT/Track.cs
/VG Music Studio - Core/NDS/Utils.cs
/VG Music Studio - MIDI
/.vscode
/ObjectListView
129 changes: 127 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,138 @@ If you want to talk or would like a game added to our configs, join our [Discord
### SDAT Engine
* Find proper formulas for LFO

----
## Building
### Windows
Even though it will build without any issues, since VG Music Studio runs on GTK4 bindings via Gir.Core, it requires some C libraries to be installed or placed within the same directory as the Windows executable (.exe).

Otherwise it will complain upon launch with the following System.TypeInitializationException error:
``DllNotFoundException: Unable to load DLL 'libgtk-4-1.dll' or one of its dependencies: The specified module could not be found. (0x8007007E)``

To avoid this error while debugging VG Music Studio, you will need to do the following:
1. Download and install MSYS2 from [the official website](https://www.msys2.org/), and ensure it is installed in the default directory: ``C:\``.
2. After installation, run the following commands in the MSYS2 terminal: ``pacman -Syy`` to reload the package database, then ``pacman -Syuu`` to update all the packages.
3. Run each of the following commands to install the required packages:
``pacman -S mingw-w64-x86_64-gtk4``
``pacman -S mingw-w64-x86_64-libadwaita``
``pacman -S mingw-w64-x86_64-gtksourceview5``

### macOS
#### Intel (x86-64)
Even though it will build without any issues, since VG Music Studio runs on GTK4 bindings via Gir.Core, it requires some C libraries to be installed or placed within the same directory as the macOS executable.

Otherwise it will complain upon launch with the following System.TypeInitializationException error:
``DllNotFoundException: Unable to load DLL 'libgtk-4-1.dylib' or one of its dependencies: The specified module could not be found. (0x8007007E)``

To avoid this error while debugging VG Music Studio, you will need to do the following:
1. Download and install [Homebrew](https://brew.sh/) with the following macOS terminal command:
``/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"``
This will ensure Homebrew is installed in the default directory, which is ``/usr/local``.
2. After installation, run the following command from the macOS terminal to update all packages: ``brew update``
3. Run each of the following commands to install the required packages:
``brew install gtk4``
``brew install libadwaita``
``brew install gtksourceview5``

#### Apple Silicon (AArch64)
Currently unknown if this will work on Apple Silicon, since it's a completely different CPU architecture, it may need some ARM-specific APIs to build or function correctly.

If you have figured out a way to get it to run under Apple Silicon, please let us know!

### Linux
Most Linux distributions should be able to build this without anything extra to download and install.

However, if you get the following System.TypeInitializationException error upon launching VG Music Studio during debugging:
``DllNotFoundException: Unable to load DLL 'libgtk-4-1.so.0' or one of its dependencies: The specified module could not be found. (0x8007007E)``
Then it means that either ``gtk4``, ``libadwaita`` or ``gtksourceview5`` is missing from your current installation of your Linux distribution. Often occurs if a non-GTK based desktop environment is installed by default, or the Linux distribution has been installed without a GUI.

To install them, run the following commands:
#### Debian (or Debian based distributions, such as Ubuntu, elementary OS, Pop!_OS, Zorin OS, Kali Linux etc.)
First, update the current packages with ``sudo apt update && sudo apt upgrade`` and install any updates, then run:
``sudo apt install libgtk-4-1``
``sudo apt install libadwaita-1``
``sudo apt install libgtksourceview-5``

##### Vanilla OS (Debian based distribution)
Debian based distribution, Vanilla OS, uses the Distrobox based package management system called 'apx' instead of apt (apx as in 'apex', not to be confused with Microsoft Windows's UWP appx packages).
But it is still a Debian based distribution, nonetheless. And fortunately, it comes pre-installed with GNOME, which means you don't need to install any libraries!

You will, however, still need to install the .NET SDK and .NET Runtime using apx, and cannot be used with 'sudo'.

Instead, run any commands to install packages like this:
``apx install [package-name]``

#### Arch Linux (or Arch Linux based distributions, such as Manjaro, Garuda Linux, EndeavourOS, SteamOS etc.)
First, update the current packages with ``sudo pacman -Syy && sudo pacman -Syuu`` and install any updates, then run:
``sudo pacman -S gtk4``
``sudo pacman -S libadwaita``
``sudo pacman -S gtksourceview5``

##### ChimeraOS (Arch based distribution)
Note: Not to be confused with Chimera Linux, the Linux distribution made from scratch with a custom Linux kernel. This one is an Arch Linux based distribution.

Arch Linux based distribution, ChimeraOS, comes pre-installed with the GNOME desktop environment. To access it, open the terminal and type ``chimera-session desktop``.

But because it is missing the .NET SDK and .NET Runtime, and the root directory is read-only, you will need to run the following command: ``sudo frzr-unlock``

Then install any required packages like this example: ``sudo pacman -S [package-name]``

Note: Any installed packages installed in the root directory with the pacman utility will be undone when ChimeraOS is updated, due to the way [frzr](https://github.com/ChimeraOS/frzr) functions. Also, frzr may be what inspired Vanilla OS's [ABRoot](https://github.com/Vanilla-OS/ABRoot) utility.

#### Fedora (or other Red Hat based distributions, such as Red Hat Enterprise Linux, AlmaLinux, Rocky Linux etc.)
First, update the current packages with ``sudo dnf check-update && sudo dnf update`` and install any updates, then run:
``sudo dnf install gtk4``
``sudo dnf install libadwaita``
``sudo dnf install gtksourceview5``

#### openSUSE (or other SUSE Linux based distributions, such as SUSE Linux Enterprise, GeckoLinux etc.)
First, update the current packages with ``sudo zypper up`` and install any updates, then run:
``sudo zypper in libgtk-4-1``
``sudo zypper in libadwaita-1-0``
``sudo zypper in libgtksourceview-5-0``

#### Alpine Linux (or Alpine Linux based distributions, such as postmarketOS etc.)
First, update the current packages with ``apk -U upgrade`` to their latest versions, then run:
``apk add gtk4.0``
``apk add libadwaita``
``apk add gtksourceview5``

Please note that VG Music Studio may not be able to build on other CPU architectures (such as AArch64, ppc64le, s390x etc.), since it hasn't been developed to support those architectures yet. Same thing applies for postmarketOS.

#### Puppy Linux
Puppy Linux is an independent distribution that has many variants, each with packages from other Linux distributions.

It's not possible to find the gtk4, libadwaita and gtksourceview5 libraries or their dependencies in the GUI package management tool, Puppy Package Manager. Because Puppy Linux is built to be a portable and lightweight distribution and to be compatible with older hardware. And because of this, it is only possible to find gtk+2 libraries and other legacy dependencies that it relies on.

So therefore, VG Music Studio isn't supported on Puppy Linux.

#### Chimera Linux
Note: Not to be confused with the Arch Linux based distribution named ChimeraOS. This one is completely different and written from scratch, and uses a modified Linux kernel.

Chimera Linux already comes pre-installed with the GNOME desktop environment and uses the Alpine Package Kit. If you need to install any necessary packages, run the following command example:
``apk add [package-name]``

#### Void Linux
First, update the current packages with ``sudo xbps-install -Su`` to their latest versions, then run:
``sudo xbps-install gtk4``
``sudo xbps-install libadwaita``
``sudo xbps-install gtksourceview5``

### FreeBSD
It may be possible to build VG Music Studio on FreeBSD (and FreeBSD based operating systems), however this section will need to be updated with better accuracy on how to build on this platform.

If your operating system is FreeBSD, or is based on FreeBSD, the [portmaster](https://cgit.freebsd.org/ports/tree/ports-mgmt/portmaster/) utility will need to be installed before installing ``gtk40``, ``libadwaita`` and ``gtksourceview5``. A guide on how to do so can be found [here](https://docs.freebsd.org/en/books/handbook/ports/).

Once installed and configured, run the following commands to install these ports:
``portmaster -PP gtk40``
``portmaster -PP libadwaita``
``portmaster -PP gtksourceview5``

----
## Special Thanks To:
### General
* Stich991 - Italian translation
* tuku473 - Design suggestions, colors, Spanish translation
* Lachesis - French translation
* Delusional Moonlight - Russian translation

### AlphaDream Engine
* irdkwia - Finding games that used the engine
Expand Down
41 changes: 0 additions & 41 deletions VG Music Studio - Core/Dependencies/KMIDI.deps.json

This file was deleted.

Binary file removed VG Music Studio - Core/Dependencies/KMIDI.dll
Binary file not shown.
77 changes: 0 additions & 77 deletions VG Music Studio - Core/Dependencies/KMIDI.xml

This file was deleted.

4 changes: 3 additions & 1 deletion VG Music Studio - Core/Engine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ public abstract class Engine : IDisposable

public abstract Config Config { get; }
public abstract Mixer Mixer { get; }
public abstract Mixer_NAudio Mixer_NAudio { get; }
public abstract Player Player { get; }
public abstract bool UseNewMixer { get; }

public virtual void Dispose()
public virtual void Dispose()
{
Config.Dispose();
Mixer.Dispose();
Expand Down
Loading