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

LogWindow sometimes obscured. Some samples added to .organ file with incorrect path. Wave tremulant addition tweak. #109

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
21 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
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
kwhite-uottawa marked this conversation as resolved.
Show resolved Hide resolved

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
2 changes: 1 addition & 1 deletion .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]
kwhite-uottawa marked this conversation as resolved.
Show resolved Hide resolved

permissions:
contents: write
Expand Down
30 changes: 30 additions & 0 deletions portsdir/audio/goodf/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
PORTNAME= goodf
# git clone https://github.com/GrandOrgue/GoOdf; cd GoOdf; git describe --tags `git reflog | sed -e 's/ .*//'`
# v0.15.0-3-g1353c46
DISTVERSIONPREFIX= v
DISTVERSION= 0.15.0
DISTVERSIONSUFFIX= -3-g1353c46
PORTREVISION= 16
CATEGORIES= audio

MAINTAINER= kwhite@uottawa.ca
COMMENT= Create and modify GrandOrgue organ definition files
WWW= https://github.com/GrandOrgue/GoOdf

LICENSE= GPLv3
LICENSE_FILE= ${WRKSRC}/LICENSE.txt

BUILD_DEPENDS= ImageMagick7>0:graphics/ImageMagick7 \
zip>0:archivers/zip

USES= cmake
USE_WX= 3.0+
# use 3.0 to be compatible with ubuntu-20.04 builds on github

USE_GITHUB= yes
GH_PROJECT= GoOdf
GH_ACCOUNT= GrandOrgue
GH_ACCOUNT= kwhite-uottawa
GH_TAGNAME= 28e51e0

