TracktionEngine
Loading...
Searching...
No Matches
Namespaces | Classes | Functions
engine::dawproject Namespace Reference

DAWproject interchange format support. More...

Namespaces

namespace  xml
 DAWproject XML element and attribute names.
 

Classes

class  DAWprojectExporter
 Internal class for exporting an Edit to DAWproject format. More...
 
class  DAWprojectImporter
 Internal class for importing DAWproject files into an Edit. More...
 
class  IDGenerator
 ID generator for DAWproject XML elements. More...
 
class  IDRefResolver
 ID reference resolver for parsing DAWproject XML. More...
 
struct  ParseOptions
 Options for parsing a DAWproject file. More...
 
struct  WriteOptions
 Options for writing a DAWproject file. More...
 

Functions

std::unique_ptr< EditparseDAWproject (Engine &engine, const juce::File &file, ParseOptions options={})
 Parses a .dawproject file and creates an Edit.
 
tl::expected< std::unique_ptr< juce::XmlElement >, juce::String > createDAWproject (Edit &edit, WriteOptions options={})
 Creates the project.xml content from an Edit.
 
juce::Result writeDAWprojectFile (const juce::File &file, Edit &edit, WriteOptions options={})
 Writes a complete .dawproject file from an Edit.
 
float velocityToNormalized (int velocity)
 Velocity conversion between tracktion (0-127 int) and DAWproject (0.0-1.0 normalized).
 
int normalizedToVelocity (float normalized)
 
float controllerValueToNormalized (int value, int controllerType)
 MIDI controller value conversion.
 
int normalizedToControllerValue (float normalized, int controllerType)
 
const char * controllerTypeToExpression (int type)
 Maps tracktion MidiControllerEvent type to DAWproject expression type string.
 
int expressionToControllerType (const juce::String &expression)
 Maps DAWproject expression type string to tracktion MidiControllerEvent type.
 
double ticksToBeats (int64_t ticks, int ticksPerQuarterNote=defaultTicksPerQuarterNote)
 
int64_t beatsToTicks (double beats, int ticksPerQuarterNote=defaultTicksPerQuarterNote)
 
juce::String colourToDAWprojectString (juce::Colour colour)
 Color conversion between tracktion (juce::Colour) and DAWproject (CSS-style hex string).
 
juce::Colour dawprojectStringToColour (const juce::String &str)
 
float normalizedToPan (double normalized)
 Pan conversion between tracktion (-1.0 to 1.0) and DAWproject (0.0-1.0 normalized, 0.5 = centre).
 
double panToNormalized (float pan)
 
double gainToDecibels (float gain)
 Volume conversion between linear gain and decibels.
 
float decibelsToGain (double dB)
 
void setAttributeIfNotEmpty (juce::XmlElement &element, const char *name, const juce::String &value)
 XML helper functions.
 
void setAttributeIfValid (juce::XmlElement &element, const char *name, double value)
 
std::unique_ptr< juce::XmlElement > createXmlElement (const char *tagName)
 
juce::XmlElement * addChildElement (juce::XmlElement &parent, const char *tagName)
 
double parseDouble (const juce::String &str, double defaultValue=0.0)
 Parses a double from a string, handling potential formatting differences.
 
int parseInt (const juce::String &str, int defaultValue=0)
 Parses an int from a string.
 
bool parseBool (const juce::String &str, bool defaultValue=false)
 Parses a bool from a string or attribute value.
 

Detailed Description

DAWproject interchange format support.

DAWproject is an open interchange format for digital audio workstation projects. It stores project data as XML files (project.xml, metadata.xml) bundled in a ZIP archive along with embedded audio files.

See also
https://github.com/bitwig/dawproject

Function Documentation

◆ parseDAWproject()

std::unique_ptr< Edit > engine::dawproject::parseDAWproject ( Engine engine,
const juce::File &  file,
ParseOptions  options = {} 
)

Parses a .dawproject file and creates an Edit.

Parameters
engineThe Engine to use for the new Edit
fileThe .dawproject file
optionsOptions controlling the import behavior
Returns
A new Edit if successful, or nullptr on failure

References parseDAWproject().

Referenced by parseDAWproject().

◆ createDAWproject()

tl::expected< std::unique_ptr< juce::XmlElement >, juce::String > engine::dawproject::createDAWproject ( Edit edit,
WriteOptions  options = {} 
)

Creates the project.xml content from an Edit.

Parameters
editThe Edit to export
optionsOptions controlling the export behavior
Returns
An XmlElement representing the project, or an error string

References createDAWproject().

Referenced by createDAWproject().

◆ writeDAWprojectFile()

juce::Result engine::dawproject::writeDAWprojectFile ( const juce::File &  file,
Edit edit,
WriteOptions  options = {} 
)

Writes a complete .dawproject file from an Edit.

This creates a ZIP archive containing:

  • project.xml (the main project data)
  • metadata.xml (project metadata)
  • audio/ subdirectory with embedded audio files (if enabled)
  • plugins/ subdirectory with plugin state files (if enabled)
