~ubuntu-branches/ubuntu/vivid/aeolus/vivid

« back to all changes in this revision

Viewing changes to source/imidi.h

  • Committer: Bazaar Package Importer
  • Author(s): Alessio Treglia
  • Date: 2010-04-19 19:12:51 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20100419191251-hgarjfcdfl7c0ryl
Tags: 0.8.4-3
debian/patches/01-makefile.patch: Drop -march=native flag, it isn't valid
for Debian packages as the results are unpredictable, thanks to
Bastian Blank for reporting this (Closes: #578278).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    Copyright (C) 2003-2008 Fons Adriaensen <fons@kokkinizita.net>
 
3
    Copyright (C) 2008 Hans Fugal <hans@fugal.net>
 
4
    
 
5
    This program is free software; you can redistribute it and/or modify
 
6
    it under the terms of the GNU General Public License as published by
 
7
    the Free Software Foundation; either version 2 of the License, or
 
8
    (at your option) any later version.
 
9
 
 
10
    This program is distributed in the hope that it will be useful,
 
11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
    GNU General Public License for more details.
 
14
 
 
15
    You should have received a copy of the GNU General Public License
 
16
    along with this program; if not, write to the Free Software
 
17
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
18
*/
 
19
 
 
20
 
 
21
#ifndef __IMIDI_H
 
22
#define __IMIDI_H
 
23
 
 
24
 
 
25
#include <stdlib.h>
 
26
#include <stdio.h>
 
27
#include <clthreads.h>
 
28
#ifdef __linux__
 
29
#include <alsa/asoundlib.h>
 
30
#endif
 
31
#ifdef __APPLE__
 
32
#include <CoreMIDI/MIDIServices.h>
 
33
#endif
 
34
#include "lfqueue.h"
 
35
#include "messages.h"
 
36
 
 
37
 
 
38
 
 
39
class Imidi : public A_thread
 
40
{
 
41
public:
 
42
 
 
43
    Imidi (Lfq_u32 *qnote, Lfq_u8 *qmidi, uint16_t *midimap, const char *appname);
 
44
    virtual ~Imidi (void);
 
45
 
 
46
    void terminate (void);
 
47
#ifdef __APPLE__
 
48
    void coremidi_proc (const MIDIPacketList *pktlist, void *refCon, void *connRefCon);
 
49
#endif
 
50
 
 
51
private:
 
52
 
 
53
    virtual void thr_main (void);
 
54
 
 
55
    void open_midi (void);
 
56
    void close_midi (void);
 
57
    void proc_midi (void);
 
58
    void proc_mesg (ITC_mesg *M);
 
59
 
 
60
    Lfq_u32        *_qnote; 
 
61
    Lfq_u8         *_qmidi; 
 
62
    uint16_t       *_midimap;
 
63
    const char     *_appname;
 
64
#ifdef __linux__
 
65
    snd_seq_t      *_handle;
 
66
#endif
 
67
#ifdef __APPLE__
 
68
    MIDIClientRef   _handle;
 
69
#endif
 
70
    int             _client;
 
71
    int             _ipport;
 
72
    int             _opport;
 
73
};
 
74
 
 
75
 
 
76
#endif