Skip to content

Commit

Permalink
Merge branch 'lte-lib' into develop-1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
vsicurella committed May 12, 2024
2 parents 9619b8a + 8e8acec commit 7172adc
Show file tree
Hide file tree
Showing 51 changed files with 1,377 additions and 1,166 deletions.
34 changes: 21 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,26 +34,19 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
set(LibraryPath "${CMAKE_CURRENT_SOURCE_DIR}/Libraries/win64")
set(LibraryInclude "${LibraryPath}/include")
set(LibraryCode "${LibraryInclude}/libssh2.h")
# set(CryptoLib "${CMAKE_CURRENT_SOURCE_DIR}/Libraries/win64/bin/libcrypto-1_1-x64.dll")
# set(SSHLib "${CMAKE_CURRENT_SOURCE_DIR}/Libraries/win64/bin/libssh2-x64.dll")

# add_library( CryptoLib SHARED IMPORTED )
# set_target_properties( CryptoLib PROPERTIES IMPORTED_LOCATION "${CMAKE_BINARY_DIR}/libcrypto-1_1-x64.dll" )

add_library( SSHLib SHARED IMPORTED )
set_target_properties( SSHLib PROPERTIES IMPORTED_LOCATION "${CMAKE_BINARY_DIR}/libssh2-x64.dll" )
set_target_properties( SSHLib PROPERTIES IMPORTED_IMPLIB "${LibraryPath}/lib/libssh2.dll.a" )
endif()

if (UNIX)
set(LibraryInclude "${CMAKE_CURRENT_SOURCE_DIR}/Libraries/mac/include")
set(LibraryCode "${CMAKE_CURRENT_SOURCE_DIR}/Libraries/mac/include/libssh2.h")
file(READ
CryptoLib
"${CMAKE_CURRENT_SOURCE_DIR}/Libraries/mac/lib/libgpg-error.dylib"
"${CMAKE_CURRENT_SOURCE_DIR}/Libraries/mac/lib/libgcrypt.dylib"
)
file(READ SSHLib "${CMAKE_CURRENT_SOURCE_DIR}/Libraries/mac/lib/libssh2.dylib")
set(LibraryPath "${CMAKE_CURRENT_SOURCE_DIR}/Libraries/mac")
set(LibraryInclude "${LibraryPath}/include")
set(LibraryCode "${LibraryInclude}/libssh2.h")

add_library(SSHLib SHARED IMPORTED)
set_target_properties( SSHLib PROPERTIES IMPORTED_LOCATION "${LibraryPath}/lib/libssh2.dylib")
endif()

include_directories(${LibraryInclude})
Expand Down Expand Up @@ -133,3 +126,18 @@ target_link_libraries(LumatoneEditor
juce::juce_recommended_lto_flags
juce::juce_recommended_warning_flags
)

# if (APPLE)
# add_custom_command(
# LumatoneEditor ${JUCE_PRODUCT_NAME} POST_BUILD
# COMMAND
# ${CMAKE_COMMAND} -E copy
# "${LibraryPath}/lib/libssh2.dylib"
# "$<TARGET_FILE_DIR:${JUCE_PRODUCT_NAME}>/../Resources/libssh2.dylib"
# )
# add_custom_command(
# LumatoneEditor ${JUCE_PRODUCT_NAME} POST_BUILD
# COMMAND install_name_tool -change @rpath/libssh2.dylib @loader_path/../Frameworks/libssh2.dylib $<TARGET_FILE:${JUCE_PRODUCT_NAME}>
# )
# endif()

5 changes: 4 additions & 1 deletion Source/ColourPaletteWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,16 @@
// ColourPaletteWindow Definitions

