~ubuntu-branches/ubuntu/oneiric/muse/oneiric

« back to all changes in this revision

Viewing changes to wave.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Kobras
  • Date: 2002-04-23 17:28:23 UTC
  • Revision ID: james.westby@ubuntu.com-20020423172823-w8yplzr81a759xa3
Tags: upstream-0.5.2
ImportĀ upstreamĀ versionĀ 0.5.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//=========================================================
 
2
//  MusE
 
3
//  Linux Music Editor
 
4
//  $Id: wave.h,v 1.2 2001/11/20 15:19:32 muse Exp $
 
5
//
 
6
//  (C) Copyright 1999/2000 Werner Schweer (ws@seh.de)
 
7
//=========================================================
 
8
 
 
9
#ifndef __AUDIO_H__
 
10
#define __AUDIO_H__
 
11
 
 
12
#include <qstring.h>
 
13
#include <list>
 
14
#include <qfileinfo.h>
 
15
 
 
16
class Xml;
 
17
class SndFile;
 
18
 
 
19
//---------------------------------------------------------
 
20
//   Clip
 
21
//---------------------------------------------------------
 
22
 
 
23
class Clip {
 
24
      QString _name;
 
25
      SndFile* f;
 
26
      int _spos;                    // start sample position in WaveFile
 
27
      int len;                      // len of clip
 
28
      int refs;
 
29
 
 
30
   public:
 
31
      Clip();
 
32
      Clip(SndFile* f, int start, int len);
 
33
      ~Clip();
 
34
      const QString& name() const      { return _name;  }
 
35
      void setName(const QString& s)   { _name = s;     }
 
36
      void incRef();
 
37
      int decRef();
 
38
      int spos() const                 { return _spos;  }
 
39
      void setSpos(int s)              { _spos = s;     }
 
40
      SndFile* file() const            { return f;      }
 
41
 
 
42
      void read(unsigned, float**, int, unsigned, int*, const double);
 
43
      void read(Xml&);
 
44
      void write(int, Xml&) const;
 
45
      int samples() const              { return len; }
 
46
      void setSamples(int s)           { len = s;    }
 
47
      int  references()                { return refs; }
 
48
      };
 
49
 
 
50
class ClipList : public std::list<Clip*> {
 
51
   public:
 
52
      int idx(Clip*) const;
 
53
      Clip* search(const QString&) const;
 
54
      void write(int, Xml&) const;
 
55
      void add(Clip* clip) { push_back(clip); }
 
56
      void remove(Clip*);
 
57
      };
 
58
 
 
59
typedef ClipList::iterator iClip;
 
60
typedef ClipList::const_iterator ciClip;
 
61
 
 
62
 
 
63
#endif
 
64