Ardour
9.0-pre0-582-g084a23a80d
fader_widget.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2024 Robin Gareus <robin@gareus.org>
3
*
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License, or
7
* (at your option) any later version.
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License along
15
* with this program; if not, write to the Free Software Foundation, Inc.,
16
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
*/
18
19
#pragma once
20
21
#include <
gtkmm/adjustment.h
>
22
#include "
gtkmm2ext/cairo_widget.h
"
23
24
#include "
widgets/visibility.h
"
25
26
namespace
ArdourWidgets
{
27
28
class
LIBWIDGETS_API
FaderWidget
:
public
virtual
CairoWidget
29
{
30
public
:
31
FaderWidget
(
Gtk::Adjustment
&,
int
orient);
32
virtual
~FaderWidget
() {};
33
34
sigc::signal<void,int>
StartGesture
;
35
sigc::signal<void,int>
StopGesture
;
36
sigc::signal<void>
OnExpose
;
37
38
virtual
void
set_default_value
(
float
) = 0;
39
40
enum
Tweaks
{
41
NoShowUnityLine = 0x1,
42
NoButtonForward = 0x2,
43
NoVerticalScroll = 0x4,
44
DoubleClickReset = 0x8,
45
};
46
47
enum
Orientation
{
48
VERT
,
49
HORIZ
,
50
};
51
52
void
set_tweaks
(
Tweaks
);
53
Tweaks
tweaks
()
const
{
return
_tweaks; }
54
55
int
orientation
()
const
{
return
_orien; }
56
57
virtual
void
set_bg
(
Gtkmm2ext::Color
) = 0;
58
virtual
void
set_fg
(
Gtkmm2ext::Color
) = 0;
59
virtual
void
unset_bg
() = 0;
60
virtual
void
unset_fg
() = 0;
61
62
protected
:
63
bool
on_button_press_event
(
GdkEventButton
*);
64
bool
on_button_release_event
(
GdkEventButton
*);
65
bool
on_touch_begin_event
(
GdkEventTouch
*);
66
bool
on_touch_end_event
(
GdkEventTouch
*);
67
bool
on_enter_notify_event
(
GdkEventCrossing
* ev);
68
bool
on_leave_notify_event
(
GdkEventCrossing
* ev);
69
bool
on_scroll_event
(
GdkEventScroll
* ev);
70
bool
on_grab_broken_event
(
GdkEventGrabBroken
*);
71
72
void
adjustment_changed
();
73
74
virtual
void
set_adjustment_from_event
(
GdkEventButton
*) = 0;
75
76
Gtk::Adjustment
&
_adjustment
;
77
78
Tweaks
_tweaks
;
79
int
_orien
;
80
bool
_dragging
;
81
bool
_hovering
;
82
float
_default_value
;
83
84
85
GdkWindow
*
_grab_window
;
86
double
_grab_loc
;
87
double
_grab_start
;
88
};
89
90
}
adjustment.h
cairo_widget.h
ArdourWidgets::FaderWidget
Definition:
fader_widget.h:29
ArdourWidgets::FaderWidget::unset_fg
virtual void unset_fg()=0
ArdourWidgets::FaderWidget::set_adjustment_from_event
virtual void set_adjustment_from_event(GdkEventButton *)=0
ArdourWidgets::FaderWidget::OnExpose
sigc::signal< void > OnExpose
Definition:
fader_widget.h:36
ArdourWidgets::FaderWidget::tweaks
Tweaks tweaks() const
Definition:
fader_widget.h:53
ArdourWidgets::FaderWidget::_grab_start
double _grab_start
Definition:
fader_widget.h:87
ArdourWidgets::FaderWidget::on_grab_broken_event
bool on_grab_broken_event(GdkEventGrabBroken *)
ArdourWidgets::FaderWidget::set_bg
virtual void set_bg(Gtkmm2ext::Color)=0
ArdourWidgets::FaderWidget::_hovering
bool _hovering
Definition:
fader_widget.h:81
ArdourWidgets::FaderWidget::StartGesture
sigc::signal< void, int > StartGesture
Definition:
fader_widget.h:32
ArdourWidgets::FaderWidget::_grab_loc
double _grab_loc
Definition:
fader_widget.h:86
ArdourWidgets::FaderWidget::_grab_window
GdkWindow * _grab_window
Definition:
fader_widget.h:85
ArdourWidgets::FaderWidget::set_default_value
virtual void set_default_value(float)=0
ArdourWidgets::FaderWidget::set_fg
virtual void set_fg(Gtkmm2ext::Color)=0
ArdourWidgets::FaderWidget::Orientation
Orientation
Definition:
fader_widget.h:47
ArdourWidgets::FaderWidget::HORIZ
@ HORIZ
Definition:
fader_widget.h:49
ArdourWidgets::FaderWidget::VERT
@ VERT
Definition:
fader_widget.h:48
ArdourWidgets::FaderWidget::on_touch_end_event
bool on_touch_end_event(GdkEventTouch *)
ArdourWidgets::FaderWidget::_default_value
float _default_value
Definition:
fader_widget.h:82
ArdourWidgets::FaderWidget::_orien
int _orien
Definition:
fader_widget.h:79
ArdourWidgets::FaderWidget::_dragging
bool _dragging
Definition:
fader_widget.h:80
ArdourWidgets::FaderWidget::_tweaks
Tweaks _tweaks
Definition:
fader_widget.h:78
ArdourWidgets::FaderWidget::on_enter_notify_event
bool on_enter_notify_event(GdkEventCrossing *ev)
This is a default handler for the signal signal_enter_notify_event().
ArdourWidgets::FaderWidget::adjustment_changed
void adjustment_changed()
ArdourWidgets::FaderWidget::Tweaks
Tweaks
Definition:
fader_widget.h:40
ArdourWidgets::FaderWidget::on_touch_begin_event
bool on_touch_begin_event(GdkEventTouch *)
ArdourWidgets::FaderWidget::on_leave_notify_event
bool on_leave_notify_event(GdkEventCrossing *ev)
This is a default handler for the signal signal_leave_notify_event().
ArdourWidgets::FaderWidget::StopGesture
sigc::signal< void, int > StopGesture
Definition:
fader_widget.h:35
ArdourWidgets::FaderWidget::set_tweaks
void set_tweaks(Tweaks)
ArdourWidgets::FaderWidget::on_button_release_event
bool on_button_release_event(GdkEventButton *)
This is a default handler for the signal signal_button_release_event().
ArdourWidgets::FaderWidget::_adjustment
Gtk::Adjustment & _adjustment
Definition:
fader_widget.h:76
ArdourWidgets::FaderWidget::on_scroll_event
bool on_scroll_event(GdkEventScroll *ev)
This is a default handler for the signal signal_scroll_event().
ArdourWidgets::FaderWidget::unset_bg
virtual void unset_bg()=0
ArdourWidgets::FaderWidget::on_button_press_event
bool on_button_press_event(GdkEventButton *)
This is a default handler for the signal signal_button_press_event().
ArdourWidgets::FaderWidget::~FaderWidget
virtual ~FaderWidget()
Definition:
fader_widget.h:32
ArdourWidgets::FaderWidget::orientation
int orientation() const
Definition:
fader_widget.h:55
ArdourWidgets::FaderWidget::FaderWidget
FaderWidget(Gtk::Adjustment &, int orient)
CairoWidget
Definition:
cairo_widget.h:38
Gtk::Adjustment
Definition:
adjustment.h:63
ArdourWidgets
Definition:
ardour_ui.h:192
Gtkmm2ext::Color
uint32_t Color
Definition:
colors.h:33
_GdkDrawable
Definition:
gdkdrawable.h:54
_GdkEventButton
Definition:
gdkevents.h:321
_GdkEventCrossing
Definition:
gdkevents.h:383
_GdkEventGrabBroken
Definition:
gdkevents.h:495
_GdkEventScroll
Definition:
gdkevents.h:351
_GdkEventTouch
Definition:
gdkevents.h:336
visibility.h
LIBWIDGETS_API
#define LIBWIDGETS_API
Definition:
widgets/widgets/visibility.h:39
libs
widgets
widgets
fader_widget.h
Generated on Wed Dec 25 2024 05:44:14 for Ardour by
1.9.1