Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
shaduzlabs committed Sep 23, 2016
2 parents 7e1df65 + e355e62 commit 732e9bc
Show file tree
Hide file tree
Showing 79 changed files with 491 additions and 621 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ string(TIMESTAMP CABL_BUILD_DATE "%Y-%m-%d")

set (CABL_VERSION_MAJOR 0)
set (CABL_VERSION_MINOR 9)
set (CABL_VERSION_MICRO 4)
set (CABL_VERSION_MICRO 5)
set (CABL_VERSION_STRING "${CABL_VERSION_MAJOR}.${CABL_VERSION_MINOR}.${CABL_VERSION_MICRO}")

if($ENV{APPVEYOR})
Expand Down Expand Up @@ -218,7 +218,7 @@ set(

set(
inc_util_INCLUDES
inc/cabl/util/ColorRGB.h
inc/cabl/util/Color.h
inc/cabl/util/Functions.h
inc/cabl/util/Log.h
inc/cabl/util/Macros.h
Expand Down Expand Up @@ -410,7 +410,7 @@ set(

set(
src_util_SRCS
src/util/ColorRGB.cpp
src/util/Color.cpp
src/util/Functions.cpp
src/util/Version.cpp
)
Expand Down
10 changes: 5 additions & 5 deletions examples/device-test/DeviceTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@

namespace
{
const sl::util::ColorRGB kColor_Black{0};
const sl::util::ColorRGB kColor_Red{0xff, 0, 0, 0xff};
const sl::util::ColorRGB kColor_Yellow{0xff, 0xff, 0, 0x55};
const sl::util::ColorRGB kColor_Blue{0xff, 0, 0, 0x77};
const sl::Color kColor_Black{0};
const sl::Color kColor_Red{0xff, 0, 0, 0xff};
const sl::Color kColor_Yellow{0xff, 0xff, 0, 0x55};
const sl::Color kColor_Blue{0xff, 0, 0, 0x77};
}

//--------------------------------------------------------------------------------------------------
Expand All @@ -31,7 +31,7 @@ namespace sl
{

using namespace midi;
using namespace util;
using namespace cabl;
using namespace std::placeholders;

//--------------------------------------------------------------------------------------------------
Expand Down
13 changes: 6 additions & 7 deletions examples/euklid/Euklid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ const uint8_t kEuklidDefaultPulses = 4;
const uint8_t kEuklidDefaultOffset = 0;
const uint8_t kEuklidNumTracks = 3;

const sl::util::ColorRGB kEuklidColor_Track[3] = {{60, 0, 0, 80}, {0, 60, 0, 80}, {0, 0, 60, 80}};
const sl::util::ColorRGB kEuklidColor_Track_CurrentStep[3]
const sl::Color kEuklidColor_Track[3] = {{60, 0, 0, 80}, {0, 60, 0, 80}, {0, 0, 60, 80}};
const sl::Color kEuklidColor_Track_CurrentStep[3]
= {{127, 0, 0, 127}, {0, 127, 0, 127}, {0, 0, 127, 127}};

const sl::util::ColorRGB kEuklidColor_Black(0, 0, 0, 0);
const sl::Color kEuklidColor_Black(0, 0, 0, 0);

const sl::util::ColorRGB kEuklidColor_Step_Empty(35, 35, 35, 20);
const sl::util::ColorRGB kEuklidColor_Step_Empty_Current(127, 127, 127, 50);
const sl::Color kEuklidColor_Step_Empty(35, 35, 35, 20);
const sl::Color kEuklidColor_Step_Empty_Current(127, 127, 127, 50);
}

//--------------------------------------------------------------------------------------------------
Expand All @@ -38,7 +38,6 @@ namespace sl
{

using namespace midi;
using namespace util;
using namespace std::placeholders;

//--------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -341,7 +340,7 @@ void Euklid::updateGUI()
device()->graphicDisplay(0)->setPixel(j, i, {static_cast<uint8_t>(j), 0, 0});
}
}
static util::ColorRGB s_colorWhite{0xff};
static Color s_colorWhite{0xff};
static Alignment s_alignCenter = Alignment::Center;

std::string strTrackName = "TRACK " + std::to_string(m_currentTrack + 1);
Expand Down
2 changes: 1 addition & 1 deletion inc/cabl/cabl.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class Lib
public:
static std::string version()
{
return util::Version(CABL_VERSION_MAJOR, CABL_VERSION_MINOR, CABL_VERSION_MICRO);
return Version(CABL_VERSION_MAJOR, CABL_VERSION_MINOR, CABL_VERSION_MICRO);
}
};

Expand Down
2 changes: 0 additions & 2 deletions inc/cabl/client/Client.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ namespace cabl

//--------------------------------------------------------------------------------------------------

using namespace devices;

class Client
{
public:
Expand Down
5 changes: 1 addition & 4 deletions inc/cabl/devices/Coordinator.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,14 @@ namespace sl
{
namespace cabl
{
namespace devices
{

//--------------------------------------------------------------------------------------------------

class Coordinator
{
public:
using tCollDeviceDescriptor = std::vector<DeviceDescriptor>;
using tDevicePtr = std::shared_ptr<devices::Device>;
using tDevicePtr = std::shared_ptr<Device>;
using tCollDevices = std::map<DeviceDescriptor, tDevicePtr>;

using tClientId = std::string;
Expand Down Expand Up @@ -84,6 +82,5 @@ class Coordinator

//--------------------------------------------------------------------------------------------------

} // namespace devices
} // namespace cabl
} // namespace sl
10 changes: 3 additions & 7 deletions inc/cabl/devices/Device.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "cabl/comm/DeviceHandle.h"
#include "cabl/devices/DeviceRegistrar.h"

#include "cabl/util/ColorRGB.h"
#include "cabl/util/Color.h"

namespace sl
{
Expand All @@ -32,9 +32,6 @@ class Canvas;
class TextDisplay;
class LedArray;

namespace devices
{

class Device
{

Expand Down Expand Up @@ -260,9 +257,9 @@ class Device

virtual size_t numOfLedArrays() const = 0;

virtual void setButtonLed(Button, const util::ColorRGB&);
virtual void setButtonLed(Button, const Color&);

virtual void setKeyLed(unsigned, const util::ColorRGB&);
virtual void setKeyLed(unsigned, const Color&);

virtual void sendMidiMsg(tRawData);

Expand Down Expand Up @@ -323,6 +320,5 @@ class Device

//--------------------------------------------------------------------------------------------------

} // namespace devices
} // namespace cabl
} // namespace sl
9 changes: 0 additions & 9 deletions inc/cabl/devices/DeviceFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@ namespace cabl
//--------------------------------------------------------------------------------------------------

class DeviceHandle;

//--------------------------------------------------------------------------------------------------

namespace devices
{

//--------------------------------------------------------------------------------------------------

class Device;

//--------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -56,6 +48,5 @@ class DeviceFactory

//--------------------------------------------------------------------------------------------------

} // namespace devices
} // namespace cabl
} // namespace sl
6 changes: 0 additions & 6 deletions inc/cabl/devices/DeviceRegistrar.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ namespace cabl

//--------------------------------------------------------------------------------------------------

namespace devices
{

//--------------------------------------------------------------------------------------------------

class Device;

//--------------------------------------------------------------------------------------------------
Expand All @@ -48,6 +43,5 @@ class DeviceRegistrar

//--------------------------------------------------------------------------------------------------

} // namespace devices
} // namespace cabl
} // namespace sl
42 changes: 21 additions & 21 deletions inc/cabl/gfx/Canvas.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <cstdint>
#include <string>

