MuseScore
3.4
Music composition and notation
zerberus
sample.h
Go to the documentation of this file.
1
//=============================================================================
2
// Zerberus
3
// Zample player
4
//
5
// Copyright (C) 2013 Werner Schweer
6
//
7
// This program is free software; you can redistribute it and/or modify
8
// it under the terms of the GNU General Public License version 2
9
// as published by the Free Software Foundation and appearing in
10
// the file LICENCE.GPL
11
//=============================================================================
12
13
#ifndef __SAMPLE_H__
14
#define __SAMPLE_H__
15
16
//---------------------------------------------------------
17
// Sample
18
//---------------------------------------------------------
19
20
class
Sample
{
21
int
_channel
;
22
short
*
_data
;
23
long
long
_frames
;
24
int
_sampleRate
;
25
long
long
_loopStart
;
26
long
long
_loopEnd
;
27
int
_loopMode
;
28
29
public
:
30
Sample
(
int
ch,
short
* val,
int
f,
int
sr)
31
: _channel(ch), _data(val), _frames(f), _sampleRate(sr) {}
32
~Sample
();
33
bool
read
(
const
QString&);
34
long
long
frames
()
const
{
return
_frames
; }
35
short
*
data
()
const
{
return
_data +
_channel
; }
36
int
channel
()
const
{
return
_channel
; }
37
int
sampleRate
()
const
{
return
_sampleRate
; }
38
39
void
setLoopStart
(
int
v) { _loopStart = v; }
40
void
setLoopEnd
(
int
v) { _loopEnd = v; }
41
void
setLoopMode
(
int
v) { _loopMode = v; }
42
long
long
loopStart
() {
return
_loopStart
; }
43
long
long
loopEnd
() {
return
_loopEnd
; }
44
int
loopMode
() {
return
_loopMode
; }
45
};
46
47
#endif
48
Sample::loopEnd
long long loopEnd()
Definition:
sample.h:43
Sample::~Sample
~Sample()
Definition:
instrument.cpp:34
Sample::channel
int channel() const
Definition:
sample.h:36
Sample::_data
short * _data
Definition:
sample.h:22
Sample::_sampleRate
int _sampleRate
Definition:
sample.h:24
Sample::_loopStart
long long _loopStart
Definition:
sample.h:25
Sample::_channel
int _channel
Definition:
sample.h:21
Sample::_frames
long long _frames
Definition:
sample.h:23
Sample::loopStart
long long loopStart()
Definition:
sample.h:42
Sample::loopMode
int loopMode()
Definition:
sample.h:44
Sample::setLoopStart
void setLoopStart(int v)
Definition:
sample.h:39
Sample::read
bool read(const QString &)
Sample::frames
long long frames() const
Definition:
sample.h:34
Sample::setLoopEnd
void setLoopEnd(int v)
Definition:
sample.h:40
Sample::data
short * data() const
Definition:
sample.h:35
Sample
Definition:
sample.h:20
Sample::Sample
Sample(int ch, short *val, int f, int sr)
Definition:
sample.h:30
Sample::_loopEnd
long long _loopEnd
Definition:
sample.h:26
Sample::_loopMode
int _loopMode
Definition:
sample.h:27
Sample::setLoopMode
void setLoopMode(int v)
Definition:
sample.h:41
Sample::sampleRate
int sampleRate() const
Definition:
sample.h:37
Generated by
1.8.13