summaryrefslogtreecommitdiffstats
path: root/arts/modules/effects/freeverbguifactory_impl.cc
blob: 17878daa041c9736fd8921e6204d6370b4ea527a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
    /*

    Copyright (C) 2001 Stefan Westerfeld
                       stefan@space.twc.de

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.

    You should have received a copy of the GNU Library General Public License
    along with this library; see the file COPYING.LIB.  If not, write to
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    Boston, MA 02110-1301, USA.

    */

#include "artsmoduleseffects.h"
#include "debug.h"
#include "connect.h"

#include <kglobal.h>
#include <klocale.h>

using namespace std;
using namespace Arts;

namespace Arts {

class FreeverbGuiFactory_impl : public FreeverbGuiFactory_skel
{
public:
	Widget createGui(Object freeverb);
};

REGISTER_IMPLEMENTATION(FreeverbGuiFactory_impl);

}

Widget FreeverbGuiFactory_impl::createGui(Object object)
{
	KGlobal::locale()->insertCatalogue(  "artsmodules" );
	arts_return_val_if_fail(!object.isNull(), Arts::Widget::null());

	Synth_FREEVERB freeverb = DynamicCast(object);
	arts_return_val_if_fail(!freeverb.isNull(), Arts::Widget::null());

	HBox hbox;
	hbox.width(330); hbox.height(80); hbox.show();

	Poti roomsize;
	roomsize.x(20); roomsize.y(10); roomsize.caption(i18n("roomsize").utf8().data());
	roomsize.color("red"); roomsize.min(0); roomsize.max(1);
	roomsize.value(freeverb.roomsize());
	roomsize.range(100);
	roomsize.tqparent(hbox);
	roomsize.show();
	connect(roomsize,"value_changed", freeverb, "roomsize");
	hbox._addChild(roomsize,"roomsizeWidget");

	Poti damp;
	damp.x(80); damp.y(10); damp.caption(i18n("damp").utf8().data());
	damp.color("red"); damp.min(0); damp.max(1);
	damp.value(freeverb.damp());
	damp.range(100);
	damp.tqparent(hbox);
	damp.show();
	connect(damp,"value_changed", freeverb, "damp");
	hbox._addChild(damp,"dampWidget");

	Poti wet;
	wet.x(140); wet.y(10); wet.caption(i18n("wet").utf8().data());
	wet.color("red"); wet.min(0); wet.max(1);
	wet.value(freeverb.wet());
	wet.range(100);
	wet.tqparent(hbox);
	wet.show();
	connect(wet,"value_changed", freeverb, "wet");
	hbox._addChild(wet,"wetWidget");

	Poti dry;
	dry.x(200); dry.y(10); dry.caption(i18n("dry").utf8().data());
	dry.color("red"); dry.min(0); dry.max(1);
	dry.value(freeverb.dry());
	dry.range(100);
	dry.tqparent(hbox);
	dry.show();
	connect(dry,"value_changed", freeverb, "dry");
	hbox._addChild(dry,"dryWidget");

	Poti width;
	width.x(260); width.y(10); width.caption(i18n("width").utf8().data());
	width.color("red"); width.min(0); width.max(1);
	width.value(freeverb.width());
	width.range(100);
	width.tqparent(hbox);
	width.show();
	connect(width,"value_changed", freeverb, "width");
	hbox._addChild(width,"widthWidget");

	return hbox;
}