Skip to content

Commit 9343221

Browse files
committed
Path fix and collision_z
1 parent d1e5001 commit 9343221

18 files changed

+64
-22
lines changed

IanniX.pro

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,18 @@ macx {
4242
CONFIG += x86_64
4343
message("IanniX for Mac 64bits")
4444
}
45+
46+
BUNDLE_RES3.files = Examples
47+
BUNDLE_RES3.path = Contents/Resources
48+
QMAKE_BUNDLE_DATA += BUNDLE_RES3
49+
50+
BUNDLE_RES2.files = Tools
51+
BUNDLE_RES2.path = Contents/Resources
52+
QMAKE_BUNDLE_DATA += BUNDLE_RES2
53+
54+
BUNDLE_RES4.files = Patches
55+
BUNDLE_RES4.path = Contents/Resources
56+
QMAKE_BUNDLE_DATA += BUNDLE_RES4
4557
}
4658
!macx {
4759
DEFINES += IANNIX_64

gui/uiinspector.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ UiInspector::UiInspector(QWidget *parent) :
107107

108108
ui->files->importAsFiles = false;
109109
UiFileItem::configure(ui->files);
110-
UiFileItem::syncWith(QFileInfoList() << QFileInfo(Application::pathApplication.absoluteFilePath() + "/Examples/") << QFileInfo(Application::pathDocuments.absoluteFilePath() + "/"), ui->files->getTree());
110+
UiFileItem::syncWith(QFileInfoList() << QFileInfo(Application::pathExamples.absoluteFilePath() + "/") << QFileInfo(Application::pathDocuments.absoluteFilePath() + "/"), ui->files->getTree());
111111
ui->files->getTree()->collapseAll();
112112
for(quint16 i = 0 ; i < ui->files->getTree()->topLevelItemCount() ; i++) {
113113
UiFileItem *searchItem = ((UiFileItem*)ui->files->getTree()->topLevelItem(i))->find(Application::pathApplication.absoluteFilePath() + "/IanniX/");

gui/uiview.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public slots:
9393
void actionResize(QSize size);
9494
void gridChange();
9595
void actionPatchesFolder() {
96-
QDesktopServices::openUrl(QUrl::fromLocalFile(QFileInfo(Application::pathApplication.absoluteFilePath() + "/Patches/").absoluteFilePath()));
96+
QDesktopServices::openUrl(QUrl::fromLocalFile(QFileInfo(Application::pathPatches.absoluteFilePath() + "/").absoluteFilePath()));
9797
}
9898

9999

iannix.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ IanniX::IanniX(const QString &_projectToLoad, QObject *parent) :
3636

3737
#ifdef QT5
3838
OpenGlDrawing::dpi = QWindow().devicePixelRatio();
39-
qApp->setAttribute(Qt::AA_UseHighDpiPixmaps);
4039
#endif
4140
Render::textures = new UiTextureItems();
4241
Render::colors = new UiColorItems();

iannixapp.cpp

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ int main(int argc, char *argv[]) {
3838

3939
IanniXApp iannixApp(argc, argv);
4040

41+
#ifdef QT5
42+
qApp->setAttribute(Qt::AA_UseHighDpiPixmaps);
43+
qApp->setAttribute(Qt::AA_ShareOpenGLContexts);
44+
#endif
45+
4146
//QString locale = QLocale::system().name();
4247
//QTranslator translator;
4348
//translator.load("Translation_" + locale, "Tools");
@@ -83,9 +88,10 @@ void IanniXApp::launch(int &argc, char **argv) {
8388
//Start
8489
setHelp();
8590

86-
QDir pathApplicationDir = QDir(QCoreApplication::applicationDirPath()).absolutePath();
91+
QDir pathApplicationDir = QDir(QCoreApplication::applicationDirPath()).absolutePath(), pathApplicationDirM;
8792
#ifdef Q_OS_MAC
8893
pathApplicationDir.cdUp();
94+
pathApplicationDirM = pathApplicationDir;
8995
pathApplicationDir.cdUp();
9096
pathApplicationDir.cdUp();
9197
#endif
@@ -103,10 +109,22 @@ void IanniXApp::launch(int &argc, char **argv) {
103109
if(Application::pathApplication.absoluteFilePath().endsWith("/IanniX-build"))
104110
Application::pathApplication = QFileInfo(Application::pathApplication.absoluteFilePath().remove("-build"));
105111

112+
#ifdef Q_OS_MAC
113+
Application::pathExamples = pathApplicationDirM.absolutePath() + "/Resources/Examples";
114+
Application::pathTools = pathApplicationDirM.absolutePath() + "/Resources/Tools";
115+
Application::pathPatches = pathApplicationDirM.absolutePath() + "/Resources/Patches";
116+
#else
117+
Application::pathExamples = Application::pathApplication.absoluteFilePath() + "/Examples";
118+
Application::pathTools = Application::pathApplication.absoluteFilePath() + "/Tools";
119+
Application::pathPatches = Application::pathApplication.absoluteFilePath() + "/Patches";
120+
#endif
121+
106122
qDebug("Paths");
107123
qDebug("\tDocuments : %s", qPrintable(Application::pathDocuments .absoluteFilePath()));
108124
qDebug("\tApplication: %s", qPrintable(Application::pathApplication.absoluteFilePath()));
109125
qDebug("\tCurrent : %s", qPrintable(Application::pathCurrent .absoluteFilePath()));
126+
qDebug("\tExamples : %s", qPrintable(Application::pathExamples .absoluteFilePath()));
127+
qDebug("\tTools : %s", qPrintable(Application::pathTools .absoluteFilePath()));
110128
qDebug("Arguments");
111129
for(quint16 i = 0 ; i < argc ; i++)
112130
qDebug("\t%2d=\t%s", i, argv[i]);
@@ -135,8 +153,8 @@ void IanniXApp::launch(int &argc, char **argv) {
135153
}
136154

137155
//Add font
138-
if(QFontDatabase::addApplicationFont(Application::pathApplication.absoluteFilePath() + "/Tools/Museo.ttf"))
139-
qDebug("Loading IanniX font failed : %s", qPrintable(Application::pathApplication.absoluteFilePath() + "/Tools/Museo.ttf"));
156+
if(QFontDatabase::addApplicationFont(Application::pathTools.absoluteFilePath() + "/Museo.ttf"))
157+
qDebug("Loading IanniX font failed : %s", qPrintable(Application::pathTools.absoluteFilePath() + "/Museo.ttf"));
140158
//List of fonts
141159
if(false) {
142160
qDebug("[FONTS]");
@@ -288,8 +306,10 @@ void IanniXApp::setHelp() {
288306
Help::categories["values"].infos << HelpInfo(QString("collision_curve_zPos"), tr("z coordinate of the collided curve"));
289307
Help::categories["values"].infos << HelpInfo(QString("collision_xPos"), tr("x coordinate of the collision between the cursor and the curve"));
290308
Help::categories["values"].infos << HelpInfo(QString("collision_yPos"), tr("y coordinate of the collision between the cursor and the curve"));
309+
Help::categories["values"].infos << HelpInfo(QString("collision_zPos"), tr("z coordinate of the collision between the cursor and the curve"));
291310
Help::categories["values"].infos << HelpInfo(QString("collision_value_x"), tr("x mapped coordinate of the collision between the cursor and the curve"));
292311
Help::categories["values"].infos << HelpInfo(QString("collision_value_y"), tr("y mapped coordinate of the collision between the cursor and the curve"));
312+
Help::categories["values"].infos << HelpInfo(QString("collision_value_z"), tr("z mapped coordinate of the collision between the cursor and the curve"));
293313
Help::categories["values"].infos << HelpInfo(QString("collision_distance"), tr("Distance between the collision and the cursor"));
294314
Help::categories["values"].infos << HelpInfo(QString("timetag"), tr("Set an OSC Timetag (compliant with Internet NTP timestamps) to message"));
295315
Help::categories["values"].infos << HelpInfo(QString("status"), tr("Playback status of score (\"play\"), \"stop\" or \"fastrewind\")"));

interfaces/extoscpatterneditor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ ExtOscPatternEditor::ExtOscPatternEditor(QWidget *parent) :
7373
ui->templates->clear();
7474
addTemplate("Templates", true);
7575
addTemplate("--");
76-
QFileInfoList files = QDir(Application::pathApplication.absoluteFilePath() + "/Tools/Templates/").entryInfoList(QStringList() << "*.txt", QDir::Files | QDir::NoDotAndDotDot, QDir::Name | QDir::IgnoreCase);
76+
QFileInfoList files = QDir(Application::pathTools.absoluteFilePath() + "/Templates/").entryInfoList(QStringList() << "*.txt", QDir::Files | QDir::NoDotAndDotDot, QDir::Name | QDir::IgnoreCase);
7777
files << QDir(Application::pathDocuments.absoluteFilePath() + "/Templates/").entryInfoList(QStringList() << "*.txt", QDir::Files | QDir::NoDotAndDotDot, QDir::Name | QDir::IgnoreCase);
7878
bool firstTemplate = true;
7979
QString title;

interfaces/interfacehttp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ InterfaceHttp::InterfaceHttp(QWidget *parent) :
4141
connect(webSocketServer, SIGNAL(newConnection()), SLOT(webSocketsNewConnection()));
4242

4343
//Html template
44-
QFile htmlTemplateFile(Application::pathApplication.absoluteFilePath() + "/Tools/HTML Template.html");
44+
QFile htmlTemplateFile(Application::pathTools.absoluteFilePath() + "/HTML Template.html");
4545
if(htmlTemplateFile.open(QFile::ReadOnly)) {
4646
htmlTemplate = htmlTemplateFile.readAll();
4747
htmlTemplateFile.close();

interfaces/interfacemidi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public slots:
136136
void receivedMidiRealtime(quint8 type, quint8 val1, quint8 val2);
137137
void networkManualParsing();
138138
void openExamples() {
139-
QDesktopServices::openUrl(QUrl::fromLocalFile(QFileInfo(Application::pathApplication.absoluteFilePath() + "/Patches/Ableton Live/").absoluteFilePath()));
139+
QDesktopServices::openUrl(QUrl::fromLocalFile(QFileInfo(Application::pathPatches.absoluteFilePath() + "/Ableton Live/").absoluteFilePath()));
140140
}
141141
void downloadMidiJack() {
142142
QDesktopServices::openUrl(QUrl("http://www.nerds.de/data/setuploopbe1.exe"));

interfaces/interfaceosc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ void InterfaceOsc::bonjourRecordResolved(const QHostInfo &info, int port) {
135135
#endif
136136
void InterfaceOsc::bonjourScan() {
137137
//Templates
138-
QFileInfoList files = QDir(Application::pathApplication.absoluteFilePath() + "/Tools/Templates/").entryInfoList(QStringList() << "*.txt", QDir::Files | QDir::NoDotAndDotDot, QDir::Name | QDir::IgnoreCase);
138+
QFileInfoList files = QDir(Application::pathTools.absoluteFilePath() + "/Templates/").entryInfoList(QStringList() << "*.txt", QDir::Files | QDir::NoDotAndDotDot, QDir::Name | QDir::IgnoreCase);
139139
files << QDir(Application::pathDocuments.absoluteFilePath() + "/Templates/").entryInfoList(QStringList() << "*.txt", QDir::Files | QDir::NoDotAndDotDot, QDir::Name | QDir::IgnoreCase);
140140
foreach(const QFileInfo &file, files) {
141141
QString header;

interfaces/interfaceosc.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ private slots:
106106
void portChanged();
107107
void portOutChanged();
108108
void openExamples() {
109-
QDesktopServices::openUrl(QUrl::fromLocalFile(QFileInfo(Application::pathApplication.absoluteFilePath() + "/Patches/MaxMSP/").absoluteFilePath()));
110-
QDesktopServices::openUrl(QUrl::fromLocalFile(QFileInfo(Application::pathApplication.absoluteFilePath() + "/Patches/PureData/").absoluteFilePath()));
111-
QDesktopServices::openUrl(QUrl::fromLocalFile(QFileInfo(Application::pathApplication.absoluteFilePath() + "/Patches/Processing/").absoluteFilePath()));
109+
QDesktopServices::openUrl(QUrl::fromLocalFile(QFileInfo(Application::pathPatches.absoluteFilePath() + "/MaxMSP/").absoluteFilePath()));
110+
QDesktopServices::openUrl(QUrl::fromLocalFile(QFileInfo(Application::pathPatches.absoluteFilePath() + "/PureData/").absoluteFilePath()));
111+
QDesktopServices::openUrl(QUrl::fromLocalFile(QFileInfo(Application::pathPatches.absoluteFilePath() + "/Processing/").absoluteFilePath()));
112112
}
113113

114114
private:

0 commit comments

Comments
 (0)