pyrekordbox.mysettings.file#

Rekordbox My-Setting file handlers.

pyrekordbox.mysettings.file.compute_checksum(data, struct)[source]#

Computes the CRC16 XModem checksum for My-Setting files.

The checksum is calculated over the contents of the data field, except for DJMSETTING.DAT files where the checksum is calculated over all preceding bytes including the length fields.

Parameters:
databytes

The binary filey contents of the My-Setting file for which the checksum is computed.

structStruct

The Struct of the My-Setting file. This is used for deciding which bytes are used for computing the checksum.

Returns:
crcint

The calculated CRC16-XModem checksum.

References

https://reveng.sourceforge.io/crc-catalogue/all.htm#crc.cat.crc-16-xmodem

class pyrekordbox.mysettings.file.SettingsFile[source]#

Bases: MutableMapping

Base class for the Rekordbox My-Setting file handler.

The base class implements the getters and setter defined by the keys and default values in the defaults class attribute. The keys of the defaults dictionary, which has to be defined by the inheriting class, defines the valid attributes of the My-Setting file. The values are used as default values if a new (and empty) My-Setting file is initialized.

struct#
defaults#
version = ''#
classmethod parse(data)[source]#

Parses the in-memory data of a Rekordbox settings binary file.

Parameters:
databytes

The in-memory binary contents of a Rekordbox settings file.

Returns:
selfSettingsFile

The new instance with the parsed file content.

classmethod parse_file(path)[source]#

Reads and parses a Rekordbox settings binary file.

Parameters:
pathstr or Path

The path of a Rekordbox settings file which is used to read the file contents before parsing the binary data.

Returns:
selfSettingsFile

The new instance with the parsed file content.

See also

SettingsFile.parse

Parses the data of a Rekordbox settings file.

get(key, default=None)[source]#

Returns the value of a setting of the My-Setting file.

If the key is not found in the My-Setting data, but it is present in the defaults class dictionary, that default value is used. Otherwise, the parameter default is used as default value.

Parameters:
keystr

The key of the setting.

defaultAny, optional

The default value returned if the setting does not exist in the My-Setting file data or the defaults dictionary.

Returns:
valueAny

The value of the setting.

set(key, value)[source]#

Sets the value of a setting of the My-Setting file.

Parameters:
keystr

The key of the setting.

valueAny

The new value for updating the setting.

build()[source]#

Constructs the binary data for saving the My-Setting file.

Returns:
byte_databytes

The binary file contents fot eh My-Setting file.

save(path)[source]#

Save the contents of the My-Setting file object.

Parameters:
pathstr

The file path used for saving.

See also

build

Constructs the binary data of the file.

class pyrekordbox.mysettings.file.MySettingFile[source]#

Bases: SettingsFile

Rekordbox MYSETTING.DAT file handler.

See also

SettingsFile

Base class implementing getters and setter defined by the keys and default values in the defaults class attribute.

struct = <Struct>#
defaults = {'auto_cue': EnumIntegerString.new(129, 'on'), 'auto_cue_level': EnumIntegerString.new(136, 'memory'), 'disc_slot_illumination': EnumIntegerString.new(130, 'bright'), 'eject_lock': EnumIntegerString.new(128, 'unlock'), 'hotcue_autoload': EnumIntegerString.new(129, 'on'), 'hotcue_color': EnumIntegerString.new(128, 'off'), 'jog_mode': EnumIntegerString.new(129, 'vinyl'), 'jog_ring_brightness': EnumIntegerString.new(130, 'bright'), 'jog_ring_indicator': EnumIntegerString.new(129, 'on'), 'language': EnumIntegerString.new(129, 'english'), 'lcd_brightness': EnumIntegerString.new(131, 'three'), 'master_tempo': EnumIntegerString.new(128, 'off'), 'needle_lock': EnumIntegerString.new(129, 'lock'), 'on_air_display': EnumIntegerString.new(129, 'on'), 'phase_meter': EnumIntegerString.new(128, 'type1'), 'play_mode': EnumIntegerString.new(129, 'single'), 'quantize': EnumIntegerString.new(129, 'on'), 'quantize_beat_value': EnumIntegerString.new(128, 'one'), 'slip_flashing': EnumIntegerString.new(129, 'on'), 'sync': EnumIntegerString.new(128, 'off'), 'tempo_range': EnumIntegerString.new(129, 'ten'), 'time_mode': EnumIntegerString.new(129, 'remain')}#
class pyrekordbox.mysettings.file.MySetting2File[source]#

Bases: SettingsFile

Rekordbox MYSETTING2.DAT file handler.

See also

SettingsFile

Base class implementing getters and setter defined by the keys and default values in the defaults class attribute.

struct = <Struct>#
defaults = {'beat_jump_beat_value': EnumIntegerString.new(133, 'sixteen'), 'jog_display_mode': EnumIntegerString.new(128, 'auto'), 'jog_lcd_brightness': EnumIntegerString.new(131, 'three'), 'pad_button_brightness': EnumIntegerString.new(131, 'three'), 'vinyl_speed_adjust': EnumIntegerString.new(129, 'touch'), 'waveform': EnumIntegerString.new(128, 'waveform'), 'waveform_divisions': EnumIntegerString.new(129, 'phrase')}#
class pyrekordbox.mysettings.file.DjmMySettingFile[source]#

Bases: SettingsFile

Rekordbox DJMMYSETTING.DAT file handler.

See also

SettingsFile

Base class implementing getters and setter defined by the keys and default values in the defaults class attribute.

struct = <Struct>#
defaults = {'beat_fx_quantize': EnumIntegerString.new(129, 'on'), 'channel_fader_curve': EnumIntegerString.new(129, 'linear'), 'channel_fader_curve_long': EnumIntegerString.new(128, 'exponential'), 'cross_fader_curve': EnumIntegerString.new(130, 'fast_cut'), 'display_brightness': EnumIntegerString.new(133, 'five'), 'headphones_mono_split': EnumIntegerString.new(128, 'stereo'), 'headphones_pre_eq': EnumIntegerString.new(128, 'post_eq'), 'indicator_brightness': EnumIntegerString.new(130, 'three'), 'mic_low_cut': EnumIntegerString.new(129, 'on'), 'midi_button_type': EnumIntegerString.new(128, 'toggle'), 'midi_channel': EnumIntegerString.new(128, 'one'), 'talk_over_level': EnumIntegerString.new(129, 'minus_18db'), 'talk_over_mode': EnumIntegerString.new(128, 'advanced')}#
class pyrekordbox.mysettings.file.DevSettingFile[source]#

Bases: SettingsFile

Rekordbox DEVSETTING.DAT file handler.

Warning

The data of the DEVSETTING.DAT file is not supported. Only the header can be parsed and written. This class is implemented for completness only.

See also

SettingsFile

Base class implementing getters and setter defined by the keys and default values in the defaults class attribute.

struct = <Struct>#
defaults = {'entries': ''}#