midisnoop-master/0000755000175000017500000000000012427516312013347 5ustar lumaglumagmidisnoop-master/COPYING.GPL0000644000175000017500000004311012427516312015022 0ustar lumaglumag GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. midisnoop-master/install/0000755000175000017500000000000012427516312015015 5ustar lumaglumagmidisnoop-master/install/__init__.py0000644000175000017500000000000012427516312017114 0ustar lumaglumagmidisnoop-master/install/util.py0000644000175000017500000000524112427516312016346 0ustar lumaglumagfrom gzip import open as _open from os import ( X_OK, access, chdir, environ, getcwd, makedirs, pardir, pathsep, sep ) from os.path import abspath, dirname, isabs, isdir, isfile, join from platform import mac_ver, win32_ver from string import Template from subprocess import PIPE, Popen MAJOR_VERSION = 0 MINOR_VERSION = 1 REVISION = 3 VERSION = "%d.%d.%d" % (MAJOR_VERSION, MINOR_VERSION, REVISION) PLATFORM_MACX = 1 PLATFORM_UNIX = 2 PLATFORM_WIN32 = 3 _PLATFORM = (mac_ver()[0] and PLATFORM_MACX) or \ (win32_ver()[0] and PLATFORM_WIN32) or PLATFORM_UNIX def createSourcePackage(path): gzipStream = _open(filename=path, mode="wb") try: gitArgs = ["git", "archive", "--format=tar", "--prefix=midisnoop-%s%s" % (VERSION, sep), "HEAD"] oldDirectory = getcwd() chdir(getRootDirectory()) try: process = Popen(gitArgs, stdout=PIPE, bufsize=-1) try: processOut = process.stdout while True: data = processOut.read(8192) if not data: break gzipStream.write(data) finally: result = process.wait() if result: raise Exception("git archive process failed") finally: chdir(oldDirectory) finally: gzipStream.close() def findExecutable(command): if not isabs(command): path = environ.get("PATH") if path is not None: for path in path.split(pathsep): commandPath = abspath(join(path.strip('\"'), command)) if isfile(commandPath) and access(commandPath, X_OK): return commandPath commandPath = abspath(command) if isfile(commandPath) and access(commandPath, X_OK): return commandPath return None def getPlatform(): return _PLATFORM def getResourcesDirectory(): return join(getRootDirectory(), "resources") def getRootDirectory(): return abspath(join(dirname(__file__), pardir)) def getTemplatesDirectory(): return join(getRootDirectory(), "templates") def writeTemplate(destination, source, data): destination = abspath(destination) destinationDir = dirname(destination) if not isdir(destinationDir): makedirs(destinationDir) source = abspath(source) sourceDir = dirname(source) if not isdir(sourceDir): makedirs(sourceDir) fp = open(source) try: s = fp.read() finally: fp.close() s = Template(s).substitute(data) fp = open(destination, 'w') try: fp.write(s) finally: fp.close() midisnoop-master/install/build-desktop-file0000755000175000017500000000204712427516312020431 0ustar lumaglumag#!/usr/bin/env python from optparse import OptionParser from os import makedirs, sep from os.path import abspath, dirname, isdir, join from util import ( getResourcesDirectory, getTemplatesDirectory, writeTemplate ) def main(): parser = OptionParser("usage: %prog [options] binDir dataDir") parser.add_option("-d", "--desktop-file", action="store", default=join(getResourcesDirectory(), "midisnoop.desktop"), dest="desktopFile", help="Desktop file destination") options, args = parser.parse_args() if len(args) != 2: parser.error("incorrect number of required arguments") desktopFile = options.desktopFile desktopDir = dirname(desktopFile) if not isdir(desktopDir): makedirs(desktopDir) data = { "binDir": abspath(args[0]), "dataDir": abspath(args[1]) } writeTemplate(desktopFile, join(getTemplatesDirectory(), "midisnoop.desktop"), data) if __name__ == "__main__": main() midisnoop-master/install/build-source-package0000755000175000017500000000232312427516312020731 0ustar lumaglumag#!/usr/bin/env python from optparse import OptionParser from os import makedirs, pardir from os.path import abspath, basename, isdir, join from util import VERSION, createSourcePackage, getRootDirectory def main(): rootDirectory = getRootDirectory() parser = OptionParser("usage: %prog [options]") parser.add_option("-a", "--archive-name", action="store", default="midisnoop-%s.tar.gz" % VERSION, dest="archiveName", help="The archive file name") parser.add_option("-d", "--destination-dir", action="store", default=abspath(join(rootDirectory, pardir)), dest="destinationDir", help="Directory to store the source archive in") options, args = parser.parse_args() if len(args): parser.error("incorrect number of required arguments") archiveName = options.archiveName if basename(archiveName) != archiveName: parser.error("'%s': invalid archive name" % archiveName) destinationDir = options.destinationDir if not isdir(destinationDir): makedirs(destinationDir) createSourcePackage(join(destinationDir, archiveName)) if __name__ == "__main__": main() midisnoop-master/README0000644000175000017500000000045312427516312014231 0ustar lumaglumag`midisnoop` is a MIDI monitor and prober. For more information on `midisnoop`, visit: http://midisnoop.googlecode.com/ All images, save for application logos, are taken from the excellent Oxygen Icon Theme. For more information on the Oxygen Icon Theme, visit: http://www.oxygen-icons.org/ midisnoop-master/templates/0000755000175000017500000000000012427516312015345 5ustar lumaglumagmidisnoop-master/templates/midisnoop.desktop0000644000175000017500000000041512427516312020741 0ustar lumaglumag[Desktop Entry] Categories=Audio;AudioVideo;Qt; Comment=MIDI monitor and prober. Encoding=UTF-8 Exec=${binDir}/midisnoop GenericName=Midisnoop GenericName[en_US]=Midisnoop Hidden=false #Icon=${dataDir}/icons/midisnoop.png Name=Midisnoop Terminal=false Type=Application midisnoop-master/src/0000755000175000017500000000000012427516312014136 5ustar lumaglumagmidisnoop-master/src/view.h0000644000175000017500000000305012427516312015257 0ustar lumaglumag/* * midisnoop - MIDI monitor and prober * Copyright (C) 2012 Devin Anderson * * 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 2 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, write to the Free Software Foundation, Inc., 675 Mass * Ave, Cambridge, MA 02139, USA. */ #ifndef __VIEW_H__ #define __VIEW_H__ #include #include "closeeventfilter.h" class View: public QObject { Q_OBJECT public: bool isCloseEnabled() const; bool isVisible() const; public slots: void hide(); virtual void setCloseEnabled(bool enabled); virtual void setVisible(bool visible); void show(); signals: void closeEnabledChanged(bool enabled); void closeRequest(); void visibilityChanged(bool visible); protected: explicit View(QWidget *rootWidget, QObject *parent=0); virtual ~View(); const QWidget * getRootWidget() const; QWidget * getRootWidget(); private: CloseEventFilter closeEventFilter; QWidget *rootWidget; }; #endif midisnoop-master/src/designerview.cpp0000644000175000017500000000174112427516312017340 0ustar lumaglumag/* * midisnoop - MIDI monitor and prober * Copyright (C) 2012 Devin Anderson * * 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 2 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, write to the Free Software Foundation, Inc., 675 Mass * Ave, Cambridge, MA 02139, USA. */ #include "designerview.h" #include "util.h" DesignerView::DesignerView(const QString &path, QObject *parent): View(loadForm(path), parent) { // Empty } DesignerView::~DesignerView() { // Empty } midisnoop-master/src/error.h0000644000175000017500000000176612427516312015452 0ustar lumaglumag/* * midisnoop - MIDI monitor and prober * Copyright (C) 2012 Devin Anderson * * 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 2 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, write to the Free Software Foundation, Inc., 675 Mass * Ave, Cambridge, MA 02139, USA. */ #ifndef __ERROR_H__ #define __ERROR_H__ #include class Error { public: explicit Error(const QString &message); ~Error(); QString getMessage(); private: QString message; }; #endif midisnoop-master/src/aboutview.h0000644000175000017500000000253012427516312016314 0ustar lumaglumag/* * midisnoop - MIDI monitor and prober * Copyright (C) 2012 Devin Anderson * * 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 2 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, write to the Free Software Foundation, Inc., 675 Mass * Ave, Cambridge, MA 02139, USA. */ #ifndef __ABOUTVIEW_H__ #define __ABOUTVIEW_H__ #include #include #include "dialogview.h" class AboutView: public DialogView { Q_OBJECT public: explicit AboutView(QObject *parent=0); ~AboutView(); public slots: void setMajorVersion(int majorVersion); void setMinorVersion(int minorVersion); void setRevision(int revision); private: void updateVersion(); QPushButton *closeButton; int majorVersion; int minorVersion; int revision; QLabel *version; }; #endif midisnoop-master/src/closeeventfilter.cpp0000644000175000017500000000260612427516312020223 0ustar lumaglumag/* * midisnoop - MIDI monitor and prober * Copyright (C) 2012 Devin Anderson * * 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 2 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, write to the Free Software Foundation, Inc., 675 Mass * Ave, Cambridge, MA 02139, USA. */ #include "closeeventfilter.h" CloseEventFilter::CloseEventFilter(QObject *parent): QObject(parent) { closeEnabled = true; } CloseEventFilter::~CloseEventFilter() { // Empty } bool CloseEventFilter::eventFilter(QObject *obj, QEvent *event) { if (event->type() == QEvent::Close) { event->ignore(); if (closeEnabled) { emit closeRequest(); } return true; } return QObject::eventFilter(obj, event); } bool CloseEventFilter::isCloseEnabled() const { return closeEnabled; } void CloseEventFilter::setCloseEnabled(bool enabled) { closeEnabled = enabled; } midisnoop-master/src/util.h0000644000175000017500000000227312427516312015270 0ustar lumaglumag/* * midisnoop - MIDI monitor and prober * Copyright (C) 2012 Devin Anderson * * 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 2 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, write to the Free Software Foundation, Inc., 675 Mass * Ave, Cambridge, MA 02139, USA. */ #ifndef __UTIL_H__ #define __UTIL_H__ #include #include template inline T * getChild(const QObject *object, const QString &name=QString()) { T *child = object->findChild(name); assert(child); return child; } QString getMIDIControlString(quint8 control); QString getMIDINoteString(quint8 note); QWidget * loadForm(const QString &path, QWidget *parent=0); #endif midisnoop-master/src/view.cpp0000644000175000017500000000352212427516312015616 0ustar lumaglumag/* * midisnoop - MIDI monitor and prober * Copyright (C) 2012 Devin Anderson * * 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 2 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, write to the Free Software Foundation, Inc., 675 Mass * Ave, Cambridge, MA 02139, USA. */ #include "util.h" #include "view.h" View::View(QWidget *rootWidget, QObject *parent): QObject(parent) { connect(&closeEventFilter, SIGNAL(closeRequest()), SIGNAL(closeRequest())); rootWidget->installEventFilter(&closeEventFilter); this->rootWidget = rootWidget; } View::~View() { delete rootWidget; } const QWidget * View::getRootWidget() const { return rootWidget; } QWidget * View::getRootWidget() { return rootWidget; } void View::hide() { setVisible(false); } bool View::isCloseEnabled() const { return closeEventFilter.isCloseEnabled(); } bool View::isVisible() const { return rootWidget->isVisible(); } void View::setCloseEnabled(bool enabled) { if (closeEventFilter.isCloseEnabled() != enabled) { closeEventFilter.setCloseEnabled(enabled); emit closeEnabledChanged(enabled); } } void View::setVisible(bool visible) { if (rootWidget->isVisible() != visible) { rootWidget->setVisible(visible); emit visibilityChanged(visible); } } void View::show() { setVisible(true); } midisnoop-master/src/messageview.h0000644000175000017500000000241512427516312016630 0ustar lumaglumag/* * midisnoop - MIDI monitor and prober * Copyright (C) 2012 Devin Anderson * * 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 2 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, write to the Free Software Foundation, Inc., 675 Mass * Ave, Cambridge, MA 02139, USA. */ #ifndef __MESSAGEVIEW_H__ #define __MESSAGEVIEW_H__ #include #include #include "designerview.h" class MessageView: public DesignerView { Q_OBJECT public: explicit MessageView(QObject *parent=0); ~MessageView(); signals: void sendRequest(const QString &data); private slots: void handleSendButtonClick(); private: QPushButton *closeButton; QPlainTextEdit *message; QPushButton *sendButton; }; #endif midisnoop-master/src/configureview.cpp0000644000175000017500000000724612427516312017527 0ustar lumaglumag/* * midisnoop - MIDI monitor and prober * Copyright (C) 2012 Devin Anderson * * 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 2 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, write to the Free Software Foundation, Inc., 675 Mass * Ave, Cambridge, MA 02139, USA. */ #include "configureview.h" #include "util.h" ConfigureView::ConfigureView(QObject *parent): DesignerView(":/midisnoop/configureview.ui", parent) { QWidget *rootWidget = getRootWidget(); driver = getChild(rootWidget, "driver"); connect(driver, SIGNAL(activated(int)), SLOT(handleDriverActivation(int))); ignoreActiveSensingEvents = getChild(rootWidget, "ignoreActiveSensingEvents"); connect(ignoreActiveSensingEvents, SIGNAL(clicked(bool)), SIGNAL(ignoreActiveSensingEventsChangeRequest(bool))); ignoreSystemExclusiveEvents = getChild(rootWidget, "ignoreSystemExclusiveEvents"); connect(ignoreSystemExclusiveEvents, SIGNAL(clicked(bool)), SIGNAL(ignoreSystemExclusiveEventsChangeRequest(bool))); ignoreTimeEvents = getChild(rootWidget, "ignoreTimeEvents"); connect(ignoreTimeEvents, SIGNAL(clicked(bool)), SIGNAL(ignoreTimeEventsChangeRequest(bool))); inputPort = getChild(rootWidget, "inputPort"); connect(inputPort, SIGNAL(activated(int)), SLOT(handleInputPortActivation(int))); outputPort = getChild(rootWidget, "outputPort"); connect(outputPort, SIGNAL(activated(int)), SLOT(handleOutputPortActivation(int))); closeButton = getChild(rootWidget, "closeButton"); connect(closeButton, SIGNAL(clicked()), SIGNAL(closeRequest())); } ConfigureView::~ConfigureView() { // Empty } void ConfigureView::addDriver(int index, const QString &name) { driver->insertItem(index + 1, name); } void ConfigureView::addInputPort(int index, const QString &name) { inputPort->insertItem(index + 1, name); } void ConfigureView::addOutputPort(int index, const QString &name) { outputPort->insertItem(index + 1, name); } void ConfigureView::handleDriverActivation(int index) { emit driverChangeRequest(index - 1); } void ConfigureView::handleInputPortActivation(int index) { emit inputPortChangeRequest(index - 1); } void ConfigureView::handleOutputPortActivation(int index) { emit outputPortChangeRequest(index - 1); } void ConfigureView::removeInputPort(int index) { inputPort->removeItem(index + 1); } void ConfigureView::removeOutputPort(int index) { outputPort->removeItem(index + 1); } void ConfigureView::setDriver(int index) { driver->setCurrentIndex(index + 1); } void ConfigureView::setIgnoreActiveSensingEvents(bool ignore) { ignoreActiveSensingEvents->setChecked(ignore); } void ConfigureView::setIgnoreSystemExclusiveEvents(bool ignore) { ignoreSystemExclusiveEvents->setChecked(ignore); } void ConfigureView::setIgnoreTimeEvents(bool ignore) { ignoreTimeEvents->setChecked(ignore); } void ConfigureView::setInputPort(int index) { inputPort->setCurrentIndex(index + 1); } void ConfigureView::setOutputPort(int index) { outputPort->setCurrentIndex(index + 1); } midisnoop-master/src/aboutview.cpp0000644000175000017500000000353712427516312016657 0ustar lumaglumag/* * midisnoop - MIDI monitor and prober * Copyright (C) 2012 Devin Anderson * * 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 2 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, write to the Free Software Foundation, Inc., 675 Mass * Ave, Cambridge, MA 02139, USA. */ #include #include "aboutview.h" #include "util.h" AboutView::AboutView(QObject *parent): DialogView(":/midisnoop/aboutview.ui", parent) { closeButton = getChild(dialog, "closeButton"); connect(closeButton, SIGNAL(clicked()), SIGNAL(closeRequest())); majorVersion = 0; minorVersion = 0; revision = 0; version = getChild(dialog, "version"); updateVersion(); } AboutView::~AboutView() { // Empty } void AboutView::setMajorVersion(int majorVersion) { this->majorVersion = majorVersion; updateVersion(); } void AboutView::setMinorVersion(int minorVersion) { this->minorVersion = minorVersion; updateVersion(); } void AboutView::setRevision(int revision) { this->revision = revision; updateVersion(); } void AboutView::updateVersion() { QLocale locale = QLocale::system(); version->setText(tr("%1.%2.%3", "versionFormat"). arg(locale.toString(majorVersion)). arg(locale.toString(minorVersion)). arg(locale.toString(revision))); } midisnoop-master/src/application.cpp0000644000175000017500000000240012427516312017141 0ustar lumaglumag/* * midisnoop - MIDI monitor and prober * Copyright (C) 2012 Devin Anderson * * 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 2 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, write to the Free Software Foundation, Inc., 675 Mass * Ave, Cambridge, MA 02139, USA. */ #include #include "application.h" #include "error.h" Application::Application(int &argc, char **argv): QApplication(argc, argv) { // Empty } Application::~Application() { // Empty } bool Application::notify(QObject *receiver, QEvent *event) { try { return QApplication::notify(receiver, event); } catch (Error &e) { emit eventError(e.getMessage()); } catch (std::exception &e) { emit eventError(e.what()); } return false; } midisnoop-master/src/mainview.h0000644000175000017500000000453312427516312016133 0ustar lumaglumag/* * midisnoop - MIDI monitor and prober * Copyright (C) 2012 Devin Anderson * * 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 2 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, write to the Free Software Foundation, Inc., 675 Mass * Ave, Cambridge, MA 02139, USA. */ #ifndef __MAINVIEW_H__ #define __MAINVIEW_H__ #include #include #include #include #include "designerview.h" #include "messagetabledelegate.h" class MainView: public DesignerView { Q_OBJECT public: explicit MainView(QObject *parent=0); ~MainView(); public slots: void addReceivedMessage(quint64 timeStamp, const QString &statusDescription, const QString &dataDescription, bool valid); void addSentMessage(quint64 timeStamp, const QString &statusDescription, const QString &dataDescription, bool valid); void clearMessages(); void setMessageSendEnabled(bool enabled); signals: void aboutRequest(); void addMessageRequest(); void clearMessagesRequest(); void configureRequest(); private: enum MessageTableColumn { MESSAGETABLECOLUMN_TIMESTAMP = 0, MESSAGETABLECOLUMN_STATUS = 1, MESSAGETABLECOLUMN_DATA = 2, MESSAGETABLECOLUMN_TOTAL = 3 }; int addMessage(quint64 timeStamp, const QString &statusDescription, const QString &dataDescription, bool valid); void setModelData(int row, int column, const QVariant &value, int role=Qt::DisplayRole); QAction *aboutAction; QAction *addAction; QAction *clearAction; QAction *configureAction; MessageTableDelegate tableDelegate; QAction *quitAction; QStandardItemModel tableModel; QTableView *tableView; }; #endif midisnoop-master/src/mainview.ui0000644000175000017500000001250212427516312016314 0ustar lumaglumag MainWindow 0 0 800 600 midisnoop Qt::ScrollBarAsNeeded QAbstractItemView::CurrentChanged|QAbstractItemView::SelectedClicked false QAbstractItemView::SingleSelection QAbstractItemView::ScrollPerPixel QAbstractItemView::ScrollPerPixel 150 true true 0 0 800 23 &File &Edit &Help toolBar 16 16 Qt::ToolButtonTextUnderIcon TopToolBarArea false :/midisnoop/images/16x16/add.png:/midisnoop/images/16x16/add.png Add Add a MIDI message to send. Ctrl+D :/midisnoop/images/16x16/clear.png:/midisnoop/images/16x16/clear.png Clear Clear MIDI messages. Ctrl+L :/midisnoop/images/16x16/quit.png:/midisnoop/images/16x16/quit.png Quit Quit this application. Ctrl+Q :/midisnoop/images/16x16/configure.png:/midisnoop/images/16x16/configure.png Configure Configure midisnoop. Ctrl+O :/midisnoop/images/16x16/information.png:/midisnoop/images/16x16/information.png About About midisnoop. Ctrl+A midisnoop-master/src/dialogview.cpp0000644000175000017500000000231112427516312016771 0ustar lumaglumag/* * midisnoop - MIDI monitor and prober * Copyright (C) 2012 Devin Anderson * * 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 2 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, write to the Free Software Foundation, Inc., 675 Mass * Ave, Cambridge, MA 02139, USA. */ #include #include #include "dialogview.h" DialogView::DialogView(const QString &path, QObject *parent): DesignerView(path, parent) { dialog = qobject_cast(getRootWidget()); assert(dialog); dialog->setWindowFlags(Qt::CustomizeWindowHint | Qt::Dialog | Qt::WindowCloseButtonHint); dialog->setModal(true); } DialogView::~DialogView() { // Empty } midisnoop-master/src/main.cpp0000644000175000017500000000526712427516312015600 0ustar lumaglumag/* * midisnoop - MIDI monitor and prober * Copyright (C) 2012 Devin Anderson * * 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 2 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, write to the Free Software Foundation, Inc., 675 Mass * Ave, Cambridge, MA 02139, USA. */ #include #include #include #include #include #include #include #include #include "controller.h" #include "error.h" int main(int argc, char **argv) { Application application(argc, argv); QString errorMessage; application.setApplicationName("midisnoop"); application.setOrganizationDomain("midisnoop.googlecode.com"); application.setOrganizationName("midisnoop.googlecode.com"); // Translations QString directory = QLibraryInfo::location(QLibraryInfo::TranslationsPath); QString language = QLocale::system().name(); QTranslator qtTranslator; qtTranslator.load("qt_" + language, directory); application.installTranslator(&qtTranslator); QTranslator translator; translator.load("midisnoop_" + language); application.installTranslator(&translator); qDebug() << application.tr("Translations loaded."); try { // Controller qDebug() << application.tr("Creating core application objects ..."); Controller controller(application); qDebug() << application.tr("Core application objects created."); // Run the program qDebug() << application.tr("Running ..."); controller.run(); } catch (Error &e) { errorMessage = e.getMessage(); } catch (std::exception &e) { errorMessage = e.what(); } // Deal with errors. int result; if (errorMessage.isEmpty()) { qDebug() << application.tr("Exiting without errors ..."); result = EXIT_SUCCESS; } else { QTextStream(stderr) << application.tr("Error: %1\n").arg(errorMessage); result = EXIT_FAILURE; } // Cleanup qDebug() << application.tr("Unloading translations ..."); application.removeTranslator(&translator); application.removeTranslator(&qtTranslator); return result; } midisnoop-master/src/messagetabledelegate.h0000644000175000017500000000302612427516312020437 0ustar lumaglumag/* * midisnoop - MIDI monitor and prober * Copyright (C) 2012 Devin Anderson * * 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 2 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, write to the Free Software Foundation, Inc., 675 Mass * Ave, Cambridge, MA 02139, USA. */ #ifndef __MESSAGETABLEDELEGATE_H__ #define __MESSAGETABLEDELEGATE_H__ #include class MessageTableDelegate: public QStyledItemDelegate { Q_OBJECT public: explicit MessageTableDelegate(QObject *parent=0); ~MessageTableDelegate(); QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const; void setEditorData(QWidget *editor, const QModelIndex &index) const; void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const; void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const; }; #endif midisnoop-master/src/configureview.ui0000644000175000017500000001015512427516312017353 0ustar lumaglumag Dialog Qt::ApplicationModal 0 0 400 325 Configure :/midisnoop/images/16x16/configure.png:/midisnoop/images/16x16/configure.png MIDI Driver 20 Driver --none selected-- Input Port --none selected-- Output Port --none selected-- Event Filter Ignore System Exclusive Events Ignore Time Events Ignore Active Sensing Events Qt::Horizontal 0 0 Close :/midisnoop/images/16x16/close.png:/midisnoop/images/16x16/close.png midisnoop-master/src/engine.h0000644000175000017500000000626712427516312015567 0ustar lumaglumag/* * midisnoop - MIDI monitor and prober * Copyright (C) 2012 Devin Anderson * * 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 2 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, write to the Free Software Foundation, Inc., 675 Mass * Ave, Cambridge, MA 02139, USA. */ #ifndef __ENGINE_H__ #define __ENGINE_H__ #include #include #include #include class Engine: public QObject { Q_OBJECT public: explicit Engine(QObject *parent=0); ~Engine(); int getDriver() const; int getDriverCount() const; QString getDriverName(int index) const; bool getIgnoreActiveSensingEvents() const; bool getIgnoreSystemExclusiveEvents() const; bool getIgnoreTimeEvents() const; int getInputPort() const; int getInputPortCount() const; QString getInputPortName(int index) const; int getOutputPort() const; int getOutputPortCount() const; QString getOutputPortName(int index) const; public slots: quint64 sendMessage(const QByteArray &message); void setDriver(int index); void setIgnoreActiveSensingEvents(bool ignore); void setIgnoreSystemExclusiveEvents(bool ignore); void setIgnoreTimeEvents(bool ignore); void setInputPort(int index); void setOutputPort(int index); signals: void driverChanged(int index); void ignoreActiveSensingEventsChanged(bool ignore); void ignoreSystemExclusiveEventsChanged(bool ignore); void ignoreTimeEventsChanged(bool ignore); void inputPortAdded(int index, const QString &name); void inputPortChanged(int index); void inputPortRemoved(int index); void messageReceived(quint64 timeStamp, const QByteArray &message); void outputPortAdded(int index, const QString &name); void outputPortChanged(int index); void outputPortRemoved(int index); private: static void handleMidiInput(double timeStamp, std::vector *message, void *engine); quint64 getCurrentTimestamp() const; void handleMidiInput(double timeStamp, const std::vector &message); void removePorts(); void updateEventFilter(); int driver; QList driverAPIs; QStringList driverNames; bool ignoreActiveSensingEvents; bool ignoreSystemExclusiveEvents; bool ignoreTimeEvents; RtMidiIn *input; int inputPort; QStringList inputPortNames; RtMidiOut *output; int outputPort; QStringList outputPortNames; bool virtualPortsAdded; }; #endif midisnoop-master/src/engine.cpp0000644000175000017500000002605512427516312016117 0ustar lumaglumag/* * midisnoop - MIDI monitor and prober * Copyright (C) 2012 Devin Anderson * * 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 2 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, write to the Free Software Foundation, Inc., 675 Mass * Ave, Cambridge, MA 02139, USA. */ #include #include #include "engine.h" #include "error.h" #if QT_VERSION >= 0x040700 #include #else #include #include #include #endif // Static functions void Engine::handleMidiInput(double timeStamp, std::vector *message, void *engine) { static_cast(engine)->handleMidiInput(timeStamp, *message); } // Class definition Engine::Engine(QObject *parent): QObject(parent) { // Get available MIDI drivers. std::vector apis; RtMidi::getCompiledApi(apis); int apiCount = apis.size(); for (int i = 0; i < apiCount; i++) { RtMidi::Api api = apis[i]; switch (api) { case RtMidi::LINUX_ALSA: driverNames.append(tr("ALSA Sequencer")); break; case RtMidi::MACOSX_CORE: driverNames.append(tr("CoreMidi")); break; case RtMidi::UNIX_JACK: driverNames.append(tr("JACK Audio Connection Kit")); break; case RtMidi::WINDOWS_KS: driverNames.append(tr("Windows Kernel Streaming")); break; case RtMidi::WINDOWS_MM: driverNames.append(tr("Windows Multimedia MIDI")); break; default: qWarning() << tr("Unexpected MIDI API constant: %1"). arg(static_cast(api)); // Fallthrough on purpose case RtMidi::RTMIDI_DUMMY: case RtMidi::UNSPECIFIED: continue; } driverAPIs.append(api); } driver = -1; ignoreActiveSensingEvents = true; ignoreSystemExclusiveEvents = true; ignoreTimeEvents = true; inputPort = -1; outputPort = -1; } Engine::~Engine() { setDriver(-1); } int Engine::getDriver() const { return driver; } int Engine::getDriverCount() const { return driverAPIs.count(); } QString Engine::getDriverName(int index) const { assert((index >= 0) && (index < driverAPIs.count())); return driverNames[index]; } bool Engine::getIgnoreActiveSensingEvents() const { return ignoreActiveSensingEvents; } bool Engine::getIgnoreSystemExclusiveEvents() const { return ignoreSystemExclusiveEvents; } bool Engine::getIgnoreTimeEvents() const { return ignoreTimeEvents; } int Engine::getInputPort() const { return inputPort; } int Engine::getInputPortCount() const { return inputPortNames.count(); } QString Engine::getInputPortName(int index) const { assert((index >= 0) && (index < inputPortNames.count())); return inputPortNames[index]; } int Engine::getOutputPort() const { return outputPort; } int Engine::getOutputPortCount() const { return outputPortNames.count(); } QString Engine::getOutputPortName(int index) const { assert((index >= 0) && (index < outputPortNames.count())); return outputPortNames[index]; } quint64 Engine::getCurrentTimestamp() const { #if QT_VERSION >= 0x040700 return QDateTime::currentDateTime().toMSecsSinceEpoch(); #else struct timeval time; if (gettimeofday(&time, 0) == -1) { throw Error(tr("failed to get time of day: %1").arg(strerror(errno))); } return (static_cast(time.tv_sec) * 1000) + (static_cast(time.tv_usec) / 1000); #endif } void Engine::handleMidiInput(double /*timeStamp*/, const std::vector &message) { switch (message[0]) { case 0xf0: if (ignoreSystemExclusiveEvents) { qWarning() << "RtMidi did not filter system exclusive event"; return; } break; case 0xf1: case 0xf8: case 0xf9: if (ignoreTimeEvents) { qWarning() << "RtMidi did not filter time event"; return; } break; case 0xfe: if (ignoreActiveSensingEvents) { qWarning() << "RtMidi did not filter active sensing event"; return; } } quint64 timeStamp = getCurrentTimestamp(); QByteArray msg; int size = static_cast(message.size()); for (int i = 0; i < size; i++) { msg.append(message[i]); } emit messageReceived(timeStamp, msg); } void Engine::removePorts() { setInputPort(-1); setOutputPort(-1); for (int i = inputPortNames.count() - 1; i >= 0; i--) { inputPortNames.removeAt(i); emit inputPortRemoved(i); } for (int i = outputPortNames.count() - 1; i >= 0; i--) { outputPortNames.removeAt(i); emit outputPortRemoved(i); } } quint64 Engine::sendMessage(const QByteArray &message) { assert(outputPort != -1); std::vector msg; for (int i = 0; i < message.count(); i++) { msg.push_back(static_cast(message[i])); } try { output->sendMessage(&msg); } catch (RtError &e) { throw Error(e.what()); } return getCurrentTimestamp(); } void Engine::setDriver(int index) { assert((index >= -1) && (index < driverAPIs.count())); if (driver != index) { // Close the currently open MIDI driver. if (driver != -1) { removePorts(); delete input; delete output; driver = -1; emit driverChanged(-1); } // Open the new driver. if (index != -1) { RtMidi::Api api = driverAPIs[index]; try { input = new RtMidiIn(api, "midisnoop"); QScopedPointer inputPtr(input); output = new RtMidiOut(api, "midisnoop"); QScopedPointer outputPtr(output); input->setCallback(handleMidiInput, this); // Add ports. try { unsigned int count = input->getPortCount(); QString name; for (unsigned int i = 0; i < count; i++) { name = QString::fromStdString(input->getPortName(i)); inputPortNames.append(name); emit inputPortAdded(i, name); } count = output->getPortCount(); for (unsigned int i = 0; i < count; i++) { name = QString::fromStdString(output->getPortName(i)); outputPortNames.append(name); emit outputPortAdded(i, name); } // Add a virtual port to drivers that support virtual ports. switch (api) { case RtMidi::LINUX_ALSA: case RtMidi::MACOSX_CORE: case RtMidi::UNIX_JACK: name = tr("[virtual input]"); inputPortNames.append(name); emit inputPortAdded(inputPortNames.count() - 1, name); name = tr("[virtual output]"); outputPortNames.append(name); emit outputPortAdded(outputPortNames.count() - 1, name); virtualPortsAdded = true; break; default: virtualPortsAdded = false; } } catch (...) { removePorts(); throw; } inputPtr.take(); outputPtr.take(); } catch (RtError &e) { throw Error(e.what()); } driver = index; emit driverChanged(index); } } } void Engine::setIgnoreActiveSensingEvents(bool ignore) { if (ignoreActiveSensingEvents != ignore) { ignoreActiveSensingEvents = ignore; updateEventFilter(); emit ignoreActiveSensingEventsChanged(ignore); } } void Engine::setIgnoreSystemExclusiveEvents(bool ignore) { if (ignoreSystemExclusiveEvents != ignore) { ignoreSystemExclusiveEvents = ignore; updateEventFilter(); emit ignoreSystemExclusiveEventsChanged(ignore); } } void Engine::setIgnoreTimeEvents(bool ignore) { if (ignoreTimeEvents != ignore) { ignoreTimeEvents = ignore; updateEventFilter(); emit ignoreTimeEventsChanged(ignore); } } void Engine::setInputPort(int index) { assert((index >= -1) && (index < inputPortNames.count())); if (inputPort != index) { // Close the currently open input port. if (inputPort != -1) { try { input->closePort(); } catch (RtError &e) { qWarning() << e.what(); } inputPort = -1; emit inputPortChanged(-1); } // Open the new input port. if (index != -1) { try { if (virtualPortsAdded && (index == (inputPortNames.count() - 1))) { input->openVirtualPort("MIDI Input"); } else { input->openPort(index, "MIDI Input"); } } catch (RtError &e) { throw Error(e.what()); } inputPort = index; updateEventFilter(); emit inputPortChanged(index); } } } void Engine::setOutputPort(int index) { assert((index >= -1) && (index < outputPortNames.count())); if (outputPort != index) { // Close the currently open output port. if (outputPort != -1) { try { output->closePort(); } catch (RtError &e) { qWarning() << e.what(); } outputPort = -1; emit outputPortChanged(-1); } // Open the new output port. if (index != -1) { try { if (virtualPortsAdded && (index == (outputPortNames.count() - 1))) { output->openVirtualPort("MIDI Output"); } else { output->openPort(index, "MIDI Output"); } } catch (RtError &e) { throw Error(e.what()); } outputPort = index; emit outputPortChanged(index); } } } void Engine::updateEventFilter() { if (inputPort != -1) { input->ignoreTypes(ignoreSystemExclusiveEvents, ignoreTimeEvents, ignoreActiveSensingEvents); } } midisnoop-master/src/util.cpp0000644000175000017500000002337312427516312015627 0ustar lumaglumag/* * midisnoop - MIDI monitor and prober * Copyright (C) 2012 Devin Anderson * * 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 2 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, write to the Free Software Foundation, Inc., 675 Mass * Ave, Cambridge, MA 02139, USA. */ #include #include #include #include #include "util.h" QString getMIDIControlString(quint8 control) { assert(control < 0x80); QString name; switch (control) { case 0x0: name = qApp->tr("Bank Select"); break; case 0x1: name = qApp->tr("Modulation Wheel"); break; case 0x2: name = qApp->tr("Breath Controller"); break; case 0x4: name = qApp->tr("Foot Controller"); break; case 0x5: name = qApp->tr("Portamento Time"); break; case 0x6: name = qApp->tr("Data Entry MSB"); break; case 0x7: name = qApp->tr("Channel Volume"); break; case 0x8: name = qApp->tr("Balance"); break; case 0xa: name = qApp->tr("Pan"); break; case 0xb: name = qApp->tr("Expression Controller"); break; case 0xc: name = qApp->tr("Effect Control 1"); break; case 0xd: name = qApp->tr("Effect Control 2"); break; case 0x10: name = qApp->tr("General Purpose Controller 1"); break; case 0x11: name = qApp->tr("General Purpose Controller 2"); break; case 0x12: name = qApp->tr("General Purpose Controller 3"); break; case 0x13: name = qApp->tr("General Purpose Controller 4"); break; case 0x20: name = qApp->tr("Bank Select LSB"); break; case 0x21: name = qApp->tr("Modulation Wheel LSB"); break; case 0x22: name = qApp->tr("Breath Controller LSB"); break; case 0x23: name = qApp->tr("Control 3 LSB"); break; case 0x24: name = qApp->tr("Foot Controller LSB"); break; case 0x25: name = qApp->tr("Portamento Time LSB"); break; case 0x26: name = qApp->tr("Data Entry LSB"); break; case 0x27: name = qApp->tr("Channel Volume LSB"); break; case 0x28: name = qApp->tr("Balance LSB"); break; case 0x29: name = qApp->tr("Control 9 LSB"); break; case 0x2a: name = qApp->tr("Pan LSB"); break; case 0x2b: name = qApp->tr("Expression Controller LSB"); break; case 0x2c: name = qApp->tr("Effect Control 1 LSB"); break; case 0x2d: name = qApp->tr("Effect Control 2 LSB"); break; case 0x2e: name = qApp->tr("Control 14 LSB"); break; case 0x2f: name = qApp->tr("Control 15 LSB"); break; case 0x30: name = qApp->tr("General Purpose Controller 1 LSB"); break; case 0x31: name = qApp->tr("General Purpose Controller 2 LSB"); break; case 0x32: name = qApp->tr("General Purpose Controller 3 LSB"); break; case 0x33: name = qApp->tr("General Purpose Controller 4 LSB"); break; case 0x34: name = qApp->tr("Control 20 LSB"); break; case 0x35: name = qApp->tr("Control 21 LSB"); break; case 0x36: name = qApp->tr("Control 22 LSB"); break; case 0x37: name = qApp->tr("Control 23 LSB"); break; case 0x38: name = qApp->tr("Control 24 LSB"); break; case 0x39: name = qApp->tr("Control 25 LSB"); break; case 0x3a: name = qApp->tr("Control 26 LSB"); break; case 0x3b: name = qApp->tr("Control 27 LSB"); break; case 0x3c: name = qApp->tr("Control 28 LSB"); break; case 0x3d: name = qApp->tr("Control 29 LSB"); break; case 0x3e: name = qApp->tr("Control 30 LSB"); break; case 0x3f: name = qApp->tr("Control 31 LSB"); break; case 0x40: name = qApp->tr("Damper Pedal On/Off"); break; case 0x41: name = qApp->tr("Portamento On/Off"); break; case 0x42: name = qApp->tr("Sostenuto On/Off"); break; case 0x43: name = qApp->tr("Soft Pedal On/Off"); break; case 0x44: name = qApp->tr("Legato Footswitch"); break; case 0x45: name = qApp->tr("Hold 2"); break; case 0x46: name = qApp->tr("Sound Controller 1 (Default: Sound Variation)"); break; case 0x47: name = qApp->tr("Sound Controller 2 (Default: Timbre/Harmonic " "Intensity)"); break; case 0x48: name = qApp->tr("Sound Controller 3 (Default: Release Time)"); break; case 0x49: name = qApp->tr("Sound Controller 4 (Default: Attack Time)"); break; case 0x4a: name = qApp->tr("Sound Controller 5 (Default: Brightness)"); break; case 0x4b: name = qApp->tr("Sound Controller 6 (Default: Decay Time)"); break; case 0x4c: name = qApp->tr("Sound Controller 7 (Default: Vibrato Rate)"); break; case 0x4d: name = qApp->tr("Sound Controller 8 (Default: Vibrato Depth)"); break; case 0x4e: name = qApp->tr("Sound Controller 9 (Default: Vibrato Delay)"); break; case 0x4f: name = qApp->tr("Sound Controller 10"); break; case 0x50: name = qApp->tr("General Purpose Controller 5"); break; case 0x51: name = qApp->tr("General Purpose Controller 6"); break; case 0x52: name = qApp->tr("General Purpose Controller 7"); break; case 0x53: name = qApp->tr("General Purpose Controller 8"); break; case 0x5b: name = qApp->tr("Effects 1 Depth (Default: Reverb Send Level)"); break; case 0x5c: name = qApp->tr("Effects 2 Depth"); break; case 0x5d: name = qApp->tr("Effects 3 Depth (Default: Chorus Send Level"); break; case 0x5e: name = qApp->tr("Effects 4 Depth"); break; case 0x5f: name = qApp->tr("Effects 5 Depth"); break; case 0x60: name = qApp->tr("Data Increment"); break; case 0x61: name = qApp->tr("Data Decrement"); break; case 0x62: name = qApp->tr("Non-Registered Parameter Number LSB"); break; case 0x63: name = qApp->tr("Non-Registered Parameter Number MSB"); break; case 0x64: name = qApp->tr("Registered Parameter Number LSB"); break; case 0x65: name = qApp->tr("Registered Parameter Number MSB"); break; case 0x78: name = qApp->tr("All Sound Off"); break; case 0x79: name = qApp->tr("Reset All Controllers"); break; case 0x7a: name = qApp->tr("Local Control On/Off"); break; case 0x7b: name = qApp->tr("All Notes Off"); break; case 0x7c: name = qApp->tr("Omni Mode Off"); break; case 0x7d: name = qApp->tr("Omni Mode On"); break; case 0x7e: name = qApp->tr("Mono Mode On"); break; case 0x7f: name = qApp->tr("Poly Mode On"); break; default: name = qApp->tr("Undefined"); } return qApp->translate("midiControlFormat", "%1 - %2"). arg(QLocale::system().toString(control), name); } QString getMIDINoteString(quint8 note) { assert(note < 0x80); QString noteStr; switch (note % 12) { case 0: noteStr = qApp->translate("cNote", "C"); break; case 1: noteStr = qApp->translate("cSharpNote", "C#"); break; case 2: noteStr = qApp->translate("dNote", "D"); break; case 3: noteStr = qApp->translate("dSharpNote", "D#"); break; case 4: noteStr = qApp->translate("eNote", "E"); break; case 5: noteStr = qApp->translate("fNote", "F"); break; case 6: noteStr = qApp->translate("fSharpNote", "F#"); break; case 7: noteStr = qApp->translate("gNote", "G"); break; case 8: noteStr = qApp->translate("gSharpNote", "G#"); break; case 9: noteStr = qApp->translate("aNote", "A"); break; case 10: noteStr = qApp->translate("aSharpNote", "A#"); break; case 11: noteStr = qApp->translate("bNote", "B"); } QLocale locale = QLocale::system(); return qApp->translate("midiNoteFormat", "%1 (%2%3)"). arg(locale.toString(static_cast(note)), noteStr, locale.toString(static_cast(note / 12) - 1)); } QWidget * loadForm(const QString &path, QWidget *parent) { QFile file(path); // XX: Qt makes a jump based on uninitialized values the first time this // call is made. bool opened = file.open(QFile::ReadOnly); assert(opened); QUiLoader uiLoader; // XX: Qt also makes a jump based on uninitialized values the first time // this call is made. QWidget *widget = uiLoader.load(&file, parent); assert(widget); file.close(); return widget; } midisnoop-master/src/errorview.cpp0000644000175000017500000000233012427516312016664 0ustar lumaglumag/* * midisnoop - MIDI monitor and prober * Copyright (C) 2012 Devin Anderson * * 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 2 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, write to the Free Software Foundation, Inc., 675 Mass * Ave, Cambridge, MA 02139, USA. */ #include "errorview.h" #include "util.h" ErrorView::ErrorView(QObject *parent): DialogView(":/midisnoop/errorview.ui", parent) { closeButton = getChild(dialog, "closeButton"); connect(closeButton, SIGNAL(clicked()), SIGNAL(closeRequest())); message = getChild(dialog, "message"); } ErrorView::~ErrorView() { // Empty } void ErrorView::setMessage(const QString &message) { this->message->setText(message); } midisnoop-master/src/messageview.ui0000644000175000017500000000410212427516312017011 0ustar lumaglumag Dialog Qt::ApplicationModal 0 0 450 300 Send Message :/midisnoop/images/16x16/add.png:/midisnoop/images/16x16/add.png true Qt::Horizontal 0 0 Send :/midisnoop/images/16x16/add.png:/midisnoop/images/16x16/add.png Close :/midisnoop/images/16x16/close.png:/midisnoop/images/16x16/close.png midisnoop-master/src/aboutview.ui0000644000175000017500000001770512427516312016514 0ustar lumaglumag Dialog Qt::ApplicationModal 0 0 555 241 About midisnoop :/midisnoop/images/16x16/information.png:/midisnoop/images/16x16/information.png true 32 32 :/midisnoop/images/32x32/information.png Qt::Vertical 0 0 18 75 true false midisnoop Qt::AlignCenter Version: 0.2.1 Written By: Devin Anderson <surfacepatterns (at) gmail (dot) com> License: GNU General Public License Home Page: <a href="http://midisnoop.googlecode.com">http://midisnoop.googlecode.com</a> Qt::RichText true Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse Issue Tracker: <a href="http://code.google.com/p/midisnoop/issues/list">http://code.google.com/p/midisnoop/issues/list</a> Qt::RichText true Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse User Group: <a href="http://groups.google.com/group/midisnoop-users">http://groups.google.com/group/midisnoop-users</a> Qt::RichText true Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse Development Group: <a href="http://groups.google.com/group/midisnoop-development">http://groups.google.com/group/midisnoop-development</a> Qt::RichText true Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse Qt::Horizontal 0 0 Close :/midisnoop/images/16x16/close.png:/midisnoop/images/16x16/close.png midisnoop-master/src/errorview.h0000644000175000017500000000224212427516312016333 0ustar lumaglumag/* * midisnoop - MIDI monitor and prober * Copyright (C) 2012 Devin Anderson * * 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 2 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, write to the Free Software Foundation, Inc., 675 Mass * Ave, Cambridge, MA 02139, USA. */ #ifndef __ERRORVIEW_H__ #define __ERRORVIEW_H__ #include #include #include "dialogview.h" class ErrorView: public DialogView { Q_OBJECT public: explicit ErrorView(QObject *parent=0); ~ErrorView(); public slots: void setMessage(const QString &message); private: QPushButton *closeButton; QLabel *message; }; #endif midisnoop-master/src/controller.h0000644000175000017500000000346312427516312016500 0ustar lumaglumag/* * midisnoop - MIDI monitor and prober * Copyright (C) 2012 Devin Anderson * * 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 2 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, write to the Free Software Foundation, Inc., 675 Mass * Ave, Cambridge, MA 02139, USA. */ #ifndef __CONTROLLER_H__ #define __CONTROLLER_H__ #include "aboutview.h" #include "application.h" #include "configureview.h" #include "engine.h" #include "errorview.h" #include "mainview.h" #include "messageview.h" class Controller: public QObject { Q_OBJECT public: explicit Controller(Application &application, QObject *parent=0); ~Controller(); void run(); private slots: void handleDriverChange(); void handleMessageSend(const QString &message); void handleReceivedMessage(quint64 timeStamp, const QByteArray &message); private: QString getGenericDataDescription(const QByteArray &message, int lastIndex=-1); void parseMessage(const QByteArray &message); void showError(const QString &message); AboutView aboutView; Application &application; ConfigureView configureView; QString dataDescription; Engine engine; ErrorView errorView; MainView mainView; MessageView messageView; QString statusDescription; bool valid; }; #endif midisnoop-master/src/error.cpp0000644000175000017500000000170112427516312015772 0ustar lumaglumag/* * midisnoop - MIDI monitor and prober * Copyright (C) 2012 Devin Anderson * * 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 2 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, write to the Free Software Foundation, Inc., 675 Mass * Ave, Cambridge, MA 02139, USA. */ #include "error.h" Error::Error(const QString &message) { this->message = message; } Error::~Error() { // Empty } QString Error::getMessage() { return message; } midisnoop-master/src/resources.qrc0000644000175000017500000000111612427516312016656 0ustar lumaglumag images/16x16/add.png images/16x16/clear.png images/16x16/close.png images/16x16/configure.png images/16x16/error.png images/16x16/information.png images/16x16/quit.png images/32x32/error.png images/32x32/information.png aboutview.ui configureview.ui errorview.ui mainview.ui messageview.ui midisnoop-master/src/src.pro0000644000175000017500000000615512427516312015456 0ustar lumaglumag################################################################################ # Build ################################################################################ MIDISNOOP_APP_SUFFIX = bin MIDISNOOP_DATA_SUFFIX = share !isEmpty(DEBUG) { CONFIG += debug DEFINES += MIDISNOOP_DEBUG } isEmpty(BUILDDIR) { BUILDDIR = ../build } isEmpty(MAKEDIR) { MAKEDIR = ../make } isEmpty(MAJOR_VERSION) { MAJOR_VERSION = 0 } isEmpty(MINOR_VERSION) { MINOR_VERSION = 1 } isEmpty(REVISION) { REVISION = 3 } MIDISNOOP_VERSION = $${MAJOR_VERSION}.$${MINOR_VERSION}.$${REVISION} macx { CONFIG += x86_64 DEFINES += MIDISNOOP_PLATFORM_MACX } else:unix { DEFINES += MIDISNOOP_PLATFORM_UNIX } else:win32 { DEFINES += MIDISNOOP_PLATFORM_WIN32 } else { warning(Your platform has not been detected successfully. Expect errors.) } isEmpty(PREFIX) { win32 { PREFIX = C:/Program Files/midisnoop } else { PREFIX = /usr/local } } isEmpty(DATAROOTDIR) { DATAROOTDIR = $${PREFIX}/$${MIDISNOOP_DATA_SUFFIX} } isEmpty(EXECPREFIX) { EXECPREFIX = $${PREFIX} } isEmpty(BINDIR) { MIDISNOOP_APP_INSTALL_PATH = $${EXECPREFIX}/$${MIDISNOOP_APP_SUFFIX} } else { MIDISNOOP_APP_INSTALL_PATH = $${BINDIR} } isEmpty(DATADIR) { MIDISNOOP_DATA_INSTALL_PATH = $${DATAROOTDIR} } else { MIDISNOOP_DATA_INSTALL_PATH = $${DATADIR} } CONFIG += console warn_on DEFINES += MIDISNOOP_MAJOR_VERSION=$${MAJOR_VERSION} \ MIDISNOOP_MINOR_VERSION=$${MINOR_VERSION} \ MIDISNOOP_REVISION=$${REVISION} DESTDIR = $${BUILDDIR}/$${MIDISNOOP_APP_SUFFIX} HEADERS += aboutview.h \ application.h \ closeeventfilter.h \ configureview.h \ controller.h \ designerview.h \ dialogview.h \ engine.h \ error.h \ errorview.h \ mainview.h \ messagetabledelegate.h \ messageview.h \ util.h \ view.h LIBS += -lrtmidi MOC_DIR = $${MAKEDIR} OBJECTS_DIR = $${MAKEDIR} QT += core gui uitools widgets RCC_DIR = $${MAKEDIR} RESOURCES += resources.qrc SOURCES += aboutview.cpp \ application.cpp \ closeeventfilter.cpp \ configureview.cpp \ controller.cpp \ designerview.cpp \ dialogview.cpp \ engine.cpp \ error.cpp \ errorview.cpp \ main.cpp \ mainview.cpp \ messagetabledelegate.cpp \ messageview.cpp \ util.cpp \ view.cpp TARGET = midisnoop TEMPLATE = app VERSION = $${MIDISNOOP_VERSION} ################################################################################ # Install ################################################################################ # icon.files = src/lib/images/32x32/midisnoop.png unix:!macx { #icon.path = $${MIDISNOOP_DATA_INSTALL_PATH}/icons/ desktop.CONFIG += no_check_exist desktop.extra = ../install/build-desktop-file \ '$${MIDISNOOP_APP_INSTALL_PATH}' '$${MIDISNOOP_DATA_INSTALL_PATH}' desktop.files = ../resources/midisnoop.desktop desktop.path = $${MIDISNOOP_DATA_INSTALL_PATH}/applications INSTALLS += desktop } else { # icon.path = $${MIDISNOOP_DATA_INSTALL_PATH} } # INSTALLS += icon target.path = $${MIDISNOOP_APP_INSTALL_PATH} INSTALLS += target midisnoop-master/src/dialogview.h0000644000175000017500000000210612427516312016440 0ustar lumaglumag/* * midisnoop - MIDI monitor and prober * Copyright (C) 2012 Devin Anderson * * 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 2 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, write to the Free Software Foundation, Inc., 675 Mass * Ave, Cambridge, MA 02139, USA. */ #ifndef __DIALOGVIEW_H__ #define __DIALOGVIEW_H__ #include #include "designerview.h" class DialogView: public DesignerView { Q_OBJECT protected: explicit DialogView(const QString &path, QObject *parent=0); virtual ~DialogView(); QDialog *dialog; }; #endif midisnoop-master/src/errorview.ui0000644000175000017500000000532212427516312016523 0ustar lumaglumag Dialog Qt::ApplicationModal 0 0 375 150 Error :/midisnoop/images/16x16/error.png:/midisnoop/images/16x16/error.png true 0 0 32 32 :/midisnoop/images/32x32/error.png Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop true Qt::Horizontal 0 0 Close :/midisnoop/images/16x16/close.png:/midisnoop/images/16x16/close.png midisnoop-master/src/application.h0000644000175000017500000000214712427516312016616 0ustar lumaglumag/* * midisnoop - MIDI monitor and prober * Copyright (C) 2012 Devin Anderson * * 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 2 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, write to the Free Software Foundation, Inc., 675 Mass * Ave, Cambridge, MA 02139, USA. */ #ifndef __APPLICATION_H__ #define __APPLICATION_H__ #include class Application: public QApplication { Q_OBJECT public: Application(int &argc, char **argv); ~Application(); bool notify(QObject *receiver, QEvent *event); signals: void eventError(const QString &message); }; #endif midisnoop-master/src/designerview.h0000644000175000017500000000201412427516312016777 0ustar lumaglumag/* * midisnoop - MIDI monitor and prober * Copyright (C) 2012 Devin Anderson * * 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 2 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, write to the Free Software Foundation, Inc., 675 Mass * Ave, Cambridge, MA 02139, USA. */ #ifndef __DESIGNERVIEW_H__ #define __DESIGNERVIEW_H__ #include "view.h" class DesignerView: public View { Q_OBJECT protected: explicit DesignerView(const QString &path, QObject *parent=0); virtual ~DesignerView(); }; #endif midisnoop-master/src/closeeventfilter.h0000644000175000017500000000236512427516312017672 0ustar lumaglumag/* * midisnoop - MIDI monitor and prober * Copyright (C) 2012 Devin Anderson * * 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 2 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, write to the Free Software Foundation, Inc., 675 Mass * Ave, Cambridge, MA 02139, USA. */ #ifndef __CLOSEEVENTFILTER_H__ #define __CLOSEEVENTFILTER_H__ #include #include class CloseEventFilter: public QObject { Q_OBJECT public: explicit CloseEventFilter(QObject *parent=0); ~CloseEventFilter(); bool eventFilter(QObject *obj, QEvent *event); bool isCloseEnabled() const; void setCloseEnabled(bool enabled); signals: void closeRequest(); private: bool closeEnabled; }; #endif midisnoop-master/src/controller.cpp0000644000175000017500000004110612427516312017027 0ustar lumaglumag/* * midisnoop - MIDI monitor and prober * Copyright (C) 2012 Devin Anderson * * 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 2 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, write to the Free Software Foundation, Inc., 675 Mass * Ave, Cambridge, MA 02139, USA. */ #include #include #include "controller.h" #include "error.h" #include "util.h" // Static data const int statusLengths[0x80] = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 2, 3, 2, -1, -1, 1, -1, 1, 1, 1, 1, 1, -1, 1, 1 }; // Class definition Controller::Controller(Application &application, QObject *parent): QObject(parent), application(application) { // Setup about view aboutView.setMajorVersion(MIDISNOOP_MAJOR_VERSION); aboutView.setMinorVersion(MIDISNOOP_MINOR_VERSION); aboutView.setRevision(MIDISNOOP_REVISION); connect(&aboutView, SIGNAL(closeRequest()), &aboutView, SLOT(hide())); // Setup configure view int driverCount = engine.getDriverCount(); if (! driverCount) { throw Error(tr("no MIDI drivers found")); } for (int i = 0; i < driverCount; i++) { configureView.addDriver(i, engine.getDriverName(i)); } int driver = engine.getDriver(); int outputPort = engine.getOutputPort(); configureView.setDriver(driver); configureView.setInputPort(engine.getInputPort()); configureView.setIgnoreActiveSensingEvents (engine.getIgnoreActiveSensingEvents()); configureView.setIgnoreSystemExclusiveEvents (engine.getIgnoreSystemExclusiveEvents()); configureView.setIgnoreTimeEvents(engine.getIgnoreTimeEvents()); configureView.setOutputPort(outputPort); connect(&configureView, SIGNAL(closeRequest()), &configureView, SLOT(hide())); connect(&configureView, SIGNAL(driverChangeRequest(int)), &engine, SLOT(setDriver(int))); connect(&configureView, SIGNAL(ignoreActiveSensingEventsChangeRequest(bool)), &engine, SLOT(setIgnoreActiveSensingEvents(bool))); connect(&configureView, SIGNAL(ignoreSystemExclusiveEventsChangeRequest(bool)), &engine, SLOT(setIgnoreSystemExclusiveEvents(bool))); connect(&configureView, SIGNAL(ignoreTimeEventsChangeRequest(bool)), &engine, SLOT(setIgnoreTimeEvents(bool))); connect(&configureView, SIGNAL(inputPortChangeRequest(int)), &engine, SLOT(setInputPort(int))); connect(&configureView, SIGNAL(outputPortChangeRequest(int)), &engine, SLOT(setOutputPort(int))); // Setup error view connect(&errorView, SIGNAL(closeRequest()), &errorView, SLOT(hide())); // Setup main view mainView.setMessageSendEnabled((driver != -1) && (outputPort != -1)); connect(&mainView, SIGNAL(aboutRequest()), &aboutView, SLOT(show())); connect(&mainView, SIGNAL(addMessageRequest()), &messageView, SLOT(show())); connect(&mainView, SIGNAL(clearMessagesRequest()), &mainView, SLOT(clearMessages())); connect(&mainView, SIGNAL(configureRequest()), &configureView, SLOT(show())); connect(&mainView, SIGNAL(closeRequest()), &application, SLOT(quit())); // Setup message view connect(&messageView, SIGNAL(closeRequest()), &messageView, SLOT(hide())); connect(&messageView, SIGNAL(sendRequest(const QString &)), &messageView, SLOT(hide())); connect(&messageView, SIGNAL(sendRequest(const QString &)), SLOT(handleMessageSend(const QString &))); // Setup engine connect(&engine, SIGNAL(messageReceived(quint64, const QByteArray &)), SLOT(handleReceivedMessage(quint64, const QByteArray &))); connect(&engine, SIGNAL(driverChanged(int)), &configureView, SLOT(setDriver(int))); connect(&engine, SIGNAL(driverChanged(int)), SLOT(handleDriverChange())); connect(&engine, SIGNAL(ignoreActiveSensingEventsChanged(bool)), &configureView, SLOT(setIgnoreActiveSensingEvents(bool))); connect(&engine, SIGNAL(ignoreSystemExclusiveEventsChanged(bool)), &configureView, SLOT(setIgnoreSystemExclusiveEvents(bool))); connect(&engine, SIGNAL(ignoreTimeEventsChanged(bool)), &configureView, SLOT(setIgnoreTimeEvents(bool))); connect(&engine, SIGNAL(inputPortAdded(int, QString)), &configureView, SLOT(addInputPort(int, QString))); connect(&engine, SIGNAL(inputPortChanged(int)), &configureView, SLOT(setInputPort(int))); connect(&engine, SIGNAL(inputPortChanged(int)), SLOT(handleDriverChange())); connect(&engine, SIGNAL(inputPortRemoved(int)), &configureView, SLOT(removeInputPort(int))); connect(&engine, SIGNAL(outputPortAdded(int, QString)), &configureView, SLOT(addOutputPort(int, QString))); connect(&engine, SIGNAL(outputPortChanged(int)), &configureView, SLOT(setOutputPort(int))); connect(&engine, SIGNAL(outputPortChanged(int)), SLOT(handleDriverChange())); connect(&engine, SIGNAL(outputPortRemoved(int)), &configureView, SLOT(removeOutputPort(int))); // Setup application connect(&application, SIGNAL(eventError(QString)), &errorView, SLOT(setMessage(QString))); connect(&application, SIGNAL(eventError(QString)), &errorView, SLOT(show())); } Controller::~Controller() { // Disconnect engine signals handled by the controller before the engine is // deleted. disconnect(&engine, SIGNAL(messageReceived(quint64, const QByteArray &)), this, SLOT(handleReceivedMessage(quint64, const QByteArray &))); disconnect(&engine, SIGNAL(driverChanged(int)), this, SLOT(handleDriverChange())); disconnect(&engine, SIGNAL(inputPortChanged(int)), this, SLOT(handleDriverChange())); disconnect(&engine, SIGNAL(outputPortChanged(int)), this, SLOT(handleDriverChange())); } QString Controller::getGenericDataDescription(const QByteArray &message, int lastIndex) { assert((lastIndex >= -1) && (lastIndex < message.count())); if (lastIndex == -1) { lastIndex = message.count() - 1; } QStringList dataParts; for (int i = 1; i <= lastIndex; i++) { dataParts += QString("%1"). arg(static_cast(message[i]), 2, 16, QChar('0')); } dataParts += tr("(%1 bytes)").arg(lastIndex); return dataParts.join(" "); } void Controller::handleDriverChange() { mainView.setMessageSendEnabled((engine.getDriver() != -1) && (engine.getOutputPort() != -1)); } void Controller::handleMessageSend(const QString &message) { // Convert the message to bytes. QStringList bytes = message.split(' ', QString::SkipEmptyParts); int count = bytes.count(); QByteArray msg; for (int i = 0; i < count; i++) { QString byteStr = bytes[i]; bool success; uint value = byteStr.toUInt(&success, 16); if ((! success) || (value > 0xff)) { showError(tr("'%1' is not a valid hexadecimal MIDI byte"). arg(byteStr)); return; } msg.append(static_cast(static_cast(value))); } // Make sure the bytes represent a valid MIDI message. parseMessage(msg); if (! valid) { showError(tr("The given message is not a valid MIDI message.")); return; } // Send the message. quint64 timeStamp = engine.sendMessage(msg); mainView.addSentMessage(timeStamp, statusDescription, dataDescription, valid); } void Controller::handleReceivedMessage(quint64 timeStamp, const QByteArray &message) { parseMessage(message); mainView.addReceivedMessage(timeStamp, statusDescription, dataDescription, valid); } void Controller::parseMessage(const QByteArray &message) { // Make sure we have an actual message. int length = message.count(); if (! length) { dataDescription = ""; statusDescription = tr("empty message"); valid = false; return; } // Validate status byte. quint8 status = static_cast(message[0]); if (status < 0x80) { dataDescription = getGenericDataDescription(message); statusDescription = tr("%1 (invalid status)"). arg(static_cast(status), 2, 16, QChar('0')); valid = false; return; } // Validate length and data. QString errorMessage; int expectedLength = statusLengths[status - 0x80]; int lastDataIndex; switch (expectedLength) { case -1: dataDescription = getGenericDataDescription(message); statusDescription = tr("%1 (undefined status)"). arg(static_cast(status), 2, 16, QChar('0')); valid = false; return; case 0: if (length == 1) { dataDescription = ""; statusDescription = tr("System Exclusive (no data)"); valid = false; return; } if (static_cast(message[length - 1]) != 0xf7) { dataDescription = getGenericDataDescription(message); statusDescription = tr("System Exclusive (end not found)"); valid = false; return; } lastDataIndex = length - 2; break; default: if (length != expectedLength) { dataDescription = getGenericDataDescription(message); statusDescription = tr("%1 (incorrect length)"). arg(static_cast(status), 2, 16, QChar('0')); valid = false; return; } lastDataIndex = length - 1; } // Validate data bytes. for (int i = 1; i <= lastDataIndex; i++) { if (static_cast(message[i]) >= 0x80) { dataDescription = getGenericDataDescription(message); statusDescription = tr("%1 (invalid data)"). arg(static_cast(status), 2, 16, QChar('0')); valid = false; return; } } // Convert message to user-friendly strings. QString s; int value; valid = true; switch (status & 0xf0) { case 0x80: dataDescription = tr("Note: %1, Velocity: %2"). arg(getMIDINoteString(static_cast(message[1]))). arg(static_cast(message[2])); statusDescription = tr("Note Off, Channel %1").arg((status & 0xf) + 1); break; case 0x90: dataDescription = tr("Note: %1, Velocity: %2"). arg(getMIDINoteString(static_cast(message[1]))). arg(static_cast(message[2])); statusDescription = tr("Note On, Channel %1").arg((status & 0xf) + 1); break; case 0xa0: dataDescription = tr("Note: %1, Pressure: %2"). arg(getMIDINoteString(static_cast(message[1]))). arg(static_cast(message[2])); statusDescription = tr("Aftertouch, Channel %1"). arg((status & 0xf) + 1); break; case 0xb0: dataDescription = tr("Controller: %1, Value: %2"). arg(getMIDIControlString(static_cast(message[1]))). arg(static_cast(message[2])); statusDescription = tr("Controller, Channel %1"). arg((status & 0xf) + 1); break; case 0xc0: dataDescription = tr("Number: %1").arg(static_cast(message[1])); statusDescription = tr("Program Change, Channel %1"). arg((status & 0xf) + 1); break; case 0xd0: dataDescription = tr("Pressure: %1"). arg(static_cast(message[1])); statusDescription = tr("Channel Pressure, Channel %1"). arg((status & 0xf) + 1); break; case 0xe0: dataDescription = tr("Value: %1"). arg((((static_cast(message[2])) << 7) | (static_cast(message[1]))) - 0x2000); statusDescription = tr("Pitch Wheel, Channel %1"). arg((status & 0xf) + 1); break; case 0xf0: switch (status & 0xf) { case 0x0: dataDescription = getGenericDataDescription(message, lastDataIndex); statusDescription = tr("System Exclusive"); break; case 0x1: value = message[0] & 0xf; switch (message[0] & 0x70) { case 0x00: dataDescription = tr("Frames Low Nibble: %1").arg(value); break; case 0x10: dataDescription = tr("Frames High Nibble: %1").arg(value); break; case 0x20: dataDescription = tr("Seconds Low Nibble: %1").arg(value); break; case 0x30: dataDescription = tr("Seconds High Nibble: %1").arg(value); break; case 0x40: dataDescription = tr("Minutes Low Nibble: %1").arg(value); break; case 0x50: dataDescription = tr("Minutes High Nibble: %1").arg(value); break; case 0x60: dataDescription = tr("Hours Low Nibble: %1").arg(value); break; case 0x70: switch ((value & 0x6) >> 1) { case 0: s = tr("24 fps"); break; case 1: s = tr("25 fps"); break; case 2: s = tr("30 fps (drop-frame)"); break; case 3: s = tr("30 fps"); break; default: // We shouldn't get here. assert(false); } dataDescription = tr("Hours High Nibble: %1, SMPTE Type: %2"). arg(value & 1).arg(s); break; default: // We shouldn't get here. assert(false); } statusDescription = tr("MTC Quarter Frame"); break; case 0x2: dataDescription = tr("MIDI Beat: %1"). arg(((static_cast(message[2])) << 7) | (static_cast(message[1]))); statusDescription = tr("Song Position Pointer"); break; case 0x3: dataDescription = tr("Song Number: %1"). arg(static_cast(message[1])); statusDescription = tr("Song Select"); break; case 0x6: dataDescription = ""; statusDescription = tr("Tune Request"); break; case 0x8: dataDescription = ""; statusDescription = tr("MIDI Clock"); break; case 0x9: dataDescription = ""; statusDescription = tr("MIDI Tick"); break; case 0xa: dataDescription = ""; statusDescription = tr("MIDI Start"); break; case 0xb: dataDescription = ""; statusDescription = tr("MIDI Continue"); break; case 0xc: dataDescription = ""; statusDescription = tr("MIDI Stop"); break; case 0xe: dataDescription = ""; statusDescription = tr("Active Sense"); break; case 0xf: dataDescription = ""; statusDescription = tr("Reset"); break; default: // We shouldn't get here. assert(false); } break; default: // We shouldn't get here. assert(false); } } void Controller::run() { mainView.show(); application.exec(); } void Controller::showError(const QString &message) { errorView.setMessage(message); errorView.show(); } midisnoop-master/src/mainview.cpp0000644000175000017500000001143312427516312016463 0ustar lumaglumag/* * midisnoop - MIDI monitor and prober * Copyright (C) 2012 Devin Anderson * * 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 2 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, write to the Free Software Foundation, Inc., 675 Mass * Ave, Cambridge, MA 02139, USA. */ #include #include #include "mainview.h" #include "util.h" MainView::MainView(QObject *parent): DesignerView(":/midisnoop/mainview.ui", parent) { QWidget *widget = getRootWidget(); aboutAction = getChild(widget, "aboutAction"); connect(aboutAction, SIGNAL(triggered()), SIGNAL(aboutRequest())); addAction = getChild(widget, "addAction"); connect(addAction, SIGNAL(triggered()), SIGNAL(addMessageRequest())); clearAction = getChild(widget, "clearAction"); connect(clearAction, SIGNAL(triggered()), SIGNAL(clearMessagesRequest())); configureAction = getChild(widget, "configureAction"); connect(configureAction, SIGNAL(triggered()), SIGNAL(configureRequest())); quitAction = getChild(widget, "quitAction"); connect(quitAction, SIGNAL(triggered()), SIGNAL(closeRequest())); tableModel.setColumnCount(MESSAGETABLECOLUMN_TOTAL); tableModel.setRowCount(0); tableModel.setHeaderData(MESSAGETABLECOLUMN_DATA, Qt::Horizontal, tr("Data"), Qt::DisplayRole); tableModel.setHeaderData(MESSAGETABLECOLUMN_STATUS, Qt::Horizontal, tr("Status"), Qt::DisplayRole); tableModel.setHeaderData(MESSAGETABLECOLUMN_TIMESTAMP, Qt::Horizontal, tr("Timestamp"), Qt::DisplayRole); tableView = getChild(widget, "centralWidget"); tableView->setItemDelegate(&tableDelegate); tableView->setModel(&tableModel); } MainView::~MainView() { // Empty } int MainView::addMessage(quint64 timeStamp, const QString &statusDescription, const QString &dataDescription, bool valid) { int count = tableModel.rowCount(); bool inserted = tableModel.insertRow(count); assert(inserted); Qt::AlignmentFlag alignment = Qt::AlignTop; setModelData(count, MESSAGETABLECOLUMN_DATA, dataDescription); setModelData(count, MESSAGETABLECOLUMN_DATA, alignment, Qt::TextAlignmentRole); setModelData(count, MESSAGETABLECOLUMN_STATUS, statusDescription); setModelData(count, MESSAGETABLECOLUMN_STATUS, alignment, Qt::TextAlignmentRole); setModelData(count, MESSAGETABLECOLUMN_TIMESTAMP, timeStamp); setModelData(count, MESSAGETABLECOLUMN_TIMESTAMP, alignment, Qt::TextAlignmentRole); if (! valid) { setModelData(count, MESSAGETABLECOLUMN_STATUS, QIcon(":/midisnoop/images/16x16/error.png"), Qt::DecorationRole); } tableView->resizeRowToContents(count); tableView->scrollToBottom(); return count; } void MainView::addReceivedMessage(quint64 timeStamp, const QString &statusDescription, const QString &dataDescription, bool valid) { addMessage(timeStamp, statusDescription, dataDescription, valid); } void MainView::addSentMessage(quint64 timeStamp, const QString &statusDescription, const QString &dataDescription, bool valid) { int index = addMessage(timeStamp, statusDescription, dataDescription, valid); const QBrush &brush = qApp->palette().alternateBase(); setModelData(index, MESSAGETABLECOLUMN_DATA, brush, Qt::BackgroundRole); setModelData(index, MESSAGETABLECOLUMN_STATUS, brush, Qt::BackgroundRole); setModelData(index, MESSAGETABLECOLUMN_TIMESTAMP, brush, Qt::BackgroundRole); } void MainView::clearMessages() { int count = tableModel.rowCount(); if (count) { bool removed = tableModel.removeRows(0, tableModel.rowCount()); assert(removed); } } void MainView::setMessageSendEnabled(bool enabled) { addAction->setEnabled(enabled); } void MainView::setModelData(int row, int column, const QVariant &value, int role) { bool result = tableModel.setData(tableModel.index(row, column), value, role); assert(result); } midisnoop-master/src/messageview.cpp0000644000175000017500000000266012427516312017165 0ustar lumaglumag/* * midisnoop - MIDI monitor and prober * Copyright (C) 2012 Devin Anderson * * 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 2 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, write to the Free Software Foundation, Inc., 675 Mass * Ave, Cambridge, MA 02139, USA. */ #include "messageview.h" #include "util.h" MessageView::MessageView(QObject *parent): DesignerView(":/midisnoop/messageview.ui", parent) { QWidget *rootWidget = getRootWidget(); closeButton = getChild(rootWidget, "closeButton"); connect(closeButton, SIGNAL(clicked()), SIGNAL(closeRequest())); message = getChild(rootWidget, "message"); sendButton = getChild(rootWidget, "sendButton"); connect(sendButton, SIGNAL(clicked()), SLOT(handleSendButtonClick())); } MessageView::~MessageView() { // Empty } void MessageView::handleSendButtonClick() { emit sendRequest(message->toPlainText()); } midisnoop-master/src/configureview.h0000644000175000017500000000457512427516312017176 0ustar lumaglumag/* * midisnoop - MIDI monitor and prober * Copyright (C) 2012 Devin Anderson * * 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 2 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, write to the Free Software Foundation, Inc., 675 Mass * Ave, Cambridge, MA 02139, USA. */ #ifndef __CONFIGUREVIEW_H__ #define __CONFIGUREVIEW_H__ #include #include #include #include "designerview.h" class ConfigureView: public DesignerView { Q_OBJECT public: explicit ConfigureView(QObject *parent=0); ~ConfigureView(); public slots: void addDriver(int index, const QString &name); void addInputPort(int index, const QString &name); void addOutputPort(int index, const QString &name); void removeInputPort(int index); void removeOutputPort(int index); void setDriver(int index); void setIgnoreActiveSensingEvents(bool ignore); void setIgnoreSystemExclusiveEvents(bool ignore); void setIgnoreTimeEvents(bool ignore); void setInputPort(int index); void setOutputPort(int index); signals: void driverChangeRequest(int index); void ignoreActiveSensingEventsChangeRequest(bool ignore); void ignoreSystemExclusiveEventsChangeRequest(bool ignore); void ignoreTimeEventsChangeRequest(bool ignore); void inputPortChangeRequest(int index); void outputPortChangeRequest(int index); private slots: void handleDriverActivation(int index); void handleInputPortActivation(int index); void handleOutputPortActivation(int index); private: QPushButton *closeButton; QComboBox *driver; QCheckBox *ignoreActiveSensingEvents; QCheckBox *ignoreSystemExclusiveEvents; QCheckBox *ignoreTimeEvents; QComboBox *inputPort; QComboBox *outputPort; }; #endif midisnoop-master/src/messagetabledelegate.cpp0000644000175000017500000000547512427516312021004 0ustar lumaglumag/* * midisnoop - MIDI monitor and prober * Copyright (C) 2012 Devin Anderson * * 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 2 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, write to the Free Software Foundation, Inc., 675 Mass * Ave, Cambridge, MA 02139, USA. */ #include #include #include #include "messagetabledelegate.h" MessageTableDelegate::MessageTableDelegate(QObject *parent): QStyledItemDelegate(parent) { // Empty } MessageTableDelegate::~MessageTableDelegate() { // Empty } QWidget * MessageTableDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &/*option*/, const QModelIndex &/*index*/) const { QTextEdit *editor = new QTextEdit(parent); editor->setFrameShadow(QTextEdit::Plain); editor->setFrameShape(QTextEdit::NoFrame); editor->setLineWidth(0); editor->setMidLineWidth(0); editor->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); editor->setReadOnly(true); editor->setTextInteractionFlags(Qt::TextSelectableByKeyboard | Qt::TextSelectableByMouse); return editor; } void MessageTableDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const { QTextEdit *textEditor = qobject_cast(editor); textEditor->setPlainText(index.data(Qt::EditRole).toString()); QTextDocument *document = textEditor->document(); document->setDocumentMargin(0); QTextFrame *rootFrame = document->rootFrame(); QTextFrameFormat frameFormat = rootFrame->frameFormat(); frameFormat.setBottomMargin(0); frameFormat.setLeftMargin(3); frameFormat.setRightMargin(3); frameFormat.setTopMargin(0); rootFrame->setFrameFormat(frameFormat); } void MessageTableDelegate::setModelData(QWidget */*editor*/, QAbstractItemModel */*model*/, const QModelIndex &/*index*/) const { // Empty } void MessageTableDelegate::updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &/*index*/) const { editor->setGeometry(option.rect); } midisnoop-master/src/images/0000755000175000017500000000000012427516312015403 5ustar lumaglumagmidisnoop-master/src/images/16x16/0000755000175000017500000000000012427516312016170 5ustar lumaglumagmidisnoop-master/src/images/16x16/quit.png0000644000175000017500000000151212427516312017657 0ustar lumaglumagPNG  IHDRabKGD pHYsvv}ՂtIME  )xoIDATxڍkTW?7o^f2$'u\4?Ԫ *Em.ڕJv]A6]tbn\ؒt!313̼_yxt!҅spUk~hݛ}[ `w{je匪_t/5E ʹTΝcX$􌷶F$:@'E|6aD\I߀"[JT6Cd1:Fg0Zby_wV p~r+s( Ey_Q[¼ m a)s [782ٯ.&m2dȴ P7VjrNr*ji?1^.i;ju-_7ATV=buwp"@Al [YB$CZV;[_MxPZ#*jR!:yIENDB`midisnoop-master/src/images/16x16/error.png0000644000175000017500000000132212427516312020025 0ustar lumaglumagPNG  IHDRasBIT|d pHYs:tEXtSoftwarewww.inkscape.org<OIDATxڥSMKQ=dij]4RMZv۬\E_{AZDUwv! `T\Hh4DfUy 39$ nBaIZa6d*) 0Q qjN;;A&_z<8hS?xy7[0/ A6ig ;?CʲG8UF|%k a ?hAL9\q1GF`utwr9BPbH4z MO~A1:57 "RU8YYIڄjeM@p#c:h .0:2NN i "(t]==//2R1r@Uԙ8RPj@G}iO85ӗ,:a@AJ7(/ӨJa-*FC /LK:W,HKl3 x¯4cTx ~%FcˎZe # F:5 I'-dS~杫'/4!]Xc- '}IENDB`midisnoop-master/src/images/16x16/clear.png0000644000175000017500000000144212427516312017765 0ustar lumaglumagPNG  IHDRabKGD pHYsu85tIME5$AFIDAT8˕YHTaΜљtt\,Kh, $#"  ""(. ҋS.$,K1YYUQ}/0y|GMnXLfTz*t[ti =^&0B|ӿui~jni:-A,/H<\ƝGtʂGvVeS`#QzvrXǓ]:X5 hաH[50`ʻ-S3M쫪*DH@覯|SwRi*tfϘ[g&fǵ5M작[cx @PC_ !]l>G"A-tU FvCQ(I G7yrQ0 ;&Ƣ$\2g 074D n@ ٬6Olݑ锯$:j*q5vengn9=#~Mp\*TŲUlc)dm(2$>h1B>ԍC edydNkuRYM +_?Q2|NamʶAnXp8 T ܝL&X0t)<@*c(B!pUU~7%k9h[Ys/ۢ_y3ss's-D>`? W70ذ>tW)mVuFIXOA`Lhtpp[{k1s߇\.d=^k8MY_gr7@4x3$Wȑw‹8R`^N[REDly#O8ChWXSM᠖bL mu߂t:-"IΨ1HĚAD[|5tjdP*멁=SSq.`Xs(=&6Wwq`,.hxٗ_m_ BNIENDB`midisnoop-master/src/images/16x16/information.png0000644000175000017500000000144312427516312021225 0ustar lumaglumagPNG  IHDRasBIT|d pHYs:tEXtSoftwarewww.inkscape.org<IDATxuKQǿwM~,aDf? B걇 $YaX+iP KP@KaEhK=ͺ]VT{9|g3CcᡈZ($BZjw<,.ְ@tq>f<.R\(UH\d IÂv KD\s*J"˳ CaX}B0RB0ɔ 8!{p> p, d dm&e5rf|bf(( h J$ Ƣ&XOG3q6lBp-{T U"價@Z8.t"s@|BoBQsyDTڹC"MC.`G-,%/t8`4v Cg J`$gu>?98k! 7ZTVؔeZXMƍH5¢ʾ F ,^*B IENDB`midisnoop-master/src/images/16x16/close.png0000644000175000017500000000132212427516312020001 0ustar lumaglumagPNG  IHDRasBIT|d pHYs:tEXtSoftwarewww.inkscape.org<OIDATxڥOQ;3Z[ Ba$qe;Wd {H|BM?BW.]hta A@]P N23&N [Orr;w)%SjNUxfrɦ\.KuX;Blwvål6yw4dY!=bw.X$!=7n̍*^W}it^5c9h๎X[)\B(HW-*tՆ )߿N::H`{_Mj O۹!Z=y@KIz$&z%&hiiC&8F&u 1uw s諫*m&J`VYG/be"aIecuf-2 6\]_C̾~|f~ҏ'C&J ax$5i"T`Jb6AڃO z ~YJMRDHޘK"S!*S5Y;p&FWJrWIRIb8aP<&WʵS nA$'J-K fT*Dp/*FU@IENDB`midisnoop-master/src/images/16x16/add.png0000644000175000017500000000106412427516312017427 0ustar lumaglumagPNG  IHDRasBIT|d pHYs:tEXtSoftwarewww.inkscape.org<IDATxڥMkQ5IILiݸH]DD?p"čӕ`A@\BRn.TDqL36t;BEpDBy8#L_M `xT75adHڣmS)l*b^iȎ(؁fL]-1=&' x׷nɔd^$,)sU;rq錡-W  [C('1*]B:]FbxB1+(AP!@Xep<ʕexzH= H>&x _{;5CmM b[]8v ˖9:s)2ghZd/vitC;b/f}L@Em܈#x0:/]za!Ny0ֱu.y(+&)s~AL?v ._.#:zt8s  v^$zy3qp>q,/lWƣQ$y~=,qU~E Kԝ=L@!qO:qItBm$}ٕ+wvH@ر )DUaE&xz.t> OIm9(6 򭝰D_LSN *VSCTl6_P/ kE24j=|=ȅ@2G^at^v@Nt T%FSƇKʒȇyv -gjc743.\ nD )l&Qi& ?$<)d~qAG<7ߞ>8lF%"QGsω*^3U `^VyhyIENDB`midisnoop-master/src/images/32x32/information.png0000644000175000017500000000314412427516312021221 0ustar lumaglumagPNG  IHDR szzsBIT|d pHYsvv}ՂtEXtSoftwarewww.inkscape.org<IDATxW[lTEvv-ъHIH4<` b (1(>-.4b#.*;vwmz&)v /~ɷ3;;s䜳L#jLQB(qd00(A!Vc ƈ1KL c[JfOPɕV2 kCvTM O47&v.׼@2cKyh*M/jU0t44h`"@EO2WG8k2!#6+}pھLƁ }iXZ#@my-/ ]Bֆ;`XCJ3j:y|8GYؔ0$\!Pݳo:xtmp"x s͖!(C0zS>߈c8C)p5P B7uC""f{ԙ>ص{8Lݐ)"~ Z`0JȀ } OU8\Rͽ81w1­`9G>0xHD]~'QD-amt]Mƀ  {5f1F@XH,0"HHj-.P鬍q7 .* qxwO=3L,f:Ea41 A3;a۶4N|pZEآE:Ύ= : Rj(6opx+' c eE=eq"TܯzrFٗR6}JD*6"ޠ9iX%QWB' e EޙsdoC>}؀)&j' Ar MsUm5:T]xh>XsѪjDR|(R ׀eS E׆cF.:[F0p@ ri d^q1cDZ2ʃ0pbbpAsׅl5urw&g6ѵɅBYw 檇YpQ7? 6eO6IENDB`midisnoop-master/README.PACKAGING0000644000175000017500000000272012427516312015513 0ustar lumaglumagPackaging `midisnoop` ===================== Contents: 1. Install Parts 2. Install Options For Packagers 1. Install Parts ---------------- A `midisnoop` install is made up of two files: 1. `midisnoop` - The application. 2. `midisnoop.desktop` - The desktop file. 2. Install Options For Packagers -------------------------------- `midisnoop` is built using the typical UNIX build process (`configure`, `make`, `make install`). There are several options that you can pass to the configure script in order to select what will or will not be built, and where each item will be installed: $ ./configure --help Usage: configure [options] [qmake-args] Options: -h, --help show this help message and exit --bin-dir=BINDIR Install directory for midisnoop executable --build-dir=BUILDDIR Build directory --data-dir=DATADIR Install directory for general data files --data-root-dir=DATAROOTDIR Install root for data files --debug Build a debug executable --exec-prefix=EXECPREFIX Install prefix for executable data --make-dir=MAKEDIR Make directory --prefix=PREFIX Install prefix After building `midisnoop`, you may want to set the install path for to a different location than the 'prefix' for packaging purposes. To do this, execute: make install INSTALL_ROOT=/path/to/some/location You *must* make sure that the path is not a relative path. midisnoop-master/COPYING0000644000175000017500000000040712427516312014403 0ustar lumaglumagAll files in this tree are licensed under the GPL, save for the files under 'src/images' which are licensed under the LGPL in accordance with the licensing of the Oxygen Icon Theme. Please see COPYING.GPL and COPYING.LGPL for more information on these licenses. midisnoop-master/COPYING.LGPL0000644000175000017500000006350312427516312015146 0ustar lumaglumag GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! midisnoop-master/AUTHORS0000644000175000017500000000006612427516312014421 0ustar lumaglumagDevin Anderson midisnoop-master/INSTALL0000644000175000017500000000140212427516312014375 0ustar lumaglumagBuilding and Installing `midisnoop` ==================================== Contents: 1. Build Requirements 2. Building and Installing from Source 1. Build Requirements --------------------- In order to compile `midisnoop`, you must have the following libraries (and their corresponding development packages) installed: * qt4 * RtMidi In addition, you'll need the following tools: * python * qmake 2. Building and Installing from Source -------------------------------------- To build `midisnoop`, change your current directory to the top-level directory of the project and execute the following commands: ./configure --prefix=/usr make Optionally, you can use your own directory prefix. To install `midisnoop`, execute the command: make install midisnoop-master/.gitignore0000644000175000017500000000013112427516312015332 0ustar lumaglumagMakefile build/ build-stamp debian/ make/ resources/ *.pro.user *.pyc !templates/debian/ midisnoop-master/configure0000755000175000017500000000772612427516312015272 0ustar lumaglumag#!/usr/bin/env python from optparse import OptionParser from os.path import abspath, dirname, join from subprocess import call from sys import argv, stderr, stdout from install.util import ( MAJOR_VERSION, MINOR_VERSION, PLATFORM_MACX, PLATFORM_UNIX, PLATFORM_WIN32, REVISION, findExecutable, getPlatform ) def main(): parser = OptionParser("usage: %prog [options] [qmake-args]") parser.add_option("--bin-dir", action="store", default=None, dest="binDir", help="Install directory for midisnoop executable") parser.add_option("--build-dir", action="store", default=None, dest="buildDir", help="Build directory") parser.add_option("--data-dir", action="store", default=None, dest="dataDir", help="Install directory for general data files") parser.add_option("--data-root-dir", action="store", default=None, dest="dataRootDir", help="Install root for data files") parser.add_option("--debug", action="store_true", default=False, dest="debug", help="Build a debug executable") parser.add_option("--exec-prefix", action="store", default=None, dest="execPrefix", help="Install prefix for executable data") parser.add_option("--make-dir", action="store", default=None, dest="makeDir", help="Make directory") parser.add_option("--prefix", action="store", default=None, dest="prefix", help="Install prefix") options, args = parser.parse_args() pkgConfigPath = findExecutable("pkg-config") if pkgConfigPath is None: stderr.write("Warning: pkg-config not found\n") elif call([pkgConfigPath, "--exists", "rtmidi"]) or \ call([pkgConfigPath, "--atleast-version=2.0.1", "rtmidi"]): exit("Error: rtmidi version >= 2.0.1 is required for compilation") qmakePath = findExecutable("qmake") if qmakePath is None: exit("Error: qmake is required for build configuration") platform = getPlatform() platformArgs = [] if platform == PLATFORM_MACX: platformArgs += ["-spec", "macx-g++"] platformStr = "MACX" elif platform == PLATFORM_WIN32: platformStr = "WIN32" else: platformStr = "UNIX" scriptDir = abspath(dirname(argv[0])) buildDir = options.buildDir if buildDir is None: buildDir = "build" buildDir = abspath(join(scriptDir, buildDir)) makeDir = options.makeDir if makeDir is None: makeDir = "make" makeDir = abspath(join(scriptDir, makeDir)) prefix = options.prefix if prefix is None: prefix = "/usr/local" else: prefix = abspath(prefix) dataRootDir = options.dataRootDir if dataRootDir is None: dataRootDir = "share" dataRootDir = abspath(join(prefix, dataRootDir)) execPrefix = options.execPrefix if execPrefix is None: execPrefix = prefix else: execPrefix = abspath(execPrefix) binDir = options.binDir if binDir is None: binDir = "bin" binDir = abspath(join(execPrefix, binDir)) dataDir = options.dataDir if dataDir is None: dataDir = dataRootDir else: dataDir = abspath(join(prefix, dataDir)) # Run `qmake` qmakeArgs = [qmakePath, "-recursive"] + platformArgs + args + \ ["MAJOR_VERSION=%d" % MAJOR_VERSION, "MINOR_VERSION=%d" % MINOR_VERSION, "REVISION=%d" % REVISION, "BUILDDIR=%s" % buildDir, "MAKEDIR=%s" % makeDir, "PREFIX=%s" % prefix, "DATAROOTDIR=%s" % dataRootDir, "EXECPREFIX=%s" % execPrefix, "BINDIR=%s" % binDir, "DATADIR=%s" % dataDir] if options.debug: qmakeArgs.append("DEBUG=1") if call(qmakeArgs): parser.error("qmake returned an error") stdout.write("Configure successful. Run `make` to build, and " "`make install` to install.\n") if __name__ == "__main__": main() midisnoop-master/midisnoop.pro0000644000175000017500000000004112427516312016065 0ustar lumaglumagSUBDIRS = src TEMPLATE = subdirs