~ubuntu-branches/ubuntu/breezy/muse/breezy

« back to all changes in this revision

Viewing changes to mpevent.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Kobras
  • Date: 2004-02-07 15:18:22 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040207151822-es27xxkzbcxkebjm
Tags: 0.6.3-1
* New upstream version.
* Added patches:
  + [10_alsa_init_fix] New, from upstream CVS.
    Initialize direction variable when setting Alsa parameters.
  + [10_canvas_translation_fix] New, from upstream CVS.
    Do not translate tooltips twice in canvas popup.
  + [10_checkbox_fix] New, from upstream CVS.
    Use proper set/test methods on metronome checkboxes.
  + [10_html_doc_cleanup] New.
    Fix links and HTML errors in documentation.
  + [20_allow_system_timer] New.
    The new upstream version fails by default if the real-time clock
    could not be accessed (usually the case when not running suid-root).
    This patch reverts the old behaviour of falling back to the more
    inaccurate system timer.
* Updated patches:
  + [11_PIC_fixes_fixup] Rediffed.
* Removed patches:
  + [20_no_atomic_asm] Merged upstream.
* debian/compat: Splice out debhelper compatibility level from rules file.
* debian/control: Build-depend on latest jack release by default.
  Closes: #228788
* debian/control: Bump standards version.
* debian/control: Use auto-generated debconf dependency via misc:Depends.
* debian/control: Minor tweaks to the long description.
* debian/control: Tighten fluidsynth build dependency to sane version.
* debian/muse.doc-base: New. Register HTML documentation with doc-base.
* debian/templates: Tiny rewording, and typo fix.
* debian/templates, debian/po/*: Switch to po-debconf for translations.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//=========================================================
 
2
//  MusE
 
3
//  Linux Music Editor
 
4
//  $Id: mpevent.h,v 1.1.1.1 2003/10/29 10:05:08 wschweer Exp $
 
5
//
 
6
//  (C) Copyright 1999-2002 Werner Schweer (ws@seh.de)
 
7
//=========================================================
 
8
 
 
9
#ifndef __MPEVENT_H__
 
10
#define __MPEVENT_H__
 
11
 
 
12
#include <map>
 
13
#include "memory.h"
 
14
 
 
15
class MidiEvent;
 
16
class EvData;
 
17
 
 
18
//---------------------------------------------------------
 
19
//   MidiPlayEvent
 
20
//---------------------------------------------------------
 
21
 
 
22
class MidiPlayEvent {
 
23
      unsigned char _port, _channel, _type, _a, _b;
 
24
      EvData* edata;
 
25
 
 
26
   public:
 
27
      MidiPlayEvent();
 
28
      MidiPlayEvent(const MidiPlayEvent&);
 
29
      MidiPlayEvent(int p, int c, int t, int a, int b)
 
30
        : _port(p), _channel(c), _type(t), _a(a), _b(b) {
 
31
            edata = 0;
 
32
            }
 
33
      MidiPlayEvent(int p, const unsigned char* data, int len);
 
34
      MidiPlayEvent(int p, EvData* data);
 
35
      MidiPlayEvent& operator=(const MidiPlayEvent&);
 
36
 
 
37
      ~MidiPlayEvent();
 
38
      int port()    const      { return _port;    }
 
39
      int channel() const      { return _channel; }
 
40
      int type()    const      { return _type;    }
 
41
      void setType(int val)    { _type = val;     }
 
42
      void setPort(int val)    { _port = val;     }
 
43
      void setChannel(int val) { _channel = val;  }
 
44
      int dataA()   const      { return _a;       }
 
45
      int dataB()   const      { return _b;       }
 
46
      void setA(int val)       { _a = val;        }
 
47
      void setB(int val)       { _b = val;        }
 
48
      const unsigned char* data() const;
 
49
      int len() const;
 
50
      void dump() const;
 
51
      bool isNote() const      { return _type == 0x90; }
 
52
      bool isNoteOff() const {
 
53
            return (_type == 0x80)||(_type == 0x90 && _b == 0);
 
54
            }
 
55
      EvData* eventData() const { return edata; }
 
56
      void play() const;
 
57
      };
 
58
 
 
59
//---------------------------------------------------------
 
60
//   MPEventList
 
61
//---------------------------------------------------------
 
62
 
 
63
typedef std::multimap<int, MidiPlayEvent, std::less<int>, RTalloc<MidiPlayEvent> > MPEL;
 
64
typedef std::pair<const int, MidiPlayEvent> MPEP;
 
65
 
 
66
struct MPEventList : public MPEL {
 
67
      void add(int tick, int a, int b, int c, int d, int e) {
 
68
            MPEL::insert(MPEP (tick, MidiPlayEvent(a,b,c,d,e)));
 
69
            }
 
70
      void add(int tick, int port, EvData* ed) {
 
71
            MPEL::insert(MPEP (tick, MidiPlayEvent(port, ed)));
 
72
            }
 
73
      void add(int tick, const MidiEvent* e, int port, int channel);
 
74
      void play() const;
 
75
      };
 
76
 
 
77
typedef MPEventList::iterator iMPEvent;
 
78
typedef MPEventList::const_iterator ciMPEvent;
 
79
typedef std::pair <iMPEvent, iMPEvent> MPEventRange;
 
80
 
 
81
#endif
 
82