Keep in mind that because these constants are members of the BParameter
class, if you need to reference them from outside a BParameter, you need
to preface the reference with "BParameter::", such as
BParameter
::B_NULL_PARAMETER
.
| Class Overview |
BParameter
objects may only be created
by using the appropriate functions in the
BParameterGroup
class.
status_t AddInput(BParameter* input);
status_t AddOutput(BParameter* output);
AddInput()
adds the
BParameter
specified by
input
to the set of
BParameter
s that transmit data into the
BParameter
. The specified input parameter's
AddOutput()
function is called to let it know
that it's sending data to this parameter.
AddOutput()
adds the
BParameter
specified by
output
to the set of
BParameter
s to which the
BParameter
outputs data. The specified
output
parameter's
AddInput()
function is called to let it know
that it's receiving data from this parameter.
Return Code | Description |
---|---|
| The item was successfully added to the list. |
| The item couldn't be added to the list. |
int32 CountChannels();
void SetChannelCount(int32 numChannels);
Some BParameter
s have more than one channel of the same type. For
example, a stereo volume parameter with independent left and right gain
would have two channels, while a single parameter value that affects both
the left and right by the same amount would have only one channel.
CountChannels()
returns the number of channels manipulated by the
BParameter
.
The default is one channel; if your node provides more channels, call
SetChannelCount()
after creating the
BParameter
. SetChannelCount()
specifies the number of channels the parameter manipulates.
int32 CountInputs();
int32 CountOutputs();
These two functions return the number of inputs or outputs currently
connected to the BParameter
. The number of inputs or outputs may be
different from the number of channels, since an input or output might be
comprised of multiple channels (a single stereo sound input or output
might consist of a left channel and a right channel, for example).
status_t GetValue(void* buffer,
size_t* ioSize,
bigtime_t* lastChange);
status_t SetValue(const void* buffer,
size_t size,
bigtime_t changeWhen);
GetValue()
returns the current
value of the BParameter
. On entry, buffer
points to ioSize
bytes of memory, indicating where the current value of
the BParameter
should be stored. On return, ioSize
indicates the actual
number of bytes returned in the buffer, and lastChange
indicates the time
at which the BParameter
's value last changed.
SetValue()
changes the value
of the BParameter
. The new value, which is
size
bytes long, is obtained from the
specified buffer
. The change occurs
at the performance time specified by changeWhen
.
In either case, if the parameter is a multichannel parameter, the buffer
should be large enough to contain the values for all the channels, and
ioSize
or size
should indicate the total size of the buffer.
These calls simply dispatch to the
BControllable::GetParameterValue()
and
BControllable::SetParameterValue()
functions.
Return Code | Description |
---|---|
| No errors. |
| The buffer is too small ( |
| The parameter doesn't have a value ( |
Port errors. | See Ports in the The Kernel Kit |
BParameterGroup* Group() const;
Returns the
BParameterGroup
that most directly contains the BParameter
.
int32 ID() const;
Returns the BParameter
's ID number. This ID is used by the node to route
value change requests to the right place. This value should be unique
within the
BParameterWeb
containing the BParameter
.
BParameter* InputAt(int32 index);
BParameter* OutputAt(int32 index);
InputAt()
returns the BParameter
that feeds data into the input number
specified by index
, which can range from zero to
CountInputs()
-1.
OutputAt()
returns the BParameter
that receives data from the output
number specified by index
, which can range from zero to
CountOutputs()
-1.
Both functions return NULL
if an invalid
index
is specified.
const char* Kind() const;
Returns the BParameter
's kind. The kind isn't necessarily user-readable,
but it can be used to figure out what kind of
BControl
to create to visually represent the configuration option provided by the
BParameter
.
See the
BParameterGroup::MakeNullParameter()
,
BParameterGroup::MakeDiscreteParameter()
, and
BParameterGroup::MakeContinuousParameter()
functions for more detailed information about the available kinds.
media_type MediaType();
void SetMediaType(media_type type);
MediaType()
returns the type of media data that flows through the
BParameter
.
SetMediaType()
changes the recorded type of media data. The default, if
it hasn't been changed, is B_MEDIA_NO_TYPE
.
The
media_type
of a BParameter
is used to inform interested parties as to
the format of the data; it's an informational setting, and doesn't alter
the data flowing through the BParameter
in any way.
const char* Name() const;
Returns the BParameter
's name, which is suitable for display to the user
(for example, it can be used as the label in a user interface object).
media_parameter_type Type() const;
Returns the kind of parameter the object represents.
Constant | Description |
---|---|
| The |
| The |
| The |
const char* Unit() const;
Returns the unit of measurement used by the BParameter
. This might be,
for example, "dB," "kHz," or "fps." It should be human-readable, as it
may be displayed in a user interface.
virtual type_code ValueType() = 0;
Returns a type code indicating the type of data type of the BParameter
's
value. This is usually B_INT32_TYPE
for selectors or
B_FLOAT_TYPE
for sliders.
Declared in: media/ParameterWeb.h
Constant | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| The parameter represents the main volume control. | ||||||||||||||||
| The parameter represents a gain control. | ||||||||||||||||
| The parameter represents a balance control. | ||||||||||||||||
| The parameter represents a frequency, like a radio tuner. | ||||||||||||||||
| The parameter represents a level, as in EQ and effects. | ||||||||||||||||
| The parameter represents playback speed. A value of 1.0 indicates normal speed; less than 1.0 is slower, greater than 1.0 is faster. | ||||||||||||||||
| The parameter indicates a crossfade for mixing audio or video; 0 indicates that the the first of a pair of streams should be presented, 100 indicates that the other should be presented, and values in between indicate the degree of mixing that should occur. | ||||||||||||||||
| The parameter indicates compression ratio; the value is 0 for no compression, 99 for 100:1 compression. | ||||||||||||||||
| The parameter indicates quality level; the value is 0 for maximum compression, 100 for no compression. | ||||||||||||||||
| The parameter indicates bit rate in bits per second. | ||||||||||||||||
| The parameter indicates a "group of pictures" such as how many frames apart a keyframe should be inserted into a video stream. | ||||||||||||||||
| The parameter represents a mute control; a value of 0 passes data through unchanged, while a value of 1 mutes the data. | ||||||||||||||||
| The parameter represents an enable toggle; a value of 0 disables the function while a value of 1 enables it. | ||||||||||||||||
| The parameter represents an input MUX. The value specifies which input should pass through. | ||||||||||||||||
| The parameter represents an output MUX; the value specifies which output should receive the incoming data. | ||||||||||||||||
| The parameter represents a channel tuner (like a TV channel); the value indicates the channel number. | ||||||||||||||||
| The parameter's value indicates a track number. | ||||||||||||||||
| The parameter indicates whether the node is silent (0), playing (1), or recording (2). | ||||||||||||||||
| The parameter indicates performance mode: -1 for backwards, 0 for stop, 1 for playing, and 2 for paused. | ||||||||||||||||
| The parameter indicates video or audio resolution. | ||||||||||||||||
| The parameter indicates video color space. | ||||||||||||||||
| The parameter represents a selector for picking frame rate. | ||||||||||||||||
| The parameter represents a selector for choosing a video format. The
| ||||||||||||||||
| The parameter represents a physical input (such as a microphone jack or line input jack). | ||||||||||||||||
| The parameter represents a physical output (such as a line output jack or headphone jack). | ||||||||||||||||
| The parameter represents a point at which bits of data are transferred between the computer and the A/V input hardware. | ||||||||||||||||
| The parameter represents a point at which bits of data are transferred between the computer and the A/V output hardware. | ||||||||||||||||
| The parameter represents an analog to digital converter. | ||||||||||||||||
| The parameter represents a digital to analog converter. | ||||||||||||||||
| The parameter represents a media_input. | ||||||||||||||||
| The parameter represents a media_output. | ||||||||||||||||
| A discrete parameter indicating one of five states: rewinding, stopped, playing, paused, and fast-forwarding. | ||||||||||||||||
| The parameter's kind isn't one of the above. |
Indicates the kind of parameter represented by a
BParameter
object.
Declared in: media/ParameterWeb.h
Constant | Description |
---|---|
| The |
| The |
| The |
These are the possible parameter types, which are returned by the
Type()
function. They indicate what subclass of BParameter
the object is.
Keep in mind that because these constants are members of the BParameter
class, if you need to reference them from outside a BParameter, you need
to preface the reference with "BParameter::", such as
BParameter
::B_NULL_PARAMETER
.