Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DRAFT] DX7: make loading of .syx patches integrated with "load SYNTH" UI #2694

Draft
wants to merge 2 commits into
base: community
Choose a base branch
from
Draft
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
39 changes: 0 additions & 39 deletions src/deluge/gui/menu_item/dx/browse.cpp

This file was deleted.

33 changes: 0 additions & 33 deletions src/deluge/gui/menu_item/dx/browse.h

This file was deleted.

179 changes: 0 additions & 179 deletions src/deluge/gui/menu_item/dx/cartridge.cpp

This file was deleted.

17 changes: 14 additions & 3 deletions src/deluge/gui/ui/browser/browser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include "util/functions.h"
#include <cstring>
#include <new>
#include <strings.h>

using namespace deluge;

Expand Down Expand Up @@ -397,6 +398,12 @@ Error Browser::readFileItemsForFolder(char const* filePrefixHere, bool allowFold
return error;
}

// TODO: dubplicate for testing...
static bool isSYXFile(FileItem *item) {
size_t len = item->filename.getLength();
return(len >= 4 && strcasecmp(item->filename.get()+(len-4), ".syx") == 0);
}

void Browser::deleteFolderAndDuplicateItems(Availability instrumentAvailabilityRequirement) {
int32_t writeI = 0;
FileItem* nextItem = (FileItem*)fileItems.getElementAddress(0);
Expand Down Expand Up @@ -447,10 +454,14 @@ void Browser::deleteFolderAndDuplicateItems(Availability instrumentAvailabilityR
}
}
}
}

} else if (isSYXFile(nextItem)) {
// This is a bit of a hack, but loading every single syx file and checking the signature
// is going to be quite expensive.
//if (nextItem->filePointer.objsize >= 4096) {
goto deleteThisItem;
//}
// Or if next item has an Instrument, and we're just a file...
else if (nextItem->instrument) {
} else if (nextItem->instrument) {
if (!strcasecmp(readItem->displayName, nextItem->displayName)) { // And if same name...
goto deleteThisItem;
}
Expand Down
Loading
Loading