Some more work on the Doxygen version of the haiku_book.
I will keep working on the Docbook version, but as I'm still not completely comfortable with that as final choice, I'm playing around with this as well. The String.cpp file contained doxygen documentation for almost all methods, I copied those to a new file (string.dox) and grouped them accordingly. (Done because Axel is absolutely against in-header or in-source docs) Integrated the BMidiConsumer and BMidiLocalConsumer class into the same file (like I did now to the producers), since I think it's better to keep a 1:1 relation with the headers. Removed the mididefs.dox file and replaced it with the midi2/Midi2Defs.dox file which actually documents the Midi2Defs.h file, rather than contain a custom page that was somewhat hard to find. Please see http://www.myhouserules.nl/haiku_book/index.html for a generated book from the current source. I actually quite like the output so far, though I'm aware of the fact that I needed to perform some tricks to let Doxygen get to this point. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19651 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+8
-8
@@ -1,4 +1,4 @@
|
||||
# Doxyfile 1.4.7
|
||||
# Doxyfile 1.5.1-p1
|
||||
|
||||
# This file describes the settings to be used by the documentation system
|
||||
# doxygen (www.doxygen.org) for a project
|
||||
@@ -45,11 +45,11 @@ CREATE_SUBDIRS = NO
|
||||
# documentation generated by doxygen is written. Doxygen will use this
|
||||
# information to generate all constant output in the proper language.
|
||||
# The default language is English, other supported languages are:
|
||||
# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish,
|
||||
# Dutch, Finnish, French, German, Greek, Hungarian, Italian, Japanese,
|
||||
# Japanese-en (Japanese with English messages), Korean, Korean-en, Norwegian,
|
||||
# Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish,
|
||||
# Swedish, and Ukrainian.
|
||||
# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
|
||||
# Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hungarian,
|
||||
# Italian, Japanese, Japanese-en (Japanese with English messages), Korean,
|
||||
# Korean-en, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian,
|
||||
# Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian.
|
||||
|
||||
OUTPUT_LANGUAGE = English
|
||||
|
||||
@@ -209,7 +209,7 @@ BUILTIN_STL_SUPPORT = NO
|
||||
# member in the group (if any) for the other members of the group. By default
|
||||
# all members of a group must be documented explicitly.
|
||||
|
||||
DISTRIBUTE_GROUP_DOC = YES
|
||||
DISTRIBUTE_GROUP_DOC = NO
|
||||
|
||||
# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
|
||||
# the same type (for instance a group of public functions) to be put as a
|
||||
@@ -465,7 +465,7 @@ INPUT = . \
|
||||
support \
|
||||
../../headers/os/midi2 \
|
||||
../../headers/os/support \
|
||||
../../headers/posix/syslog.h
|
||||
../../headers/posix/syslog.h
|
||||
|
||||
# If the value of the INPUT tag contains directories, you can use the
|
||||
# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
|
||||
|
||||
@@ -0,0 +1,279 @@
|
||||
/*!
|
||||
\file Midi2Defs.h
|
||||
\ingroup midi2
|
||||
*/
|
||||
|
||||
/*!
|
||||
\name Channel Message Masks
|
||||
\brief Some definitions to define the raw MIDI events.
|
||||
|
||||
The default implementation of BMidiLocalConsumer::Data() uses these constants
|
||||
to determine which event has been passed on. If you override that method, you
|
||||
may use the constants yourself.
|
||||
*/
|
||||
|
||||
//! @{
|
||||
|
||||
/*!
|
||||
\var B_NOTE_OFF
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_NOTE_ON
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_KEY_PRESSURE
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_CONTROL_CHANGE
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_PROGRAM_CHANGE
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_CHANNEL_PRESSURE
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_PITCH_BEND
|
||||
*/
|
||||
|
||||
//! @}
|
||||
|
||||
|
||||
/*!
|
||||
\name System Messages
|
||||
\brief Some definitions to define the raw MIDI system messages.
|
||||
|
||||
The default implementation of BMidiLocalConsumer::Data() uses these constants
|
||||
to determine which event system message has been passed on. See
|
||||
BMidiLocalProducer::SpraySystemCommon() and BMidiLocalProducer::SpraySystemRealTime()
|
||||
for more details on how and when to use these messages.
|
||||
*/
|
||||
|
||||
//! @{
|
||||
|
||||
/*!
|
||||
\var B_SYS_EX_START
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_MIDI_TIME_CODE
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_SONG_POSITION
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_SONG_SELECT
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_CABLE_MESSAGE
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_TUNE_REQUEST
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_SYS_EX_END
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_TIMING_CLOCK
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_START
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_CONTINUE
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_STOP
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_ACTIVE_SENSING
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_SYSTEM_RESET
|
||||
*/
|
||||
|
||||
//! @}
|
||||
|
||||
/*!
|
||||
\name Controller Numbers
|
||||
\brief Constants that represent specific controller messages.
|
||||
|
||||
These constants can be used in BMidiLocalProducer::SprayControlChange()
|
||||
and BMidiLocalConsumer::ControlChange(). These constants represent the
|
||||
MIDI specification.
|
||||
*/
|
||||
|
||||
//! @{
|
||||
|
||||
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_MODULATION
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_BREATH_CONTROLLER
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_FOOT_CONTROLLER
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_PORTAMENTO_TIME
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_DATA_ENTRY
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_MAIN_VOLUME
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_MIDI_BALANCE
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_PAN
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_EXPRESSION_CTRL
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_GENERAL_CTRL_1
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_GENERAL_CTRL_2
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_GENERAL_CTRL_3
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_GENERAL_CTRL_4
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_SUSTAIN_PEDAL
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_PORTAMENTO
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_SOSTENUTO
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_SOFT_PEDAL
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_HOLD_2
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_GENERAL_CTRL_5
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_GENERAL_CTRL_6
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_TEMPO_CHANGE
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_GENERAL_CTRL_7
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_GENERAL_CTRL_8
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_EFFECTS_DEPTH
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_TREMOLO_DEPTH
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_CHORUS_DEPTH
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_CELESTE_DEPTH
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_PHASER_DEPTH
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_DATA_INCREMENT
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_DATA_DECREMENT
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_RESET_ALL_CONTROLLERS
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_LOCAL_CONTROL
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_ALL_NOTES_OFF
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_OMNI_MODE_OFF
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_OMNI_MODE_ON
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_MONO_MODE_ON
|
||||
*/
|
||||
|
||||
/*!
|
||||
\var B_POLY_MODE_ON
|
||||
*/
|
||||
|
||||
|
||||
//! @}
|
||||
|
||||
|
||||
@@ -288,7 +288,7 @@ as the BeOS R5 kits, although there are a few small differences in the API
|
||||
|
||||
More about the Midi Kit:
|
||||
|
||||
- \subpage midi2defs
|
||||
- \ref Midi2Defs.h
|
||||
- Be Newsletter Volume 3, Issue 47 - Motor Mix sample code
|
||||
- Be Newsletter Volume 4, Issue 3 - Overview of the new kit
|
||||
- <A HREF="http://open-beos.sourceforge.net/nsl.php?mode=display&id=33">OpenBeOS
|
||||
|
||||
@@ -54,3 +54,238 @@ Unfortunately, the Midi Kit provides no easy mechanism for doing any of this,
|
||||
so you are on your own here.
|
||||
|
||||
*/
|
||||
|
||||
/*!
|
||||
\class BMidiLocalConsumer MidiConsumer.h
|
||||
\ingroup midi2
|
||||
\ingroup libmidi2
|
||||
\brief A consumer endpoint that is created by your own application
|
||||
|
||||
If you want to create a consumer that reacts to MIDI events, you should
|
||||
subclass BMidiLocalConsumer.
|
||||
|
||||
Each local consumer has its own thread that receives and dispatches the MIDI
|
||||
events. Whenever MIDI data arrives, the Data() hook passes the MIDI event on to
|
||||
a more specific hook function: NoteOn(), NoteOff(), SystemExclusive(), and so
|
||||
on. Calls to these hook functions are serialized -- they will never have to be
|
||||
re-entrant. They also should not be called from outside the thread that is
|
||||
invoking them.
|
||||
|
||||
Your subclass can override any of the MIDI event hooks. BMidiLocalConsumer
|
||||
doesn't provide default implementations for them, so you don't have to call a
|
||||
hook's default implementation if you override it. For complete control, you can
|
||||
also override Data().
|
||||
|
||||
Most hook functions take a channel argument. Even though MIDI channels are
|
||||
really numbered 1 through 16, the hook functions work with channels 0 through
|
||||
15. The performance time for the event is specified in microseconds relative to
|
||||
the system time base. A performance time that is 0 (or really any time in the
|
||||
past) means "play as soon as possible". See the \ref midi2time "introduction"
|
||||
for more information about timing and consumers.
|
||||
|
||||
The thread driving the consumer's events is a very high priority real time
|
||||
thread. Events should be handled as quickly as possible (not counting
|
||||
snoozing). If non-time-critical computation is needed it may be wise to queue
|
||||
events up for a lower priority thread to handle them external to the main event
|
||||
thread.
|
||||
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BMidiLocalConsumer::BMidiLocalConsumer(const char *name = NULL)
|
||||
\brief Creates a new local consumer endpoint
|
||||
|
||||
The new endpoint is not visible to other applications until you Register() it.
|
||||
|
||||
You can tell the constructor what the name of the new consumer will be. If you
|
||||
pass NULL (or use the default argument), then the consumer's name will be an
|
||||
empty string. It won't be NULL, since endpoint names cannot be NULL.
|
||||
|
||||
There is no guarantee that the endpoint will be successfully created. For
|
||||
example, the Midi Server may not be running. Therefore, you should always call
|
||||
IsValid() after creating a new endpoint to make sure that everything went okay.
|
||||
If not, Release() the object to reclaim memory and abort gracefully.
|
||||
|
||||
\code
|
||||
MyConsumer* cons = new MyConsumer(...);
|
||||
if (!cons->IsValid())
|
||||
{
|
||||
cons->Release();
|
||||
...exit gracefully...
|
||||
}
|
||||
\endcode
|
||||
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalConsumer::SetLatency(bigtime_t latency)
|
||||
\brief Changes the published latency of the consumer
|
||||
\sa Latency()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn int32 BMidiLocalConsumer::GetProducerID()
|
||||
\brief Returns the ID of the producer that most recently sent a MIDI event to
|
||||
this consumer
|
||||
|
||||
You can call this from one of the hooks to determine which producer the event
|
||||
came from.
|
||||
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalConsumer::SetTimeout(bigtime_t when, void* data)
|
||||
\brief Requests that the Timeout() hook will be called at some point
|
||||
|
||||
This method asks the consumer thread to call the Timeout() hook as soon as
|
||||
possible after the timeout expires. For every call to SetTimeout(), the
|
||||
Timeout() hook is only called once. Note: the term "timeout" may be a little
|
||||
misleading; the hook will <I>always</I> be called, even if events are received
|
||||
in the mean time. Apparently, this facility is handy for dealing with early
|
||||
events.
|
||||
|
||||
Note that the event thread blocks on the consumer's port as long as no events
|
||||
arrive. By default no timeout is set, and as a result the thread blocks
|
||||
forever. Your call to SetTimeout() doesn't change this. The new timeout value
|
||||
will go into effect the next time the thread tries to read from the port, i.e.
|
||||
after the first event has been received. If no event ever comes in, the
|
||||
Timeout() hook will never be called. This also means that you cannot cancel a
|
||||
timeout once you have set it. To repeat, calling SetTimeout() only takes effect
|
||||
after at least one new event has been received.
|
||||
|
||||
\param when An absolute time that's measured against the system clock.
|
||||
|
||||
\param data A pointer to a "cookie" that you can pass along to Timeout(). The
|
||||
data is not copied, so you must ensure that the pointer remains valid until
|
||||
Timeout() is called. You typically delete the data inside Timeout().
|
||||
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalConsumer::Timeout(void* data)
|
||||
\brief Hook function that is called per your own request
|
||||
\sa SetTimeout()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalConsumer::Data(
|
||||
uchar* data, size_t length, bool atomic, bigtime_t time)
|
||||
\brief Invoked when raw MIDI is received
|
||||
|
||||
What the default implementation of Data() does depends on the value of atomic.
|
||||
If atomic is true, the data received comprises a single MIDI event; i.e. one
|
||||
status byte followed by the appropriate number of data bytes and nothing else.
|
||||
In this case, Data() calls the event-specific hook function that corresponds to
|
||||
that status byte. This optimization is used by the Midi Kit to allow faster
|
||||
dispatch of events generated by the specific Spray functions from
|
||||
BMidiLocalProducer.
|
||||
|
||||
If atomic is false, Data() ignores the MIDI event. If you want a consumer to
|
||||
handle non-atomic events, you have to override Data() and program this
|
||||
yourself. In that case, you probably also want to call the default
|
||||
implementation to handle the "normal" MIDI events.
|
||||
|
||||
Data() is rarely overridden, but you can override it if you want to. If you do,
|
||||
remember that the data buffer is owned by the Midi Kit. Do not attempt to
|
||||
modify or free it, lest you wish to be laughed at by other developers.
|
||||
|
||||
\param data the MIDI event data
|
||||
\param length byte size of the data buffer
|
||||
\param atomic whether the data buffer contains a single complete MIDI event
|
||||
\param time the requested performance time of the event
|
||||
|
||||
\sa BMidiLocalProducer::SprayData()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalConsumer::NoteOff(
|
||||
uchar channel, uchar note, uchar velocity, bigtime_t time)
|
||||
\brief Invoked when a Note Off event is received
|
||||
\sa BMidiLocalProducer::SprayNoteOff()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalConsumer::NoteOn(
|
||||
uchar channel, uchar note, uchar velocity, bigtime_t time)
|
||||
\brief Invoked when a Note On event is received
|
||||
\sa BMidiLocalProducer::SprayNoteOn()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalConsumer::KeyPressure(
|
||||
uchar channel, uchar note, uchar pressure, bigtime_t time)
|
||||
\brief Invoked when a Polyphonic Pressure (Aftertouch) event is received
|
||||
\sa BMidiLocalProducer::SprayKeyPressure()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalConsumer::ControlChange(
|
||||
uchar channel, uchar controlNumber, uchar controlValue, bigtime_t time)
|
||||
\brief Invoked when a Controller Change event is received
|
||||
\sa BMidiLocalProducer::SprayControlChange()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalConsumer::ProgramChange(
|
||||
uchar channel, uchar programNumber, bigtime_t time)
|
||||
\brief Invoked when a Program Change event is received
|
||||
\sa BMidiLocalProducer::SprayProgramChange()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalConsumer::ChannelPressure(
|
||||
uchar channel, uchar pressure, bigtime_t time)
|
||||
\brief Invoked when a Channel Pressure event is received
|
||||
\sa BMidiLocalProducer::SprayChannelPressure()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalConsumer::PitchBend(
|
||||
uchar channel, uchar lsb, uchar msb, bigtime_t time)
|
||||
\brief Invoked when a Pitch Bend event is received
|
||||
\sa BMidiLocalProducer::SprayPitchBend()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalConsumer::SystemExclusive(
|
||||
void* data, size_t length, bigtime_t time)
|
||||
\brief Invoked when a System Exclusive event is received
|
||||
|
||||
The data does not include the sysex start and end control bytes (0xF0 and 0xF7),
|
||||
only the payload of the sysex message.
|
||||
|
||||
The data belongs to the Midi Kit and is only valid for the duration of this
|
||||
event. You may not modify or free it.
|
||||
|
||||
\sa BMidiLocalProducer::SpraySystemExclusive()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalConsumer::SystemCommon(
|
||||
uchar status, uchar data1, uchar data2, bigtime_t time)
|
||||
\brief Invoked when a System Common event is received
|
||||
|
||||
Not all data bytes are used for all common events. Unused bytes are set to 0.
|
||||
|
||||
\sa BMidiLocalProducer::SpraySystemCommon()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalConsumer::SystemRealTime(
|
||||
uchar status, bigtime_t time)
|
||||
\brief Invoked when a Real Time event is received
|
||||
\sa BMidiLocalProducer::SpraySystemRealTime()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalConsumer::TempoChange(int32 beatsPerMinute, bigtime_t time)
|
||||
\brief Invoked when a Tempo Change event is received
|
||||
\sa BMidiLocalProducer::SprayTempoChange()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalConsumer::AllNotesOff(bool justChannel, bigtime_t time)
|
||||
\brief Not used
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
/*!
|
||||
\page midi2defs Midi Kit definitions (Midi2Defs.h)
|
||||
|
||||
\section channelmasks Channel message masks
|
||||
|
||||
<TABLE BORDER="1">
|
||||
<TR><TD>B_NOTE_OFF</TD><TD>0x80</TD></TR>
|
||||
<TR><TD>B_NOTE_ON</TD><TD>0x90</TD></TR>
|
||||
<TR><TD>B_KEY_PRESSURE</TD><TD>0xa0</TD></TR>
|
||||
<TR><TD>B_CONTROL_CHANGE</TD><TD>0xb0</TD></TR>
|
||||
<TR><TD>B_PROGRAM_CHANGE</TD><TD>0xc0</TD></TR>
|
||||
<TR><TD>B_CHANNEL_PRESSURE</TD><TD>0xd0</TD></TR>
|
||||
<TR><TD>B_PITCH_BEND</TD><TD>0xe0</TD></TR>
|
||||
</TABLE>
|
||||
|
||||
\section systemmessages System messages
|
||||
|
||||
<TABLE BORDER="1">
|
||||
<TR><TD>B_SYS_EX_START</TD><TD>0xf0</TD></TR>
|
||||
<TR><TD>B_MIDI_TIME_CODE</TD><TD>0xf1</TD></TR>
|
||||
<TR><TD>B_SONG_POSITION</TD><TD>0xf2</TD></TR>
|
||||
<TR><TD>B_SONG_SELECT</TD><TD>0xf3</TD></TR>
|
||||
<TR><TD>B_CABLE_MESSAGE</TD><TD>0xf5</TD></TR>
|
||||
<TR><TD>B_TUNE_REQUEST</TD><TD>0xf6</TD></TR>
|
||||
<TR><TD>B_SYS_EX_END</TD><TD>0xf7</TD></TR>
|
||||
<TR><TD>B_TIMING_CLOCK</TD><TD>0xf8</TD></TR>
|
||||
<TR><TD>B_START</TD><TD>0xfa</TD></TR>
|
||||
<TR><TD>B_CONTINUE</TD><TD>0xfb</TD></TR>
|
||||
<TR><TD>B_STOP</TD><TD>0xfc</TD></TR>
|
||||
<TR><TD>B_ACTIVE_SENSING</TD><TD>0xfe</TD></TR>
|
||||
<TR><TD>B_SYSTEM_RESET</TD><TD>0xff</TD></TR>
|
||||
</TABLE>
|
||||
|
||||
\section controllernumbers Controller numbers
|
||||
|
||||
<TABLE BORDER="1">
|
||||
<TR><TD>B_MODULATION</TD><TD>0x01</TD></TR>
|
||||
<TR><TD>B_BREATH_CONTROLLER</TD><TD>0x02</TD></TR>
|
||||
<TR><TD>B_FOOT_CONTROLLER</TD><TD>0x04</TD></TR>
|
||||
<TR><TD>B_PORTAMENTO_TIME</TD><TD>0x05</TD></TR>
|
||||
<TR><TD>B_DATA_ENTRY</TD><TD>0x06</TD></TR>
|
||||
<TR><TD>B_MAIN_VOLUME</TD><TD>0x07</TD></TR>
|
||||
<TR><TD>B_MIDI_BALANCE</TD><TD>0x08</TD></TR>
|
||||
<TR><TD>B_PAN</TD><TD>0x0a</TD></TR>
|
||||
<TR><TD>B_EXPRESSION_CTRL</TD><TD>0x0b</TD></TR>
|
||||
<TR><TD>B_GENERAL_CTRL_1</TD><TD>0x10</TD></TR>
|
||||
<TR><TD>B_GENERAL_CTRL_2</TD><TD>0x11</TD></TR>
|
||||
<TR><TD>B_GENERAL_CTRL_3</TD><TD>0x12</TD></TR>
|
||||
<TR><TD>B_GENERAL_CTRL_4</TD><TD>0x13</TD></TR>
|
||||
<TR><TD>B_SUSTAIN_PEDAL</TD><TD>0x40</TD></TR>
|
||||
<TR><TD>B_PORTAMENTO</TD><TD>0x41</TD></TR>
|
||||
<TR><TD>B_SOSTENUTO</TD><TD>0x42</TD></TR>
|
||||
<TR><TD>B_SOFT_PEDAL</TD><TD>0x43</TD></TR>
|
||||
<TR><TD>B_HOLD_2</TD><TD>0x45</TD></TR>
|
||||
<TR><TD>B_GENERAL_CTRL_5</TD><TD>0x50</TD></TR>
|
||||
<TR><TD>B_GENERAL_CTRL_6</TD><TD>0x51</TD></TR>
|
||||
<TR><TD>B_TEMPO_CHANGE</TD><TD>0x51</TD></TR>
|
||||
<TR><TD>B_GENERAL_CTRL_7</TD><TD>0x52</TD></TR>
|
||||
<TR><TD>B_GENERAL_CTRL_8</TD><TD>0x53</TD></TR>
|
||||
<TR><TD>B_EFFECTS_DEPTH</TD><TD>0x5b</TD></TR>
|
||||
<TR><TD>B_TREMOLO_DEPTH</TD><TD>0x5c</TD></TR>
|
||||
<TR><TD>B_CHORUS_DEPTH</TD><TD>0x5d</TD></TR>
|
||||
<TR><TD>B_CELESTE_DEPTH</TD><TD>0x5e</TD></TR>
|
||||
<TR><TD>B_PHASER_DEPTH</TD><TD>0x5f</TD></TR>
|
||||
<TR><TD>B_DATA_INCREMENT</TD><TD>0x60</TD></TR>
|
||||
<TR><TD>B_DATA_DECREMENT</TD><TD>0x61</TD></TR>
|
||||
<TR><TD>B_RESET_ALL_CONTROLLERS</TD><TD>0x79</TD></TR>
|
||||
<TR><TD>B_LOCAL_CONTROL</TD><TD>0x7a</TD></TR>
|
||||
<TR><TD>B_ALL_NOTES_OFF</TD><TD>0x7b</TD></TR>
|
||||
<TR><TD>B_OMNI_MODE_OFF</TD><TD>0x7c</TD></TR>
|
||||
<TR><TD>B_OMNI_MODE_ON</TD><TD>0x7d</TD></TR>
|
||||
<TR><TD>B_MONO_MODE_ON</TD><TD>0x7e</TD></TR>
|
||||
<TR><TD>B_POLY_MODE_ON</TD><TD>0x7f</TD></TR>
|
||||
</TABLE>
|
||||
|
||||
\section bmidiop BMidiOp
|
||||
|
||||
<TABLE BORDER="1">
|
||||
<TR><TD>B_MIDI_NO_OP</TD></TR>
|
||||
<TR><TD>B_MIDI_REGISTERED</TD></TR>
|
||||
<TR><TD>B_MIDI_UNREGISTERED</TD></TR>
|
||||
<TR><TD>B_MIDI_CONNECTED</TD></TR>
|
||||
<TR><TD>B_MIDI_DISCONNECTED</TD></TR>
|
||||
<TR><TD>B_MIDI_CHANGED_NAME</TD></TR>
|
||||
<TR><TD>B_MIDI_CHANGED_LATENCY</TD></TR>
|
||||
<TR><TD>B_MIDI_CHANGED_PROPERTIES</TD></TR>
|
||||
</TABLE>
|
||||
|
||||
*/
|
||||
@@ -1,232 +0,0 @@
|
||||
/*!
|
||||
\class BMidiLocalConsumer MidiConsumer.h
|
||||
\ingroup midi2
|
||||
\ingroup libmidi2
|
||||
\brief A consumer endpoint that is created by your own application
|
||||
|
||||
If you want to create a consumer that reacts to MIDI events, you should
|
||||
subclass BMidiLocalConsumer.
|
||||
|
||||
Each local consumer has its own thread that receives and dispatches the MIDI
|
||||
events. Whenever MIDI data arrives, the Data() hook passes the MIDI event on to
|
||||
a more specific hook function: NoteOn(), NoteOff(), SystemExclusive(), and so
|
||||
on. Calls to these hook functions are serialized -- they will never have to be
|
||||
re-entrant. They also should not be called from outside the thread that is
|
||||
invoking them.
|
||||
|
||||
Your subclass can override any of the MIDI event hooks. BMidiLocalConsumer
|
||||
doesn't provide default implementations for them, so you don't have to call a
|
||||
hook's default implementation if you override it. For complete control, you can
|
||||
also override Data().
|
||||
|
||||
Most hook functions take a channel argument. Even though MIDI channels are
|
||||
really numbered 1 through 16, the hook functions work with channels 0 through
|
||||
15. The performance time for the event is specified in microseconds relative to
|
||||
the system time base. A performance time that is 0 (or really any time in the
|
||||
past) means "play as soon as possible". See the \ref midi2time "introduction"
|
||||
for more information about timing and consumers.
|
||||
|
||||
The thread driving the consumer's events is a very high priority real time
|
||||
thread. Events should be handled as quickly as possible (not counting
|
||||
snoozing). If non-time-critical computation is needed it may be wise to queue
|
||||
events up for a lower priority thread to handle them external to the main event
|
||||
thread.
|
||||
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BMidiLocalConsumer::BMidiLocalConsumer(const char *name = NULL)
|
||||
\brief Creates a new local consumer endpoint
|
||||
|
||||
The new endpoint is not visible to other applications until you Register() it.
|
||||
|
||||
You can tell the constructor what the name of the new consumer will be. If you
|
||||
pass NULL (or use the default argument), then the consumer's name will be an
|
||||
empty string. It won't be NULL, since endpoint names cannot be NULL.
|
||||
|
||||
There is no guarantee that the endpoint will be successfully created. For
|
||||
example, the Midi Server may not be running. Therefore, you should always call
|
||||
IsValid() after creating a new endpoint to make sure that everything went okay.
|
||||
If not, Release() the object to reclaim memory and abort gracefully.
|
||||
|
||||
\code
|
||||
MyConsumer* cons = new MyConsumer(...);
|
||||
if (!cons->IsValid())
|
||||
{
|
||||
cons->Release();
|
||||
...exit gracefully...
|
||||
}
|
||||
\endcode
|
||||
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalConsumer::SetLatency(bigtime_t latency)
|
||||
\brief Changes the published latency of the consumer
|
||||
\sa Latency()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn int32 BMidiLocalConsumer::GetProducerID()
|
||||
\brief Returns the ID of the producer that most recently sent a MIDI event to
|
||||
this consumer
|
||||
|
||||
You can call this from one of the hooks to determine which producer the event
|
||||
came from.
|
||||
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalConsumer::SetTimeout(bigtime_t when, void* data)
|
||||
\brief Requests that the Timeout() hook will be called at some point
|
||||
|
||||
This method asks the consumer thread to call the Timeout() hook as soon as
|
||||
possible after the timeout expires. For every call to SetTimeout(), the
|
||||
Timeout() hook is only called once. Note: the term "timeout" may be a little
|
||||
misleading; the hook will <I>always</I> be called, even if events are received
|
||||
in the mean time. Apparently, this facility is handy for dealing with early
|
||||
events.
|
||||
|
||||
Note that the event thread blocks on the consumer's port as long as no events
|
||||
arrive. By default no timeout is set, and as a result the thread blocks
|
||||
forever. Your call to SetTimeout() doesn't change this. The new timeout value
|
||||
will go into effect the next time the thread tries to read from the port, i.e.
|
||||
after the first event has been received. If no event ever comes in, the
|
||||
Timeout() hook will never be called. This also means that you cannot cancel a
|
||||
timeout once you have set it. To repeat, calling SetTimeout() only takes effect
|
||||
after at least one new event has been received.
|
||||
|
||||
\param when An absolute time that's measured against the system clock.
|
||||
|
||||
\param data A pointer to a "cookie" that you can pass along to Timeout(). The
|
||||
data is not copied, so you must ensure that the pointer remains valid until
|
||||
Timeout() is called. You typically delete the data inside Timeout().
|
||||
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalConsumer::Timeout(void* data)
|
||||
\brief Hook function that is called per your own request
|
||||
\sa SetTimeout()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalConsumer::Data(
|
||||
uchar* data, size_t length, bool atomic, bigtime_t time)
|
||||
\brief Invoked when raw MIDI is received
|
||||
|
||||
What the default implementation of Data() does depends on the value of atomic.
|
||||
If atomic is true, the data received comprises a single MIDI event; i.e. one
|
||||
status byte followed by the appropriate number of data bytes and nothing else.
|
||||
In this case, Data() calls the event-specific hook function that corresponds to
|
||||
that status byte. This optimization is used by the Midi Kit to allow faster
|
||||
dispatch of events generated by the specific Spray functions from
|
||||
BMidiLocalProducer.
|
||||
|
||||
If atomic is false, Data() ignores the MIDI event. If you want a consumer to
|
||||
handle non-atomic events, you have to override Data() and program this
|
||||
yourself. In that case, you probably also want to call the default
|
||||
implementation to handle the "normal" MIDI events.
|
||||
|
||||
Data() is rarely overridden, but you can override it if you want to. If you do,
|
||||
remember that the data buffer is owned by the Midi Kit. Do not attempt to
|
||||
modify or free it, lest you wish to be laughed at by other developers.
|
||||
|
||||
\param data the MIDI event data
|
||||
\param length byte size of the data buffer
|
||||
\param atomic whether the data buffer contains a single complete MIDI event
|
||||
\param time the requested performance time of the event
|
||||
|
||||
\sa BMidiLocalProducer::SprayData()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalConsumer::NoteOff(
|
||||
uchar channel, uchar note, uchar velocity, bigtime_t time)
|
||||
\brief Invoked when a Note Off event is received
|
||||
\sa BMidiLocalProducer::SprayNoteOff()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalConsumer::NoteOn(
|
||||
uchar channel, uchar note, uchar velocity, bigtime_t time)
|
||||
\brief Invoked when a Note On event is received
|
||||
\sa BMidiLocalProducer::SprayNoteOn()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalConsumer::KeyPressure(
|
||||
uchar channel, uchar note, uchar pressure, bigtime_t time)
|
||||
\brief Invoked when a Polyphonic Pressure (Aftertouch) event is received
|
||||
\sa BMidiLocalProducer::SprayKeyPressure()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalConsumer::ControlChange(
|
||||
uchar channel, uchar controlNumber, uchar controlValue, bigtime_t time)
|
||||
\brief Invoked when a Controller Change event is received
|
||||
\sa BMidiLocalProducer::SprayControlChange()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalConsumer::ProgramChange(
|
||||
uchar channel, uchar programNumber, bigtime_t time)
|
||||
\brief Invoked when a Program Change event is received
|
||||
\sa BMidiLocalProducer::SprayProgramChange()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalConsumer::ChannelPressure(
|
||||
uchar channel, uchar pressure, bigtime_t time)
|
||||
\brief Invoked when a Channel Pressure event is received
|
||||
\sa BMidiLocalProducer::SprayChannelPressure()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalConsumer::PitchBend(
|
||||
uchar channel, uchar lsb, uchar msb, bigtime_t time)
|
||||
\brief Invoked when a Pitch Bend event is received
|
||||
\sa BMidiLocalProducer::SprayPitchBend()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalConsumer::SystemExclusive(
|
||||
void* data, size_t length, bigtime_t time)
|
||||
\brief Invoked when a System Exclusive event is received
|
||||
|
||||
The data does not include the sysex start and end control bytes (0xF0 and 0xF7),
|
||||
only the payload of the sysex message.
|
||||
|
||||
The data belongs to the Midi Kit and is only valid for the duration of this
|
||||
event. You may not modify or free it.
|
||||
|
||||
\sa BMidiLocalProducer::SpraySystemExclusive()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalConsumer::SystemCommon(
|
||||
uchar status, uchar data1, uchar data2, bigtime_t time)
|
||||
\brief Invoked when a System Common event is received
|
||||
|
||||
Not all data bytes are used for all common events. Unused bytes are set to 0.
|
||||
|
||||
\sa BMidiLocalProducer::SpraySystemCommon()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalConsumer::SystemRealTime(
|
||||
uchar status, bigtime_t time)
|
||||
\brief Invoked when a Real Time event is received
|
||||
\sa BMidiLocalProducer::SpraySystemRealTime()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalConsumer::TempoChange(int32 beatsPerMinute, bigtime_t time)
|
||||
\brief Invoked when a Tempo Change event is received
|
||||
\sa BMidiLocalProducer::SprayTempoChange()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalConsumer::AllNotesOff(bool justChannel, bigtime_t time)
|
||||
\brief Not used
|
||||
*/
|
||||
@@ -1,228 +0,0 @@
|
||||
/*!
|
||||
\class BMidiLocalProducer MidiProducer.h
|
||||
\ingroup midi2
|
||||
\ingroup libmidi2
|
||||
\brief A producer endpoint that is created by your own application
|
||||
|
||||
You create a BMidiLocalProducer if you want your application to send MIDI
|
||||
events. You use the various spray functions to send events to all connected
|
||||
consumers. If no consumers are connected to the producer, any calls to the
|
||||
spray functions are ignored.
|
||||
|
||||
Most spray functions accept a channel argument. Even though MIDI channels are
|
||||
really numbered 1 through 16, the spray functions work with channels 0 through
|
||||
15. You can also specify the performance time for the event using the time
|
||||
argument. Specify 0 (or any time in the past) to perform the event "now", i.e.
|
||||
as soon as possible. You can also schedule events to be performed in the
|
||||
future, by passing a time such as system_time() + 5000000, which means 5
|
||||
seconds from now.
|
||||
|
||||
Unlike BMidiLocalConsumer, which should be subclassed almost always, you hardly
|
||||
ever need to derive a class from BMidiLocalProducer. The only reason for
|
||||
subclassing is when you need to know when the producer gets connected or
|
||||
disconnected.
|
||||
|
||||
Also unlike consumers, local producers have no thread of control directly
|
||||
associated with them. If you want to send out the MIDI events from a different
|
||||
thread, you will have to create one yourself.
|
||||
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BMidiLocalProducer::BMidiLocalProducer(const char *name = NULL)
|
||||
\brief Creates a new local producer endpoint
|
||||
|
||||
The new endpoint is not visible to other applications until you Register() it.
|
||||
|
||||
You can tell the constructor what the name of the new producer will be. If you
|
||||
pass NULL (or use the default argument), then the producer's name will be an
|
||||
empty string. It won't be NULL, since endpoint names cannot be NULL.
|
||||
|
||||
There is no guarantee that the endpoint will be successfully created. For
|
||||
example, the Midi Server may not be running. Therefore, you should always call
|
||||
IsValid() after creating a new endpoint to make sure that everything went okay.
|
||||
If not, Release() the object to reclaim memory and abort gracefully.
|
||||
|
||||
\code
|
||||
BMidiLocalProducer* prod = new BMidiLocalProducer(...);
|
||||
if (!prod->IsValid())
|
||||
{
|
||||
prod->Release();
|
||||
...exit gracefully...
|
||||
}
|
||||
\endcode
|
||||
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalProducer::Connected(BMidiConsumer* cons)
|
||||
\brief Invoked when a new consumer is connected to this producer
|
||||
|
||||
Although typical notifications (i.e. from BMidiRoster's "watching" facility)
|
||||
are only sent if it is some other app that is performing the operation,
|
||||
Connected() is also called if you are making the connection yourself.
|
||||
|
||||
If you override this hook, you don't have to call the default implementation,
|
||||
because that does nothing.
|
||||
|
||||
\param cons The newly connected consumer. The reference count of the consumer
|
||||
object is not increased, so you should not Release() it. However, if you want
|
||||
to keep track of the consumer beyond this function, you should first Acquire()
|
||||
it, and Release() it when you are done.
|
||||
|
||||
\sa Disconnected()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalProducer::Disconnected(BMidiConsumer* cons)
|
||||
\brief Invoked when a consumer is disconnected from this producer
|
||||
\sa Connected()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalProducer::SprayData(
|
||||
void* data, size_t length, bool atomic = false, bigtime_t time = 0) const
|
||||
\brief Sends raw MIDI data downstream to all connected consumers
|
||||
|
||||
Typically you won't have to call SprayData(); the other spray functions will do
|
||||
just fine. If you do call it, remember that you retain ownership of the data
|
||||
and that you are responsible for freeing it at some point. (Even though data is
|
||||
not declared const, the function does not change it.)
|
||||
|
||||
With atomic set to false, you can send a MIDI message in segments (perhaps for
|
||||
a large sysex dump). However, when you do this, you are on your own. The Midi
|
||||
Kit only tags the data as being non-atomic, but offers no additional support.
|
||||
The default implementation of BMidiLocalConsumer completely ignores such
|
||||
events. To handle non-atomic MIDI data, you should override the
|
||||
BMidiLocalConsumer::Data() hook and process the MIDI event yourself. All of
|
||||
BMidiLocalProducer's other spray functions always send atomic data.
|
||||
|
||||
\param data the MIDI event data
|
||||
\param length byte size of the data buffer
|
||||
\param atomic whether the data buffer contains a single complete MIDI event
|
||||
\param time the required performance time of the event
|
||||
|
||||
\sa BMidiLocalConsumer::Data()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalProducer::SprayNoteOff(
|
||||
uchar channel, uchar note, uchar velocity, bigtime_t time = 0) const
|
||||
\brief Sends a Note Off event to all connected consumers
|
||||
\sa BMidiLocalConsumer::NoteOff()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalProducer::SprayNoteOn(
|
||||
uchar channel, uchar note, uchar velocity, bigtime_t time = 0) const
|
||||
\brief Sends a Note On event to all connected consumers
|
||||
\sa BMidiLocalConsumer::NoteOn()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalProducer::SprayKeyPressure(
|
||||
uchar channel, uchar note, uchar pressure, bigtime_t time = 0) const
|
||||
\brief Sends a Polyphonic Pressure (Aftertouch) event to all connected
|
||||
consumers
|
||||
\sa BMidiLocalConsumer::KeyPressure()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalProducer::SprayControlChange(
|
||||
uchar channel, uchar controlNumber, uchar controlValue,
|
||||
bigtime_t time = 0) const
|
||||
\brief Sends a Controller Change event to all connected consumers
|
||||
|
||||
\sa \ref controllernumbers
|
||||
\sa BMidiLocalConsumer::ControlChange()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalProducer::SprayProgramChange(
|
||||
uchar channel, uchar programNumber, bigtime_t time = 0) const
|
||||
\brief Sends a Program Change event to all connected consumers
|
||||
\sa BMidiLocalConsumer::ProgramChange()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalProducer::SprayChannelPressure(
|
||||
uchar channel, uchar pressure, bigtime_t time = 0) const
|
||||
\brief Sends a Channel Pressure event to all connected consumers
|
||||
\sa BMidiLocalConsumer::ChannelPressure()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalProducer::SprayPitchBend(
|
||||
uchar channel, uchar lsb, uchar msb, bigtime_t time = 0) const
|
||||
\brief Sends a Pitch Bend event to all connected consumers
|
||||
\sa BMidiLocalConsumer::PitchBend()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalProducer::SpraySystemExclusive(
|
||||
void* data, size_t length, bigtime_t time = 0) const
|
||||
\brief Sends a System Exclusive event to all connected consumers
|
||||
|
||||
You retain ownership of the data and are responsible for freeing it. Even
|
||||
though data is not declared const, the function does not change it. Even though
|
||||
the amount of data may be quite large, this function always sends sysex
|
||||
messages as an atomic block of data.
|
||||
|
||||
\sa BMidiLocalConsumer::SystemExclusive()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalProducer::SpraySystemCommon(
|
||||
uchar status, uchar data1, uchar data2, bigtime_t time = 0) const
|
||||
\brief Sends a System Common event to the connected consumers
|
||||
|
||||
The status byte must be one of the following:
|
||||
|
||||
<TABLE BORDER="1">
|
||||
<TR><TD>0xF1</TD><TD>B_MIDI_TIME_CODE</TD><TD>data1 only</TD></TR>
|
||||
<TR><TD>0xF2</TD><TD>B_SONG_POSITION</TD><TD>data1 and data2</TD></TR>
|
||||
<TR><TD>0xF3</TD><TD>B_SONG_SELECT</TD><TD>data1 only</TD></TR>
|
||||
<TR><TD>0xF5</TD><TD>B_CABLE_MESSAGE</TD><TD>data1 only</TD></TR>
|
||||
<TR><TD>0xF6</TD><TD>B_TUNE_REQUEST</TD><TD>no data</TD></TR>
|
||||
<TR><TD>0xF7</TD><TD>B_SYS_EX_END</TD><TD>no data</TD></TR>
|
||||
</TABLE>
|
||||
|
||||
\sa BMidiLocalConsumer::SystemCommon()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalProducer::SpraySystemRealTime(
|
||||
uchar status, bigtime_t time = 0) const
|
||||
\brief Sends a Real Time event to the connected consumers
|
||||
|
||||
The status byte must be one of the following:
|
||||
|
||||
<TABLE BORDER="1">
|
||||
<TR><TD>0xF8</TD><TD>B_TIMING_CLOCK</TD></TR>
|
||||
<TR><TD>0xFA</TD><TD>B_START</TD></TR>
|
||||
<TR><TD>0xFB</TD><TD>B_CONTINUE</TD></TR>
|
||||
<TR><TD>0xFC</TD><TD>B_STOP</TD></TR>
|
||||
<TR><TD>0xFE</TD><TD>B_ACTIVE_SENSING</TD></TR>
|
||||
<TR><TD>0xFF</TD><TD>B_SYSTEM_RESET</TD></TR>
|
||||
</TABLE>
|
||||
|
||||
Because of their high priority, the MIDI specification allows real time
|
||||
messages to "interleave" with other MIDI messages. A large sysex dump, for
|
||||
example, may be interrupted by a real time event. The Midi Kit, however,
|
||||
doesn't care. If you (or another producer) have just sent a big system
|
||||
exclusive to a consumer, any following real time message will simply have to
|
||||
wait until the consumer has dealt with the sysex.
|
||||
|
||||
\sa BMidiLocalConsumer::SystemRealTime()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalProducer::SprayTempoChange(
|
||||
int32 bpm, bigtime_t time = 0) const
|
||||
\brief Sends a Tempo Change event to the connected consumers.
|
||||
|
||||
This kind of Tempo Change event is not really part of the MIDI spec, rather
|
||||
it is an extension from the SMF (Standard MIDI File) format.
|
||||
|
||||
\sa BMidiLocalConsumer::TempoChange()
|
||||
*/
|
||||
@@ -75,3 +75,234 @@ list have their reference counts bumped, so you need to Release() them before
|
||||
you delete the list or they will go all leaky on you.
|
||||
|
||||
*/
|
||||
|
||||
/*!
|
||||
\class BMidiLocalProducer MidiProducer.h
|
||||
\ingroup midi2
|
||||
\ingroup libmidi2
|
||||
\brief A producer endpoint that is created by your own application
|
||||
|
||||
You create a BMidiLocalProducer if you want your application to send MIDI
|
||||
events. You use the various spray functions to send events to all connected
|
||||
consumers. If no consumers are connected to the producer, any calls to the
|
||||
spray functions are ignored.
|
||||
|
||||
Most spray functions accept a channel argument. Even though MIDI channels are
|
||||
really numbered 1 through 16, the spray functions work with channels 0 through
|
||||
15. You can also specify the performance time for the event using the time
|
||||
argument. Specify 0 (or any time in the past) to perform the event "now", i.e.
|
||||
as soon as possible. You can also schedule events to be performed in the
|
||||
future, by passing a time such as system_time() + 5000000, which means 5
|
||||
seconds from now.
|
||||
|
||||
Unlike BMidiLocalConsumer, which should be subclassed almost always, you hardly
|
||||
ever need to derive a class from BMidiLocalProducer. The only reason for
|
||||
subclassing is when you need to know when the producer gets connected or
|
||||
disconnected.
|
||||
|
||||
Also unlike consumers, local producers have no thread of control directly
|
||||
associated with them. If you want to send out the MIDI events from a different
|
||||
thread, you will have to create one yourself.
|
||||
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BMidiLocalProducer::BMidiLocalProducer(const char *name = NULL)
|
||||
\brief Creates a new local producer endpoint
|
||||
|
||||
The new endpoint is not visible to other applications until you Register() it.
|
||||
|
||||
You can tell the constructor what the name of the new producer will be. If you
|
||||
pass NULL (or use the default argument), then the producer's name will be an
|
||||
empty string. It won't be NULL, since endpoint names cannot be NULL.
|
||||
|
||||
There is no guarantee that the endpoint will be successfully created. For
|
||||
example, the Midi Server may not be running. Therefore, you should always call
|
||||
IsValid() after creating a new endpoint to make sure that everything went okay.
|
||||
If not, Release() the object to reclaim memory and abort gracefully.
|
||||
|
||||
\code
|
||||
BMidiLocalProducer* prod = new BMidiLocalProducer(...);
|
||||
if (!prod->IsValid())
|
||||
{
|
||||
prod->Release();
|
||||
...exit gracefully...
|
||||
}
|
||||
\endcode
|
||||
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalProducer::Connected(BMidiConsumer* cons)
|
||||
\brief Invoked when a new consumer is connected to this producer
|
||||
|
||||
Although typical notifications (i.e. from BMidiRoster's "watching" facility)
|
||||
are only sent if it is some other app that is performing the operation,
|
||||
Connected() is also called if you are making the connection yourself.
|
||||
|
||||
If you override this hook, you don't have to call the default implementation,
|
||||
because that does nothing.
|
||||
|
||||
\param cons The newly connected consumer. The reference count of the consumer
|
||||
object is not increased, so you should not Release() it. However, if you want
|
||||
to keep track of the consumer beyond this function, you should first Acquire()
|
||||
it, and Release() it when you are done.
|
||||
|
||||
\sa Disconnected()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalProducer::Disconnected(BMidiConsumer* cons)
|
||||
\brief Invoked when a consumer is disconnected from this producer
|
||||
\sa Connected()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalProducer::SprayData(
|
||||
void* data, size_t length, bool atomic = false, bigtime_t time = 0) const
|
||||
\brief Sends raw MIDI data downstream to all connected consumers
|
||||
|
||||
Typically you won't have to call SprayData(); the other spray functions will do
|
||||
just fine. If you do call it, remember that you retain ownership of the data
|
||||
and that you are responsible for freeing it at some point. (Even though data is
|
||||
not declared const, the function does not change it.)
|
||||
|
||||
With atomic set to false, you can send a MIDI message in segments (perhaps for
|
||||
a large sysex dump). However, when you do this, you are on your own. The Midi
|
||||
Kit only tags the data as being non-atomic, but offers no additional support.
|
||||
The default implementation of BMidiLocalConsumer completely ignores such
|
||||
events. To handle non-atomic MIDI data, you should override the
|
||||
BMidiLocalConsumer::Data() hook and process the MIDI event yourself. All of
|
||||
BMidiLocalProducer's other spray functions always send atomic data.
|
||||
|
||||
\param data the MIDI event data
|
||||
\param length byte size of the data buffer
|
||||
\param atomic whether the data buffer contains a single complete MIDI event
|
||||
\param time the required performance time of the event
|
||||
|
||||
\sa BMidiLocalConsumer::Data()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalProducer::SprayNoteOff(
|
||||
uchar channel, uchar note, uchar velocity, bigtime_t time = 0) const
|
||||
\brief Sends a Note Off event to all connected consumers
|
||||
\sa BMidiLocalConsumer::NoteOff()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalProducer::SprayNoteOn(
|
||||
uchar channel, uchar note, uchar velocity, bigtime_t time = 0) const
|
||||
\brief Sends a Note On event to all connected consumers
|
||||
\sa BMidiLocalConsumer::NoteOn()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalProducer::SprayKeyPressure(
|
||||
uchar channel, uchar note, uchar pressure, bigtime_t time = 0) const
|
||||
\brief Sends a Polyphonic Pressure (Aftertouch) event to all connected
|
||||
consumers
|
||||
\sa BMidiLocalConsumer::KeyPressure()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalProducer::SprayControlChange(
|
||||
uchar channel, uchar controlNumber, uchar controlValue,
|
||||
bigtime_t time = 0) const
|
||||
\brief Sends a Controller Change event to all connected consumers
|
||||
|
||||
\sa Midi2Defs.h
|
||||
\sa BMidiLocalConsumer::ControlChange()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalProducer::SprayProgramChange(
|
||||
uchar channel, uchar programNumber, bigtime_t time = 0) const
|
||||
\brief Sends a Program Change event to all connected consumers
|
||||
\sa BMidiLocalConsumer::ProgramChange()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalProducer::SprayChannelPressure(
|
||||
uchar channel, uchar pressure, bigtime_t time = 0) const
|
||||
\brief Sends a Channel Pressure event to all connected consumers
|
||||
\sa BMidiLocalConsumer::ChannelPressure()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalProducer::SprayPitchBend(
|
||||
uchar channel, uchar lsb, uchar msb, bigtime_t time = 0) const
|
||||
\brief Sends a Pitch Bend event to all connected consumers
|
||||
\sa BMidiLocalConsumer::PitchBend()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalProducer::SpraySystemExclusive(
|
||||
void* data, size_t length, bigtime_t time = 0) const
|
||||
\brief Sends a System Exclusive event to all connected consumers
|
||||
|
||||
You retain ownership of the data and are responsible for freeing it. Even
|
||||
though data is not declared const, the function does not change it. Even though
|
||||
the amount of data may be quite large, this function always sends sysex
|
||||
messages as an atomic block of data.
|
||||
|
||||
\sa BMidiLocalConsumer::SystemExclusive()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalProducer::SpraySystemCommon(
|
||||
uchar status, uchar data1, uchar data2, bigtime_t time = 0) const
|
||||
\brief Sends a System Common event to the connected consumers
|
||||
|
||||
The status byte must be one of the following:
|
||||
|
||||
<TABLE BORDER="1">
|
||||
<TR><TD>0xF1</TD><TD>B_MIDI_TIME_CODE</TD><TD>data1 only</TD></TR>
|
||||
<TR><TD>0xF2</TD><TD>B_SONG_POSITION</TD><TD>data1 and data2</TD></TR>
|
||||
<TR><TD>0xF3</TD><TD>B_SONG_SELECT</TD><TD>data1 only</TD></TR>
|
||||
<TR><TD>0xF5</TD><TD>B_CABLE_MESSAGE</TD><TD>data1 only</TD></TR>
|
||||
<TR><TD>0xF6</TD><TD>B_TUNE_REQUEST</TD><TD>no data</TD></TR>
|
||||
<TR><TD>0xF7</TD><TD>B_SYS_EX_END</TD><TD>no data</TD></TR>
|
||||
</TABLE>
|
||||
|
||||
\sa BMidiLocalConsumer::SystemCommon()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalProducer::SpraySystemRealTime(
|
||||
uchar status, bigtime_t time = 0) const
|
||||
\brief Sends a Real Time event to the connected consumers
|
||||
|
||||
The status byte must be one of the following:
|
||||
|
||||
<TABLE BORDER="1">
|
||||
<TR><TD>0xF8</TD><TD>B_TIMING_CLOCK</TD></TR>
|
||||
<TR><TD>0xFA</TD><TD>B_START</TD></TR>
|
||||
<TR><TD>0xFB</TD><TD>B_CONTINUE</TD></TR>
|
||||
<TR><TD>0xFC</TD><TD>B_STOP</TD></TR>
|
||||
<TR><TD>0xFE</TD><TD>B_ACTIVE_SENSING</TD></TR>
|
||||
<TR><TD>0xFF</TD><TD>B_SYSTEM_RESET</TD></TR>
|
||||
</TABLE>
|
||||
|
||||
Because of their high priority, the MIDI specification allows real time
|
||||
messages to "interleave" with other MIDI messages. A large sysex dump, for
|
||||
example, may be interrupted by a real time event. The Midi Kit, however,
|
||||
doesn't care. If you (or another producer) have just sent a big system
|
||||
exclusive to a consumer, any following real time message will simply have to
|
||||
wait until the consumer has dealt with the sysex.
|
||||
|
||||
\sa BMidiLocalConsumer::SystemRealTime()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BMidiLocalProducer::SprayTempoChange(
|
||||
int32 bpm, bigtime_t time = 0) const
|
||||
\brief Sends a Tempo Change event to the connected consumers.
|
||||
|
||||
This kind of Tempo Change event is not really part of the MIDI spec, rather
|
||||
it is an extension from the SMF (Standard MIDI File) format.
|
||||
|
||||
\sa BMidiLocalConsumer::TempoChange()
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@@ -257,7 +257,7 @@ void MyView::MessageReceived(BMessage* msg)
|
||||
}
|
||||
\endcode
|
||||
|
||||
\sa \ref bmidiop "The possible be:op codes (BMidiOp)"
|
||||
For the possible midi options, see #BMidiOp
|
||||
*/
|
||||
|
||||
/*!
|
||||
@@ -292,3 +292,12 @@ There is no real reason use this function, since all BMidiRoster's public
|
||||
function are static.
|
||||
|
||||
*/
|
||||
|
||||
/*!
|
||||
\enum BMidiOp
|
||||
\brief Defines the status codes for MIDI Server notification messages.
|
||||
|
||||
These codes are used when you request notification as in BMidiRoster::StartWatching().
|
||||
Check against these codes to determine what is happening. See the StartWatching() method
|
||||
for a more complete description of the codes and their meaning.
|
||||
*/
|
||||
|
||||
@@ -15,9 +15,9 @@ BString is a string allocation and manipulation class. The object
|
||||
takes care to allocate and free memory for you, so it will always be
|
||||
"big enough" to store your strings.
|
||||
|
||||
\author <a href='mailto:[email protected]>Marc Flerackers</a>
|
||||
\author <a href='mailto:[email protected]>Stefano Ceccherini</a>
|
||||
\author <a href='mailto:[email protected]>Oliver Tappe</a>
|
||||
\author Marc Flerackers \<[email protected]\>
|
||||
\author Stefano Ceccherini \<[email protected]\>
|
||||
\author Oliver Tappe \<[email protected]\>
|
||||
*/
|
||||
|
||||
/*!
|
||||
@@ -57,10 +57,13 @@ string.
|
||||
Frees the memory allocated by the BString object.
|
||||
*/
|
||||
|
||||
/*! @{
|
||||
|
||||
/*!
|
||||
\name Access Methods
|
||||
*/
|
||||
|
||||
//! @{
|
||||
|
||||
/*!
|
||||
\fn const char* BString::String() const
|
||||
\brief Returns a pointer to the object string, NULL terminated.
|
||||
@@ -88,10 +91,13 @@ Counts the number of UTF8 characters contained in the string.
|
||||
|
||||
//! @}
|
||||
|
||||
/*! @{
|
||||
|
||||
/*!
|
||||
\name Assignment Methods
|
||||
*/
|
||||
|
||||
//! @{
|
||||
|
||||
/*!
|
||||
\fn BString& BString::operator=(const BString &string)
|
||||
\brief Makes a copy of the given BString object.
|
||||
@@ -159,14 +165,20 @@ Counts the number of UTF8 characters contained in the string.
|
||||
\return The function always returns \c *this .
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString &BString::SetTo(const char *str)
|
||||
*/
|
||||
|
||||
//! @}
|
||||
|
||||
|
||||
/*! @{
|
||||
/*!
|
||||
\name Substring Copying
|
||||
*/
|
||||
|
||||
\*!
|
||||
//! @{
|
||||
|
||||
/*!
|
||||
\fn BString &BString::CopyInto(BString &into, int32 fromOffset, int32 length) const
|
||||
\brief Copy the BString data (or part of it) into another BString.
|
||||
\param into The BString where to copy the object.
|
||||
@@ -184,3 +196,800 @@ Counts the number of UTF8 characters contained in the string.
|
||||
*/
|
||||
|
||||
//! @}
|
||||
|
||||
/*!
|
||||
\name Appending Methods
|
||||
*/
|
||||
|
||||
//! @{
|
||||
|
||||
/*!
|
||||
\fn BString& BString::operator+=(const char *str)
|
||||
\brief Appends the given string to the object.
|
||||
\param str A pointer to the string to append.
|
||||
\return This function always returns *this .
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::operator+=(char c)
|
||||
\brief Appends the given character to the object.
|
||||
\param c The character to append.
|
||||
\return This function always returns *this .
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString & BString::operator+=(const BString &string)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString &BString::Append(const BString &string)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString &BString::Append(const char *str)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::Append(const BString &string, int32 length)
|
||||
\brief Appends the given BString to the object.
|
||||
\param string The BString to append.
|
||||
\param length The maximum bytes to get from the original object.
|
||||
\return This function always returns *this .
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::Append(const char *str, int32 length)
|
||||
\brief Appends the given string to the object.
|
||||
\param str A pointer to the string to append.
|
||||
\param length The maximum bytes to get from the original string.
|
||||
\return This function always returns *this .
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::Append(char c, int32 count)
|
||||
\brief Appends the given character to the object.
|
||||
\param c The character to append.
|
||||
\param count The number of characters to append.
|
||||
\return This function always returns *this .
|
||||
*/
|
||||
|
||||
//! @}
|
||||
|
||||
|
||||
/*!
|
||||
\name Prepending Methods
|
||||
*/
|
||||
|
||||
//! @{
|
||||
|
||||
/*!
|
||||
\fn BString& BString::Prepend(const char *str)
|
||||
\brief Prepends the given string to the object.
|
||||
\param str A pointer to the string to prepend.
|
||||
\return This function always returns *this .
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::Prepend(const BString &string)
|
||||
\brief Prepends the given BString to the object.
|
||||
\param string The BString object to prepend.
|
||||
\return This function always returns *this .
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::Prepend(const char *str, int32 length)
|
||||
\brief Prepends the given string to the object.
|
||||
\param str A pointer to the string to prepend.
|
||||
\param length The maximum amount of bytes to get from the string.
|
||||
\return This function always returns *this .
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::Prepend(const BString &string, int32 len)
|
||||
\brief Prepends the given BString to the object.
|
||||
\param string The BString object to prepend.
|
||||
\param len The maximum amount of bytes to get from the BString.
|
||||
\return This function always returns *this .
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::Prepend(char c, int32 count)
|
||||
\brief Prepends the given character to the object.
|
||||
\param c The character to prepend.
|
||||
\param count The amount of characters to prepend.
|
||||
\return This function always returns *this .
|
||||
*/
|
||||
|
||||
//! @}
|
||||
|
||||
|
||||
/*!
|
||||
\name Inserting Methods
|
||||
*/
|
||||
|
||||
//! @{
|
||||
|
||||
/*!
|
||||
\fn BString& BString::Insert(const char *str, int32 pos)
|
||||
\brief Inserts the given string at the given position into the object's data.
|
||||
\param str A pointer to the string to insert.
|
||||
\param pos The offset into the BString's data where to insert the string.
|
||||
\return This function always returns *this .
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::Insert(const char *str, int32 length, int32 pos)
|
||||
\brief Inserts the given string at the given position into the object's data.
|
||||
\param str A pointer to the string to insert.
|
||||
\param length The amount of bytes to insert.
|
||||
\param pos The offset into the BString's data where to insert the string.
|
||||
\return This function always returns *this .
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::Insert(const char *str, int32 fromOffset, int32 length, int32 pos)
|
||||
\brief Inserts the given string at the given position into the object's data.
|
||||
\param str A pointer to the string to insert.
|
||||
\param fromOffset
|
||||
\param length The amount of bytes to insert.
|
||||
\param pos The offset into the BString's data where to insert the string.
|
||||
\return This function always returns *this .
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::Insert(const BString &string, int32 pos)
|
||||
\brief Inserts the given BString at the given position into the object's data.
|
||||
\param string The BString object to insert.
|
||||
\param pos The offset into the BString's data where to insert the string.
|
||||
\return This function always returns *this .
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::Insert(const BString &string, int32 length, int32 pos)
|
||||
\brief Inserts the given BString at the given position into the object's data.
|
||||
\param string The BString object to insert.
|
||||
\param length The amount of bytes to insert.
|
||||
\param pos The offset into the BString's data where to insert the string.
|
||||
\return This function always returns *this .
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::Insert(const BString &string, int32 fromOffset, int32 length, int32 pos)
|
||||
\brief Inserts the given string at the given position into the object's data.
|
||||
\param string The BString object to insert.
|
||||
\param fromOffset
|
||||
\param length The amount of bytes to insert.
|
||||
\param pos The offset into the BString's data where to insert the string.
|
||||
\return This function always returns *this .
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::Insert(char c, int32 count, int32 pos)
|
||||
\brief Inserts the given character at the given position into the object's data.
|
||||
\param c The character to insert.
|
||||
\param count The amount of bytes to insert.
|
||||
\param pos The offset into the BString's data where to insert the string.
|
||||
\return This function always returns *this .
|
||||
*/
|
||||
|
||||
//! @}
|
||||
|
||||
|
||||
/*!
|
||||
\name Removing Methods
|
||||
*/
|
||||
|
||||
//! @{
|
||||
|
||||
/*!
|
||||
\fn BString& BString::Truncate(int32 newLength, bool lazy)
|
||||
\brief Truncate the string to the new length.
|
||||
\param newLength The new lenght of the string.
|
||||
\param lazy If true, the memory-optimisation is postponed to later
|
||||
\return This function always returns *this .
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::Remove(int32 from, int32 length)
|
||||
\brief Removes some bytes, starting at the given offset
|
||||
\param from The offset from which you want to start removing
|
||||
\param length The number of bytes to remove
|
||||
\return This function always returns *this .
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::RemoveFirst(const BString &string)
|
||||
\brief Removes the first occurrence of the given BString.
|
||||
\param string The BString to remove.
|
||||
\return This function always returns *this .
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::RemoveLast(const BString &string)
|
||||
\brief Removes the last occurrence of the given BString.
|
||||
\param string The BString to remove.
|
||||
\return This function always returns *this .
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::RemoveAll(const BString &string)
|
||||
\brief Removes all occurrences of the given BString.
|
||||
\param string The BString to remove.
|
||||
\return This function always returns *this .
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::RemoveFirst(const char *string)
|
||||
\brief Removes the first occurrence of the given string.
|
||||
\param string A pointer to the string to remove.
|
||||
\return This function always returns *this .
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::RemoveLast(const char *string)
|
||||
\brief Removes the last occurrence of the given string.
|
||||
\param string A pointer to the string to remove.
|
||||
\return This function always returns *this .
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::RemoveAll(const char *str)
|
||||
\brief Removes all occurrences of the given string.
|
||||
\param str A pointer to the string to remove.
|
||||
\return This function always returns *this .
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::RemoveSet(const char *setOfCharsToRemove)
|
||||
\brief Removes all the characters specified.
|
||||
\param setOfCharsToRemove The set of characters to remove.
|
||||
\return This function always returns *this .
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::MoveInto(BString &into, int32 from, int32 length)
|
||||
\brief Move the BString data (or part of it) into another BString.
|
||||
\param into The BString where to move the object.
|
||||
\param from The offset (zero based) where to begin the move
|
||||
\param length The amount of bytes to move.
|
||||
\return This function always returns into.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BString::MoveInto(char *into, int32 from, int32 length)
|
||||
\brief Move the BString data (or part of it) into the given buffer.
|
||||
\param into The buffer where to move the object.
|
||||
\param from The offset (zero based) where to begin the move
|
||||
\param length The amount of bytes to move.
|
||||
*/
|
||||
|
||||
//! @}
|
||||
|
||||
|
||||
/*!
|
||||
\name Comparison Methods
|
||||
*/
|
||||
|
||||
//! @{
|
||||
|
||||
/*!
|
||||
\fn bool BString::operator<(const char *string) const
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn bool BString::operator<(const BString &string) const
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn bool BString::operator<=(const char *string) const
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn bool BString::operator<=(const BString &string) const
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn bool BString::operator==(const char *string) const
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn bool BString::operator==(const BString &string) const
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn bool BString::operator>=(const char *string) const
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn bool BString::operator>=(const BString &string) const
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn bool BString::operator>(const char *string) const
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn bool BString::operator>(const BString &string) const
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn bool BString::operator!=(const BString &string) const
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn bool BString::operator!=(const char *str) const
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn int BString::Compare(const BString &string) const
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn int BString::Compare(const char *string) const
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn int BString::Compare(const BString &string, int32 n) const
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn int BString::Compare(const char *string, int32 n) const
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn int BString::ICompare(const BString &string) const
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn int BString::ICompare(const char *str) const
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn int BString::ICompare(const BString &string, int32 n) const
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn int BString::ICompare(const char *str, int32 n) const
|
||||
*/
|
||||
|
||||
//! @}
|
||||
|
||||
|
||||
/*!
|
||||
\name Searching Methods
|
||||
*/
|
||||
|
||||
//! @{
|
||||
|
||||
/*!
|
||||
\fn int32 BString::FindFirst(const BString &string) const
|
||||
\brief Find the first occurrence of the given BString.
|
||||
\param string The BString to search for.
|
||||
\return The offset(zero based) into the data
|
||||
where the given BString has been found.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn int32 BString::FindFirst(const char *string) const
|
||||
\brief Find the first occurrence of the given string.
|
||||
\param string The string to search for.
|
||||
\return The offset(zero based) into the data
|
||||
where the given string has been found.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn int32 BString::FindFirst(const BString &string, int32 fromOffset) const
|
||||
\brief Find the first occurrence of the given BString,
|
||||
starting from the given offset.
|
||||
\param string The BString to search for.
|
||||
\param fromOffset The offset where to start the search.
|
||||
\return An integer which is the offset(zero based) into the data
|
||||
where the given BString has been found.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn int32 BString::FindFirst(const char *string, int32 fromOffset) const
|
||||
\brief Find the first occurrence of the given string,
|
||||
starting from the given offset.
|
||||
\param string The string to search for.
|
||||
\param fromOffset The offset where to start the search.
|
||||
\return The offset(zero based) into the data
|
||||
where the given string has been found.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn int32 BString::FindFirst(char c) const
|
||||
\brief Find the first occurrence of the given character.
|
||||
\param c The character to search for.
|
||||
\return The offset(zero based) into the data
|
||||
where the given character has been found.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn int32 BString::FindFirst(char c, int32 fromOffset) const
|
||||
\brief Find the first occurrence of the given character,
|
||||
starting from the given offset.
|
||||
\param c The character to search for.
|
||||
\param fromOffset The offset where to start the search.
|
||||
\return The offset(zero based) into the data
|
||||
where the given character has been found.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn int32 BString::FindLast(const BString &string) const
|
||||
\brief Find the last occurrence of the given BString.
|
||||
\param string The BString to search for.
|
||||
\return The offset(zero based) into the data
|
||||
where the given BString has been found.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn int32 BString::FindLast(const char *string) const
|
||||
\brief Find the last occurrence of the given string.
|
||||
\param string The string to search for.
|
||||
\return The offset(zero based) into the data
|
||||
where the given string has been found.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn int32 BString::FindLast(const BString &string, int32 beforeOffset) const
|
||||
\brief Find the last occurrence of the given BString,
|
||||
starting from the given offset, and going backwards.
|
||||
\param string The BString to search for.
|
||||
\param beforeOffset The offset where to start the search.
|
||||
\return An integer which is the offset(zero based) into the data
|
||||
where the given BString has been found.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn int32 BString::FindLast(const char *string, int32 beforeOffset) const
|
||||
\brief Find the last occurrence of the given string,
|
||||
starting from the given offset, and going backwards.
|
||||
\param string The string to search for.
|
||||
\param beforeOffset The offset where to start the search.
|
||||
\return The offset(zero based) into the data
|
||||
where the given string has been found.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn int32 BString::FindLast(char c) const
|
||||
\brief Find the last occurrence of the given character.
|
||||
\param c The character to search for.
|
||||
\return The offset(zero based) into the data
|
||||
where the given character has been found.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn int32 BString::FindLast(char c, int32 beforeOffset) const
|
||||
\brief Find the last occurrence of the given character,
|
||||
starting from the given offset and going backwards.
|
||||
\param c The character to search for.
|
||||
\param beforeOffset The offset where to start the search.
|
||||
\return The offset(zero based) into the data
|
||||
where the given character has been found.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn int32 BString::IFindFirst(const BString &string) const
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn int32 BString::IFindFirst(const char *string) const
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn int32 BString::IFindFirst(const BString &string, int32 fromOffset) const
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn int32 BString::IFindFirst(const char *string, int32 fromOffset) const
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn int32 BString::IFindLast(const BString &string) const
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn int32 BString::IFindLast(const char *string) const
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn int32 BString::IFindLast(const BString &string, int32 beforeOffset) const
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn int32 BString::IFindLast(const char *string, int32 beforeOffset) const
|
||||
*/
|
||||
|
||||
//! @}
|
||||
|
||||
|
||||
/*!
|
||||
\name Replacing Methods
|
||||
*/
|
||||
|
||||
//! @{
|
||||
|
||||
/*!
|
||||
\fn BString& BString::ReplaceFirst(char replaceThis, char withThis)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::ReplaceLast(char replaceThis, char withThis)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::ReplaceAll(char replaceThis, char withThis, int32 fromOffset)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::Replace(char replaceThis, char withThis, int32 maxReplaceCount, int32 fromOffset)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::ReplaceFirst(const char *replaceThis, const char *withThis)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::ReplaceLast(const char *replaceThis, const char *withThis)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::ReplaceAll(const char *replaceThis, const char *withThis, int32 fromOffset)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::Replace(const char *replaceThis, const char *withThis, int32 maxReplaceCount, int32 fromOffset)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::IReplaceFirst(char replaceThis, char withThis)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::IReplaceLast(char replaceThis, char withThis)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::IReplaceAll(char replaceThis, char withThis, int32 fromOffset)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::IReplace(char replaceThis, char withThis, int32 maxReplaceCount, int32 fromOffset)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::IReplaceFirst(const char *replaceThis, const char *withThis)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::IReplaceLast(const char *replaceThis, const char *withThis)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::IReplaceAll(const char *replaceThis, const char *withThis, int32 fromOffset)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::IReplace(const char *replaceThis, const char *withThis, int32 maxReplaceCount, int32 fromOffset)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::ReplaceSet(const char *setOfChars, char with)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::ReplaceSet(const char *setOfChars, const char *with)
|
||||
*/
|
||||
|
||||
// @}
|
||||
|
||||
|
||||
/*!
|
||||
\name Character Access
|
||||
*/
|
||||
|
||||
//! @{
|
||||
|
||||
/*!
|
||||
\fn char & BString::operator[](int32 index)
|
||||
\brief Returns a reference to the data at the given offset.
|
||||
|
||||
This function can be used to read a byte or to change its value.
|
||||
There is no bounds checking though, so make sure the \c index
|
||||
you supply is valid.
|
||||
\param index The index (zero based) of the byte to get.
|
||||
\return Returns a reference to the specified byte.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn char BString::operator[](int32 index) const
|
||||
\brief Returns the character in the string at the given offset.
|
||||
|
||||
This function can be used to read a byte. There is no bound checking
|
||||
though, use ByteAt() if you don't know if the \c index parameter is
|
||||
valid.
|
||||
\param index The index (zero based) of the byte to get.
|
||||
\return Returns a reference to the specified byte.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn char BString::ByteAt(int32 index) const
|
||||
\brief Returns the character in the string at the given offset.
|
||||
|
||||
This function can be used to read a byte.
|
||||
\param index The index (zero based) of the byte to get.
|
||||
\return Returns a reference to the specified byte.
|
||||
*/
|
||||
|
||||
//! @}
|
||||
|
||||
|
||||
/*!
|
||||
\name Low-Level Manipulation
|
||||
*/
|
||||
|
||||
//! @{
|
||||
|
||||
/*!
|
||||
\fn char* BString::LockBuffer(int32 maxLength)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::UnlockBuffer(int32 length)
|
||||
*/
|
||||
|
||||
//! @}
|
||||
|
||||
|
||||
/*!
|
||||
\name Case Manipulation
|
||||
*/
|
||||
|
||||
//! @{
|
||||
|
||||
/*!
|
||||
\fn BString& BString::ToLower()
|
||||
\brief Converts the BString to lowercase
|
||||
\return This function always returns *this .
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::ToUpper()
|
||||
\brief Converts the BString to uppercase
|
||||
\return This function always returns *this .
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::Capitalize()
|
||||
\brief Converts the first character to uppercase, rest to lowercase
|
||||
\return This function always returns *this .
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::CapitalizeEachWord()
|
||||
\brief Converts the first character of every word to uppercase, rest to lowercase.
|
||||
|
||||
Converts the first character of every "word" (series of alpabetical characters
|
||||
separated by non alphabetical characters) to uppercase, and the rest to lowercase.
|
||||
\return This function always returns *this .
|
||||
*/
|
||||
|
||||
//! @}
|
||||
|
||||
|
||||
/*!
|
||||
\name Escaping and Deescaping Methods
|
||||
*/
|
||||
|
||||
//! @{
|
||||
|
||||
/*!
|
||||
\fn BString& BString::CharacterEscape(const char *original, const char *setOfCharsToEscape, char escapeWith)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::CharacterEscape(const char *setOfCharsToEscape, char escapeWith)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::CharacterDeescape(const char *original, char escapeChar)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::CharacterDeescape(char escapeChar)
|
||||
*/
|
||||
|
||||
//! @}
|
||||
|
||||
|
||||
/*!
|
||||
\name Simple sprintf Replacement Methods
|
||||
|
||||
These methods may be slower than sprintf(), but they are overflow safe.
|
||||
*/
|
||||
|
||||
//! @{
|
||||
|
||||
/*!
|
||||
\fn BString& BString::operator<<(const char *str)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::operator<<(const BString &string)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::operator<<(char c)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::operator<<(int i)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::operator<<(unsigned int i)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::operator<<(uint32 i)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::operator<<(int32 i)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::operator<<(uint64 i)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::operator<<(int64 i)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BString& BString::operator<<(float f)
|
||||
*/
|
||||
|
||||
//! @}
|
||||
|
||||
/************************ end of class BString, start of general operators ************/
|
||||
/*!
|
||||
\fn bool operator<(const char *str, const BString &string)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn bool operator<=(const char *str, const BString &string)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn bool operator==(const char *str, const BString &string)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn bool operator>(const char *str, const BString &string)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn bool operator>=(const char *str, const BString &string)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn bool operator!=(const char *str, const BString &string)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn int Compare(const BString &, const BString &)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn int ICompare(const BString &, const BString &)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn int Compare(const BString *, const BString *)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn int ICompare(const BString *, const BString *)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user