Skip to content

Commit

Permalink
Clean Up Binary Libs and Locations (#4848)
Browse files Browse the repository at this point in the history
Closes #4846
  • Loading branch information
baconpaul authored Aug 16, 2021
1 parent 7a55203 commit 8b9893c
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 62 deletions.
17 changes: 10 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,14 @@ add_subdirectory(libs/sqlite-3.23.3)
add_subdirectory(libs/LuaJitLib)

juce_add_binary_data(surge-shared-binary
NAMESPACE SurgeCoreBinary
HEADER_NAME SurgeCoreBinary.h
NAMESPACE SurgeSharedBinary
HEADER_NAME SurgeSharedBinary.h
SOURCES
resources/data/configuration.xml
resources/surge-xt/README_UserArea.txt
resources/surge-xt/memoryWavetable.wt
resources/data/windows.wt
resources/data/paramdocumentation.xml)
resources/surge-shared/configuration.xml
resources/surge-shared/README_UserArea.txt
resources/surge-shared/memoryWavetable.wt
resources/surge-shared/windows.wt
resources/surge-shared/paramdocumentation.xml)

target_link_libraries(surge-shared PUBLIC
luajit-5.1
Expand Down Expand Up @@ -890,6 +890,9 @@ if( BUILD_SURGE_XT )
)

