Skip to content

Commit

Permalink
Draft track-location
Browse files Browse the repository at this point in the history
  • Loading branch information
roelofvkr committed Nov 1, 2024
1 parent 076ddda commit 614fc0d
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/clap/all.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
#include "ext/draft/resource-directory.h"
#include "ext/draft/transport-control.h"
#include "ext/draft/triggers.h"
#include "ext/draft/location.h"
#include "ext/draft/tuning.h"
#include "ext/draft/undo.h"
54 changes: 54 additions & 0 deletions include/clap/ext/draft/location.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#pragma once

#include "../../plugin.h"
#include "../../color.h"

// This extension allows a host to tell the plugin more about its position
// within a project or session.

static CLAP_CONSTEXPR const char CLAP_EXT_LOCATION[] = "clap.location/1";

#ifdef __cplusplus
extern "C" {
#endif

enum {
CLAP_PLUGIN_LOCATION_PROJECT,
CLAP_PLUGIN_LOCATION_TRACK,
CLAP_PLUGIN_LOCATION_TRACK_GROUP,
CLAP_PLUGIN_LOCATION_DEVICE

Check failure on line 19 in include/clap/ext/draft/location.h

View workflow job for this annotation

GitHub Actions / macos-latest-build

missing ',' between enumerators

Check failure on line 19 in include/clap/ext/draft/location.h

View workflow job for this annotation

GitHub Actions / macos-latest-build

missing ',' between enumerators

Check failure on line 19 in include/clap/ext/draft/location.h

View workflow job for this annotation

GitHub Actions / macos-latest-build

missing ',' between enumerators

Check failure on line 19 in include/clap/ext/draft/location.h

View workflow job for this annotation

GitHub Actions / macos-latest-build

missing ',' between enumerators

Check failure on line 19 in include/clap/ext/draft/location.h

View workflow job for this annotation

GitHub Actions / macos-latest-build

missing ',' between enumerators
CLAP_PLUGIN_LOCATION_DEVICE_PARALLEL_GROUP,

Check failure on line 20 in include/clap/ext/draft/location.h

View workflow job for this annotation

GitHub Actions / ubuntu-latest-build

expected ‘,’ or ‘}’ before ‘CLAP_PLUGIN_LOCATION_DEVICE_PARALLEL_GROUP’

Check failure on line 20 in include/clap/ext/draft/location.h

View workflow job for this annotation

GitHub Actions / ubuntu-latest-build

expected ‘,’ or ‘}’ before ‘CLAP_PLUGIN_LOCATION_DEVICE_PARALLEL_GROUP’

Check failure on line 20 in include/clap/ext/draft/location.h

View workflow job for this annotation

GitHub Actions / ubuntu-latest-build

expected ‘}’ before ‘CLAP_PLUGIN_LOCATION_DEVICE_PARALLEL_GROUP’

Check failure on line 20 in include/clap/ext/draft/location.h

View workflow job for this annotation

GitHub Actions / ubuntu-latest-build

expected ‘}’ before ‘CLAP_PLUGIN_LOCATION_DEVICE_PARALLEL_GROUP’

Check failure on line 20 in include/clap/ext/draft/location.h

View workflow job for this annotation

GitHub Actions / ubuntu-latest-build

expected ‘}’ before ‘CLAP_PLUGIN_LOCATION_DEVICE_PARALLEL_GROUP’

Check failure on line 20 in include/clap/ext/draft/location.h

View workflow job for this annotation

GitHub Actions / windows-latest-build

expected ',' or '}' before 'CLAP_PLUGIN_LOCATION_DEVICE_PARALLEL_GROUP'

Check failure on line 20 in include/clap/ext/draft/location.h

View workflow job for this annotation

GitHub Actions / windows-latest-build

expected '}' before 'CLAP_PLUGIN_LOCATION_DEVICE_PARALLEL_GROUP'

Check failure on line 20 in include/clap/ext/draft/location.h

View workflow job for this annotation

GitHub Actions / windows-latest-build

expected '}' before 'CLAP_PLUGIN_LOCATION_DEVICE_PARALLEL_GROUP'

Check failure on line 20 in include/clap/ext/draft/location.h

View workflow job for this annotation

GitHub Actions / windows-latest-build

expected ',' or '}' before 'CLAP_PLUGIN_LOCATION_DEVICE_PARALLEL_GROUP'

Check failure on line 20 in include/clap/ext/draft/location.h

View workflow job for this annotation

GitHub Actions / windows-latest-build

expected '}' before 'CLAP_PLUGIN_LOCATION_DEVICE_PARALLEL_GROUP'
CLAP_PLUGIN_LOCATION_DEVICE_SERIAL_GROUP,
};

Check failure on line 22 in include/clap/ext/draft/location.h

View workflow job for this annotation

GitHub Actions / ubuntu-latest-build

expected unqualified-id before ‘}’ token

Check failure on line 22 in include/clap/ext/draft/location.h

View workflow job for this annotation

GitHub Actions / ubuntu-latest-build

expected unqualified-id before ‘}’ token

Check failure on line 22 in include/clap/ext/draft/location.h

View workflow job for this annotation

GitHub Actions / ubuntu-latest-build

expected unqualified-id before ‘}’ token

Check failure on line 22 in include/clap/ext/draft/location.h

View workflow job for this annotation

GitHub Actions / windows-latest-build

expected unqualified-id before '}' token

Check failure on line 22 in include/clap/ext/draft/location.h

View workflow job for this annotation

GitHub Actions / windows-latest-build

expected unqualified-id before '}' token

Check failure on line 22 in include/clap/ext/draft/location.h

View workflow job for this annotation

GitHub Actions / windows-latest-build

expected unqualified-id before '}' token

typedef struct clap_plugin_location_element {
// Internal ID of the element. This is not intended for display to the user,
// but rather to give the host a potential quick way for lookups.
const char *id;
// User friendly name of the element.
const char *name;
// Kind of the element, must be one of the CLAP_PLUGIN_LOCATION_* values.
int kind;
// Index within the parent element.
uint32_t index_in_group;
// Index of the element in a global context. When sorting elements by this index,
// the order should mirror the order as it is displayed in the host.
uint32_t global_index;
// Color for this element, should be 0x00000000 if no color is used for this
// element.
clap_color_t color;
} clap_plugin_location_element_t;


typedef struct clap_plugin_location {
// Called by the host when the location of the plugin instance changes.
//
// The last item in this array always refers to the device itself, and as
// such is expected to be of kind CLAP_PLUGIN_LOCATION_DEVICE.
// [main-thread]
void (*set_location)(clap_plugin_t *plugin, clap_plugin_location_element_t *path, int num_elements);
} clap_plugin_location_t;

#ifdef __cplusplus
}

Check failure on line 53 in include/clap/ext/draft/location.h

View workflow job for this annotation

GitHub Actions / ubuntu-latest-build

expected declaration before ‘}’ token

Check failure on line 53 in include/clap/ext/draft/location.h

View workflow job for this annotation

GitHub Actions / ubuntu-latest-build

expected declaration before ‘}’ token

Check failure on line 53 in include/clap/ext/draft/location.h

View workflow job for this annotation

GitHub Actions / windows-latest-build

expected declaration before '}' token

Check failure on line 53 in include/clap/ext/draft/location.h

View workflow job for this annotation

GitHub Actions / windows-latest-build

expected declaration before '}' token
#endif

0 comments on commit 614fc0d

Please sign in to comment.