Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
Conflicts:
	src/engine/enginebuffer.h
  • Loading branch information
daschuer committed Mar 27, 2015
2 parents a154dc0 + 48bc6c2 commit 1283589
Show file tree
Hide file tree
Showing 10 changed files with 112 additions and 28 deletions.
7 changes: 7 additions & 0 deletions src/controllers/controllerengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1198,6 +1198,13 @@ double ControllerEngine::getDeckRate(const QString& group) {

bool ControllerEngine::isDeckPlaying(const QString& group) {
ControlObjectThread* pPlay = getControlObjectThread(group, "play");

if (pPlay == NULL) {
QString error = QString("Could not getControlObjectThread()");
scriptErrorDialog(error);
return false;
}

return pPlay->get() > 0.0;
}

Expand Down
11 changes: 5 additions & 6 deletions src/controllers/qtscript-bytearray/bytearrayclass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,12 @@ QScriptValue ByteArrayClass::property(const QScriptValue &object,
return QScriptValue();
if (name == length) {
return ba->length();
} else {
qint32 pos = id;
if ((pos < 0) || (pos >= ba->size()))
return QScriptValue();
return uint(ba->at(pos)) & 255;
}
return QScriptValue();
qint32 pos = id;
if ((pos < 0) || (pos >= ba->size())) {
return QScriptValue();
}
return uint(ba->at(pos)) & 255;
}
//! [4]

Expand Down
28 changes: 28 additions & 0 deletions src/encoder/encodervorbis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,34 @@ EncoderVorbis::EncoderVorbis(EncoderCallback* pCallback)
m_metaDataTitle(NULL),
m_metaDataArtist(NULL),
m_metaDataAlbum(NULL){
m_vdsp.pcm_returned = 0;
m_vdsp.preextrapolate = 0;
m_vdsp.eofflag = 0;
m_vdsp.lW = 0;
m_vdsp.W = 0;
m_vdsp.nW = 0;
m_vdsp.centerW = 0;
m_vdsp.granulepos = 0;
m_vdsp.sequence = 0;
m_vdsp.glue_bits = 0;
m_vdsp.time_bits = 0;
m_vdsp.floor_bits = 0;
m_vdsp.res_bits = 0;
m_vdsp.backend_state = NULL;

m_vinfo.version = 0;
m_vinfo.channels = 0;
m_vinfo.rate = 0;
m_vinfo.bitrate_upper = 0;
m_vinfo.bitrate_nominal = 0;
m_vinfo.bitrate_lower = 0;
m_vinfo.bitrate_window = 0;
m_vinfo.codec_setup = NULL;

m_vcomment.user_comments = NULL;
m_vcomment.comment_lengths = NULL;
m_vcomment.comments = 0;
m_vcomment.vendor = NULL;
}

EncoderVorbis::~EncoderVorbis() {
Expand Down
1 change: 1 addition & 0 deletions src/engine/enginebuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ class EngineBuffer : public EngineObject {
// three pointers may be reassigned depending on configuration and tests.
EngineBufferScale* m_pScale;
FRIEND_TEST(EngineBufferTest, SlowRubberBand);
FRIEND_TEST(EngineBufferTest, ResetPitchAdjustUsesLinear);
FRIEND_TEST(EngineBufferTest, VinylScalerRampZero);
FRIEND_TEST(EngineBufferTest, ReadFadeOut);
EngineBufferScale* m_pScaleVinyl;
Expand Down
13 changes: 7 additions & 6 deletions src/library/baseplaylistfeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,14 +352,15 @@ void BasePlaylistFeature::slotImportPlaylist() {
} else {
return;
}
QStringList entries = playlist_parser->parse(playlist_file);

// Iterate over the List that holds URLs of playlist entires
m_pPlaylistTableModel->addTracks(QModelIndex(), entries);

// delete the parser object
if (playlist_parser) {
delete playlist_parser;
QStringList entries = playlist_parser->parse(playlist_file);

// Iterate over the List that holds URLs of playlist entires
m_pPlaylistTableModel->addTracks(QModelIndex(), entries);

// delete the parser object
delete playlist_parser;
}
}

Expand Down
15 changes: 8 additions & 7 deletions src/library/cratefeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -569,15 +569,16 @@ void CrateFeature::slotImportPlaylist() {
return;
}

QList<QString> entries = playlist_parser->parse(playlist_file);
//qDebug() << "Size of Imported Playlist: " << entries.size();
if (playlist_parser) {
QList<QString> entries = playlist_parser->parse(playlist_file);
//qDebug() << "Size of Imported Playlist: " << entries.size();

//Iterate over the List that holds URLs of playlist entires
m_crateTableModel.addTracks(QModelIndex(), entries);
//Iterate over the List that holds URLs of playlist entires
m_crateTableModel.addTracks(QModelIndex(), entries);

//delete the parser object
if (playlist_parser)
delete playlist_parser;
//delete the parser object
delete playlist_parser;
}
}

void CrateFeature::slotAnalyzeCrate() {
Expand Down
3 changes: 0 additions & 3 deletions src/library/dao/analysisdao.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,6 @@ void AnalysisDao::saveTrackAnalyses(TrackInfoObject* pTrack) {
<< "waveform analysis for trackId" << trackId
<< "analysisId" << analysis.analysisId;

if (pWaveSummary->getId() != -1) {
analysis.analysisId = pWaveSummary->getId();
}
// Clear analysisId since we are re-using the AnalysisInfo
analysis.analysisId = -1;
analysis.type = AnalysisDao::TYPE_WAVESUMMARY;
Expand Down
22 changes: 22 additions & 0 deletions src/soundsourceoggvorbis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,28 @@ SoundSourceOggVorbis::SoundSourceOggVorbis(QString qFilename)
filelength(0),
current_section(0) {
setType("ogg");
vf.datasource = NULL;
vf.seekable = 0;
vf.offset = 0;
vf.end = 0;
//vf.oy
vf.links = 0;
vf.offsets = NULL;
vf.dataoffsets = NULL;
vf.serialnos = NULL;
vf.pcmlengths = NULL;
vf.vi = NULL;
vf.vc = NULL;
vf.pcm_offset = 0;
vf.ready_state = 0;
vf.current_serialno = 0;
vf.current_link = 0;
vf.bittrack = 0;
vf.samptrack = 0;
//vf.os
//vf.vd
//vf.vb
//vf.callbacks
}

SoundSourceOggVorbis::~SoundSourceOggVorbis()
Expand Down
18 changes: 18 additions & 0 deletions src/test/enginebuffertest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,21 @@ TEST_F(EngineBufferTest, ReadFadeOut) {
EXPECT_EQ(m_pMockScaleVinyl1, m_pChannel1->getEngineBuffer()->m_pScale);
EXPECT_EQ(m_pMockScaleVinyl1->getProcessesTempo(), 1.0);
}

TEST_F(EngineBufferTest, ResetPitchAdjustUsesLinear) {
// If the key was adjusted, but keylock is off, and then the key is
// reset, then the engine should be using the linear scaler.

// First, we should be using the keylock scaler here.
ControlObject::set(ConfigKey(m_sGroup1, "pitch"), 1.2);
// Remember that a rate of "0" is "regular playback speed".
ControlObject::set(ConfigKey(m_sGroup1, "rate"), 0.05);
ControlObject::set(ConfigKey(m_sGroup1, "play"), 1.0);
ProcessBuffer();
EXPECT_EQ(m_pMockScaleKeylock1, m_pChannel1->getEngineBuffer()->m_pScale);

// Reset pitch adjust, and we should be back to the linear scaler.
ControlObject::set(ConfigKey(m_sGroup1, "pitch_adjust_set_default"), 1.0);
ProcessBuffer();
EXPECT_EQ(m_pMockScaleVinyl1, m_pChannel1->getEngineBuffer()->m_pScale);
}
22 changes: 16 additions & 6 deletions src/widget/wlibrary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ bool WLibrary::registerView(QString name, QWidget* view) {
return false;
}
if (dynamic_cast<LibraryView*>(view) == NULL) {
qDebug() << "WARNING: Attempted to register a view with WLibrary that does not implement the LibraryView interface. Ignoring.";
qDebug() << "WARNING: Attempted to register a view with WLibrary "
<< "that does not implement the LibraryView interface. "
<< "Ignoring.";
return false;
}
addWidget(view);
Expand All @@ -34,12 +36,19 @@ bool WLibrary::registerView(QString name, QWidget* view) {
void WLibrary::switchToView(const QString& name) {
QMutexLocker lock(&m_mutex);
//qDebug() << "WLibrary::switchToView" << name;
if (m_viewMap.contains(name)) {
QWidget* widget = m_viewMap[name];
if (widget != NULL && currentWidget() != widget) {
QWidget* widget = m_viewMap.value(name, NULL);
if (widget != NULL) {
LibraryView * lview = dynamic_cast<LibraryView*>(widget);
if (lview == NULL) {
qDebug() << "WARNING: Attempted to register a view with WLibrary "
<< "that does not implement the LibraryView interface. "
<< "Ignoring.";
return;
}
if (currentWidget() != widget) {
//qDebug() << "WLibrary::setCurrentWidget" << name;
setCurrentWidget(widget);
dynamic_cast<LibraryView*>(widget)->onShow();
lview->onShow();
}
}
}
Expand All @@ -49,7 +58,8 @@ void WLibrary::search(const QString& name) {
QWidget* current = currentWidget();
LibraryView* view = dynamic_cast<LibraryView*>(current);
if (view == NULL) {
qDebug() << "WARNING: Attempted to register a view with WLibrary that does not implement the LibraryView interface. Ignoring.";
qDebug() << "WARNING: Attempted to register a view with WLibrary "
<< "that does not implement the LibraryView interface. Ignoring.";
return;
}
lock.unlock();
Expand Down

0 comments on commit 1283589

Please sign in to comment.