Skip to content

Commit

Permalink
Merge pull request #33 from cannam/main
Browse files Browse the repository at this point in the history
Deployment fixes
  • Loading branch information
yucongj authored Dec 22, 2023
2 parents d092bc2 + dc8fd48 commit 501b520
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 25 deletions.
2 changes: 1 addition & 1 deletion deploy/macos/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<key>CFBundleExecutable</key>
<string>@NAME@</string>
<key>CFBundleIconFile</key>
<string>sv-macicon.icns</string>
<string>piano-precision-macicon.icns</string>
<key>CFBundleIdentifier</key>
<string>@IDENT@</string>
<key>CFBundleShortVersionString</key>
Expand Down
2 changes: 1 addition & 1 deletion deploy/macos/copy-qt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if [ -z "$app" ]; then
exit 2
fi

frameworks="QtCore QtNetwork QtGui QtXml QtSvg QtPdf QtWidgets QtPrintSupport QtDBus"
frameworks="QtCore QtNetwork QtGui QtXml QtSvg QtTest QtPdf QtWidgets QtPrintSupport QtDBus"

plugins="gif icns ico jpeg tga tiff wbmp webp cocoa minimal offscreen macstyle"

Expand Down
2 changes: 1 addition & 1 deletion deploy/macos/deploy-and-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ for builddir in $builddirs; do
grep -i 'found' |
head -1 |
sed 's/Found qmake: //' |
sed 's/qmake found: YES (//' |
sed 's/qmake[0-9]* found: YES (//' |
sed 's,/bin/qmake.*,,')
if [ -z "$qtdir" ]; then
echo "Unable to discover QTDIR from build dir $builddir"
Expand Down
2 changes: 1 addition & 1 deletion deploy/macos/paths.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ fi

set -u

frameworks="QtCore QtNetwork QtGui QtXml QtSvg QtPdf QtWidgets QtPrintSupport QtDBus"
frameworks="QtCore QtNetwork QtGui QtXml QtSvg QtTest QtPdf QtWidgets QtPrintSupport QtDBus"

