Debian Codegraph @

Qt/Qt_MyQSlider.cpp

raw
1 /* Copyright 2012 Kjetil S. Matheussen
2
3 This program is free software; you can redistribute it and/or
4 modify it under the terms of the GNU General Public License
5 as published by the Free Software Foundation; either version 2
6 of the License, or (at your option) any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12
13 You should have received a copy of the GNU General Public License
14 along with this program; if not, write to the Free Software
15 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
16
17
18 #include "Qt_MyQSlider.h"
19
20 #include "Qt_SliderPainter_proc.h"
21
22 #include "../common/OS_visual_input.h"
23
24
25 QVector<MyQSlider*> g_all_myqsliders;
26
27 static MyQSlider *find_slider(struct Patch *patch, int effect_num){
28 for(int i=0;i<g_all_myqsliders.size();i++){
29 MyQSlider *slider= g_all_myqsliders[i];
30 if(slider->_patch==patch && slider->_effect_num==effect_num)
31 return slider;
32 }
33 fprintf(stderr,"Not found, Qt_MyQSlider.cpp\n"); // could be a checkbox.
34 // abort();
35 return NULL;
36 }
37
38 float *OS_SLIDER_obtain_automation_value_pointer(struct Patch *patch,int effect_num){
39 MyQSlider *slider= find_slider(patch,effect_num);
40 if(slider==NULL)
41 return NULL;
42 else
43 return SLIDERPAINTER_obtain_automation_value_pointer(slider->_painter);
44 }
45
46 int *OS_SLIDER_obtain_automation_color_pointer(struct Patch *patch,int effect_num){
47 MyQSlider *slider= find_slider(patch,effect_num);
48 if(slider==NULL)
49 return NULL;
50 else
51 return SLIDERPAINTER_obtain_automation_color_pointer(slider->_painter);
52 }
53
54 void OS_SLIDER_release_automation_pointers(struct Patch *patch,int effect_num){
55 //RError("Dont think it is a good idea to call OS_SLIDER_release_automation_pointers");
56 MyQSlider *slider= find_slider(patch,effect_num);
57 if(slider==NULL)
58 return;
59 else
60 SLIDERPAINTER_release_automation_pointers(slider->_painter);
61 }
62