.include <bsd.port.mk>
3 changes: 3 additions & 0 deletions portsdir/audio/goodf/distinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
TIMESTAMP = 1732141934
SHA256 (kwhite-uottawa-GoOdf-v0.15.0-3-g1353c46-28e51e0_GH0.tar.gz) = 312e53f0de90065602b87087dbcac35367d2e7fb4fe5a1c091270b3989b3d609
SIZE (kwhite-uottawa-GoOdf-v0.15.0-3-g1353c46-28e51e0_GH0.tar.gz) = 5613696
2 changes: 2 additions & 0 deletions portsdir/audio/goodf/pkg-descr
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
GoOdf is a tool for creating and editing organ definition files
for GrandOrgue.
12 changes: 12 additions & 0 deletions portsdir/audio/goodf/pkg-plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
bin/GoOdf
share/GoOdf/help/help.zip
share/icons/hicolor/32x32/apps/GoOdf.png
share/icons/hicolor/16x16/apps/GoOdf.png
share/icons/hicolor/256x256/apps/GoOdf.png
share/icons/hicolor/1024x1024/apps/GoOdf.png
share/icons/hicolor/512x512/apps/GoOdf.png
share/icons/hicolor/128x128/apps/GoOdf.png
share/icons/hicolor/64x64/apps/GoOdf.png
share/icons/hicolor/48x48/apps/GoOdf.png
share/icons/hicolor/24x24/apps/GoOdf.png
share/GoOdf/applications/GoOdf.desktop
4 changes: 2 additions & 2 deletions src/Divisional.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ void Divisional::read(wxFileConfig *cfg, bool usingOldPanelFormat, Manual *ownin
}
} else {
wxLogError("%s value %s is out of range for divisional '%s' since manual '%s' only lists %u tremulants!", tremNbr, tremId, name, m_owningManual->getName(), m_owningManual->getNumberOfTremulants());
::wxGetApp().m_frame->GetLogWindow()->Show(true);
SHOWLOGWINDOW;
kwhite-uottawa marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
Expand All @@ -168,7 +168,7 @@ void Divisional::read(wxFileConfig *cfg, bool usingOldPanelFormat, Manual *ownin
}
} else {
wxLogError("%s value %s is out of range for divisional '%s' since manual '%s' only lists %u switches!", swNbr, swId, name, m_owningManual->getName(), m_owningManual->getNumberOfGoSwitches());
::wxGetApp().m_frame->GetLogWindow()->Show(true);
SHOWLOGWINDOW;
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Drawstop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void Drawstop::write(wxTextFile *outFile) {
// Issue a warning if function is set to something else than Input and referenced switches is empty
if (!function.IsSameAs(wxT("Input")) && m_switches.empty()) {
wxLogWarning("%s has function %s and should reference some switch(es) but doesn't! The function value will thus not be written to file!", getName(), getFunction());
::wxGetApp().m_frame->GetLogWindow()->Show(true);
SHOWLOGWINDOW;
}
if (defaultToEngaged)
outFile->AddLine(wxT("DefaultToEngaged=Y"));
Expand Down Expand Up @@ -98,7 +98,7 @@ void Drawstop::read(wxFileConfig *cfg, bool usingOldPanelFormat, Organ *readOrga
addSwitchReference(readOrgan->getOrganSwitchAt(swRefNbr - 1));
else {
wxLogWarning("Switch%0.3d (%s) is already added to %s! This additional switch entry will be ignored!", swRefNbr, readOrgan->getOrganSwitchAt(swRefNbr - 1)->getName(), getName());
::wxGetApp().m_frame->GetLogWindow()->Show(true);
SHOWLOGWINDOW;
}
}
}
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: 1 addition & 1 deletion src/GOODFFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ void GOODFFrame::DoOpenOrgan(wxString filePath) {
m_organ->organElementHasChanged(true);
m_organTreeCtrl->SelectItem(tree_organ);
SetImportXfadeMenuItemState();
this->Raise();
// this->Raise(); should not be necessary
kwhite-uottawa marked this conversation as resolved.
Show resolved Hide resolved
}

void GOODFFrame::OrganTreeChildItemLabelChanged(wxString label) {
Expand Down
12 changes: 10 additions & 2 deletions src/GOODFFunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@
#include <wx/filename.h>
#include <vector>
#include "GOODF.h"
// macro to both show and raise the LogWindow
kwhite-uottawa marked this conversation as resolved.
Show resolved Hide resolved
#define SHOWLOGWINDOW do { \
kwhite-uottawa marked this conversation as resolved.
Show resolved Hide resolved
wxLogWindow* w = ::wxGetApp().m_frame->GetLogWindow(); \
w->Show(true); \
w->GetFrame()->Raise(); \
kwhite-uottawa marked this conversation as resolved.
Show resolved Hide resolved
} while (0)

class Organ;

Expand Down Expand Up @@ -62,7 +68,7 @@ namespace GOODF_functions {
inline wxString removeBaseOdfPath(wxString path) {
wxString stringToReturn = path;
wxFileName fName = wxFileName(path);
if (fName.FileExists()) {
if (fName.FileExists() && stringToReturn.StartsWith(wxFILE_SEP_PATH)) {
kwhite-uottawa marked this conversation as resolved.
Show resolved Hide resolved
fName.MakeRelativeTo(::wxGetApp().m_frame->m_organ->getOdfRoot());
stringToReturn = fName.GetFullPath();
if (stringToReturn.StartsWith(wxFILE_SEP_PATH))
Expand All @@ -74,14 +80,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);
kwhite-uottawa marked this conversation as resolved.
Show resolved Hide resolved
SHOWLOGWINDOW;
}
return wxEmptyString;
}
Expand Down
2 changes: 1 addition & 1 deletion src/GoPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ void GoPanel::write(wxTextFile *outFile, unsigned panelNbr) {

if (panelNbr == 0 && nbGUIElements < 1) {
wxLogWarning("Nothing is displayed as a GUI Element on the main panel! Is this really intentional?");
::wxGetApp().m_frame->GetLogWindow()->Show(true);
SHOWLOGWINDOW;
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/Organ.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ void Organ::writeOrgan(wxTextFile *outFile) {
}
if (m_Windchestgroups.empty()) {
wxLogWarning("There are no windchestgroups in the organ! The .organ file won't be functional!");
::wxGetApp().m_frame->GetLogWindow()->Show(true);
SHOWLOGWINDOW;
}

// Couplers
Expand Down Expand Up @@ -223,7 +223,7 @@ void Organ::writeOrgan(wxTextFile *outFile) {
for (auto& sw : m_Switches) {
if (sw.getFunction().IsSameAs(wxT("Input")) && !isElementReferenced(&sw)) {
wxLogWarning("Switch %s has function Input but is not referenced anywhere.", sw.getName());
::wxGetApp().m_frame->GetLogWindow()->Show(true);
SHOWLOGWINDOW;
}
wxString switchId = wxT("[Switch") + GOODF_functions::number_format(i) + wxT("]");
outFile->AddLine(switchId);
Expand Down
34 changes: 17 additions & 17 deletions src/OrganFileParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ void OrganFileParser::parseOrganSection() {
m_organ->getOrganPanelAt(0)->addImage(img);
else {
wxLogWarning("%s is not possible to parse and use!", imgGroupName);
::wxGetApp().m_frame->GetLogWindow()->Show(true);
SHOWLOGWINDOW;
}
}
}
Expand All @@ -220,7 +220,7 @@ void OrganFileParser::parseOrganSection() {
createGUILabel(m_organ->getOrganPanelAt(0));
} else {
wxLogWarning("%s couldn't be found!", labelGroupName);
::wxGetApp().m_frame->GetLogWindow()->Show(true);
SHOWLOGWINDOW;
}
}
m_organFile->SetPath("/Organ");
Expand Down Expand Up @@ -253,7 +253,7 @@ void OrganFileParser::parseOrganSection() {
}
} else {
wxLogWarning("%s couldn't be found!", enclosureGroupName);
::wxGetApp().m_frame->GetLogWindow()->Show(true);
SHOWLOGWINDOW;
}
}
m_organFile->SetPath("/Organ");
Expand All @@ -277,7 +277,7 @@ void OrganFileParser::parseOrganSection() {
}
} else {
wxLogWarning("%s couldn't be found!", switchGroupName);
::wxGetApp().m_frame->GetLogWindow()->Show(true);
SHOWLOGWINDOW;
}
}
m_organFile->SetPath("/Organ");
Expand All @@ -301,7 +301,7 @@ void OrganFileParser::parseOrganSection() {
}
} else {
wxLogWarning("%s couldn't be found!", tremGroupName);
::wxGetApp().m_frame->GetLogWindow()->Show(true);
SHOWLOGWINDOW;
}
}
m_organFile->SetPath("/Organ");
Expand All @@ -321,14 +321,14 @@ void OrganFileParser::parseOrganSection() {
m_organ->addWindchestgroup(windchest);
} else {
wxLogWarning("%s couldn't be found!", windchestGroupName);
::wxGetApp().m_frame->GetLogWindow()->Show(true);
SHOWLOGWINDOW;
}
}
m_organFile->SetPath("/Organ");
}
if (nbrWindchests == 0) {
wxLogWarning("There are no windchestgroups in the organ! The .organ file won't be functional until at least one windchestgroup exist!");
::wxGetApp().m_frame->GetLogWindow()->Show(true);
SHOWLOGWINDOW;
}

