Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ available_features = [features.HifiEq,
features.MSVSHacks,
features.Vamp,
features.PromoTracks,
features.AutoDjCrates,

# "Features" of dubious quality
features.PerfTools,
Expand Down
4 changes: 3 additions & 1 deletion build/depends.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ def sources(self, build):
"engine/enginemaster.cpp",
"engine/enginedelay.cpp",
"engine/engineflanger.cpp",
"engine/enginefiltereffect.cpp",
"engine/enginevumeter.cpp",
"engine/enginevinylsoundemu.cpp",
"engine/sidechain/enginesidechain.cpp",
Expand All @@ -507,6 +508,7 @@ def sources(self, build):
"engine/enginemicrophone.cpp",
"engine/enginedeck.cpp",
"engine/enginepassthrough.cpp",
"engine/channelmixer_autogen.cpp",

"engine/enginecontrol.cpp",
"engine/ratecontrol.cpp",
Expand Down Expand Up @@ -754,7 +756,7 @@ def sources(self, build):
"util/timer.cpp",
"util/performancetimer.cpp",
"util/version.cpp",
"util/rlimit.cpp",
"util/rlimit.cpp",

# Add the QRC file which compiles in some extra resources
# (prefs icons, etc.)
Expand Down
40 changes: 35 additions & 5 deletions build/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,22 +133,27 @@ def sources(self, build):
sources = ['controllers/bulk/bulkcontroller.cpp',
'controllers/bulk/bulkenumerator.cpp']
if not int(build.flags['hid']):
sources.append('controllers/hid/hidcontrollerpresetfilehandler.cpp')
sources.append('controllers/hid/hidcontrollerpresetfilehandler.cpp')
return sources


class Mad(Feature):
def description(self):
return "MAD MP3 Decoder"

def default(self, build):
return 0 if build.platform_is_osx else 1

def enabled(self, build):
build.flags['mad'] = util.get_flags(build.env, 'mad', 1)
build.flags['mad'] = util.get_flags(build.env, 'mad',
self.default(build))
if int(build.flags['mad']):
return True
return False

def add_options(self, build, vars):
vars.Add('mad', 'Set to 1 to enable MAD MP3 decoder support.', 1)
vars.Add('mad', 'Set to 1 to enable MAD MP3 decoder support.',
self.default(build))

def configure(self, build, conf):
if not self.enabled(build):
Expand All @@ -168,14 +173,18 @@ class CoreAudio(Feature):
def description(self):
return "CoreAudio MP3/AAC Decoder"

def default(self, build):
return 1 if build.platform_is_osx else 0

def enabled(self, build):
build.flags['coreaudio'] = util.get_flags(build.env, 'coreaudio', 0)
build.flags['coreaudio'] = util.get_flags(build.env, 'coreaudio', self.default(build))
if int(build.flags['coreaudio']):
return True
return False

def add_options(self, build, vars):
vars.Add('coreaudio', 'Set to 1 to enable CoreAudio MP3/AAC decoder support.', 0)
vars.Add('coreaudio', 'Set to 1 to enable CoreAudio MP3/AAC decoder support.',
self.default(build))

def configure(self, build, conf):
if not self.enabled(build):
Expand Down Expand Up @@ -1074,3 +1083,24 @@ def sources(self, build):
"library/featuredartistswebview.cpp",
]

class AutoDjCrates(Feature):
def description(self):
return "Auto-DJ crates (for random tracks)"

def enabled(self, build):
build.flags['autodjcrates'] = \
util.get_flags(build.env, 'autodjcrates', 1)
if int(build.flags['autodjcrates']):
return True
return False

def add_options(self, build, vars):
vars.Add('autodjcrates', 'Set to 1 to enable crates as a source for random Auto-DJ tracks.', 1)

def configure(self, build, conf):
if not self.enabled(build):
return
build.env.Append(CPPDEFINES = '__AUTODJCRATES__')