juce_add_binary_data( surge-xt-binary
NAMESPACE SurgeXTBinary
HEADER_NAME SurgeXTBinary.h

SOURCES ${SURGE_SYNTH_JUCE_RESOURCES_GLOB}
)
set_target_properties(surge-xt-binary PROPERTIES
Expand Down
33 changes: 0 additions & 33 deletions resources/data/patchbrowser/patchbrowser_init.sql

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
24 changes: 12 additions & 12 deletions src/common/SurgeStorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <queue>
#include <vembertech/vt_dsp_endian.h>
#include "UserDefaults.h"
#include "SurgeCoreBinary.h"
#include "SurgeSharedBinary.h"

#if MAC
#include <cstdlib>
Expand Down Expand Up @@ -485,9 +485,9 @@ SurgeStorage::SurgeStorage(std::string suppliedDataPath) : otherscene_clients(0)
*/

// TIXML requires a newline at end.
auto cxmlData =
std::string(SurgeCoreBinary::configuration_xml, SurgeCoreBinary::configuration_xmlSize) +
"\n";
auto cxmlData = std::string(SurgeSharedBinary::configuration_xml,
SurgeSharedBinary::configuration_xmlSize) +
"\n";
if (!snapshotloader.Parse(cxmlData.c_str()))
{
reportError("Cannot parse 'configuration.xml' in path '" + datapath +
Expand All @@ -514,8 +514,8 @@ SurgeStorage::SurgeStorage(std::string suppliedDataPath) : otherscene_clients(0)

// WindowWT is a Wavetable which now has a constructor so don't do this
// memset(&WindowWT, 0, sizeof(WindowWT));
if (loadWtAndPatch &&
!load_wt_wt_mem(SurgeCoreBinary::windows_wt, SurgeCoreBinary::windows_wtSize, &WindowWT))
if (loadWtAndPatch && !load_wt_wt_mem(SurgeSharedBinary::windows_wt,
SurgeSharedBinary::windows_wtSize, &WindowWT))
{
WindowWT.size = 0;
std::ostringstream oss;
Expand All @@ -540,8 +540,8 @@ SurgeStorage::SurgeStorage(std::string suppliedDataPath) : otherscene_clients(0)
// Load the XML DocStrings if we are loading startup data
if (loadWtAndPatch)
{
auto pdData = std::string(SurgeCoreBinary::paramdocumentation_xml,
SurgeCoreBinary::paramdocumentation_xmlSize) +
auto pdData = std::string(SurgeSharedBinary::paramdocumentation_xml,
SurgeSharedBinary::paramdocumentation_xmlSize) +
"\n";

TiXmlDocument doc;
Expand Down Expand Up @@ -673,8 +673,8 @@ void SurgeStorage::createUserDirectory()
userSkinsPath, userMidiMappingsPath})
fs::create_directories(string_to_path(s));

auto rd = std::string(SurgeCoreBinary::README_UserArea_txt,
SurgeCoreBinary::README_UserArea_txtSize) +
auto rd = std::string(SurgeSharedBinary::README_UserArea_txt,
SurgeSharedBinary::README_UserArea_txtSize) +
"\n";
auto of =
std::ofstream(string_to_path(userDataPath) / "README.txt", std::ofstream::out);
Expand Down Expand Up @@ -1110,8 +1110,8 @@ void SurgeStorage::load_wt(int id, Wavetable *wt, OscillatorStorage *osc)
wt->queue_id = -1;
if (wt_list.empty() && id == 0)
{
load_wt_wt_mem(SurgeCoreBinary::memoryWavetable_wt, SurgeCoreBinary::memoryWavetable_wtSize,
wt);
load_wt_wt_mem(SurgeSharedBinary::memoryWavetable_wt,
SurgeSharedBinary::memoryWavetable_wtSize, wt);
if (osc)
strncpy(osc->wavetable_display_name, "Sin to Saw", TXT_SIZE);

Expand Down
12 changes: 6 additions & 6 deletions src/gui/RuntimeFont.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/

#include "RuntimeFont.h"
#include "BinaryData.h"
#include "SurgeXTBinary.h"

#include <iostream>

Expand All @@ -27,15 +27,15 @@ DefaultFonts::DefaultFonts()
{
#define TEST_WITH_INDIE_FLOWER 0
#if TEST_WITH_INDIE_FLOWER
latoRegularTypeface = juce::Typeface::createSystemTypefaceFor(BinaryData::IndieFlower_ttf,
BinaryData::IndieFlower_ttfSize);
latoRegularTypeface = juce::Typeface::createSystemTypefaceFor(
SurgeXTBinary::IndieFlower_ttf, SurgeXTBinary::IndieFlower_ttfSize);
#else
latoRegularTypeface = juce::Typeface::createSystemTypefaceFor(BinaryData::LatoRegular_ttf,
BinaryData::LatoRegular_ttfSize);
latoRegularTypeface = juce::Typeface::createSystemTypefaceFor(
SurgeXTBinary::LatoRegular_ttf, SurgeXTBinary::LatoRegular_ttfSize);
#endif

firaMonoRegularTypeface = juce::Typeface::createSystemTypefaceFor(
BinaryData::FiraMonoRegular_ttf, BinaryData::FiraMonoRegular_ttfSize);
SurgeXTBinary::FiraMonoRegular_ttf, SurgeXTBinary::FiraMonoRegular_ttfSize);
displayFont = getLatoAtSize(9);
patchNameFont = getLatoAtSize(13);
lfoTypeFont = getLatoAtSize(8);
Expand Down
5 changes: 3 additions & 2 deletions src/gui/SkinSupport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <set>
#include <iostream>
#include <iomanip>
#include "BinaryData.h"
#include "SurgeXTBinary.h"

namespace Surge
{
Expand Down Expand Up @@ -277,7 +277,8 @@ bool Skin::reloadSkin(std::shared_ptr<SurgeImageStore> bitmapStore)
TiXmlDocument doc;
if (useInMemorySkin)
{
auto memSkin = std::string(BinaryData::memoryskin_xml, BinaryData::memoryskin_xmlSize);
auto memSkin =
std::string(SurgeXTBinary::memoryskin_xml, SurgeXTBinary::memoryskin_xmlSize);
doc.Parse(memSkin.c_str());
}
else
Expand Down
4 changes: 2 additions & 2 deletions src/gui/SurgeImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
*/

#include "SurgeImage.h"
#include "BinaryData.h"
#include "SurgeXTBinary.h"

SurgeImage::SurgeImage(int rid)
{
resourceID = rid;
std::string fn = "bmp00" + std::to_string(rid) + "_svg";
int bds;
auto bd = BinaryData::getNamedResource(fn.c_str(), bds);
auto bd = SurgeXTBinary::getNamedResource(fn.c_str(), bds);
if (bd)
{
drawable = juce::Drawable::createFromImageData(bd, bds);
Expand Down

0 comments on commit 8b9893c

Please sign in to comment.