Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
0b58be2
Raise() the LogWindow after calling Show(). Otherwise the log
kwhite-uottawa Nov 19, 2024
3f1d122
Load a .organ file if it is specified on the command line.
kwhite-uottawa Nov 20, 2024
8ee59c8
Add a FreeBSD audio/goodf directory tree.
kwhite-uottawa Nov 20, 2024
c0ff2d7
Update release.yml
kwhite-uottawa Nov 20, 2024
12a5360
Only trigger release builds by hand
kwhite-uottawa Nov 20, 2024
a8439fb
wxFileName.GetAbsolutePath() is available on wx 3.1.6 and above. This
kwhite-uottawa Nov 20, 2024
28e51e0
Merge branch 'master' of https://github.com/kwhite-uottawa/GoOdf
kwhite-uottawa Nov 20, 2024
fb4dfa6
Update the FreeBSD port files.
kwhite-uottawa Nov 20, 2024
10b7d34
Use WX 3.0 to be compatible with the ubuntu-20.04 build
kwhite-uottawa Nov 21, 2024
ff81740
Don't log the specifal files "DUMMY" and "REF:*"
kwhite-uottawa Nov 23, 2024
354693f
Create TestFreebsd.yml
kwhite-uottawa Nov 29, 2024
5c4d432
Update src/GOODFFunctions.h
kwhite-uottawa Nov 29, 2024
3a34eaa
Update src/GOODFFunctions.h
kwhite-uottawa Nov 29, 2024
cd6f714
Rename SHOWLOGWINDOW to SHOW_LOG_WINDOW
kwhite-uottawa Nov 29, 2024
fc57885
Revert c0ff2d7
kwhite-uottawa Nov 29, 2024
8c20781
Revert 8ee59c8 354693f FreeBSD testing does not belong in master.
kwhite-uottawa Nov 29, 2024
1f5faeb
Revert the change to removeBaseOdfPath() that was part of 0b58be2.
kwhite-uottawa Nov 30, 2024
1f1178d
Make the logWindow visible if anything has been logged. Otherwise
kwhite-uottawa Nov 30, 2024
382de96
Display a warning dialog if adding any attack or release will set
kwhite-uottawa Dec 1, 2024
abfd215
The original error report was that the log window may be obscured
kwhite-uottawa Dec 1, 2024
e5a6f99
Revert the SHOW_LOG_WINDOW changes. The macro is no longer needed.
kwhite-uottawa Dec 3, 2024
e6526bf
Merge branch 'GrandOrgue:master' into master
kwhite-uottawa Mar 10, 2025
79361e8
Add back a workflow FreeBSD test, only rebuild on workflow_dispatch
kwhite-uottawa Mar 13, 2025
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
32 changes: 32 additions & 0 deletions .github/workflows/TestFreebsd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Test

on: [workflow_dispatch]

jobs:
test:
runs-on: ubuntu-latest
name: A job to run test in FreeBSD
env:
MYTOKEN : ${{ secrets.MYTOKEN }}
MYTOKEN2: "value2"
steps:
- uses: actions/checkout@v4
- name: Test in FreeBSD
id: test
uses: vmactions/freebsd-vm@v1
with:
envs: 'MYTOKEN MYTOKEN2'
usesh: true
prepare: |
pkg install -y curl

run: |
pwd
ls -lah
whoami
env
freebsd-version
sysctl hw.model
sysctl hw.ncpu
sysctl hw.physmem
sysctl hw.usermem
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Release

on: [push]
on: [workflow_dispatch]

permissions:
contents: write
Expand All @@ -10,7 +10,7 @@ env:

jobs:
build-linux:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4
Expand All @@ -34,7 +34,7 @@ jobs:
path: ${{github.workspace}}/build/GoOdf*.tar.gz

build-appimage:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -77,7 +77,7 @@ jobs:


build-cross-windows:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4
Expand Down
11 changes: 11 additions & 0 deletions src/GOODF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,17 @@ bool GOODF::OnInit() {
// Show the frame
m_frame->Show(true);

// if a <file.organ> command line argument exists, try opening it as an organ file
if (wxApp::argc > 1) {
wxFileName f_name(wxApp::argv[1]);
if (f_name.Exists() && f_name.GetExt().IsSameAs("organ", false)) { // ignore case
// might like to use GetAbsolutePath() here, but it's only available in wx 3.1.6 or above
if (f_name.MakeAbsolute()) {
m_frame->DoOpenOrgan(f_name.GetFullPath());
}
}
}

// Start the event loop
return true;
}
Expand Down
2 changes: 2 additions & 0 deletions src/GOODFFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,8 @@ void GOODFFrame::DoOpenOrgan(wxString filePath) {
m_organTreeCtrl->SelectItem(tree_organ);
SetImportXfadeMenuItemState();
this->Raise();
if (m_logWindow->GetFrame()->IsShown())
m_logWindow->GetFrame()->Raise();
}

