kwave
18.07.70
Main Page
Related Pages
+
Namespaces
Namespace List
+
Namespace Members
+
All
_
a
b
c
f
h
i
l
m
o
p
r
s
t
u
w
y
z
Functions
Typedefs
Enumerations
+
Enumerator
a
b
c
f
i
l
o
p
r
s
u
w
+
Classes
Class List
Class Index
Class Hierarchy
+
Class Members
+
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
~
+
Variables
a
b
c
d
e
f
g
h
i
m
n
p
r
s
t
v
w
x
y
z
Typedefs
Enumerations
+
Enumerator
a
b
c
d
e
f
g
i
l
m
n
o
p
r
s
t
u
v
w
Related Functions
+
Files
File List
+
File Members
+
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
+
Functions
_
a
b
c
d
e
f
i
l
m
p
q
r
s
t
x
z
Variables
Typedefs
+
Macros
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
z
MouseMark.cpp
Go to the documentation of this file.
1
/***************************************************************************
2
MouseMark.cpp - Handling of mouse selection
3
-------------------
4
begin : Sun Nov 12 2000
5
copyright : (C) 2000 by Thomas Eschenbacher
6
email : Thomas.Eschenbacher@gmx.de
7
***************************************************************************/
8
9
/***************************************************************************
10
* *
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
15
* *
16
***************************************************************************/
17
18
#include "config.h"
19
20
#include <QtGlobal>
21
22
#include "
libgui/MouseMark.h
"
23
24
//****************************************************************************
25
Kwave::MouseMark::MouseMark
()
26
:m_initial(0), m_last(0)
27
{
28
}
29
30
//****************************************************************************
31
Kwave::MouseMark::~MouseMark
()
32
{
33
}
34
35
//****************************************************************************
36
void
Kwave::MouseMark::set
(
sample_index_t
l,
sample_index_t
r)
37
{
38
m_initial
= l;
39
m_last
= r;
40
}
41
42
//****************************************************************************
43
sample_index_t
Kwave::MouseMark::left
()
const
44
{
45
return
qMin(
m_initial
,
m_last
);
46
}
47
48
//****************************************************************************
49
sample_index_t
Kwave::MouseMark::right
()
const
50
{
51
return
qMax(
m_initial
,
m_last
);
52
}
53
54
//****************************************************************************
55
void
Kwave::MouseMark::grep
(
sample_index_t
x)
56
{
57
const
sample_index_t
d_last =
58
(x >
m_last
) ? (x -
m_last
) : (
m_last
- x);
59
const
sample_index_t
d_first =
60
(x >
m_initial
) ? (x -
m_initial
) : (
m_initial
- x);
61
if
(d_last > d_first)
62
m_initial
=
m_last
;
63
m_last
= x;
64
}
65
66
//****************************************************************************
67
void
Kwave::MouseMark::update
(
sample_index_t
x)
68
{
69
m_last
= x;
70
}
71
72
//****************************************************************************
73
//****************************************************************************
Kwave::MouseMark::m_initial
sample_index_t m_initial
Definition:
MouseMark.h:83
Kwave::MouseMark::set
void set(sample_index_t l, sample_index_t r)
Definition:
MouseMark.cpp:36
Kwave::MouseMark::right
sample_index_t right() const
Definition:
MouseMark.cpp:49
Kwave::MouseMark::grep
void grep(sample_index_t x)
Definition:
MouseMark.cpp:55
sample_index_t
quint64 sample_index_t
Definition:
Sample.h:28
Kwave::MouseMark::~MouseMark
virtual ~MouseMark()
Definition:
MouseMark.cpp:31
Kwave::MouseMark::MouseMark
MouseMark()
Definition:
MouseMark.cpp:25
Kwave::MouseMark::m_last
sample_index_t m_last
Definition:
MouseMark.h:86
Kwave::MouseMark::update
void update(sample_index_t x)
Definition:
MouseMark.cpp:67
MouseMark.h
Kwave::MouseMark::left
sample_index_t left() const
Definition:
MouseMark.cpp:43
libgui
MouseMark.cpp
Generated on Sat Mar 24 2018 09:10:24 for kwave by
1.8.13