Skip to content

Commit

Permalink
Merge pull request #87 from bitwig/spotless
Browse files Browse the repository at this point in the history
Use formatting tools for java code so its easier to deal with external contributors
  • Loading branch information
kurasu authored Nov 21, 2024
2 parents 2f2912f + 6f31fb9 commit 08a57cd
Show file tree
Hide file tree
Showing 71 changed files with 2,411 additions and 2,320 deletions.
550 changes: 368 additions & 182 deletions Reference.html

Large diffs are not rendered by default.

15 changes: 12 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
plugins {
id 'java'
id 'eclipse'
id 'idea'
id 'java'
id 'eclipse'
id 'idea'
id "com.diffplug.spotless" version "6.25.0"
}

repositories {
Expand All @@ -23,6 +24,14 @@ dependencies {
testImplementation 'org.reflections:reflections:0.10.2'
}

spotless {
java {
importOrder('java', 'javax', 'jakarta', '')
removeUnusedImports()
eclipse()
}
}

group = 'com.bitwig.open'
version = '1-SNAPSHOT'
description = 'dawproject file format'
Expand Down
15 changes: 7 additions & 8 deletions src/main/java/com/bitwig/dawproject/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
import jakarta.xml.bind.annotation.XmlAttribute;

/** Metadata about the application which saved the DAWPROJECT file. */
public class Application
{
/** Name of the application. */
@XmlAttribute(required = true)
public String name;
public class Application {
/** Name of the application. */
@XmlAttribute(required = true)
public String name;

/** Version number of the application. */
@XmlAttribute(required = true)
public String version;
/** Version number of the application. */
@XmlAttribute(required = true)
public String version;
}
63 changes: 35 additions & 28 deletions src/main/java/com/bitwig/dawproject/Arrangement.java
Original file line number Diff line number Diff line change
@@ -1,41 +1,48 @@
package com.bitwig.dawproject;

import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlRootElement;

import com.bitwig.dawproject.timeline.Lanes;
import com.bitwig.dawproject.timeline.Markers;
import com.bitwig.dawproject.timeline.Points;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlRootElement;

/** Represents the main Arrangement timeline of a DAW. */

@XmlRootElement(name = "Arrangement")
public class Arrangement extends Referenceable
{
/** Automation data for time-signature inside this Arrangement.
* <pre>{@code
* <Arrangement>
* <TimeSignatureAutomation target="id-of-TimeSignatureParameter" ... >
* <TimeSignaturePoint time="0" numerator="7", denominator="8"/>
* <TimeSignaturePoint time="21" numerator="4", denominator="4"/>
* ...
* </TimeSignatureAutomation>
* </Arrangement>
* }</pre>
* */
@XmlElement(required = false, name = "TimeSignatureAutomation", type = Points.class)
public Points timeSignatureAutomation;
public class Arrangement extends Referenceable {
/**
* Automation data for time-signature inside this Arrangement.
*
* <pre>{@code
* <Arrangement>
* <TimeSignatureAutomation target="id-of-TimeSignatureParameter" ... >
* <TimeSignaturePoint time="0" numerator="7", denominator="8"/>
* <TimeSignaturePoint time="21" numerator="4", denominator="4"/>
* ...
* </TimeSignatureAutomation>
* </Arrangement>
* }</pre>
*/
@XmlElement(required = false, name = "TimeSignatureAutomation", type = Points.class)
public Points timeSignatureAutomation;

/** Automation data for tempo inside this Arrangement, which will define the conversion between seconds and beats
* at the root level. */
@XmlElement(required = false, name = "TempoAutomation", type = Points.class)
public Points tempoAutomation;
/**
* Automation data for tempo inside this Arrangement, which will define the
* conversion between seconds and beats at the root level.
*/
@XmlElement(required = false, name = "TempoAutomation", type = Points.class)
public Points tempoAutomation;

/** Cue markers inside this arrangement */
@XmlElement(required = false, name = "Markers", type = Markers.class)
public Markers markers;
/** Cue markers inside this arrangement */
@XmlElement(required = false, name = "Markers", type = Markers.class)
public Markers markers;

/** The lanes of this arrangement. Generally this would contain another Lanes timeline for (and scoped to) each
* track which would then contain all Note, Audio, and Automation timelines. */
@XmlElement(name = "Lanes", type = Lanes.class)
public Lanes lanes;
/**
* The lanes of this arrangement. Generally this would contain another Lanes
* timeline for (and scoped to) each track which would then contain all Note,
* Audio, and Automation timelines.
*/
@XmlElement(name = "Lanes", type = Lanes.class)
public Lanes lanes;
}
14 changes: 8 additions & 6 deletions src/main/java/com/bitwig/dawproject/BoolParameter.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

import jakarta.xml.bind.annotation.XmlAttribute;
import jakarta.xml.bind.annotation.XmlRootElement;
/** Represents a parameter which can provide a boolean (true/false) value and be used as an automation target. */
/**
* Represents a parameter which can provide a boolean (true/false) value and be
* used as an automation target.
*/
@XmlRootElement(name = "BoolParameter")
public class BoolParameter extends Parameter
{
/** Boolean value for this parameter. */
@XmlAttribute(required = false)
public Boolean value;
public class BoolParameter extends Parameter {
/** Boolean value for this parameter. */
@XmlAttribute(required = false)
public Boolean value;
}
86 changes: 43 additions & 43 deletions src/main/java/com/bitwig/dawproject/Channel.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,57 +2,57 @@

import java.util.List;

import com.bitwig.dawproject.device.Device;
import jakarta.xml.bind.annotation.XmlAttribute;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlElementRef;
import jakarta.xml.bind.annotation.XmlElementWrapper;
import jakarta.xml.bind.annotation.XmlIDREF;
import jakarta.xml.bind.annotation.XmlRootElement;

import com.bitwig.dawproject.device.Device;

/**
* Represents a mixer channel. It provides the ability to route signals to other channels and can contain
* Device/Plug-in for processing.
* Represents a mixer channel. It provides the ability to route signals to other
* channels and can contain Device/Plug-in for processing.
*/
@XmlRootElement(name = "Channel")
public class Channel extends Lane
{
/** Role of this channel in the mixer. */
@XmlAttribute(required = false)
public MixerRole role;

/** Number of audio-channels of this mixer channel. (1=mono, 2=stereo…) */
@XmlAttribute(required = false)
public Integer audioChannels = 2;

/** Channel volume */
@XmlElement(name = "Volume", required = false)
public RealParameter volume;

/** Channel pan/balance */
@XmlElement(name = "Pan", required = false)
public RealParameter pan;

/** Channel mute */
@XmlElement(name = "Mute", required = false)
public BoolParameter mute;

/** Channel solo */
@XmlAttribute(required = false)
public Boolean solo;

/** Output channel routing */
@XmlIDREF
@XmlAttribute()
public Channel destination;

/** Send levels & destination */
@XmlElementWrapper(name="Sends")
@XmlElement(name="Send", type = Send.class)
public List<Send> sends;

/** Devices & plug-ins of this channel */
@XmlElementWrapper(name="Devices")
@XmlElementRef
public List<Device> devices;
public class Channel extends Lane {
/** Role of this channel in the mixer. */
@XmlAttribute(required = false)
public MixerRole role;

/** Number of audio-channels of this mixer channel. (1=mono, 2=stereo…) */
@XmlAttribute(required = false)
public Integer audioChannels = 2;

/** Channel volume */
@XmlElement(name = "Volume", required = false)
public RealParameter volume;

/** Channel pan/balance */
@XmlElement(name = "Pan", required = false)
public RealParameter pan;

/** Channel mute */
@XmlElement(name = "Mute", required = false)
public BoolParameter mute;

/** Channel solo */
@XmlAttribute(required = false)
public Boolean solo;

/** Output channel routing */
@XmlIDREF
@XmlAttribute()
public Channel destination;

/** Send levels & destination */
@XmlElementWrapper(name = "Sends")
@XmlElement(name = "Send", type = Send.class)
public List<Send> sends;

/** Devices & plug-ins of this channel */
@XmlElementWrapper(name = "Devices")
@XmlElementRef
public List<Device> devices;
}
10 changes: 2 additions & 8 deletions src/main/java/com/bitwig/dawproject/ContentType.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@
import jakarta.xml.bind.annotation.XmlEnum;

@XmlEnum
public enum ContentType
{
audio,
automation,
notes,
video,
markers,
tracks,
public enum ContentType {
audio, automation, notes, video, markers, tracks,
}
Loading

0 comments on commit 08a57cd

Please sign in to comment.