ColourPaletteWindow::ColourPaletteWindow(const LumatoneEditorState& stateIn)
: LumatoneEditorStateController("ColourPaletteWindow", stateIn)
: LumatoneEditorState("ColourPaletteWindow", stateIn)
, LumatoneEditorState::Controller(static_cast<LumatoneEditorState&>(*this))
{
setName("ColourPaletteWindow");
setLookAndFeel(&getEditorLookAndFeel());

colourSelectorGroup.reset(new ColourSelectionGroup());

loadColourPalettesFromFile();

palettePanel.reset(new ColourPalettesPanel(getColourPalettes(), colourSelectorGroup.get()));
palettePanel->addListener(this);

Expand Down
3 changes: 2 additions & 1 deletion Source/ColourPaletteWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ class PaletteEditPanel;
/*
*/
class ColourPaletteWindow : public juce::Component
, private LumatoneEditorStateController
, public LumatoneEditorState
, private LumatoneEditorState::Controller
, public juce::ChangeListener
, public ColourPalettesPanel::Listener
{
Expand Down
56 changes: 25 additions & 31 deletions Source/GlobalSettingsArea.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

#include "./Settings/SettingsContainer.h"

#include "./lumatone_editor_library/device/lumatone_controller.h"
//[/Headers]

#include "GlobalSettingsArea.h"
Expand Down Expand Up @@ -76,10 +75,12 @@ GlobalSettingsArea::GlobalSettingsArea (const LumatoneEditorState& stateIn)
activeMacroButtonColourEdit.reset(new ColourViewComponent());
addAndMakeVisible(activeMacroButtonColourEdit.get());
activeMacroButtonColourEdit->addChangeListener(this);
activeMacroButtonColourEdit->setColour(getActiveMacroButtonColour().toString(), false);

inactiveMacroButtonColourEdit.reset(new ColourViewComponent());
addAndMakeVisible(inactiveMacroButtonColourEdit.get());
inactiveMacroButtonColourEdit->addChangeListener(this);
inactiveMacroButtonColourEdit->setColour(getInactiveMacroButtonColour().toString(), false);

lblDeveloperMode.reset(new juce::Label("DeveloperModeLabel", "Developer Mode"));
addChildComponent(lblDeveloperMode.get());
Expand All @@ -90,9 +91,20 @@ GlobalSettingsArea::GlobalSettingsArea (const LumatoneEditorState& stateIn)
lblPresetButtonColours->setFont(getAppFonts().getFont(LumatoneEditorFont::UniviaProBold));

addStatusListener(this);
addEditorListener(this);

settingsButton->setEnabled(false);

lblPresetButtonColours->setColour(Label::ColourIds::textColourId, getEditorLookAndFeel().findColour(LumatoneEditorColourIDs::LabelPink));

lblColourActiveMacroButton->setColour(Label::ColourIds::textColourId, getEditorLookAndFeel().findColour(LumatoneEditorColourIDs::DescriptionText));
lblColourInactiveMacroButton->setColour(Label::ColourIds::textColourId, getEditorLookAndFeel().findColour(LumatoneEditorColourIDs::DescriptionText));

settingsButton->setColour(TextButton::ColourIds::buttonColourId, Colour(0xff383b3d));
settingsButton->setColour(TextButton::ColourIds::textColourOffId, Colour(0xffffffff));

connectionStateChanged(getConnectionState());

/* We don't want a resize here
/*
//[/UserPreSize]
Expand Down Expand Up @@ -126,6 +138,16 @@ GlobalSettingsArea::~GlobalSettingsArea()
//[/Destructor]
}

void GlobalSettingsArea::macroButtonInactiveColourChanged(juce::Colour colour)
{
inactiveMacroButtonColourEdit->setColour(colour.toString(), false);
}

void GlobalSettingsArea::macroButtonActiveColourChanged(juce::Colour colour)
{
activeMacroButtonColourEdit->setColour(colour.toString(), false);
}

//==============================================================================
void GlobalSettingsArea::paint (juce::Graphics& g)
{
Expand Down Expand Up @@ -220,46 +242,18 @@ void GlobalSettingsArea::buttonClicked (juce::Button* buttonThatWasClicked)

//[MiscUserCode] You can add your own definitions of your custom methods or any other code here...

void GlobalSettingsArea::lookAndFeelChanged()
{
lblPresetButtonColours->setColour(Label::ColourIds::textColourId, getEditorLookAndFeel().findColour(LumatoneEditorColourIDs::LabelPink));

lblColourActiveMacroButton->setColour(Label::ColourIds::textColourId, getEditorLookAndFeel().findColour(LumatoneEditorColourIDs::DescriptionText));
lblColourInactiveMacroButton->setColour(Label::ColourIds::textColourId, getEditorLookAndFeel().findColour(LumatoneEditorColourIDs::DescriptionText));

settingsButton->setColour(TextButton::ColourIds::buttonColourId, Colour(0xff383b3d));
settingsButton->setColour(TextButton::ColourIds::textColourOffId, Colour(0xffffffff));
}

void GlobalSettingsArea::changeListenerCallback(ChangeBroadcaster *source)
{
if (source == inactiveMacroButtonColourEdit.get())
{
String inactiveMacroButtonColour = inactiveMacroButtonColourEdit->getColourAsString();
getLumatoneController()->sendMacroButtonInactiveColour(inactiveMacroButtonColour);
setInactiveMacroButtonColour(inactiveMacroButtonColourEdit->getColourAsObject());
}
else if (source == activeMacroButtonColourEdit.get())
{
String activeMacroButtonColour = activeMacroButtonColourEdit->getColourAsString();
getLumatoneController()->sendMacroButtonActiveColour(activeMacroButtonColour);
setActiveMacroButtonColour(activeMacroButtonColourEdit->getColourAsObject());
}
}

void GlobalSettingsArea::restoreStateFromPropertiesFile()
{
inactiveMacroButtonColourEdit->setColour(getProperty(LumatoneEditorProperty::InactiveMacroButtonColour, "000000"));
activeMacroButtonColourEdit->setColour(getProperty(LumatoneEditorProperty::ActiveMacroButtonColour, "FFFFFF"));
}

void GlobalSettingsArea::saveStateToPropertiesFile(PropertiesFile* propertiesFile)
{
String inactiveMacroButtonColour = inactiveMacroButtonColourEdit->getColourAsString();
propertiesFile->setValue(LumatoneEditorProperty::InactiveMacroButtonColour, inactiveMacroButtonColour);

String activeMacroButtonColour = activeMacroButtonColourEdit->getColourAsString();
propertiesFile->setValue(LumatoneEditorProperty::ActiveMacroButtonColour, activeMacroButtonColour);
}

void GlobalSettingsArea::listenToColourEditButtons(Button::Listener* listenerIn)
{
inactiveMacroButtonColourEdit->addListener(listenerIn);
Expand Down
14 changes: 6 additions & 8 deletions Source/GlobalSettingsArea.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "./LumatoneEditorState.h"

#include "./lumatone_editor_library/listeners/status_listener.h"
#include "./lumatone_editor_library/listeners/editor_listener.h"
#include "./colour_view_component.h"

//[/Headers]
Expand All @@ -43,6 +44,7 @@ class GlobalSettingsArea : public juce::Component,
public LumatoneEditorState,
public ChangeListener,
public LumatoneEditor::StatusListener,
public LumatoneEditor::EditorListener,
public juce::Button::Listener
{
public:
Expand All @@ -54,27 +56,23 @@ class GlobalSettingsArea : public juce::Component,
//[UserMethods] -- You can add your own custom methods in this section.
void changeListenerCallback(ChangeBroadcaster *source) override;

void saveStateToPropertiesFile(PropertiesFile* propertiesFile);

void listenToColourEditButtons(Button::Listener* listenerIn);

void lookAndFeelChanged() override;

void setDeveloperMode(bool devModeOn);

// LumatoneEditor::StatusListener implementation
// void connectionEstablished(int inputDevice, int outputDevice) override;
void connectionStateChanged(ConnectionState newState) override;
// void connectionFailed() override;

// LumatoneEditor::EditorListener implementation
void macroButtonInactiveColourChanged(juce::Colour colour) override;
void macroButtonActiveColourChanged(juce::Colour colour) override;

//[/UserMethods]

void paint (juce::Graphics& g) override;
void resized() override;
void buttonClicked (juce::Button* buttonThatWasClicked) override;

private:
void restoreStateFromPropertiesFile();

private:
//[UserVariables] -- You can add your own custom variables in this section.
Expand Down
12 changes: 8 additions & 4 deletions Source/LumatoneEditorLookAndFeel.h
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ class LumatoneEditorLookAndFeel : public LookAndFeel_V4
Label* label = new Label(sld.getName() + "_ValueLabel");
label->setText(String(sld.getValue()), dontSendNotification);
label->setJustificationType(Justification::centred);
// label->setFont(getAppFont(LumatoneEditorFont::GothamNarrowMedium));
label->setFont(getAppFont(LumatoneEditorFont::GothamNarrowMedium));

Colour textColour = (sld.isEnabled())
? findColour(LumatoneEditorColourIDs::DescriptionText)
Expand Down Expand Up @@ -820,8 +820,10 @@ class LumatoneEditorLookAndFeel : public LookAndFeel_V4
for (auto prop : box.getProperties())
l->getProperties().set(prop.name, prop.value);

auto name = box.getName();
auto fontHeight = box.getHeight() * CONTROLBOXFONTHEIGHTSCALAR;
l->setBounds(box.getLocalBounds());
l->setFont(getComboBoxFont(box).withHeight(box.getHeight() * CONTROLBOXFONTHEIGHTSCALAR)); // Any style overrides should have been passed to Label
l->setFont(getComboBoxFont(box)); // Any style overrides should have been passed to Label

return l;
}
Expand All @@ -832,8 +834,10 @@ class LumatoneEditorLookAndFeel : public LookAndFeel_V4
float fontHeight = labelToPosition.getFont().getHeight();

labelToPosition.setBounds(
margin, roundToInt((box.getHeight() - fontHeight) * 0.5f),
box.getWidth() - box.getHeight() - margin, fontHeight
margin
, (box.getHeight() - fontHeight) * 0.5
, box.getWidth() - box.getHeight() - margin /* leave room for down arrow glyph */
, fontHeight
);
}

Expand Down
Loading

0 comments on commit 7172adc

Please sign in to comment.