/mainwindow.h

http://ewitool.googlecode.com/ · C Header · 148 lines · 102 code · 21 blank · 25 comment · 0 complexity · 3817da064efd9976ba8e098cdbaeed7d MD5 · raw file

  1. /***************************************************************************
  2. * Copyright (C) 2008 by Steve Merrony *
  3. * ewitool At merrony dot flyer dot co dot uk *
  4. * *
  5. * This program is free software; you can redistribute it and/or modify *
  6. * it under the terms of the GNU General Public License as published by *
  7. * the Free Software Foundation; either version 3 of the License, or *
  8. * (at your option) any later version. *
  9. * *
  10. * This program is distributed in the hope that it will be useful, *
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of *
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
  13. * GNU General Public License for more details. *
  14. * *
  15. * You should have received a copy of the GNU General Public License *
  16. * along with this program; if not, write to the *
  17. * Free Software Foundation, Inc., *
  18. * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
  19. ***************************************************************************/
  20. #ifndef MAINWINDOW_H
  21. #define MAINWINDOW_H
  22. /**
  23. @author Steve Merrony <ewitool At merrony dot flyer dot co dot uk>
  24. */
  25. #include <QAction>
  26. #include <QContextMenuEvent>
  27. #include <QGridLayout>
  28. #include <QLCDNumber>
  29. #include "ui_mainwindow.h"
  30. #include "clipboard.h"
  31. #include "ewilistwidget.h"
  32. #include "midi_data.h"
  33. #include "patchexchange.h"
  34. #include "patchexchangegui.h"
  35. #include "keyPrograms_form.h"
  36. const QString HELP_URL = "http://code.google.com/p/ewitool/wiki/Using_EWItool";
  37. const QString GPL3_URL = "http://www.gnu.org/licenses/gpl-3.0.txt";
  38. const int STATUS_MSG_TIMEOUT = 3000;
  39. const int LIBRARY_TAB = 0;
  40. const int EPX_TAB = 1;
  41. const int EWI_TAB = 2;
  42. const int PATCH_TAB = 3;
  43. const int KEYPATCH_TAB = 4;
  44. class MainWindow: public QMainWindow, public Ui::MainWindow{
  45. Q_OBJECT
  46. public:
  47. MainWindow( volatile midi_data *, QWidget * parent = 0, Qt::WFlags f = 0 );
  48. ~MainWindow();
  49. private slots:
  50. // menu
  51. void import() ;
  52. void saveAs();
  53. void print();
  54. void settings();
  55. void quit();
  56. void MIDIconnections();
  57. void sendSysexFile();
  58. void fetchAllPatches();
  59. void externalHelp();
  60. void externalLicence();
  61. void about();
  62. // GUI actions
  63. void copyCurrentPatchAs();
  64. void saveCurrentPatch();
  65. void revertPatch();
  66. void patchSelected( int );
  67. void displayPatch();
  68. void displayPatch( int );
  69. void copyEWIPatch( int );
  70. void pasteEWIPatch( int );
  71. void renameEWIPatch( int );
  72. void defaultPatch();
  73. void makeDry();
  74. void deNoise();
  75. void randomPatch();
  76. void randomisePatch();
  77. void mergePatch();
  78. void maxVolPatch();
  79. void mixInPatch( int, int );
  80. void setList_chosen(QListWidgetItem *);
  81. void deletePatchSet();
  82. void librarySelectionChanged( );
  83. void sendLibraryToEWI();
  84. void copyToClipboard();
  85. void exportCurrentPatch();
  86. void changeSlider( int );
  87. void changeDial( int );
  88. void changeOctaveCombo( int );
  89. void changeSemitoneCombo( int );
  90. void changeGenericCombo( int );
  91. void changeCheckBox( int );
  92. void tabChanged( int );
  93. private:
  94. void setupPatchTab();
  95. void setupLibraryTab();
  96. void setupEWItab();
  97. void setupKeyPatchesTab();
  98. //void contextMenuEvent( QContextMenuEvent *);
  99. void savePatchSetAs();
  100. void printEWIpatches();
  101. void printSetPatches();
  102. void printCurrentPatch();
  103. void printPatchList( bool current );
  104. QAction *editAct, *copyAct, *pasteAct, *renameAct;
  105. QMenu *EWIcontextMenu;
  106. void loadSettings();
  107. void saveSettings();
  108. void savePatchSet( QString );
  109. int randBetween( int, int );
  110. int randNear( int, int, int );
  111. int mixInts( int, int, int );
  112. QString libraryLocation;
  113. QString libraryName;
  114. QList<int> epx_ids;
  115. int epx_details_id;
  116. QString epx_hex_patch;
  117. midi_data *mididata;
  118. EWIListWidget *EWIList;
  119. keyPrograms_form *keyPrograms;
  120. patchExchange *epx;
  121. patchExchangeGUI *epxGUI;
  122. Clipboard *clipboard;
  123. patch_t edit_patch;
  124. patch_t backup_patch;
  125. patch_t patchSet[EWI_NUM_PATCHES];
  126. };
  127. #endif