Skip to content

Commit bd3a696

Browse files
committed
Updated JUCE version, fixed some GUI related bugs
1 parent 13f7af7 commit bd3a696

6 files changed

Lines changed: 45 additions & 22 deletions

File tree

CMakeLists.txt

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ list(TRANSFORM SEQ64_GUI_ONLY_SOURCES PREPEND "Source/")
6464
if(WIN32)
6565
set(SEQ64_COMPILE_OPTIONS "/W2" "/O2")
6666
else()
67-
set(SEQ64_COMPILE_OPTIONS "-Wall" "-Wextra" "-Wno-sign-compare" "-Wno-sign-conversion" "-O3")
67+
set(SEQ64_COMPILE_OPTIONS "-Wall" "-Wextra" "-Wno-sign-compare" "-Wno-sign-conversion" "-O2")
6868
endif()
6969

7070
set(NAME_STR "SEQ64 V${PROJECT_VERSION}")
@@ -79,6 +79,10 @@ set(SEQ64_DEFINITIONS
7979
JUCE_APPLICATION_VERSION_HEX=${VER_HEX}
8080
)
8181

82+
set(CMAKE_CXX_STANDARD 17)
83+
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
84+
set(CMAKE_CXX_EXTENSIONS FALSE)
85+
8286
# Console version
8387