def sources(self, build):
return ['library/dao/autodjcratesdao.cpp']
28 changes: 18 additions & 10 deletions build/qtcreator/mixxx.pro
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CONFIG += debug link_pkgconfig portmidi script vinylcontrol m4a
CONFIG += debug link_pkgconfig portmidi script vinylcontrol m4a autodjcrates
# ladspa
DEFINES += QMAKE \ # define QMAKE for not-SCons specific ifdefs like ui_scriptstudio.h
__PORTAUDIO__ \
Expand Down Expand Up @@ -742,15 +742,15 @@ SOURCES += $$BASE_DIR/src/vamp/vampanalyser.cpp \
$$BASE_DIR/src/analyservamptest.cpp \
$$BASE_DIR/src/analyservampkeytest.cpp \
$$BASE_DIR/lib/vamp/src/vamp-hostsdk/PluginBufferingAdapter.cpp \
$$BASE_DIR/lib/vamp/src/vamp-hostsdk/PluginChannelAdapter.cpp \
$$BASE_DIR/lib/vamp/src/vamp-hostsdk/PluginHostAdapter.cpp \
$$BASE_DIR/lib/vamp/src/vamp-hostsdk/PluginInputDomainAdapter.cpp \
$$BASE_DIR/lib/vamp/src/vamp-hostsdk/PluginLoader.cpp \
$$BASE_DIR/lib/vamp/src/vamp-hostsdk/PluginSummarisingAdapter.cpp \
$$BASE_DIR/lib/vamp/src/vamp-hostsdk/PluginWrapper.cpp \
$$BASE_DIR/lib/vamp/src/vamp-hostsdk/RealTime.cpp \
$$BASE_DIR/lib/vamp/src/vamp-sdk/PluginAdapter.cpp \
$$BASE_DIR/lib/vamp/src/vamp-sdk/RealTime.cpp
$$BASE_DIR/lib/vamp/src/vamp-hostsdk/PluginChannelAdapter.cpp \
$$BASE_DIR/lib/vamp/src/vamp-hostsdk/PluginHostAdapter.cpp \
$$BASE_DIR/lib/vamp/src/vamp-hostsdk/PluginInputDomainAdapter.cpp \
$$BASE_DIR/lib/vamp/src/vamp-hostsdk/PluginLoader.cpp \
$$BASE_DIR/lib/vamp/src/vamp-hostsdk/PluginSummarisingAdapter.cpp \
$$BASE_DIR/lib/vamp/src/vamp-hostsdk/PluginWrapper.cpp \
$$BASE_DIR/lib/vamp/src/vamp-hostsdk/RealTime.cpp \
$$BASE_DIR/lib/vamp/src/vamp-sdk/PluginAdapter.cpp \
$$BASE_DIR/lib/vamp/src/vamp-sdk/RealTime.cpp
}

