Skip to content

Commit

Permalink
Merge pull request #162 from technosf/development
Browse files Browse the repository at this point in the history
v1.5.5 Beta 4
  • Loading branch information
technosf authored Nov 7, 2024
2 parents dc9207f + fc03340 commit 7e307b5
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 40 deletions.
76 changes: 51 additions & 25 deletions DEVELOP.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,25 @@ Discover and Listen to your favourite internet radio stations, and add improve t
- [Tuner Development](#tuner-development)
- [Dependencies](#dependencies)
- [Building the Tuner App From Source](#building-the-tuner-app-from-source)
- [Building the Tuner Flatpak](#building-the-tuner-flatpak)
- [Readying code for a Pull Request](#readying-code-for-a-pull-request)
- [NamingConventions](#namingconventions)
- [Building the Tuner Flatpak](#building-the-tuner-flatpak)
- [Debugging](#debugging)
- [VSCode](#vscode)
- [Bug Introduction](#bug-introduction)
- [Bug Introduction Deduction](#bug-introduction-deduction)
- [Release Process](#release-process)
- [Beta Releases](#beta-releases)
- [Production Releases](#production-releases)


## Overview

**_Tuner_** is hosted on Github, packaged as a Flatpak and distributed by Flathub. **_Tuner_** is writen in [Vala](https://vala.dev/), a C#/Java/JavaFX-like language with a self-hosting compiler that generates C code and uses the GObject type system and wrapping a number of GTK libraries. It uses [Meson](https://mesonbuild.com/) as its build system.
**_Tuner_** is hosted on [Github](https://github.com/louis77/tuner), packaged as a Flatpak and distributed by Flathub. **_Tuner_** is writen in [Vala](https://vala.dev/), a C#/Java/JavaFX-like language with a self-hosting compiler that generates C code and uses the GObject type system and wrapping a number of GTK libraries. It uses [Meson](https://mesonbuild.com/) as its build system.

**_Tuner_** has not undergone a lot of attention in a while, and would benefit from a review with an eye to refactoring and cleaning up the code, while in the short term addressing known bugs and fixing basic functional issues, documentation and also making it easier to build and test.

## Tuner Development
Hosted on Github, the _main_ branch reflects the current stable release. The _development_ branch is the development branch. Pull Requests should be made against the _development_ branch.
Hosted on Github, the _main_ branch reflects the current stable release. The _development_ branch is the development branch and where releases are staged. Pull Requests should be made against the _development_ branch.

### Dependencies

Expand All @@ -46,7 +49,7 @@ sudo apt install libgtk-3-dev libgee-0.8-dev libgranite-dev libgstreamer1.0-dev
```

### Building the Tuner App From Source
There are two build configurations: _debug_ and _release_. The _debug_ build (manifest _com.github.louis77.tuner.debug.yml_) is recommended for development, while the _release_ build (manifest _com.github.louis77.tuner.yml_) is for distribution. Build instructions will focus on the _debug_ build.
There are two build configurations: _debug_ and _release_. The _debug_ build (manifest _com.github.louis77.tuner.debug.yml_) is recommended for development, while the _release_ build (manifest _com.github.louis77.tuner.yml_) is for distribution. Build instructions will focus on the _debug_ build. Copy the required manifest to _com.github.louis77.tuner.xml_ before building.


Clone the repo and drop into the Tuner directory:
Expand All @@ -69,6 +72,26 @@ meson configure -Dprefix=/usr
sudo ninja install
```


### Building the Tuner Flatpak
Tuner uses the __elementary.io__ platform, version __8__. To build the tuner flatpak, install the elementry SDK and Platform:
```bash
apt-get install flatpak-builder
flatpak remote-add --user --if-not-exists elementary https://flatpak.elementary.io/repo.flatpakrepo
flatpak install elementary io.elementary.Sdk//8 io.elementary.Platform//8
```

Build the flatpak in the _user_ scope:
```bash
flatpak-builder --force-clean --user --sandbox --install build-dir com.github.louis77.tuner.debug.yml
```

Run the Tuner flatpack:
```bash
flatpak --user run com.github.louis77.tuner
```
Check the app version to ensure that it matches the version in the manifest.

### Readying code for a Pull Request
Before a pull request can be accepted, the code must pass linting. This is done by running the following command:
```bash
Expand All @@ -91,7 +114,9 @@ Ensure that the CI checks pass before pushing your changes.


### NamingConventions

Going forward, all new code should conform to the following naming conventions:

- Namespaces are named in camel case: NameSpaceName
- Classes are named in camel case: ClassName
- Method names are all lowercase and use underscores to separate words: method_name
Expand All @@ -102,25 +127,6 @@ Going forward, all new code should conform to the following naming conventions:
<!---- Signals are named all lowercase and use underscores to separate words postfixed with \_sig: propertyName_sig -->


## Building the Tuner Flatpak
Tuner uses the __elementary.io__ platform, version __8__. To build the tuner flatpak, install the elementry SDK and Platform:
```bash
apt-get install flatpak-builder
flatpak remote-add --user --if-not-exists elementary https://flatpak.elementary.io/repo.flatpakrepo
flatpak install elementary io.elementary.Sdk//8 io.elementary.Platform//8
```

Build the flatpak in the _user_ scope:
```bash
flatpak-builder --force-clean --user --sandbox --install build-dir com.github.louis77.tuner.debug.yml
```

Run the Tuner flatpack:
```bash
flatpak --user run com.github.louis77.tuner
```
Check the app version to ensure that it matches the version in the manifest.

## Debugging

### VSCode
Expand Down Expand Up @@ -155,11 +161,31 @@ Debugging from VSCode using GDB, set up the launch.json file as follows:
```
_Note:_ Variables appear as pointers, and generated code is not found. Please submit a better config if you have one.

### Bug Introduction
### Bug Introduction Deduction
Knowing when a bug was introduced requires building previous versions and looking for the aberrent behavior. The following commands can be used to check out previous versions of the code:
```bash
git fetch
git tag
git checkout <tag>
```
After checking out the required version, build and run the app as described above.


## Release Process
Releasing _Tuner_ comprises cutting a release of the code in [tuner github](https://github.com/louis77/tuner) and then updating the [flathub repo](https://github.com/flathub/com.github.louis77.tuner) which will automatically have the flatpak generated and rolled to Flathub for distribution.

### Beta Releases
Beta releases should be tagged from the Tuner _development_ branch in with a version number format of _v1.\*.\*-beta.\*_

Once a beta release has been tagged, the Flathub _beta_ branch can be updated via a pull request with the _beta_ tag going into the manifest _.json_, and any patches and documentation updated as needed. The pull request will trigger a flathub build, but will not merge the pull request - pull requests should be merged only if they result in a successful build.

Once the beta is successfully built by flathub it will be available for installation and testing within the user community.

Once a beta roll is deamed a success its pull request can be merged, and a production release can be rolled.

### Production Releases
Production releases are generated from _development_ pull requests into _main_. The updated _main_ branch should be tagged with a version number format of _v1.\*.\*_

Once a release has been tagged, the [flathub repo](https://github.com/flathub/com.github.louis77.tuner) _main_ branch can be updated with the _release_ tag going into the manifest _.json_, and any patches and documentation updated as needed. Updates from the _main_ branch should be copied in from a direct _pull request_ of the _main_ branch. The _main_ branch **should not** come from a merge _beta_ branch to avoid triggering subsequent builds in _beta_ .

Once the main production release is built by flathub it will be available for installation and automatically distributed to user community.
6 changes: 3 additions & 3 deletions src/Services/HttpClient.vala
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ public class Tuner.HttpClient : Object {
if (_session == null)
{
_session = new Soup.Session.with_options(
"max-conns", 30,
"max-conns-per-host", 1 ,
"timeout", 2,
"max-conns", 50,
"max-conns-per-host", 2 ,
"timeout", 3,
"user_agent", @"$(Application.APP_ID)/$(Application.APP_VERSION)"
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Widgets/HeaderBar.vala
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class Tuner.HeaderBar : Gtk.HeaderBar {
private const string DEFAULT_ICON_NAME = "internet-radio-symbolic";

// Search delay in milliseconds
private const int SEARCH_DELAY = 500;
private const int SEARCH_DELAY = 400;

/* Public */

Expand Down
6 changes: 3 additions & 3 deletions src/Widgets/Window.vala
Original file line number Diff line number Diff line change
Expand Up @@ -596,17 +596,17 @@ public class Tuner.Window : Gtk.ApplicationWindow {
*/
private async void load_search_stations(string searchText, ContentBox contentBox) {

warning(@"Searching for: $(searchText)");
warning(@"Searching for: $(searchText)"); // FIXME warnings to debugs
var station_source = _directory.load_search_stations(searchText, 100);
warning(@"Search done");

try {
var stations = station_source.next();
debug(@"Search Next done");
warning(@"Search Next done");
if (stations == null || stations.size == 0) {
contentBox.show_nothing_found();
} else {
debug(@"Search found $(stations.size) stations");
warning(@"Search found $(stations.size) stations");
var _slist = new StationList.with_stations(stations);
_slist.selection_changed.connect(handle_station_click);
_slist.favourites_changed.connect(handle_favourites_changed);
Expand Down
21 changes: 13 additions & 8 deletions tuner.mm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<map version="freeplane 1.12.1">
<!--To view this file, download free mind mapping software Freeplane from https://www.freeplane.org -->
<node TEXT="Tuner" LOCALIZED_STYLE_REF="AutomaticLayout.level.root" FOLDED="false" ID="ID_450036530" CREATED="1727737739945" MODIFIED="1728883580142"><hook NAME="MapStyle" zoom="1.1">
<node TEXT="Tuner" LOCALIZED_STYLE_REF="AutomaticLayout.level.root" FOLDED="false" ID="ID_450036530" CREATED="1727737739945" MODIFIED="1730940226909"><hook NAME="MapStyle" zoom="1.3310001">
<properties edgeColorConfiguration="#808080ff,#ff0000ff,#0000ffff,#00ff00ff,#ff00ffff,#00ffffff,#7c0000ff,#00007cff,#007c00ff,#7c007cff,#007c7cff,#7c7c00ff" show_icon_for_attributes="true" show_tags="UNDER_NODES" show_note_icons="true" fit_to_viewport="false" showTagCategories="false"/>
<tags category_separator="::"/>

Expand Down Expand Up @@ -84,7 +84,7 @@
<hook NAME="FreeNode"/>
</node>
<node TEXT="Main" LOCALIZED_STYLE_REF="AutomaticLayout.level,2" POSITION="top_or_left" ID="ID_465398489" CREATED="1727738469247" MODIFIED="1727740624996">
<arrowlink DESTINATION="ID_290939604" STARTINCLINATION="32.86957 pt;-1.56522 pt;" ENDINCLINATION="28.17391 pt;0 pt;"/>
<arrowlink DESTINATION="ID_290939604" STARTINCLINATION="32.86957 pt;-1.04348 pt;" ENDINCLINATION="28.17391 pt;0 pt;"/>
</node>
<node TEXT="Application" LOCALIZED_STYLE_REF="styles.topic" POSITION="top_or_left" ID="ID_290939604" CREATED="1727738435067" MODIFIED="1728883348499" HGAP_QUANTITY="28.08696 pt" VSHIFT_QUANTITY="13.56522 pt">
<arrowlink DESTINATION="ID_917337018" MIDDLE_LABEL="initialize" STARTINCLINATION="88.69565 pt;74.6087 pt;" ENDINCLINATION="16.69565 pt;92.34783 pt;"/>
Expand All @@ -108,11 +108,11 @@
<arrowlink DESTINATION="ID_965509116"/>
</node>
</node>
<node TEXT="Widgets" LOCALIZED_STYLE_REF="AutomaticLayout.level,1" POSITION="top_or_left" ID="ID_1027427692" CREATED="1727739279159" MODIFIED="1728885953755" HGAP_QUANTITY="-55.91304 pt" VSHIFT_QUANTITY="113.73913 pt">
<node TEXT="Widgets" LOCALIZED_STYLE_REF="AutomaticLayout.level,1" POSITION="top_or_left" ID="ID_1027427692" CREATED="1727739279159" MODIFIED="1730946643023" HGAP_QUANTITY="-50.69565 pt" VSHIFT_QUANTITY="113.73913 pt">
<cloud COLOR="#f0f0f0" SHAPE="ARC"/>
<node TEXT="Window" LOCALIZED_STYLE_REF="styles.topic" ID="ID_245535496" CREATED="1727739421591" MODIFIED="1727746922190" HGAP_QUANTITY="13.47826 pt">
<arrowlink DESTINATION="ID_290939604" STARTINCLINATION="4.17391 pt;3.13043 pt;" ENDINCLINATION="26.6087 pt;10.95652 pt;"/>
<arrowlink DESTINATION="ID_225020110" STARTINCLINATION="1.56522 pt;-9.91304 pt;" ENDINCLINATION="51.13044 pt;37.04348 pt;"/>
<arrowlink DESTINATION="ID_225020110" STARTINCLINATION="1.56522 pt;-9.3913 pt;" ENDINCLINATION="51.13044 pt;37.04348 pt;"/>
<arrowlink DESTINATION="ID_437534895"/>
<arrowlink DESTINATION="ID_336535153"/>
<arrowlink DESTINATION="ID_334873313"/>
Expand All @@ -128,7 +128,7 @@
<node TEXT="HeaderBar" LOCALIZED_STYLE_REF="styles.topic" ID="ID_1340078318" CREATED="1727741067697" MODIFIED="1728885958322" HGAP_QUANTITY="33.30435 pt" VSHIFT_QUANTITY="19.30435 pt">
<arrowlink DESTINATION="ID_1017974423"/>
<arrowlink DESTINATION="ID_1830209270" STARTINCLINATION="176.86957 pt;0 pt;" ENDINCLINATION="103.30435 pt;0 pt;"/>
<arrowlink DESTINATION="ID_1376123657" STARTINCLINATION="163.82609 pt;0 pt;" ENDINCLINATION="105.39131 pt;-1.56522 pt;"/>
<arrowlink DESTINATION="ID_1376123657" STARTINCLINATION="163.82609 pt;0 pt;" ENDINCLINATION="105.39131 pt;-1.04348 pt;"/>
<cloud COLOR="#f0f0f0" SHAPE="ROUND_RECT"/>
<node TEXT="Station" ID="ID_1911123487" CREATED="1727741254437" MODIFIED="1727746310733" LINK="#ID_931987855"/>
<node TEXT="PlayerState" LOCALIZED_STYLE_REF="styles.subsubtopic" ID="ID_1138557479" CREATED="1727747282932" MODIFIED="1727747295032">
Expand All @@ -150,7 +150,7 @@
<node TEXT="StationList" ID="ID_1676681282" CREATED="1727749335795" MODIFIED="1727845331588" HGAP_QUANTITY="19.21739 pt">
<arrowlink DESTINATION="ID_1161727976"/>
<node TEXT="StationBox" POSITION="top_or_left" ID="ID_1182867903" CREATED="1727751544955" MODIFIED="1727845947534" HGAP_QUANTITY="16.6087 pt" VSHIFT_QUANTITY="-2.08696 pt">
<arrowlink DESTINATION="ID_1847058962" STARTINCLINATION="8.86957 pt;-4.17391 pt;" ENDINCLINATION="55.30435 pt;-4.17391 pt;"/>
<arrowlink DESTINATION="ID_1847058962" STARTINCLINATION="8.86957 pt;-3.65217 pt;" ENDINCLINATION="55.30435 pt;-3.65217 pt;"/>
<node TEXT="Station" ID="ID_186251313" CREATED="1728884627066" MODIFIED="1728884667576" LINK="#ID_931987855"/>
<node TEXT="StationContextMenu" ID="ID_795354378" CREATED="1728884639064" MODIFIED="1728884681924" LINK="#ID_1716872169"/>
</node>
Expand Down Expand Up @@ -178,7 +178,7 @@
<node TEXT="Controllers" LOCALIZED_STYLE_REF="AutomaticLayout.level,1" POSITION="bottom_or_right" ID="ID_14246204" CREATED="1727739311185" MODIFIED="1727740617691">
<cloud COLOR="#f0f0f0" SHAPE="ARC"/>
<node TEXT="PlayerController" LOCALIZED_STYLE_REF="styles.topic" ID="ID_1425332313" CREATED="1727740025432" MODIFIED="1727748170307">
<arrowlink DESTINATION="ID_1914085665" STARTINCLINATION="50.6087 pt;14.08696 pt;" ENDINCLINATION="-62.08696 pt;-11.47826 pt;"/>
<arrowlink DESTINATION="ID_1914085665" STARTINCLINATION="50.6087 pt;14.08696 pt;" ENDINCLINATION="-61.56522 pt;-10.95652 pt;"/>
</node>
<node TEXT="DirectoryController" LOCALIZED_STYLE_REF="styles.topic" ID="ID_965509116" CREATED="1727740936503" MODIFIED="1727740946891">
<node TEXT="StationSource" ID="ID_22615742" CREATED="1727748003638" MODIFIED="1727748009679"/>
Expand All @@ -194,7 +194,8 @@
<node TEXT="IMediaPlayer2" ID="ID_1302286784" CREATED="1727747524626" MODIFIED="1727747544023"/>
</node>
</node>
<node TEXT="RadioBrowser" LOCALIZED_STYLE_REF="styles.topic" ID="ID_798410067" CREATED="1727740249748" MODIFIED="1727740720733">
<node TEXT="RadioBrowser" LOCALIZED_STYLE_REF="styles.topic" ID="ID_798410067" CREATED="1727740249748" MODIFIED="1730947467573">
<arrowlink DESTINATION="ID_1764137641"/>
<cloud COLOR="#f0f0f0" SHAPE="ROUND_RECT"/>
<node TEXT="Client" LOCALIZED_STYLE_REF="styles.subtopic" ID="ID_1122494073" CREATED="1727740308496" MODIFIED="1727748027032">
<arrowlink DESTINATION="ID_965509116" STARTINCLINATION="121.04348 pt;0 pt;" ENDINCLINATION="55.30435 pt;2.08696 pt;"/>
Expand All @@ -216,5 +217,9 @@
<icon BUILTIN="folder"/>
<hook NAME="FreeNode"/>
</node>
<node TEXT="api.radio-browser.info" LOCALIZED_STYLE_REF="AutomaticLayout.level,2" POSITION="bottom_or_right" ID="ID_1764137641" CREATED="1730940210146" MODIFIED="1730946606321" HGAP_QUANTITY="107.47826 pt" VSHIFT_QUANTITY="262.95653 pt">
<hook NAME="FreeNode"/>
<cloud COLOR="#f0f0f0" SHAPE="ARC"/>
</node>
</node>
</map>

0 comments on commit 7e307b5

Please sign in to comment.