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.
| Derived From: | – |
| Mix-in Classes: | – |
| Declared In: | be/media/Parameter.h |
| Library: | libmedia.so |
| Allocation: | Constructor only |
| 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
BParameters 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
BParameters 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 CODES
B_OKThe item was successfully added to the list.
B_ERRORThe item couldn't be added to the list.
int32 CountChannels();void SetChannelCount(int32 numChannels);Some BParameters 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 CODES
B_OKNo errors.
B_NO_MEMORYThe buffer is too small (GetValue()).
B_BAD_VALUEThe parameter doesn't have a value (GetValue()).
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.
B_NULL_PARAMETER The BParameter is a
BNullParameter.
B_DISCRETE_PARAMETERThe BParameter is a
BDiscreteParameter.
B_CONTINUOUS_PARAMETERThe BParameter is a
BContinuousParameter.
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: be/media/ParameterWeb.h
B_MASTER_GAINThe parameter represents the main volume control.
B_GAINThe parameter represents a gain control.
B_BALANCEThe parameter represents a balance control.
B_FREQUENCYThe parameter represents a frequency, like a radio tuner.
B_LEVELThe parameter represents a level, as in EQ and effects.
B_SHUTTLE_SPEEDThe parameter represents playback speed. A value of 1.0 indicates normal speed; less than 1.0 is slower, greater than 1.0 is faster.
B_CROSSFADEThe 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.
B_COMPRESSIONThe parameter indicates compression ratio; the value is 0 for no compression, 99 for 100:1 compression.
B_QUALITYThe parameter indicates quality level; the value is 0 for maximum compression, 100 for no compression.
B_BITRATEThe parameter indicates bit rate in bits per second.
B_GOP_SIZEThe parameter indicates a "group of pictures" such as how many frames apart a keyframe should be inserted into a video stream.
B_MUTEThe parameter represents a mute control; a value of 0 passes data through unchanged, while a value of 1 mutes the data.
B_ENABLEThe parameter represents an enable toggle; a value of 0 disables the function while a value of 1 enables it.
B_INPUT_MUXThe parameter represents an input MUX. The value specifies which input should pass through.
B_OUTPUT_MUXThe parameter represents an output MUX; the value specifies which output should receive the incoming data.
B_TUNER_CHANNELThe parameter represents a channel tuner (like a TV channel); the value indicates the channel number.
B_TRACKThe parameter's value indicates a track number.
B_RECSTATEThe parameter indicates whether the node is silent (0), playing (1), or recording (2).
B_SHUTTLE_MODEThe parameter indicates performance mode: -1 for backwards, 0 for stop, 1 for playing, and 2 for paused.
B_RESOLUTIONThe parameter indicates video or audio resolution.
B_COLOR_SPACEThe parameter indicates video color space.
B_FRAME_RATEThe parameter represents a selector for picking frame rate.
B_VIDEO_FORMATThe parameter represents a selector for choosing a video format.
The B_VIDEO_FORMAT kind has specific video format values associated with it:
| 1 | NTSC-M |
| 2 | NTSC-J |
| 3 | PAL-BDGHI |
| 4 | PAL-M |
| 5 | PAL-N |
| 6 | SECAM |
| 7 | MPEG-1 |
| 8 | MPEG-2 |
B_WEB_PHYSICAL_INPUTThe parameter represents a physical input (such as a microphone jack or line input jack).
B_WEB_PHYSICAL_OUTPUTThe parameter represents a physical output (such as a line output jack or headphone jack).
B_WEB_LOGICAL_INPUTThe parameter represents a point at which bits of data are transferred between the computer and the A/V input hardware.
B_WEB_LOGICAL_OUTPUTThe parameter represents a point at which bits of data are transferred between the computer and the A/V output hardware.
B_WEB_ADC_CONVERTERThe parameter represents an analog to digital converter.
B_WEB_DAC_CONVERTERThe parameter represents a digital to analog converter.
B_WEB_BUFFER_INPUTThe parameter represents a media_input.
B_WEB_BUFFER_OUTPUTThe parameter represents a media_output.
B_SIMPLE_TRANSPORTA discrete parameter indicating one of five states: rewinding, stopped, playing, paused, and fast-forwarding.
B_GENERICThe parameter's kind isn't one of the above.
Indicates the kind of parameter represented by a
BParameter object.
Declared in: be/media/ParameterWeb.h
B_NULL_PARAMETER The BParameter is a
BNullParameter.
B_DISCRETE_PARAMETERThe BParameter is a
BDiscreteParameter.
B_CONTINUOUS_PARAMETERThe BParameter is a
BContinuousParameter.
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.