8488
add_executable(seq64_console
@@ -89,9 +93,6 @@ add_executable(seq64_console
8993
"juce/modules/juce_audio_basics/juce_audio_basics.cpp"
9094
"juce/modules/juce_data_structures/juce_data_structures.cpp"
9195
)
92-
if(APPLE)
93-
set_target_properties(seq64_console PROPERTIES CXX_STANDARD 14 CXX_STANDARD_REQUIRED TRUE CXX_EXTENSIONS FALSE)
94-
endif()
9596
target_include_directories(seq64_console PRIVATE
9697
"Source"
9798
"juce/modules"
@@ -116,12 +117,10 @@ if(SEQ64_BUILD_GUI)
116117
juce_add_gui_app(seq64_gui PRODUCT_NAME "seq64_gui" COMPANY_NAME "Sauraen")
117118
juce_generate_juce_header(seq64_gui)
118119
target_sources(seq64_gui PRIVATE ${SEQ64_SHARED_SOURCES} ${SEQ64_GUI_ONLY_SOURCES})
119-
if(APPLE)
120-
set_target_properties(seq64_gui PROPERTIES CXX_STANDARD 14 CXX_STANDARD_REQUIRED TRUE CXX_EXTENSIONS FALSE)
121-
endif()
122120
target_compile_definitions(seq64_gui PRIVATE
123121
${SEQ64_DEFINITIONS}
124122
JUCE_DISPLAY_SPLASH_SCREEN=0
123+
JUCE_MODAL_LOOPS_PERMITTED=1
125124
)
126125
target_link_libraries(seq64_gui PRIVATE
127126
juce::juce_core

Source/SeqEditor.cpp

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,10 @@ void SeqEditor::buttonClicked (juce::Button* buttonThatWasClicked)
790790
//TODO default files
791791
File f = File::getSpecialLocation(File::userHomeDirectory); //TODO SEQ64::readFolderProperty("midiimportfolder");
792792
FileChooser box("Select a MIDI to load...", f, "*.mid;*.midi;*.rmi", true);
793-
if(!box.browseForFileToOpen()) return;
793+
File oldwd = File::getCurrentWorkingDirectory();
794+
bool hitokay = box.browseForFileToOpen();
795+
oldwd.setAsCurrentWorkingDirectory();
796+
if(!hitokay) return;
794797
f = box.getResult();
795798
if(!f.existsAsFile()){
796799
std::cout << "File " << f.getFullPathName() << " does not exist!";
@@ -814,7 +817,10 @@ void SeqEditor::buttonClicked (juce::Button* buttonThatWasClicked)
814817

815818
File savelocation = File::getSpecialLocation(File::userHomeDirectory); //SEQ64::readFolderProperty("midifolder");
816819
FileChooser box("Save MIDI", savelocation, "*.mid", true);
817-
if(!box.browseForFileToSave(true)) return;
820+
File oldwd = File::getCurrentWorkingDirectory();
821+
bool hitokay = box.browseForFileToSave(true);
822+
oldwd.setAsCurrentWorkingDirectory();
823+
if(!hitokay) return;
818824
savelocation = box.getResult();
819825
startSeqOperation("MIDI export", &SeqFile::exportMIDI, savelocation, midiopts);
820826
//[/UserButtonCode_btnExportMIDI]
@@ -827,7 +833,10 @@ void SeqEditor::buttonClicked (juce::Button* buttonThatWasClicked)
827833
if(!checkSeqPresence(false)) return;
828834
File f = File::getSpecialLocation(File::userHomeDirectory); //TODO SEQ64::readFolderProperty("romfolder");
829835
FileChooser box("Load .mus", f, "*.mus", true);
830-
if(!box.browseForFileToOpen()) return;
836+
File oldwd = File::getCurrentWorkingDirectory();
837+
bool hitokay = box.browseForFileToOpen();
838+
oldwd.setAsCurrentWorkingDirectory();
839+
if(!hitokay) return;
831840
f = box.getResult();
832841
seq.reset(new SeqFile(abi));
833842
startSeqOperation(".mus import", &SeqFile::importMus, f);
@@ -839,7 +848,10 @@ void SeqEditor::buttonClicked (juce::Button* buttonThatWasClicked)
839848
if(!checkSeqPresence(true)) return;
840849
File savelocation = File::getSpecialLocation(File::userHomeDirectory); //SEQ64::readFolderProperty("comfolder");
841850
FileChooser box("Save .mus", savelocation, "*.mus", true);
842-
if(!box.browseForFileToSave(true)) return;
851+
File oldwd = File::getCurrentWorkingDirectory();
852+
bool hitokay = box.browseForFileToSave(true);
853+
oldwd.setAsCurrentWorkingDirectory();
854+
if(!hitokay) return;
843855
savelocation = box.getResult();
844856
int dialect = optMusCommunity->getToggleState() ? 0 : optMusCanon->getToggleState() ? 2 : 4;
845857
dialect |= optStyleSFX->getToggleState() ? 1 : 0;
@@ -854,7 +866,10 @@ void SeqEditor::buttonClicked (juce::Button* buttonThatWasClicked)
854866
if(!checkSeqPresence(false)) return;
855867
File f = File::getSpecialLocation(File::userHomeDirectory); //TODO SEQ64::readFolderProperty("romfolder");
856868
FileChooser box("Load .com/.aseq", f, "*.com;*.aseq;*.seq;*.m64;*.bin;*.seq", true);
857-
if(!box.browseForFileToOpen()) return;
869+
File oldwd = File::getCurrentWorkingDirectory();
870+
bool hitokay = box.browseForFileToOpen();
871+
oldwd.setAsCurrentWorkingDirectory();
872+
if(!hitokay) return;
858873
f = box.getResult();
859874
seq.reset(new SeqFile(abi));
860875
startSeqOperation(".com/.aseq import", &SeqFile::importCom, f);
@@ -866,7 +881,10 @@ void SeqEditor::buttonClicked (juce::Button* buttonThatWasClicked)
866881
if(!checkSeqPresence(true)) return;
867882
File savelocation = File::getSpecialLocation(File::userHomeDirectory); //SEQ64::readFolderProperty("comfolder");
868883
FileChooser box("Save .com/.aseq", savelocation, "*.com;*.aseq;*.seq;*.m64;*.bin;*.seq", true);
869-
if(!box.browseForFileToSave(true)) return;
884+
File oldwd = File::getCurrentWorkingDirectory();
885+
bool hitokay = box.browseForFileToSave(true);
886+
oldwd.setAsCurrentWorkingDirectory();
887+
if(!hitokay) return;
870888
savelocation = box.getResult();
871889
startSeqOperation(".com/.aseq export", &SeqFile::exportCom, savelocation);
872890
//[/UserButtonCode_btnExportCom]
@@ -957,7 +975,9 @@ void SeqEditor::timerCallback(){
957975
}
958976

959977
ValueTree SeqEditor::getABI(){
960-
ValueTree abi = SeqFile::loadABI(lstABI->get(lstABI->getLastRowSelected()));
978+
int row = lstABI->getLastRowSelected();
979+
String abistr = lstABI->get(row);
980+
ValueTree abi = SeqFile::loadABI(abistr);
961981
if(!abi.isValid()){
962982
NativeMessageBox::showMessageBox(AlertWindow::WarningIcon, "seq64",
963983
"Invalid ABI selected!");

Source/SeqFile.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,30 +166,30 @@ StringArray SeqFile::getAvailABIs(){
166166
ValueTree SeqFile::loadABI(String name){
167167
File abifile = findFile("abi/" + name + ".xml");
168168
if(!abifile.existsAsFile()){
169-
std::cout << "Could not find file " + abifile.getFullPathName() + "!";
169+
std::cout << "Could not find file " + abifile.getFullPathName() + "!\n";
170170
return ValueTree();
171171
}
172172
std::unique_ptr<XmlElement> xml = parseXML(abifile);
173173
if(!xml){
174-
std::cout << "Error parsing XML of " + abifile.getFullPathName() + "!";
174+
std::cout << "Error parsing XML of " + abifile.getFullPathName() + "!\n";
175175
return ValueTree();
176176
}
177177
return ValueTree::fromXml(*xml);
178178
}
179179
bool SeqFile::saveABI(String name, ValueTree abi_){
180180
File abifile = findFile("abi/" + name + ".xml");
181181
if(!abifile.existsAsFile()){
182-
std::cout << "Could not find file " + abifile.getFullPathName() + "!";
182+
std::cout << "Could not find file " + abifile.getFullPathName() + "!\n";
183183
return false;
184184
}
185185
std::unique_ptr<XmlElement> xml = abi_.createXml();
186186
if(!xml){
187-
std::cout << "Error creating XML for currently loaded ABI!";
187+
std::cout << "Error creating XML for currently loaded ABI!\n";
188188
return false;
189189
}
190190
FileOutputStream fos(abifile);
191191
if(fos.failedToOpen()){
192-
std::cout << "Couldn't open file " + abifile.getFullPathName() + " for writing!";
192+
std::cout << "Couldn't open file " + abifile.getFullPathName() + " for writing!\n";
193193
return false;
194194
}
195195
fos.setPosition(0);

Source/TextListBox.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@ void TextListBox::Listener::rowDoubleClicked(TextListBox* parent, int row) {
3131
}
3232

3333
TextListBox::TextListBox(Listener *l, String headerCaption)
34-
: ListBox("TextListBox", this), listener(l), font(15.0f), selectonadd(true) {
34+
: ListBoxModel(), // this must be constructed as a model before passing
35+
ListBox("TextListBox", this), // itself to ListBox constructor
36+
listener(l),
37+
font(15.0f),
38+
selectonadd(true) {
3539
setMultipleSelectionEnabled(false);
3640
setClickingTogglesRowSelection(false);
3741
setRowSelectedOnMouseDown(true);

Source/TextListBox.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
#include "Common.hpp"
2929

30-
class TextListBox : public ListBox, ListBoxModel
30+
class TextListBox : public ListBoxModel, public ListBox
3131
{
3232
public:
3333
class Listener{

juce

Submodule juce updated 2677 files

0 commit comments

Comments
 (0)