xref: /haiku/src/kits/midi2/MidiConsumer.cpp (revision 51978af14a173e7fae0563b562be5603bc652aeb)
1 /*
2  * Copyright (c) 2002-2003 Matthijs Hollemans
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a
5  * copy of this software and associated documentation files (the "Software"),
6  * to deal in the Software without restriction, including without limitation
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8  * and/or sell copies of the Software, and to permit persons to whom the
9  * Software is furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in
12  * all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20  * DEALINGS IN THE SOFTWARE.
21  */
22 
23 #include "debug.h"
24 #include "MidiConsumer.h"
25 #include "protocol.h"
26 
27 //------------------------------------------------------------------------------
28 
29 bigtime_t BMidiConsumer::Latency() const
30 {
31 	bigtime_t res = 0LL;
32 
33 	if (LockLooper())
34 	{
35 		res = latency;
36 		UnlockLooper();
37 	}
38 
39 	return res;
40 }
41 
42 //------------------------------------------------------------------------------
43 
44 BMidiConsumer::BMidiConsumer(const char* name)
45 	: BMidiEndpoint(name)
46 {
47 	isConsumer = true;
48 	latency = 0LL;
49 	port = 0;
50 }
51 
52 //------------------------------------------------------------------------------
53 
54 BMidiConsumer::~BMidiConsumer()
55 {
56 	// Do nothing.
57 }
58 
59 //------------------------------------------------------------------------------
60 
61 void BMidiConsumer::_Reserved1() { }
62 void BMidiConsumer::_Reserved2() { }
63 void BMidiConsumer::_Reserved3() { }
64 void BMidiConsumer::_Reserved4() { }
65 void BMidiConsumer::_Reserved5() { }
66 void BMidiConsumer::_Reserved6() { }
67 void BMidiConsumer::_Reserved7() { }
68 void BMidiConsumer::_Reserved8() { }
69 
70 //------------------------------------------------------------------------------
71