1 /* 2 * Copyright (C) 2002 - David W. Durham 3 * 4 * This file is part of ReZound, an audio editing application. 5 * 6 * ReZound is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published 8 * by the Free Software Foundation; either version 2 of the License, 9 * or (at your option) any later version. 10 * 11 * ReZound is distributed in the hope that it will be useful, but 12 * WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 19 */ 20 21 #ifndef __CFrontendHooks_H__ 22 #define __CFrontendHooks_H__ 23 24 #include "../../config/common.h" 25 #include "fox_compat.h" 26 27 #include "../backend/AFrontendHooks.h" 28 29 #ifdef FOX_NO_NAMESPACE 30 class FXWindow; 31 class FXFileDialog; 32 class FXDirDialog; 33 class FXCheckButton; 34 #else 35 namespace FX { class FXWindow; class FXFileDialog; class FXDirDialog; class FXCheckButton; } 36 using namespace FX; 37 #endif 38 39 class CNewSoundDialog; 40 class CRecordDialog; 41 class CRecordMacroDialog; 42 class CMacroActionParamsDialog; 43 class CJACKPortChoiceDialog; 44 class CRezSaveParametersDialog; 45 class CRawDialog; 46 class COggDialog; 47 class CMp3Dialog; 48 class CVoxDialog; 49 class CMIDIDumpSampleIdDialog; 50 class ClibaudiofileSaveParametersDialog; 51 52 class CFrontendHooks : public AFrontendHooks 53 { 54 public: 55 CFrontendHooks(FXWindow *mainWindow); 56 virtual ~CFrontendHooks(); 57 58 void doSetupAfterBackendIsSetup(); 59 60 void setWhichClipboard(size_t whichClipboard); 61 62 const string getFOXFileTypes() const; // returns a string to pass as the file types drop-down in FOX file dialogs 63 64 bool promptForOpenSoundFilename(string &filename,bool &readOnly,bool &openAsRaw); 65 bool promptForOpenSoundFilenames(vector<string> &filenames,bool &readOnly,bool &openAsRaw); 66 bool promptForSaveSoundFilename(string &filename,bool &saveAsRaw); 67 68 bool promptForNewSoundParameters(string &filename,bool &rawFormat,bool hideFilename,unsigned &channelCount,bool hideChannelCount,unsigned &sampleRate,bool hideSampleRate,sample_pos_t &length,bool hideLength); 69 70 bool promptForDirectory(string &dirname,const string title); 71 72 bool promptForRecord(ASoundRecorder *recorder); 73 74 bool showRecordMacroDialog(string ¯oName); 75 76 bool showMacroActionParamsDialog(const AActionFactory *actionFactory,MacroActionParameters ¯oActionParameters,CLoadedSound *loadedSound); 77 78 const string promptForJACKPort(const string message,const vector<string> portNames); 79 80 bool promptForRezSaveParameters(RezSaveParameters ¶meters); 81 bool promptForRawParameters(RawParameters ¶meters,bool showOffsetAndLengthParameters); 82 bool promptForOggCompressionParameters(OggCompressionParameters ¶meters); 83 bool promptForMp3CompressionParameters(Mp3CompressionParameters ¶meters); 84 bool promptForVoxParameters(VoxParameters ¶meters); 85 86 #ifdef USE_LADSPA 87 AActionDialog *getChannelSelectDialog(); 88 AActionDialog *getLADSPAActionDialog(const LADSPA_Descriptor *desc); 89 #endif 90 91 bool promptForOpenMIDISampleDump(int &sysExChannel,int &waveformId); 92 bool promptForSaveMIDISampleDump(int &sysExChannel,int &waveformId,int &loopType); 93 94 bool promptForlibaudiofileSaveParameters(libaudiofileSaveParameters ¶meters,const string formatName); 95 96 private: 97 FXWindow *mainWindow; 98 99 FXFileDialog *openDialog; 100 FXCheckButton *openAsRawCheckButton; 101 FXFileDialog *saveDialog; 102 FXCheckButton *saveAsRawCheckButton; 103 FXDirDialog *dirDialog; 104 105 CNewSoundDialog *newSoundDialog; 106 CRecordDialog *recordDialog; 107 CRecordMacroDialog *recordMacroDialog; 108 CMacroActionParamsDialog *macroActionParamsDialog; 109 CJACKPortChoiceDialog *JACKPortChoiceDialog; 110 CRezSaveParametersDialog *rezSaveParametersDialog; 111 CRawDialog *rawDialog; 112 COggDialog *oggDialog; 113 CMp3Dialog *mp3Dialog; 114 CVoxDialog *voxDialog; 115 CMIDIDumpSampleIdDialog *MIDIDumpSampleIdDialog; 116 ClibaudiofileSaveParametersDialog *libaudiofileSaveParametersDialog; 117 }; 118 119 #endif 120