echo
echo "I expect you to have already copied these frameworks from the Qt installation to"
Expand Down
10 changes: 5 additions & 5 deletions deploy/win64/generate-wxs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ $scorespec = $scores.foreach{
$score = $_
if (!($score.Name -match $suppress_re)) {
$score.Name | Out-Host
$id = $score.Name -Replace "[ .,-]", ""
$id = $score.Name -Replace "[ .,()-]", ""
$files = Get-ChildItem -path "$scoredir\$score\*" -File -Include "$score*"
$xfrags = $files.foreach{
$file = $_
$fxml = [xml] '<File Id="" Name="" Source=""/>'
$fxml.File.Id = $file.Name -Replace "[ .,-]",""
$fxml.File.Id = $file.Name -Replace "[ .,()-]",""
$fxml.File.Name = $file.Name
$fxml.File.Source = $file.FullName
$fxml.OuterXml
Expand Down Expand Up @@ -96,11 +96,11 @@ $recordingspec = $recordings.foreach{
</Component>
</Directory>
"@
$id = $recording.Name -Replace "[ .,-]", ""
$id = $recording.Name -Replace "[ .,()-]", ""
$did = "RECD_$id"
$cid = "RECC_$id"
$fid = "RECF_$id"
$fname = $recording.Name + ".opus"
$fname = $(Get-ChildItem -Path "$recordingdir\$recording\*" -File -Include "*.opus")[0].Name
$dxml.Directory.Id = $did
$dxml.Directory.Name = $recording.Name
$dxml.Directory.Component.Id = $cid
Expand All @@ -109,7 +109,7 @@ $recordingspec = $recordings.foreach{
$dxml.Directory.Component.File.Name = $fname
$fsrc = $recording.FullName + "\" + $fname
if (!(Test-Path -Path $fsrc -PathType Leaf)) {
echo "ERROR: Recording $fsrc not found"
"ERROR: Recording $fsrc not found" | Out-Host
exit 1
}
$dxml.Directory.Component.File.Source = $fsrc
Expand Down
5 changes: 4 additions & 1 deletion deploy/win64/package.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ if (! (Test-Path -Path $wixdir -PathType Container)) {
exit 2
}

& "deploy\win64\generate-wxs.ps1"
if (! (& "deploy\win64\generate-wxs.ps1")) {
"ERROR: WiX file generation failed"
exit 2
}

$name = "Christopher Cannam"

Expand Down
6 changes: 3 additions & 3 deletions deploy/win64/wxs.in
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@

<File
Id="winicon.ico"
Name="sv-winicon.ico"
Source="icons\sv-winicon.ico"/>
Name="piano-precision-winicon.ico"
Source="icons\piano-precision-winicon.ico"/>
</Component>

<Component Win64="yes"
Expand Down Expand Up @@ -352,7 +352,7 @@
<Property Id="WixAppFolder" Value="WixPerMachineFolder" />
<WixVariable Id="WixUILicenseRtf" Value="deploy\win64\License.rtf" />

<Icon Id="winicon.ico" SourceFile="icons\sv-winicon.ico"/>
<Icon Id="winicon.ico" SourceFile="icons\piano-precision-winicon.ico"/>
<Property Id="ARPPRODUCTICON" Value="winicon.ico" />

<WixVariable Id="WixUIBannerBmp" Value="deploy\win64\top.bmp"/>
Expand Down
30 changes: 22 additions & 8 deletions main/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ MainWindow::MainWindow(AudioMode audioMode, MIDIMode midiMode, bool withOSCSuppo

SVDEBUG << "MainWindow: Creating version tester" << endl;
m_versionTester = new VersionTester
("sonicvisualiser.org", "latest-version.txt", SV_VERSION);
("sonicvisualiser.org", "latest-pp-version.txt", SV_VERSION);
connect(m_versionTester, SIGNAL(newerVersionAvailable(QString)),
this, SLOT(newerVersionAvailable(QString)));
} else {
Expand Down Expand Up @@ -2427,15 +2427,23 @@ MainWindow::chooseScore() // Added by YJ Oct 5, 2021
m_score = Score();

// Creating score structure
string scorePath = ScoreFinder::getUserScoreDirectory() + "/" + scoreName.toStdString() + "/" + scoreName.toStdString();
bool success = m_score.initialize(scorePath + ".solo");
if (success) success = m_score.readTempo(scorePath + ".tempo");
if (success) success = m_score.readMeter(scorePath + ".meter");
if (success) m_score.calculateTicks();
if (!success) {
SVCERR<<"ERROR: In MainWindow::chooseScore, failed to create score structure"<<endl;
string sname = scoreName.toStdString();
string soloPath = ScoreFinder::getScoreFile(sname, "solo");
string tempoPath = ScoreFinder::getScoreFile(sname, "tempo");
string meterPath = ScoreFinder::getScoreFile(sname, "meter");
if (!m_score.initialize(soloPath)) {
SVCERR << "MainWindow::chooseScore: Failed to load score data from " << soloPath << endl;
return;
}
if (!m_score.readTempo(tempoPath)) {
SVCERR << "MainWindow::chooseScore: Failed to load tempo data from " << tempoPath << endl;
return;
}
if (!m_score.readMeter(meterPath)) {
SVCERR << "MainWindow::chooseScore: Failed to load meter data from " << meterPath << endl;
return;
}
m_score.calculateTicks();
m_session.setMusicalEvents(&(m_score.getMusicalEvents()));

auto recordingDirectory =
Expand All @@ -2453,6 +2461,7 @@ MainWindow::chooseScore() // Added by YJ Oct 5, 2021
auto bundledRecordingDirectory =
ScoreFinder::getBundledRecordingDirectory(scoreName.toStdString());
if (bundledRecordingDirectory == "") {
SVDEBUG << "MainWindow::chooseScore: Note: no bundled recording directory returned for score " << scoreName << endl;
return;
}

Expand Down Expand Up @@ -2483,6 +2492,11 @@ MainWindow::chooseScore() // Added by YJ Oct 5, 2021
settings.remove("lastpath");
settings.endGroup();

SVDEBUG << "MainWindow::chooseScore: haveUserRecordings = "
<< haveUserRecordings << ", recordingDirectory = "
<< recordingDirectory << ", bundledRecordingDirectory = "
<< bundledRecordingDirectory << endl;

// These aren't files, but they work anyway with the current file
// finder
if (haveUserRecordings) {
Expand Down
6 changes: 2 additions & 4 deletions main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -516,10 +516,8 @@ main(int argc, char **argv)
QScreen *screen = QApplication::primaryScreen();
QRect available = screen->availableGeometry();

int width = (available.width() * 2) / 3;
int height = available.height() / 2;
if (height < 450) height = (available.height() * 2) / 3;
if (width > height * 2) width = height * 2;
int width = (available.width() * 3) / 4;
int height = (available.height() * 2) / 3;

settings.beginGroup("MainWindow");

Expand Down

0 comments on commit 501b520

Please sign in to comment.