// parse ranks
Expand All @@ -351,13 +351,13 @@ void OrganFileParser::parseOrganSection() {
rankUsesLegacyXfades = true;
}
if (rankUsesLegacyXfades) {
::wxGetApp().m_frame->GetLogWindow()->Show(true);
SHOWLOGWINDOW;
break;
}
}
} else {
wxLogWarning("%s couldn't be found!", rankGroupName);
::wxGetApp().m_frame->GetLogWindow()->Show(true);
SHOWLOGWINDOW;
}
}
m_organFile->SetPath("/Organ");
Expand Down Expand Up @@ -394,7 +394,7 @@ void OrganFileParser::parseOrganSection() {
}
} else {
wxLogWarning("%s couldn't be found!", manGroupName);
::wxGetApp().m_frame->GetLogWindow()->Show(true);
SHOWLOGWINDOW;
}
}

Expand Down Expand Up @@ -446,7 +446,7 @@ void OrganFileParser::parseOrganSection() {
}
} else {
wxLogWarning("%s couldn't be found!", pistonGroupName);
::wxGetApp().m_frame->GetLogWindow()->Show(true);
SHOWLOGWINDOW;
}
}
m_organFile->SetPath("/Organ");
Expand All @@ -470,7 +470,7 @@ void OrganFileParser::parseOrganSection() {
}
} else {
wxLogWarning("%s couldn't be found!", divCplrGroupName);
::wxGetApp().m_frame->GetLogWindow()->Show(true);
SHOWLOGWINDOW;
}
}
m_organFile->SetPath("/Organ");
Expand All @@ -494,7 +494,7 @@ void OrganFileParser::parseOrganSection() {
}
} else {
wxLogWarning("%s couldn't be found!", generalGroupName);
::wxGetApp().m_frame->GetLogWindow()->Show(true);
SHOWLOGWINDOW;
}
}
m_organFile->SetPath("/Organ");
Expand All @@ -517,7 +517,7 @@ void OrganFileParser::parseOrganSection() {
}
} else {
wxLogWarning("%s couldn't be found!", setterGroupName);
::wxGetApp().m_frame->GetLogWindow()->Show(true);
SHOWLOGWINDOW;
}
}
}
Expand Down Expand Up @@ -548,7 +548,7 @@ void OrganFileParser::parseOrganSection() {
parsePanelElements(m_organ->getOrganPanelAt(m_organ->getNumberOfPanels() - 1), panelGroupName);
} else {
wxLogWarning("%s couldn't be found!", panelGroupName);
::wxGetApp().m_frame->GetLogWindow()->Show(true);
SHOWLOGWINDOW;
}
}
m_organFile->SetPath("/Organ");
Expand Down Expand Up @@ -876,13 +876,13 @@ void OrganFileParser::parsePanelElements(GoPanel *targetPanel, wxString panelId)
}
} else {
wxLogWarning("%s%s couldn't be found!", panelId, elementGroupName);
::wxGetApp().m_frame->GetLogWindow()->Show(true);
SHOWLOGWINDOW;
}
}
m_organFile->SetPath(wxT("/") + panelId);
} else {
wxLogWarning("NumberOfGUIElements=%d is invalid in %s!", nbrGuiElements, panelId);
::wxGetApp().m_frame->GetLogWindow()->Show(true);
SHOWLOGWINDOW;
}
} else {
// old style panel elements are read in another way, but they will be converted to the new style
Expand Down
4 changes: 2 additions & 2 deletions src/Pipe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ void Pipe::read(wxFileConfig *cfg, wxString pipeNr, Rank *parent, Organ *readOrg
wxLogWarning("Separate releases found in %s %s that is percussive! Ignoring them.", parent->getName(), pipeNr);
else
wxLogWarning("Separate release found in %s %s that is percussive! Ignoring it.", parent->getName(), pipeNr);
::wxGetApp().m_frame->GetLogWindow()->Show(true);
SHOWLOGWINDOW;
}

// finally a sanity check to see that there is at least one valid attack in the pipe
Expand All @@ -249,7 +249,7 @@ void Pipe::read(wxFileConfig *cfg, wxString pipeNr, Rank *parent, Organ *readOrg
a.fullPath = wxT("DUMMY");
m_attacks.push_back(a);
wxLogWarning("No valid pipe could be added for %s %s! Setting it to DUMMY.", parent->getName(), pipeNr);
::wxGetApp().m_frame->GetLogWindow()->Show(true);
SHOWLOGWINDOW;
} else {
// update the pipes root path of parent rank from the main attack
wxFileName fileName = m_attacks.front().fullPath;
Expand Down
Loading