#include "cabl/util/ColorRGB.h"
#include "cabl/util/Color.h"
#include "cabl/util/Types.h"

#include "cabl/gfx/FontManager.h"
Expand Down Expand Up @@ -149,15 +149,15 @@ class Canvas
\param color_ The pixel color (RGB + Monochrome)
*/
virtual void setPixel(
unsigned x_, unsigned y_, const util::ColorRGB& color_, bool bSetDirtyChunk_ = true);
unsigned x_, unsigned y_, const Color& color_, bool bSetDirtyChunk_ = true);

//! Get the pixel value as an RGB color
/*!
\param x_ The X coordinate of the pixel
\param y_ The Y coordinate of the pixel
\return The color of the selected pixel
*/
virtual util::ColorRGB pixel(unsigned x_, unsigned y_) const;
virtual Color pixel(unsigned x_, unsigned y_) const;

//! Draw a line
/*!
Expand All @@ -168,7 +168,7 @@ class Canvas
\param color_ The line color (white, black, invert, random)
*/
virtual void line(
unsigned x0_, unsigned y0_, unsigned x1_, unsigned y1_, const util::ColorRGB& color_);
unsigned x0_, unsigned y0_, unsigned x1_, unsigned y1_, const Color& color_);

//! Draw a bitmap
/*!
Expand All @@ -180,65 +180,65 @@ class Canvas
\param color_ The color of the pixels
*/

