Skip to content

Commit b484b74

Browse files
authored
Usage guide and contribution docs (#180)
1 parent 637932b commit b484b74

File tree

3 files changed

+158
-11
lines changed

3 files changed

+158
-11
lines changed

CONTRIBUTING.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
Contributing to libdjinterop
2+
============================
3+
4+
If you are interested in contributing to `libdjinterop`, thank you!
5+
6+
The easiest way to contribute is to look at the
7+
[issues list](https://github.com/xsco/libdjinterop/issues) and see if there is
8+
anything that you might like to try.
9+
10+
Although `libdjinterop` is a C++ library, there are usually both coding and
11+
non-coding tasks available. All contributions are hugely appreciated!
12+
13+
C++ Style Guide
14+
---------------
15+
16+
C++ coding conventions in `libdjinterop` broadly follow the
17+
[Core C++ Guidelines](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines)
18+
from ISO C++.
19+
20+
Furthermore, there is a [.clang-format](.clang-format) file in the repository,
21+
and all code contributions should conform to this.
22+
23+
Perhaps one day there will be more opinionated formatting/linting, or indeed
24+
a pre-commit hook to enforce it.
25+
26+
Unit Testing
27+
------------
28+
29+
High unit test coverage is _strongly encouraged_ for all C++ code contributions.
30+
It may become a mandatory requirement one day.
31+
32+
External Dependencies
33+
---------------------
34+
35+
Introducing any additional external dependencies into `libdjinterop` is a big
36+
decision that requires proper consideration. The aim is for the library to be
37+
built and compiled with minimal additional requirements, in order to make
38+
wider adoption as easy as possible.
39+
40+
For an external dependency to be considered, ideally it should be readily
41+
available on all stable versions of each target operating system, as well as
42+
be a stable and mature library.
43+
44+
For dependencies that do not meet these criteria, another option is to 'vendor'
45+
the dependencies into the codebase under the [ext/](ext) directory hierarchy.
46+
47+
OS Compatibility
48+
----------------
49+
50+
The library is expected to compile on:
51+
52+
* Windows - all supported versions
53+
* Linux:
54+
* Ubuntu - all LTS versions
55+
* Red Hat and friends - all supported versions
56+
* Arch Linux
57+
* macOS - all recent versions
58+
59+
The biggest user of this library is undoubtedly the [Mixxx](https://mixxx.org)
60+
open source DJ application. As such, it is a very sensible idea to ensure that
61+
the library always compiles on the operating systems that Mixxx targets too.

GUIDE.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
Guide to libdjinterop
2+
=====================
3+
4+
This documentation provides an introductory guide to the public API of
5+
`libdjinterop`, and provides information on how to get started using it.
6+
7+
High-level vs. Low-level APIs
8+
-----------------------------
9+
10+
The library offers so-called "high-level" and "low-level" APIs, which serve
11+
different purposes.
12+
13+
Low-level APIs
14+
--------------
15+
16+
The low-level APIs provides a very thin wrapper over a specific DJ database
17+
library format. A low-level API exposes all the peculiarities, details, and
18+
expressivity of that format, and does not offer any abstractions beyond
19+
presenting a C++ library interface.
20+
21+
There are multiple low-level APIs, one for each type of DJ library format.
22+
There can also be multiple low-level APIs to cover occasions where a library
23+
undergoes a significant change to its schema (e.g. Engine 1.x and Engine 2.x
24+
are distinct low-level APIs).
25+
26+
Sometimes, a low-level API (or collection of them) offer utility functions that
27+
help the end user translate from common concepts into encodings or types that
28+
are specific to the low-level library format. An example could be calculating
29+
the preferred size of a waveform for a given format.
30+
31+
The current low-level APIs offered are listed below:
32+
33+
| Low-level API | Include Path |
34+
|---------------|-----------------------------------------------------|
35+
| Engine 2.x | `#include <djinterop/engine/v2/engine_library.hpp>` |
36+
| Engine 3.x | `#include <djinterop/engine/v3/engine_library.hpp>` |
37+
38+
Note that there is no low-level API for Engine 1.x at present. This is because
39+
when the library was first being written, Engine 1.x support was introduced
40+
directly into the high-level API without a low-level companion. The low-level
41+
API was developed with the introduction of Engine 2.x, and because the 1.x
42+
library was effectively now deprecated, the effort was not undertaken to
43+
backport the idea to 1.x. If a low-level API for Engine 1.x is important to
44+
you, please consider contributing!
45+
46+
High-level API
47+
--------------
48+
49+
The library offers a high-level API as well, with a very different purpose to
50+
that of the low-level APIs. Whereas low-level APIs simply expose an underlying
51+
DJ library format in the form of a C++ API, the high-level API aims to:
52+
53+
* Abstract over all format-specific aspects.
54+
* Offer a uniform interface, regardless of the underlying DJ library format.
55+
* Offer meaningful DJ library concepts, in the form of lightweight handles to
56+
objects in the underlying DJ library, that can be read or updated.
57+
58+
The primary concepts in the high-level API are:
59+
60+
* _Database_, representing the overall DJ library.
61+
* _Track_, representing a lightweight handle to a track in the library.
62+
* _Track snapshot_, representing a collection of offline data read from a track
63+
in the library.
64+
* _Crate_, representing an unordered list of related tracks.
65+
* _Playlist_, representing an ordered list of related tracks.
66+
67+
Part of the challenge in developing `libdjinterop` is to ensure that the
68+
high-level API appropriately abstracts over all the different ways that the
69+
above concepts might be implemented in a real DJ library format.
70+
71+
In reality, a DJ library that exists on disk is always of a specific format.
72+
As such, in order to create a new library or load an existing library with the
73+
intention of operating on it using the high-level API, it is always necessary
74+
to start with format-specific functions to do so:
75+
76+
| Library Type | Include Path |
77+
|--------------|------------------------------------------|
78+
| Engine | `#include <djinterop/engine/engine.hpp>` |
79+
80+
81+
Stable API/ABI
82+
--------------
83+
84+
The library does not yet commit to offer either a stable API nor ABI. This
85+
situation may change in the future as the library matures.

README.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,11 @@ Overview
44
`libdjinterop` is a C++ library that allows access to database formats used to
55
store information about DJ record libraries.
66

7-
This library currently supports:
8-
9-
* Engine Library, as used on "Prime"-series DJ equipment.
10-
11-
Documentation can be viewed on [GitHub Pages](https://xsco.github.io/libdjinterop/)
12-
137
State of Support
148
================
159

16-
The library is currently in an early beta stage, and not all features are
17-
implemented yet. It currently supports only the Engine Library format.
10+
The library is currently in development, and not all features are implemented
11+
yet. It currently supports only the Engine Library format.
1812

1913
What is supported:
2014

@@ -29,7 +23,8 @@ What is supported:
2923
The library supports the following firmware and application versions:
3024

3125
* Engine DJ OS from 1.0.3 to 4.3.3.
32-
* Tested on Denon SC5000 and Numark Mixstream Pro. Other players (e.g. SC6000/M) may work, but this is currently untested.
26+
* Tested on Denon SC5000 and Numark Mixstream Pro. Other players (e.g.
27+
SC6000/M) may work, but this is currently untested.
3328
* Engine DJ Desktop (aka Engine Prime) from 1.0.1 to 4.3.0.
3429

3530
What is not supported (yet):
@@ -41,8 +36,14 @@ What is not supported (yet):
4136
How Do I Use It?
4237
================
4338

44-
The library is not ready for prime-time yet, but if you are willing to read
45-
source code, example applications can be found in the `example` directory.
39+
If you are new to the library, see the [introductory guide](GUIDE.md) for an
40+
explanation of how the library is structured and how to get started.
41+
42+
The [examples/](example) directory contains some small self-contained
43+
applications that use the library.
44+
45+
Detailed reference documentation for the public API can be viewed on
46+
[GitHub Pages](https://xsco.github.io/libdjinterop/).
4647

4748
How Do I Build It?
4849
============================

0 commit comments

Comments
 (0)