MuseScore  3.4
Music composition and notation
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;
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 
long long loopEnd()
Definition: sample.h:43
~Sample()
Definition: instrument.cpp:34
int channel() const
Definition: sample.h:36
short * _data
Definition: sample.h:22
int _sampleRate
Definition: sample.h:24
long long _loopStart
Definition: sample.h:25
int _channel
Definition: sample.h:21
long long _frames
Definition: sample.h:23
long long loopStart()
Definition: sample.h:42
int loopMode()
Definition: sample.h:44
void setLoopStart(int v)
Definition: sample.h:39
bool read(const QString &)
long long frames() const
Definition: sample.h:34
void setLoopEnd(int v)
Definition: sample.h:40
short * data() const
Definition: sample.h:35
Definition: sample.h:20
Sample(int ch, short *val, int f, int sr)
Definition: sample.h:30
long long _loopEnd
Definition: sample.h:26
int _loopMode
Definition: sample.h:27
void setLoopMode(int v)
Definition: sample.h:41
int sampleRate() const
Definition: sample.h:37