virtual void lineVertical(unsigned x_, unsigned y_, unsigned h_, const util::ColorRGB& color_);
virtual void lineHorizontal(unsigned x_, unsigned y_, unsigned w_, const util::ColorRGB& color_);
virtual void lineVertical(unsigned x_, unsigned y_, unsigned h_, const Color& color_);
virtual void lineHorizontal(unsigned x_, unsigned y_, unsigned w_, const Color& color_);

virtual void triangle(unsigned x0_,
unsigned y0_,
unsigned x1_,
unsigned y1_,
unsigned x2_,
unsigned y2_,
const util::ColorRGB& color_);
const Color& color_);
virtual void triangleFilled(unsigned x0_,
unsigned y0_,
unsigned x1_,
unsigned y1_,
unsigned x2_,
unsigned y2_,
const util::ColorRGB& color_,
const util::ColorRGB& fillColor_);
const Color& color_,
const Color& fillColor_);

virtual void rectangle(
unsigned x_, unsigned y_, unsigned w_, unsigned h_, const util::ColorRGB& color_);
unsigned x_, unsigned y_, unsigned w_, unsigned h_, const Color& color_);

virtual void rectangleFilled(unsigned x_,
unsigned y_,
unsigned w_,
unsigned h_,
const util::ColorRGB& color_,
const util::ColorRGB& fillColor_);
const Color& color_,
const Color& fillColor_);

virtual void rectangleRounded(
unsigned x_, unsigned y_, unsigned w_, unsigned h_, unsigned r_, const util::ColorRGB& color_);
unsigned x_, unsigned y_, unsigned w_, unsigned h_, unsigned r_, const Color& color_);

virtual void rectangleRoundedFilled(unsigned x_,
unsigned y_,
unsigned w_,
unsigned h_,
unsigned r_,
const util::ColorRGB& color_,
const util::ColorRGB& fillColor_);
const Color& color_,
const Color& fillColor_);

virtual void circle(unsigned rx_,
unsigned ry_,
unsigned r_,
const util::ColorRGB& color_,
const Color& color_,
CircleType = CircleType::Full);

virtual void circleFilled(unsigned x_,
unsigned y_,
unsigned r_,
const util::ColorRGB& color_,
const util::ColorRGB& fillColor_,
const Color& color_,
const Color& fillColor_,
CircleType = CircleType::Full);

virtual void putBitmap(unsigned x_,
unsigned y_,
unsigned w_,
unsigned h_,
const uint8_t* pBitmap_,
const util::ColorRGB& color_);
const Color& color_);

virtual void putCanvas(const Canvas& c_,
unsigned xDest_,
Expand Down Expand Up @@ -267,7 +267,7 @@ class Canvas
\param color_ The color of the pixels
*/
virtual void putCharacter(
unsigned x_, unsigned y_, char c_, const util::ColorRGB& color_, const std::string& font_ = "");
unsigned x_, unsigned y_, char c_, const Color& color_, const std::string& font_ = "");

//! Print a string
/*!
Expand All @@ -281,7 +281,7 @@ class Canvas
virtual void putText(unsigned x_,
unsigned y_,
const char* pStr_,
const util::ColorRGB& color_,
const Color& color_,
const std::string& font_ = "",
unsigned spacing_ = 0);

Expand Down

0 comments on commit 732e9bc

Please sign in to comment.