This file is indexed.

/usr/include/CLAM/MIDIDevice.hxx is in libclam-dev 1.4.0-7.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
/*
 * Copyright (c) 2001-2004 MUSIC TECHNOLOGY GROUP (MTG)
 *                         UNIVERSITAT POMPEU FABRA
 *
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */

#ifndef __MIDIDevice__
#define __MIDIDevice__


#include <string>
#include <vector>
#include "Err.hxx"
#include "MIDIEnums.hxx"
#include "InControl.hxx"

namespace CLAM{

class MIDIIn;
class MIDIOut;
class MIDIClocker;
class MIDIManager;

/** This is the abstract base class for an midi device. With an midi device
 * we refer to any kind of midi input/output.
 * MIDIDevices are usually created by the MIDIManager. The interface 
 * for the user however, are the MIDIIn and MIDIOut classes.
 * <p>
 * Each MIDIIn and MIDIOut created is registered with the MIDIManager. When the MIDIManager is started, it will create the 
 * appropiate MIDIDevice or MIDIDevices, based on the number of inputs, 
 * outputs, operating system and MIDIInConfig of the MIDIIn objects
 * @see MIDIIn, MIDIOut, MIDIDeviceList, MIDIManager
 */
class MIDIDevice
{
	friend class MIDIIn;
	friend class MIDIOut;
	friend class MIDIOutControl;
	friend class MIDIClocker;
	friend class MIDIManager;
protected:
	/** This class is used to respond to device information
	 *  request using the GetInfo method.
	 */
	struct TInfo
	{
		std::string mName;
		std::string mArch;
		/** Base constructor, calls to Reset method to clear all the values*/
		TInfo() { Reset();}

		/** Clear all the values of object, setting strings mName and mArch to ""*/
		void Reset()
		{
			mName=mArch="";
		}
	};

	MIDIIn* target[8][16][128];

	std::vector<MIDIIn*> mInputs;
	std::vector<MIDIOut*> mOutputs;

	std::string mName;

	unsigned char mLastStatus;
	int mIndex;
	int mLength;
	unsigned char mData[256];

	/** Constructor of the class that sets the name of object to the string passed by parameter
	 *  @param name String with the name of object
	 */
	MIDIDevice(const std::string& name)
	{
		mName = name;
		mLastStatus = 0;
		mIndex = 0;
		mLength = 0;
		mMIDIManager = 0;
	}
	
	/** Destructor of class*/
	virtual ~MIDIDevice() { };

	/** This method should be called to begin the use of this Device*/
	void Start(void);

	/** This method must be called to end the use of this Device*/
	void Stop(void);
	
	/** This function is executed to start the concrete use of the devices. Each implementation of MIDIDevice must define this method.*/
	virtual void ConcreteStart(void) throw(Err) = 0;

	/** This function is executed to stop the concrete use of the devices. Each implementation of MIDIDevice must define this method.*/
	virtual void ConcreteStop(void) throw(Err) = 0;

	/** Getter for the Info of Device Object attached to this MIDIDevice instantiation
	 *  @param info TInfo object that method will modify with the values of Tinfo internal object
	 */
	void GetInfo(TInfo&);

	virtual void SetClock(TControlData val) { }

	/** Reads the information given by this Device and passes data to an Audio chunk. Must be implemented by any Device derived from this class. Not implemented yet
	 */
	virtual void Read(void) throw(Err) = 0;

	virtual void Write(unsigned char* msg,int size) throw(Err) = 0;

protected:
	bool Register(MIDIManager* mm,MIDIIn& in);
	bool Register(MIDIManager* mm,MIDIOut& out);
	void Unregister(MIDIIn& in);
	void Unregister(MIDIOut& out);

	bool Register(MIDIManager* mm,MIDIClocker& in);
	void Unregister(MIDIClocker& in);

	int GetMessageLength(unsigned char byte);

	void HandleRawByte(unsigned char byte);

private:
	MIDIManager* mMIDIManager;
	MIDIManager& _MIDIManager(void);
	void _SetMIDIManager(MIDIManager* mm);

	void SetTarget(
		MIDI::Message msg,
		unsigned char chn,unsigned char firstData,
		MIDIIn* inp);
};

};//CLAM

#endif