Browse Source

rename macro to CARLA_UTILS_USE_QT, cleanup use

Signed-off-by: falkTX <falktx@falktx.com>
pull/1780/head
falkTX 1 year ago
parent
commit
4ef7357545
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
4 changed files with 12 additions and 25 deletions
  1. +1
    -10
      source/backend/utils/CachedPlugins.cpp
  2. +1
    -5
      source/backend/utils/Information.cpp
  3. +5
    -5
      source/utils/CarlaBinaryUtils.hpp
  4. +5
    -5
      source/utils/CarlaLv2Utils.hpp

+ 1
- 10
source/backend/utils/CachedPlugins.cpp View File

@@ -36,11 +36,7 @@
# include "CarlaJsfxUtils.hpp"
#endif

#if defined(USE_QT) || defined(BUILDING_CARLA_OBS)
# include <QtCore/QFileInfo>
#else
# include "water/files/File.h"
#endif
#include "water/files/File.h"

namespace CB = CARLA_BACKEND_NAMESPACE;

@@ -208,13 +204,8 @@ static const CarlaCachedPluginInfo* get_cached_plugin_lv2(Lv2WorldClass& lv2Worl

if (char* const bundle = lilv_file_uri_parse(lilvPlugin.get_bundle_uri().as_uri(), nullptr))
{
#if defined(USE_QT) || defined(BUILDING_CARLA_OBS)
const QFileInfo fbundle(QString::fromUtf8(bundle));
suri = (fbundle.fileName() + CARLA_OS_SEP).toUtf8().constData() + suri;
#else
const water::File fbundle(bundle);
suri = (fbundle.getFileName() + CARLA_OS_SEP).toRawUTF8() + suri;
#endif
lilv_free(bundle);
}
else


+ 1
- 5
source/backend/utils/Information.cpp View File

@@ -44,9 +44,7 @@
# pragma GCC diagnostic pop
#endif

#if !(defined(USE_QT) || defined(BUILDING_CARLA_OBS))
# include "water/files/File.h"
#endif
#include "water/files/File.h"

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

@@ -245,7 +243,6 @@ const char* const* carla_get_supported_features()

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

#if !(defined(USE_QT) || defined(BUILDING_CARLA_OBS))
const char* carla_get_library_filename()
{
carla_debug("carla_get_library_filename()");
@@ -275,6 +272,5 @@ const char* carla_get_library_folder()

return ret;
}
#endif

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

+ 5
- 5
source/utils/CarlaBinaryUtils.hpp View File

@@ -21,7 +21,7 @@
#include "CarlaBackend.h"
#include "CarlaScopeUtils.hpp"

#if defined(USE_QT) || defined(BUILDING_CARLA_OBS)
#if defined(CARLA_UTILS_USE_QT)
# include <QtCore/QFile>
# include <QtCore/QString>
#else
@@ -132,7 +132,7 @@ BinaryType getBinaryTypeFromFile(const char* const filename)
}
#endif

#if defined(USE_QT) || defined(BUILDING_CARLA_OBS)
#if defined(CARLA_UTILS_USE_QT)
QFile file(QString::fromUtf8(filename));
CARLA_SAFE_ASSERT_RETURN(file.open(QIODevice::ReadOnly), BINARY_NATIVE);
#else
@@ -148,7 +148,7 @@ BinaryType getBinaryTypeFromFile(const char* const filename)
// See https://github.com/Ardour/ardour/blob/master/libs/ardour/plugin_manager.cc#L867,L925
// Copyright (C) 2000-2006 Paul Davis

#if defined(USE_QT) || defined(BUILDING_CARLA_OBS)
#if defined(CARLA_UTILS_USE_QT)
char buf[68];
if (file.read(buf, 68) != 68)
#else
@@ -163,14 +163,14 @@ BinaryType getBinaryTypeFromFile(const char* const filename)
const int32_t* const pe_hdr_off_ptr = (int32_t*)&buf[60];
const int32_t pe_hdr_off = *pe_hdr_off_ptr;

#if defined(USE_QT) || defined(BUILDING_CARLA_OBS)
#if defined(CARLA_UTILS_USE_QT)
if (! file.seek(pe_hdr_off))
#else
if (! stream->setPosition(pe_hdr_off))
#endif
return BINARY_NATIVE;

#if defined(USE_QT) || defined(BUILDING_CARLA_OBS)
#if defined(CARLA_UTILS_USE_QT)
if (file.read(buf, 6) != 6)
#else
if (stream->read(buf, 6) != 6)


+ 5
- 5
source/utils/CarlaLv2Utils.hpp View File

@@ -1,6 +1,6 @@
/*
* Carla LV2 utils
* Copyright (C) 2011-2022 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2011-2023 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -83,7 +83,7 @@

#include "lv2_rdf.hpp"

#if defined(USE_QT) || defined(BUILDING_CARLA_OBS)
#if defined(CARLA_UTILS_USE_QT)
# include <QtCore/QStringList>
#else
# include "water/text/StringArray.h"
@@ -1822,7 +1822,7 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI uri, const bool loadPresets)

if (replaceNode.is_uri())
{
#if defined(USE_QT) || defined(BUILDING_CARLA_OBS)
#if defined(CARLA_UTILS_USE_QT)
const QString replaceURI(replaceNode.as_uri());

if (replaceURI.startsWith("urn:"))
@@ -2752,7 +2752,7 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI uri, const bool loadPresets)
if (presetNodes.size() > 0)
{
// create a list of preset URIs (for sorting and unique-ness)
#if defined(USE_QT) || defined(BUILDING_CARLA_OBS)
#if defined(CARLA_UTILS_USE_QT)
QStringList presetListURIs;

LILV_FOREACH(nodes, it, presetNodes)
@@ -2813,7 +2813,7 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI uri, const bool loadPresets)

if (presetLabelNodes.size() > 0)
{
#if defined(USE_QT) || defined(BUILDING_CARLA_OBS)
#if defined(CARLA_UTILS_USE_QT)
const int index = presetListURIs.indexOf(QString(presetURI));
#else
const int index = presetListURIs.indexOf(water::String(presetURI));


Loading…
Cancel
Save