CONFIG(tonal) {
Expand Down Expand Up @@ -856,6 +856,14 @@ CONFIG(ffmpeg) {
-logg
}

CONFIG(autodjcrates) {
DEFINES += __AUTODJCRATES__
HEADERS +=
$$BASE_DIR/src/library/dao/autodjcratesdao.h
SOURCES +=
$$BASE_DIR/src/library/dao/autodjcratesdao.cpp
}

# Copy Windows dependencies to DESTDIR.
win32 {
!exists($$DESTDIR):system( mkdir \"$$replace(DESTDIR, /,$$DIR_SEPARATOR)\" )
Expand Down
4 changes: 2 additions & 2 deletions build/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def get_git_revision():
return len(os.popen("git log --pretty=oneline --first-parent").read().splitlines())

def get_git_modified():
modified_matcher = re.compile("^#.*modified: (?P<filename>.*?)$")
modified_matcher = re.compile("^#.*: (?P<filename>.*?)$") # note output might be translated
modified_files = []
for line in os.popen("git status").read().splitlines():
match = modified_matcher.match(line)
Expand Down Expand Up @@ -157,7 +157,7 @@ def write_build_header(path):
f = open(path, 'w')
try:
branch_name = get_branch_name()
modified = get_modified() > 0
modified = len(get_modified()) > 0
# Do not emit BUILD_BRANCH on release branches.
if not branch_name.startswith('release'):
f.write('#define BUILD_BRANCH "%s"\n' % branch_name)
Expand Down
64 changes: 32 additions & 32 deletions res/controllers/Pioneer-CDJ-HID.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ function PioneerCDJController() {
packet.addOutput("hid","rate",22,"h");
this.controller.registerOutputPacket(packet);

// Control packet to initialize HID mode on CDJ.
// TODO - Sean: This is arbitrary example packet, fix the
// Control packet to initialize HID mode on CDJ.
// TODO - Sean: This is arbitrary example packet, fix the
// bytes to get it working. Need to add a response packet
// to input packets as well, if we receive acknowledgement
packet = new HIDPacket("request_hid_mode",[0x1],0x20);
Expand All @@ -149,10 +149,10 @@ function PioneerCDJController() {
// Control packet for screen text control
// TODO - Sean: this is just a silly example how to register
// another packet, this must be handled completely separately
// anyway when implemented. When I know what data is sent, I
// anyway when implemented. When I know what data is sent, I
// will add a helper function to actually do something with it!
var textlines = 1;
var chars = 1;
var textlines = 1;
var chars = 1;
var offset = 2;
// Register 2 bytes for each letter, I expect UTF-8 output
packet = new HIDPacket("display",[0x2,0x2],2+textlines*chars*2);
Expand All @@ -167,7 +167,7 @@ function PioneerCDJController() {
// Control packet for waveform display
// TODO - Sean: this is just a silly example how to register
// arbitrary byte packet, this must be handled completely separately
// anyway when implemented. When I know what data is sent, I
// anyway when implemented. When I know what data is sent, I
// will add a helper function to actually do something with it!
var waveform_packet_datalen = 400;
packet = new HIDPacket("waveform",[0x1,0x2],2+waveform_packet_datalen);;
Expand All @@ -181,11 +181,11 @@ function PioneerCDJController() {
this.jogScaler = function(group,name,value) { return value/12; }

// Jog wheel scratch event (ticks) scaler
this.jogPositionDelta = function(group,name,value) {
this.jogPositionDelta = function(group,name,value) {
// We sometimes receive invalid events with value > 32000, ignore those
if (value>=8192)
if (value>=8192)
return 0;
return value/3;
return value/3;
}

// Pitch on CDJ sends -1000 to 1000, reset at 0, swap direction
Expand Down Expand Up @@ -233,16 +233,16 @@ function PioneerCDJController() {
controller.setOutput("hid","flag_6_8",0);

controller.setOutput("hid","flags_9",0x0
//0x1|0x2|0x4|0x8|0x10|0x20|0x40|0x80
//0x1|0x2|0x4|0x8|0x10|0x20|0x40|0x80
);
controller.setOutput("hid","flags_10",0x0
//0x1|0x2|0x4|0x8|0x10|0x20|0x40|0x80
//0x1|0x2|0x4|0x8|0x10|0x20|0x40|0x80
);
controller.setOutput("hid","jog_vinyl_logo",1);

if ( PioneerCDJHID.id=="PIONEER CDJ-900" ||
if ( PioneerCDJHID.id=="PIONEER CDJ-900" ||
PioneerCDJHID.id=="PIONEER CDJ-2000") {

//tracknumber frames/ms control 0x1
//rate control 0x10
//bpm control 0x20
Expand Down Expand Up @@ -328,7 +328,7 @@ PioneerCDJHID.incomingData = function(data,length) {
}

// Link virtual HID naming of input and Output controls to mixxx
// Note: HID specification has more fields than we map here.
// Note: HID specification has more fields than we map here.
PioneerCDJHID.registerCallbacks = function() {
var controller = PioneerCDJHID.controller;

Expand Down Expand Up @@ -376,13 +376,13 @@ PioneerCDJHID.registerCallbacks = function() {
controller.setCallback("control","hid","beatloop_2",PioneerCDJHID.beatloop);
controller.setCallback("control","hid","time_mode",PioneerCDJHID.timeMode);

// Link normal jog touch and delta to HIDController default jog
// and scratch functions. CDJ reports more than these fields from job,
// Link normal jog touch and delta to HIDController default jog
// and scratch functions. CDJ reports more than these fields from job,
// we ignore the other input fields for jog control. Feel free to adopt.
controller.linkControl("hid","jog_touch","deck","jog_touch");
controller.linkControl("hid","jog_wheel","deck","jog_wheel");
// Standard HIDController scalers for jog functionality.

// Standard HIDController scalers for jog functionality.
// Not related to field specifications names above!
controller.setScaler("jog",PioneerCDJHID.jogScaler);
controller.setScaler("jog_scratch",PioneerCDJHID.jogPositionDelta);
Expand All @@ -393,7 +393,7 @@ PioneerCDJHID.registerCallbacks = function() {
controller.linkControl("hid","master_tempo","deck","beatsync");
controller.linkControl("hid","tempo_range","deck","beats_translate_curpos");
controller.linkControl("hid","jog_mode","deck","pfl");

// Unused buttons
// controller.linkControl("hid","menu_back","deck","");
// controller.linkControl("hid","tag_track","deck","");
Expand All @@ -418,7 +418,7 @@ PioneerCDJHID.registerCallbacks = function() {
// Callback to update LEDs from engine.connectControl
PioneerCDJHID.updateLED = function(value,group,key) {
var controller = PioneerCDJHID.controller;
if (value==1)
if (value==1)
controller.setOutput("deck",key,controller.LEDColors.on,true);
else
controller.setOutput("deck",key,controller.LEDColors.off,true);
Expand Down Expand Up @@ -504,7 +504,7 @@ PioneerCDJHID.setRate = function(value) {
var range = Math.floor(100*engine.getValue(group,"rateRange"));

// We still need to multiply actual rate with 100
controller.setOutput("hid","rate",
controller.setOutput("hid","rate",
100 * range * engine.getValue(group,"rate_dir") * engine.getValue(group,"rate")
);
}
Expand All @@ -513,7 +513,7 @@ PioneerCDJHID.setRate = function(value) {
PioneerCDJHID.setTime = function(value) {
var controller = PioneerCDJHID.controller;
var minutes,seconds,frames;
if (value==undefined)
if (value==undefined)
value = engine.getValue(
controller.resolveDeckGroup(controller.activeDeck),
"playposition"
Expand Down Expand Up @@ -629,13 +629,13 @@ PioneerCDJHID.track = function(field) {
return;

if (field.name=='previous_track') {
var position = PioneerCDJHID.track_length -
var position = PioneerCDJHID.track_length -
PioneerCDJHID.track_length * engine.getValue(group,"playposition");
if (position<PioneerCDJHID.previousJumpStartSeconds) {
// Move to beginning of track if play position was far enough
// TODO - implement this with timer so that multiple presses
// still jump to previous track.
// Currently just disabled by setting the previousJumpStartSeconds
// TODO - implement this with timer so that multiple presses
// still jump to previous track.
// Currently just disabled by setting the previousJumpStartSeconds
// value to 0
engine.setValue(group,"playposition",0);
} else {
Expand All @@ -661,18 +661,18 @@ PioneerCDJHID.track = function(field) {

PioneerCDJHID.needlesearch = function(field) {
var controller = PioneerCDJHID.controller;
var group = controller.resolveDeckGroup(controller.activeDeck);
var group = controller.resolveDeckGroup(controller.activeDeck);
var value = field.value / 400;
if (value==0)
if (value==0)
return;
engine.setValue(group,"play",false);
engine.setValue(group,"playposition",value);

}

PioneerCDJHID.hotcue = function(field) {
var controller = PioneerCDJHID.controller;
var group = controller.resolveDeckGroup(controller.activeDeck);
var group = controller.resolveDeckGroup(controller.activeDeck);
var control;
if (field.value==controller.buttonStates.released) {
controller.setOutput("hid",field.name+"_red",0);
Expand All @@ -699,7 +699,7 @@ PioneerCDJHID.hotcue = function(field) {
// Set given size beatloop or a hotcue, light LED for beatloop
PioneerCDJHID.beatloop = function(field) {
var controller = PioneerCDJHID.controller;
var group = controller.resolveDeckGroup(controller.activeDeck);
var group = controller.resolveDeckGroup(controller.activeDeck);
var size;

if (field.value==controller.buttonStates.released)
Expand Down Expand Up @@ -742,7 +742,7 @@ PioneerCDJHID.reloop_exit = function(field) {
engine.setValue(
controller.resolveDeckGroup(controller.activeDeck),
"reloop_exit",
true
true
);
var output_packet = controller.getOutputPacket("lights");
controller.setOutput("hid","beatloop_16",controller.LEDColors.off);
Expand Down
Loading