From e3a5241953051e97978ac42fa278572ae735abb3 Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Fri, 15 Jan 2016 20:36:58 +0800 Subject: Doll's Phantom. (WTF) --- ChangeLog | 5 +++++ debian/changelog | 5 +++++ debian/compat | 1 + debian/control | 11 +++++++++++ debian/copyright | 15 +++++++++++++++ debian/files | 2 ++ debian/rules | 5 +++++ debian/source/format | 1 + qmidiplayer.pro | 28 +++++++++++++++++++--------- qmpchannelswindow.hpp | 4 ++-- qmpmidiplay.cpp | 1 - qmpmidiread.cpp | 4 +--- 12 files changed, 67 insertions(+), 15 deletions(-) create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/files create mode 100755 debian/rules create mode 100644 debian/source/format diff --git a/ChangeLog b/ChangeLog index 254f93a..ff0e7ab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2016-01-15 0.6.2 beta +Fix compatibility with MSVC. +Support for MSVC is still experimental. +Add files for building a debian package (highly experimental). + 2016-01-14 0.6.2 beta Drag 'n' drop. Do not quit the program when trying to load a unsupported file. diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..8c3da68 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +qmidiplayer (0.6.2-1) UNRELEASED; urgency=low + + * Initial release. (Closes: #XXXXXX) + + -- chrisoft Fri, 15 Jan 2016 19:29:07 +0800 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..c686b55 --- /dev/null +++ b/debian/control @@ -0,0 +1,11 @@ +Source: qmidiplayer +Maintainer: Chris Xiong +Section: sound +Priority: optional +Standards-Version: 3.9.2 +Build-Depends: debhelper (>= 9), qtbase5-dev, qt5-qmake, libfluidsynth-dev + +Package: qmidiplayer +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Midi player based on Qt and fluidsynth. \ No newline at end of file diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..5fa9a7d --- /dev/null +++ b/debian/copyright @@ -0,0 +1,15 @@ +QMidiPlayer, a cross-platform player for midi files. +Copyright (C) 2015 Chris Xiong + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . diff --git a/debian/files b/debian/files new file mode 100644 index 0000000..c38ebc6 --- /dev/null +++ b/debian/files @@ -0,0 +1,2 @@ +qmidiplayer-dbg_0.6.2-1_amd64.deb debug extra +qmidiplayer_0.6.2-1_amd64.deb misc optional diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..414e9c8 --- /dev/null +++ b/debian/rules @@ -0,0 +1,5 @@ +#!/usr/bin/make -f +%: + dh $@ +override_dh_auto_install: + $(MAKE) INSTALL_ROOT=$$(pwd)/debian/qmidiplayer prefix=/usr install \ No newline at end of file diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..46ebe02 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) \ No newline at end of file diff --git a/qmidiplayer.pro b/qmidiplayer.pro index 177fb1f..8ac9dff 100644 --- a/qmidiplayer.pro +++ b/qmidiplayer.pro @@ -22,8 +22,8 @@ SOURCES += main.cpp\ qmpchanneleditor.cpp \ qmpefxwindow.cpp \ qmpinfowindow.cpp \ - qmpsettingswindow.cpp \ - qmphelpwindow.cpp + qmpsettingswindow.cpp \ + qmphelpwindow.cpp HEADERS += qmpmainwindow.hpp \ qmpmidiplay.hpp \ @@ -33,8 +33,8 @@ HEADERS += qmpmainwindow.hpp \ qmpchanneleditor.hpp \ qmpefxwindow.hpp \ qmpinfowindow.hpp \ - qmpsettingswindow.hpp \ - qmphelpwindow.hpp + qmpsettingswindow.hpp \ + qmphelpwindow.hpp FORMS += qmpmainwindow.ui \ qmpplistwindow.ui \ @@ -43,9 +43,19 @@ FORMS += qmpmainwindow.ui \ qmpchanneleditor.ui \ qmpefxwindow.ui \ qmpinfowindow.ui \ - qmpsettingswindow.ui \ - qmphelpwindow.ui - -QMAKE_CXXFLAGS += -std=c++11 -Wall -LIBS += -lfluidsynth + qmpsettingswindow.ui \ + qmphelpwindow.ui + +unix{ + isEmpty(PREFIX) { + PREFIX = /usr/local + } + BINDIR = $$PREFIX/bin + target.path = $$BINDIR + INSTALLS += target + QMAKE_CXXFLAGS += -std=c++11 -Wall + LIBS += -lfluidsynth +} +win32:LIBS += e:/libs/fluidsynth/fluidsynth.lib #You have to change these +win32:INCLUDEPATH += e:/libs/fluidsynth/include #before building... RESOURCES = resources.qrc diff --git a/qmpchannelswindow.hpp b/qmpchannelswindow.hpp index aba2a8d..f0591b6 100644 --- a/qmpchannelswindow.hpp +++ b/qmpchannelswindow.hpp @@ -17,12 +17,12 @@ namespace Ui { class QDCLabel:public QLabel { Q_OBJECT - using QLabel::QLabel; private: int id; protected: void mouseDoubleClickEvent(QMouseEvent *event){event->accept();emit onDoubleClick(id);} public: + QDCLabel(QString s):QLabel(s){id=-1;} void setID(int _id){id=_id;} signals: void onDoubleClick(int id); @@ -31,12 +31,12 @@ class QDCLabel:public QLabel class QDCPushButton:public QPushButton { Q_OBJECT - using QPushButton::QPushButton; private: int id; protected: void mousePressEvent(QMouseEvent *event){QPushButton::mousePressEvent(event);emit onClick(id);} public: + QDCPushButton(QString s):QPushButton(s){id=-1;} void setID(int _id){id=_id;} signals: void onClick(int id); diff --git a/qmpmidiplay.cpp b/qmpmidiplay.cpp index be5a60d..5bce475 100644 --- a/qmpmidiplay.cpp +++ b/qmpmidiplay.cpp @@ -201,7 +201,6 @@ void CMidiPlayer::playerInit() void CMidiPlayer::playerDeinit() { tceptr=0;tcstop=1;tcpaused=0; - //std::this_thread::sleep_for(std::chrono::milliseconds(100)); delete midiFile;midiFile=NULL; fluidDeinitialize(); } diff --git a/qmpmidiread.cpp b/qmpmidiread.cpp index f09f9e0..0bcf597 100644 --- a/qmpmidiread.cpp +++ b/qmpmidiread.cpp @@ -213,9 +213,7 @@ int CMidiFile::chunkReader(int hdrXp) } CMidiFile::CMidiFile(const char* fn) { - if(title)delete[] title; - if(copyright)delete[] copyright; - title=copyright=NULL;notes=0;std=0;valid=1; + title=copyright=NULL;notes=eventc=0;std=0;valid=1; try { if(!(f=fopen(fn,"rb")))throw (fprintf(stderr,"E: file %s doesn't exist!\n",fn),2); -- cgit v1.2.3