Parameters
fileThe destination .dawproject file
editThe Edit to export
optionsOptions controlling the export behavior
Returns
A Result indicating success or failure

References writeDAWprojectFile().

Referenced by writeDAWprojectFile().

◆ velocityToNormalized()

float engine::dawproject::velocityToNormalized ( int  velocity)

Velocity conversion between tracktion (0-127 int) and DAWproject (0.0-1.0 normalized).

References velocityToNormalized().

Referenced by velocityToNormalized().

◆ normalizedToVelocity()

int engine::dawproject::normalizedToVelocity ( float  normalized)

References normalizedToVelocity().

Referenced by normalizedToVelocity().

◆ controllerValueToNormalized()

float engine::dawproject::controllerValueToNormalized ( int  value,
int  controllerType 
)

MIDI controller value conversion.

tracktion_engine stores most controller values as 14-bit (value << 7 for 7-bit CCs). DAWproject uses normalized 0.0-1.0 values.

References controllerValueToNormalized().

Referenced by controllerValueToNormalized().

◆ normalizedToControllerValue()

int engine::dawproject::normalizedToControllerValue ( float  normalized,
int  controllerType 
)

◆ controllerTypeToExpression()

const char * engine::dawproject::controllerTypeToExpression ( int  type)

Maps tracktion MidiControllerEvent type to DAWproject expression type string.

References controllerTypeToExpression().

Referenced by controllerTypeToExpression().

◆ expressionToControllerType()

int engine::dawproject::expressionToControllerType ( const juce::String &  expression)

Maps DAWproject expression type string to tracktion MidiControllerEvent type.

For channelController, returns -1 (caller should use the controller attribute).

References expressionToControllerType().

Referenced by expressionToControllerType().

◆ ticksToBeats()

double engine::dawproject::ticksToBeats ( int64_t  ticks,
int  ticksPerQuarterNote = defaultTicksPerQuarterNote 
)

References ticksToBeats().

Referenced by ticksToBeats().

◆ beatsToTicks()

int64_t engine::dawproject::beatsToTicks ( double  beats,
int  ticksPerQuarterNote = defaultTicksPerQuarterNote 
)

References beatsToTicks().

Referenced by beatsToTicks().

◆ colourToDAWprojectString()

juce::String engine::dawproject::colourToDAWprojectString ( juce::Colour  colour)

Color conversion between tracktion (juce::Colour) and DAWproject (CSS-style hex string).

References colourToDAWprojectString().

Referenced by colourToDAWprojectString().

◆ dawprojectStringToColour()

juce::Colour engine::dawproject::dawprojectStringToColour ( const juce::String &  str)

◆ normalizedToPan()

float engine::dawproject::normalizedToPan ( double  normalized)

Pan conversion between tracktion (-1.0 to 1.0) and DAWproject (0.0-1.0 normalized, 0.5 = centre).

References normalizedToPan().

Referenced by normalizedToPan().

◆ panToNormalized()

double engine::dawproject::panToNormalized ( float  pan)

References panToNormalized().

Referenced by panToNormalized().

◆ gainToDecibels()

double engine::dawproject::gainToDecibels ( float  gain)

Volume conversion between linear gain and decibels.

References gainToDecibels().

Referenced by gainToDecibels().

◆ decibelsToGain()

float engine::dawproject::decibelsToGain ( double  dB)

References decibelsToGain().

Referenced by decibelsToGain().

◆ setAttributeIfNotEmpty()

void engine::dawproject::setAttributeIfNotEmpty ( juce::XmlElement &  element,
const char *  name,
const juce::String &  value 
)

XML helper functions.

References setAttributeIfNotEmpty().

Referenced by setAttributeIfNotEmpty().

◆ setAttributeIfValid()

void engine::dawproject::setAttributeIfValid ( juce::XmlElement &  element,
const char *  name,
double  value 
)

References setAttributeIfValid().

Referenced by setAttributeIfValid().

◆ createXmlElement()

std::unique_ptr< juce::XmlElement > engine::dawproject::createXmlElement ( const char *  tagName)

References createXmlElement().

Referenced by createXmlElement().

◆ addChildElement()

juce::XmlElement * engine::dawproject::addChildElement ( juce::XmlElement &  parent,
const char *  tagName 
)

References addChildElement().

Referenced by addChildElement().

◆ parseDouble()

double engine::dawproject::parseDouble ( const juce::String &  str,
double  defaultValue = 0.0 
)

Parses a double from a string, handling potential formatting differences.

References parseDouble().

Referenced by parseDouble().

◆ parseInt()

int engine::dawproject::parseInt ( const juce::String &  str,
int  defaultValue = 0 
)

Parses an int from a string.

References parseInt().

Referenced by parseInt().

◆ parseBool()

bool engine::dawproject::parseBool ( const juce::String &  str,
bool  defaultValue = false 
)

Parses a bool from a string or attribute value.

References parseBool().

Referenced by parseBool().