From 4b364db2e4649653f95677311f1129719cb7fade Mon Sep 17 00:00:00 2001 From: bsutherland Date: Mon, 29 Oct 2018 22:26:42 +0900 Subject: [PATCH] Apply OSX fixes supplied by jrrs. --- Source/ChannelButtonLookAndFeel.cpp | 4 ++-- Source/DROMultiplexer.cpp | 2 +- Source/OPLLookAndFeel.cpp | 6 ++---- Source/PluginGui.cpp | 6 +++--- Source/PluginGui.h | 12 ++++++------ Source/hiopl.cpp | 4 ++-- Source/setup.h | 30 ++++++++++++++--------------- Source/windows.h | 4 ++-- 8 files changed, 33 insertions(+), 35 deletions(-) diff --git a/Source/ChannelButtonLookAndFeel.cpp b/Source/ChannelButtonLookAndFeel.cpp index 2f32abd..ca4ef16 100644 --- a/Source/ChannelButtonLookAndFeel.cpp +++ b/Source/ChannelButtonLookAndFeel.cpp @@ -19,8 +19,8 @@ ChannelButtonLookAndFeel::ChannelButtonLookAndFeel() static void drawButtonShape(Graphics& g, const Path& outline, Colour baseColour, float height) { - const float mainBrightness = baseColour.getBrightness(); - const float mainAlpha = baseColour.getFloatAlpha(); + //const float mainBrightness = baseColour.getBrightness(); + //const float mainAlpha = baseColour.getFloatAlpha(); g.setFillType(FillType(baseColour)); g.fillPath(outline); diff --git a/Source/DROMultiplexer.cpp b/Source/DROMultiplexer.cpp index a28bb75..dbcf4ed 100644 --- a/Source/DROMultiplexer.cpp +++ b/Source/DROMultiplexer.cpp @@ -80,7 +80,7 @@ static Bit32u PERCUSSION_OFFSETS[5][2] = { { 0x13, 0x10 }, // bd { 0x00, 0x14 }, // sd { 0x12, 0x00 }, // tt - { 0x00, 0x15}, // cy + { 0x00, 0x15 }, // cy { 0x11, 0x00 }, // hh }; diff --git a/Source/OPLLookAndFeel.cpp b/Source/OPLLookAndFeel.cpp index f8a5847..90d198b 100644 --- a/Source/OPLLookAndFeel.cpp +++ b/Source/OPLLookAndFeel.cpp @@ -16,8 +16,8 @@ const Colour OPLLookAndFeel::DOS_GREEN_DARK = Colour(0xff003f00); OPLLookAndFeel::OPLLookAndFeel() { - toggleOff = ImageCache::getFromMemory(PluginGui::toggle_off_sq_png, PluginGui::toggle_off_sq_pngSize), 1.000f, Colour(0x00000000); - toggleOn = ImageCache::getFromMemory(PluginGui::toggle_on_sq_png, PluginGui::toggle_on_sq_pngSize), 1.000f, Colour(0x00000000); + toggleOff = ImageCache::getFromMemory(PluginGui::toggle_off_sq_png, PluginGui::toggle_off_sq_pngSize); + toggleOn = ImageCache::getFromMemory(PluginGui::toggle_on_sq_png, PluginGui::toggle_on_sq_pngSize); toggleRect = Rectangle((float)toggleOff.getWidth(), (float)toggleOn.getHeight()); // Prevents an ugly white border from being drawn around a component with keyboard focus. @@ -76,8 +76,6 @@ void OPLLookAndFeel::drawLinearSliderThumb(Graphics& g, int x, int y, int width, slider.isMouseOverOrDragging() && slider.isEnabled(), slider.isMouseButtonDown() && slider.isEnabled())); - const float outlineThickness = slider.isEnabled() ? 0.8f : 0.3f; - if (style == Slider::LinearHorizontal || style == Slider::LinearVertical) { float kx, ky; diff --git a/Source/PluginGui.cpp b/Source/PluginGui.cpp index 5f79ac4..dc0629b 100644 --- a/Source/PluginGui.cpp +++ b/Source/PluginGui.cpp @@ -2145,7 +2145,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) String context = String("Disable channel "); for (unsigned int i = 0; i < channels.size(); ++i) { - TextButton *channel = new TextButton(TRANS("-"), context + (i + 1)); + TextButton *channel = new TextButton(TRANS("-"), context + String(i + 1)); channel->setLookAndFeel(channelButtonLookAndFeel); channel->setColour(TextButton::ColourIds::buttonColourId, Colours::black); channel->setColour(TextButton::ColourIds::buttonOnColourId, Colours::black); @@ -2680,7 +2680,7 @@ void PluginGui::buttonClicked (Button* buttonThatWasClicked) else if (buttonThatWasClicked == exportButton.get()) { //[UserButtonCode_exportButton] -- add your button handler code here.. - WildcardFileFilter wildcardFilter("*.sbi", String::empty, "SBI files"); + WildcardFileFilter wildcardFilter("*.sbi", String(), "SBI files"); FileBrowserComponent browser(FileBrowserComponent::saveMode + FileBrowserComponent::canSelectFiles, instrumentSaveDirectory, &wildcardFilter, @@ -2701,7 +2701,7 @@ void PluginGui::buttonClicked (Button* buttonThatWasClicked) else if (buttonThatWasClicked == loadButton.get()) { //[UserButtonCode_loadButton] -- add your button handler code here.. - WildcardFileFilter wildcardFilter("*.sbi", String::empty, "SBI files"); + WildcardFileFilter wildcardFilter("*.sbi", String(), "SBI files"); FileBrowserComponent browser(FileBrowserComponent::openMode + FileBrowserComponent::canSelectFiles, instrumentLoadDirectory, &wildcardFilter, diff --git a/Source/PluginGui.h b/Source/PluginGui.h index 6744621..1419858 100644 --- a/Source/PluginGui.h +++ b/Source/PluginGui.h @@ -49,12 +49,12 @@ public: //============================================================================== //[UserMethods] -- You can add your own custom methods in this section. void updateFromParameters(); - bool isInterestedInFileDrag (const StringArray& files); - void fileDragEnter (const StringArray& files, int x, int y); - void fileDragMove (const StringArray& files, int x, int y); - void fileDragExit (const StringArray& files); - void filesDropped (const StringArray& files, int x, int y); - void timerCallback(); + bool isInterestedInFileDrag (const StringArray& files) override; + void fileDragEnter (const StringArray& files, int x, int y) override; + void fileDragMove (const StringArray& files, int x, int y) override; + void fileDragExit (const StringArray& files) override; + void filesDropped (const StringArray& files, int x, int y) override; + void timerCallback() override; void setRecordButtonState(bool recording); //[/UserMethods] diff --git a/Source/hiopl.cpp b/Source/hiopl.cpp index 160556a..3f02b10 100644 --- a/Source/hiopl.cpp +++ b/Source/hiopl.cpp @@ -43,8 +43,8 @@ void Hiopl::_ClearRegisters() { } } -void Hiopl::SetEmulator(Emulator emulator) { - this->emulator = emulator; +void Hiopl::SetEmulator(Emulator _emulator) { + this->emulator = _emulator; } void Hiopl::Generate(int length, float* buffer) { diff --git a/Source/setup.h b/Source/setup.h index 72fcc0e..ad9176b 100644 --- a/Source/setup.h +++ b/Source/setup.h @@ -88,26 +88,26 @@ public: DbxValue(std::string const& in,Etype _t) :_string(0),type(V_NONE) {SetDbxValue(in,_t);} /* Assigment operators */ - DbxValue& operator= (Hex in) throw(WrongType) { return copy(DbxValue(in));} - DbxValue& operator= (int in) throw(WrongType) { return copy(DbxValue(in));} - DbxValue& operator= (bool in) throw(WrongType) { return copy(DbxValue(in));} - DbxValue& operator= (double in) throw(WrongType) { return copy(DbxValue(in));} - DbxValue& operator= (std::string const& in) throw(WrongType) { return copy(DbxValue(in));} - DbxValue& operator= (char const * const in) throw(WrongType) { return copy(DbxValue(in));} - DbxValue& operator= (DbxValue const& in) throw(WrongType) { return copy(DbxValue(in));} + DbxValue& operator= (Hex in) noexcept(false) { return copy(DbxValue(in));} + DbxValue& operator= (int in) noexcept(false) { return copy(DbxValue(in));} + DbxValue& operator= (bool in) noexcept(false) { return copy(DbxValue(in));} + DbxValue& operator= (double in) noexcept(false) { return copy(DbxValue(in));} + DbxValue& operator= (std::string const& in) noexcept(false) { return copy(DbxValue(in));} + DbxValue& operator= (char const * const in) noexcept(false) { return copy(DbxValue(in));} + DbxValue& operator= (DbxValue const& in) noexcept(false) { return copy(DbxValue(in));} bool operator== (DbxValue const & other); - operator bool () const throw(WrongType); - operator Hex () const throw(WrongType); - operator int () const throw(WrongType); - operator double () const throw(WrongType); - operator char const* () const throw(WrongType); - void SetDbxValue(std::string const& in,Etype _type = V_CURRENT) throw(WrongType); + operator bool () const noexcept(false); + operator Hex () const noexcept(false); + operator int () const noexcept(false); + operator double () const noexcept(false); + operator char const* () const noexcept(false); + void SetDbxValue(std::string const& in,Etype _type = V_CURRENT) noexcept(false); std::string ToString() const; private: void destroy() throw(); - DbxValue& copy(DbxValue const& in) throw(WrongType); + DbxValue& copy(DbxValue const& in) noexcept(false); void plaincopy(DbxValue const& in) throw(); void set_hex(std::string const& in); void set_int(std::string const&in); @@ -159,7 +159,7 @@ public: min = _min; max = _max; } - void SetMinMax(DbxValue const& min,DbxValue const& max) {this->min = min; this->max=max;} + void SetMinMax(DbxValue const& _min,DbxValue const& _max) {this->min = _min; this->max=_max;} void SetDbxValue(std::string const& in); ~Prop_int(){ } virtual bool CheckDbxValue(DbxValue const& in, bool warn); diff --git a/Source/windows.h b/Source/windows.h index 5e32977..154d6e5 100644 --- a/Source/windows.h +++ b/Source/windows.h @@ -50,7 +50,7 @@ typedef uint16_t WORD; // BOOL - A boolean variable // This type is declared in WinDef.h as follows: -typedef BYTE BOOL; +// typedef BYTE BOOL; DWORD GetStdHandle (DWORD handle) { return handle; } @@ -70,7 +70,7 @@ void WriteConsole(DWORD conout,const char* strPtr, std::string message (const char* str, uint32_t count); - std::cout << std::endl << msgType << message; + std::cout << std::endl << msgType << &message; } void AllocConsole()