void GOODFFrame::OrganTreeChildItemLabelChanged(wxString label) {
Expand Down
4 changes: 3 additions & 1 deletion src/GOODFFunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,16 @@ namespace GOODF_functions {
}

inline wxString checkIfFileExist(wxString relativePath, Organ *currentOrgan) {
if (relativePath != wxEmptyString) {
if (relativePath != wxEmptyString && !relativePath.IsSameAs("DUMMY") && !relativePath.StartsWith("REF:")) { // don't need to check special "DUMMY" or "REF:" filenames
if (relativePath.StartsWith(wxT("./")) || relativePath.StartsWith(wxT(".\\")))
relativePath.erase(0, 2);
wxString fullFilePath = currentOrgan->getOdfRoot() + wxFILE_SEP_PATH + relativePath;
wxFileName theFile = wxFileName(fullFilePath, wxPATH_DOS);
if (theFile.FileExists()) {
return theFile.GetFullPath();
}
wxLogWarning("%s does not exist. Removed from .organ file", relativePath);
::wxGetApp().m_frame->GetLogWindow()->Show(true);
}
return wxEmptyString;
}
Expand Down
83 changes: 83 additions & 0 deletions src/Rank.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
#include "GOODFFunctions.h"
#include <wx/unichar.h>

#define TREMULANT_MESSAGE do { \
wxMessageDialog msg(::wxGetApp().m_frame, wxT("Warning: A mix of tremulant and non-tremulant pipes in a rank."), wxT("Pipe Tremulants Warning"), wxOK|wxCENTRE|wxICON_EXCLAMATION); \
msg.ShowModal(); \
} while(0)
#define MIXED_TREMULANTS(a, b) (((a) && (b) == -1) || (!(a) && (b) != -1))

Rank::Rank() {
name = wxT("New Rank");
firstMidiNoteNumber = 36;
Expand Down Expand Up @@ -725,6 +731,7 @@ void Rank::addToPipes(
int totalNbrOfPipes
) {
bool organRootPathIsSet = false;
bool hadIgnoreTremulant = false;

if (::wxGetApp().m_frame->m_organ->getOdfRoot() != wxEmptyString)
organRootPathIsSet = true;
Expand Down Expand Up @@ -797,6 +804,17 @@ void Rank::addToPipes(

// if there are any matching attacks we add them
if (!pipeAttacksToAdd.IsEmpty()) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that all this (in more or less every place it's done) and the relevant macros perhaps would be better done as a public function of a Pipe. Then one could just ask the Pipe if it has conflicting isTremulant values in the attacks and save a few repeated lines. The function would just return a bool value which in turn would decide whether to trigger the warning message or not.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And possibly fire that message dialog itself as well...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And possibly fire that message dialog itself as well...

That had occurred to me too. I'm not a C++ programmer. Even though I certainly understand and agree with what you're saying (public function of Pipe, etc.) implementation might take me some figuring out.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, as a message dialog would block the execution, it could be better for the flow to just log the warning and proceed.

// set the warning flag if any previous attack is different than (hasTremulantFolders || loadPipesAsTremOff)
if (p->m_attacks.size() > 0) {
for (std::list<Attack>::iterator attack = p->m_attacks.begin(); attack != p->m_attacks.end(); attack++) {
if (MIXED_TREMULANTS(hasTremulantFolders || loadPipesAsTremOff, attack->isTremulant)) {
hadIgnoreTremulant = true;
break;
}
}
}

for (unsigned j = 0; j < pipeAttacksToAdd.GetCount(); j++) {
wxString relativeFileName;
if (organRootPathIsSet)
Expand Down Expand Up @@ -846,6 +864,16 @@ void Rank::addToPipes(
// if there are any matching releases we add them
if (!pipeReleasesToAdd.IsEmpty()) {

// set the warning flag if any previous release is different than (hasTremulantFolders || loadPipesAsTremOff)
if (p->m_releases.size() > 0) {
for (std::list<Release>::iterator release = p->m_releases.begin(); release != p->m_releases.end(); release++) {
if (MIXED_TREMULANTS(hasTremulantFolders || loadPipesAsTremOff, release->isTremulant)) {
hadIgnoreTremulant = true;
break;
}
}
}

for (unsigned k = 0; k < pipeReleasesToAdd.GetCount(); k++) {
wxString relativeFileName;
if (organRootPathIsSet)
Expand Down Expand Up @@ -975,6 +1003,17 @@ void Rank::addToPipes(

// if there are any matching releases we add them
if (!pipeReleasesToAdd.IsEmpty()) {

// set the warning flag if any previous release is different than (hasTremulantFolders || loadPipesAsTremOff)
if (p->m_releases.size() > 0) {
for (std::list<Release>::iterator release = p->m_releases.begin(); release != p->m_releases.end(); release++) {
if (MIXED_TREMULANTS(true, release->isTremulant)) {
hadIgnoreTremulant = true;
break;
}
}
}

for (unsigned k = 0; k < pipeReleasesToAdd.GetCount(); k++) {
wxString relativeFileName;
if (organRootPathIsSet)
Expand Down Expand Up @@ -1020,6 +1059,9 @@ void Rank::addToPipes(
}
count++;
}
if (hadIgnoreTremulant) {
TREMULANT_MESSAGE;
}
}

void Rank::addTremulantToPipes(
Expand All @@ -1034,6 +1076,7 @@ void Rank::addTremulantToPipes(
) {
// This method is for adding additional attacks/releases as (wave) tremulants only
bool organRootPathIsSet = false;
bool hadIgnoreTremulant = false;

if (::wxGetApp().m_frame->m_organ->getOdfRoot() != wxEmptyString)
organRootPathIsSet = true;
Expand Down Expand Up @@ -1100,6 +1143,17 @@ void Rank::addTremulantToPipes(

// if there are any matching attacks we add them
if (!pipeAttacksToAdd.IsEmpty()) {

// set the warning flag if any previous attack ignores wave tremulant
if (p->m_attacks.size() > 0) {
for (std::list<Attack>::iterator attack = p->m_attacks.begin(); attack != p->m_attacks.end(); attack++) {
if (MIXED_TREMULANTS(true, attack->isTremulant)) {
hadIgnoreTremulant = true;
break;
}
}
}

for (unsigned j = 0; j < pipeAttacksToAdd.GetCount(); j++) {
wxString relativeFileName;
if (organRootPathIsSet)
Expand Down Expand Up @@ -1155,6 +1209,16 @@ void Rank::addTremulantToPipes(
else
relativeFileName = pipeReleasesToAdd.Item(k);

// set the warning flag if any previous release ignores wave tremulant
if (p->m_releases.size() > 0) {
for (std::list<Release>::iterator release = p->m_releases.begin(); release != p->m_releases.end(); release++) {
if (MIXED_TREMULANTS(true, release->isTremulant)) {
hadIgnoreTremulant = true;
break;
}
}
}

// create and add the release to the pipe
Release rel;
rel.fileName = relativeFileName;
Expand Down Expand Up @@ -1197,6 +1261,10 @@ void Rank::addTremulantToPipes(
}
count++;
}

if (hadIgnoreTremulant) {
TREMULANT_MESSAGE;
}
}

void Rank::addReleasesToPipes(
Expand All @@ -1207,6 +1275,7 @@ void Rank::addReleasesToPipes(
) {
// This method is for adding releases only from a single folder
bool organRootPathIsSet = false;
bool hadIgnoreTremulant = false;

if (::wxGetApp().m_frame->m_organ->getOdfRoot() != wxEmptyString)
organRootPathIsSet = true;
Expand Down Expand Up @@ -1241,6 +1310,17 @@ void Rank::addReleasesToPipes(

// if there are any matching attacks we add them
if (!pipeReleasesToAdd.IsEmpty()) {

// set the warning flag if any previous release is different than loadPipeAsTremOff
if (p->m_releases.size() > 0) {
for (std::list<Release>::iterator release = p->m_releases.begin(); release != p->m_releases.end(); release++) {
if (MIXED_TREMULANTS(loadPipesAsTremOff, release->isTremulant)) {
hadIgnoreTremulant = true;
break;
}
}
}

for (unsigned j = 0; j < pipeReleasesToAdd.GetCount(); j++) {
wxString relativeFileName;
if (organRootPathIsSet)
Expand All @@ -1264,6 +1344,9 @@ void Rank::addReleasesToPipes(
pipeReleasesToAdd.Empty();
count++;
}
if (hadIgnoreTremulant) {
TREMULANT_MESSAGE;
}
}

void Rank::clearAllPipes() {
Expand Down