PageRenderTime 21ms CodeModel.GetById 13ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/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/**
 24	@author Steve Merrony <ewitool At merrony dot flyer dot co dot uk>
 25*/
 26
 27#include <QAction>
 28#include <QContextMenuEvent>
 29#include <QGridLayout>
 30#include <QLCDNumber>
 31
 32#include "ui_mainwindow.h"
 33
 34#include "clipboard.h"
 35#include "ewilistwidget.h"
 36#include "midi_data.h"
 37#include "patchexchange.h"
 38#include "patchexchangegui.h"
 39#include "keyPrograms_form.h"
 40
 41const QString	HELP_URL			= "http://code.google.com/p/ewitool/wiki/Using_EWItool";
 42const QString	GPL3_URL			= "http://www.gnu.org/licenses/gpl-3.0.txt";
 43
 44const int		STATUS_MSG_TIMEOUT 	= 3000;
 45const int		LIBRARY_TAB			= 0;
 46const int		EPX_TAB				= 1;
 47const int		EWI_TAB				= 2;
 48const int		PATCH_TAB			= 3;
 49const int       KEYPATCH_TAB        = 4;
 50
 51class MainWindow: public QMainWindow, public Ui::MainWindow{
 52Q_OBJECT
 53	public:	
 54		MainWindow( volatile midi_data *, QWidget * parent = 0, Qt::WFlags f = 0 );
 55    	~MainWindow();
 56	
 57	private slots:
 58		// menu
 59		void import() ;
 60		void saveAs();
 61		void print();
 62		void settings();
 63		void quit();
 64		void MIDIconnections();
 65		void sendSysexFile();
 66		void fetchAllPatches();
 67		void externalHelp();
 68		void externalLicence();
 69		void about();
 70		// GUI actions
 71		void copyCurrentPatchAs();
 72		void saveCurrentPatch();
 73		void revertPatch();
 74		void patchSelected( int );
 75		void displayPatch();
 76		void displayPatch( int );
 77		void copyEWIPatch( int );
 78		void pasteEWIPatch( int );
 79		void renameEWIPatch( int );
 80		
 81		void defaultPatch();
 82		void makeDry();
 83		void deNoise();
 84		void randomPatch();
 85		void randomisePatch();
 86		void mergePatch();
 87        void maxVolPatch();
 88		void mixInPatch( int, int );
 89		
 90		void setList_chosen(QListWidgetItem *);
 91		void deletePatchSet();
 92		void librarySelectionChanged( );
 93		void sendLibraryToEWI();
 94		void copyToClipboard();
 95		void exportCurrentPatch();
 96				
 97		void changeSlider( int );
 98		void changeDial( int );
 99		void changeOctaveCombo( int );
100		void changeSemitoneCombo( int );
101		void changeGenericCombo( int );
102		void changeCheckBox( int );
103		
104		void tabChanged( int );
105	
106	private:
107		void setupPatchTab();
108		void setupLibraryTab();
109		void setupEWItab();
110        void setupKeyPatchesTab();
111		//void contextMenuEvent( QContextMenuEvent *);
112		void savePatchSetAs();
113		void printEWIpatches();
114		void printSetPatches();
115		void printCurrentPatch();
116		void printPatchList( bool current );
117				
118		QAction *editAct, *copyAct, *pasteAct, *renameAct;
119		QMenu *EWIcontextMenu;
120	
121		void loadSettings();
122		void saveSettings();
123		void savePatchSet( QString );
124		int randBetween( int, int );
125		int randNear( int, int, int );
126		int mixInts( int, int, int );
127		
128		QString		libraryLocation;
129		QString		libraryName;
130		QList<int>	epx_ids;
131		int			epx_details_id;
132		QString		epx_hex_patch;
133		
134		midi_data *mididata;
135		
136		EWIListWidget 	*EWIList;
137        keyPrograms_form *keyPrograms;
138		patchExchange	*epx;
139		patchExchangeGUI *epxGUI;
140		Clipboard		*clipboard;
141		
142		patch_t			edit_patch;
143		patch_t			backup_patch;
144		patch_t 		patchSet[EWI_NUM_PATCHES];
145		
146};
147
148#endif