1 /* 2 Copyright (C) 2006 Remon Sijrier 3 4 This file is part of Traverso 5 6 Traverso is free software; you can redistribute it and/or modify 7 it under the terms of the GNU General Public License as published by 8 the Free Software Foundation; either version 2 of the License, or 9 (at your option) any later version. 10 11 This program is distributed in the hope that it will be useful, 12 but 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 19 20 $Id: Fade.h,v 1.13 2008/01/21 16:22:11 r_sijrier Exp $ 21 */ 22 23 #ifndef FADE_H 24 #define FADE_H 25 26 #include "Command.h" 27 28 class Curve; 29 class AudioClip; 30 class FadeCurve; 31 class FadeView; 32 class SheetView; 33 34 class FadeRange : public Command 35 { 36 public : 37 FadeRange(AudioClip* clip, FadeCurve* curve, qint64 scalefactor); 38 FadeRange(AudioClip* clip, FadeCurve* curve, double newVal); 39 ~FadeRange(); 40 41 int begin_hold(); 42 int finish_hold(); 43 int prepare_actions(); 44 int do_action(); 45 int undo_action(); 46 void cancel_action(); 47 48 int jog(); 49 50 void set_cursor_shape(int useX, int useY); 51 52 private : 53 FadeCurve* m_curve; 54 double m_origRange; 55 double m_newRange; 56 class Private { 57 public: 58 int origX; 59 int direction; 60 QPoint mousePos; 61 qint64 scalefactor; 62 }; 63 Private* d; 64 }; 65 66 67 class FadeStrength : public Command 68 { 69 public : 70 FadeStrength(FadeView* fadeview); 71 FadeStrength(FadeCurve* fade, double val); ~FadeStrength()72 ~FadeStrength(){}; 73 74 int begin_hold(); 75 int finish_hold(); 76 int prepare_actions(); 77 int do_action(); 78 int undo_action(); 79 void cancel_action(); 80 81 int jog(); 82 83 void set_cursor_shape(int useX, int useY); 84 85 private : 86 float oldValue; 87 int origY; 88 double origStrength; 89 double newStrength; 90 FadeCurve* m_fade; 91 FadeView* m_fv; 92 QPoint mousePos; 93 }; 94 95 96 class FadeBend : public Command 97 { 98 public : 99 FadeBend(FadeView* fadeview); 100 FadeBend(FadeCurve* fade, double val); ~FadeBend()101 ~FadeBend(){}; 102 103 int begin_hold(); 104 int finish_hold(); 105 int prepare_actions(); 106 int do_action(); 107 int undo_action(); 108 void cancel_action(); 109 110 int jog(); 111 112 void set_cursor_shape(int useX, int useY); 113 114 private : 115 float oldValue; 116 int origY; 117 double origBend; 118 double newBend; 119 FadeCurve* m_fade; 120 FadeView* m_fv; 121 QPoint mousePos; 122 }; 123 124 125 class FadeMode : public Command 126 { 127 public : 128 FadeMode(FadeCurve* fade, int oldMode, int newMode); ~FadeMode()129 ~FadeMode(){}; 130 131 int prepare_actions(); 132 int do_action(); 133 int undo_action(); 134 135 private : 136 int m_oldMode; 137 int m_newMode; 138 FadeCurve* m_fade; 139 }; 140 141 142 #endif 143 144 145