Eiffel Media API
Overview Cluster Class Classes Index      Previous Next      Top Features

em.audio

Class EM_AUDIO_GROUP


Direct ancestors

EM_SHARED_ERROR_HANDLER, SDL_MIXER_FUNCTIONS_EXTERNAL

Creation

Features

Invariants

indexing

description

Implements channel grouping.

Use this class to group channels.

Note: You should not use this class as grouping is
available through {EM_CHANNELS}. {EM_CHANNELS}
will do all the dirty work for you.

date

$Date: 2005/10/24 07:03:36 $

revision

$Revision: 1.1 $

class

EM_AUDIO_GROUP

create

make (a_number: like number)

-- Create group with a_number.

ensure
number_set: number = a_number

feature -- Initialization

make (a_number: like number)

-- Create group with a_number.

ensure
number_set: number = a_number

feature -- Access

channels: DS_LINKED_LIST [INTEGER]

-- Hold channel numbers

count: INTEGER

-- Number of channels in group

ensure
count_positiv: Result >= 0
first_available_channel_number: INTEGER

-- Returns first available (not playing) channel number in group
-- or -1 when there is no channel available.

has_available_channel: BOOLEAN

-- Is there an available channel?

newest_busy_channel_number: INTEGER

-- Returns newest playing channel number in group
-- or -1 when there is no channel playing.

number: INTEGER

-- Group identifier

oldest_busy_channel_number: INTEGER

-- Returns oldest playing channel number in group
-- or -1 when there is no channel playing.

feature -- Operations

add_channel (a_channel: EM_CHANNEL)

-- Add a_channel to group as last element.

require
channel_not_void: a_channel /= Void
add_channels (from_channel_number: INTEGER; to_channel_number: INTEGER)

-- Add channels from_channel_number up to and including to_channel_number.

require
from_channel_greater_or_equal_to_channel: from_channel_number >= to_channel_number
from_channel_number_positiv: from_channel_number > 0
remove_channel (a_channel: EM_CHANNEL)

-- Remove a_channel from group.

require
a_channel_not_void: a_channel /= Void
remove_channels (from_channel_number: INTEGER; to_channel_number: INTEGER)

-- Remove channels from_channel_number up to and including to_channel_number.

require
from_channel_greater_or_equal_to_channel: from_channel_number >= to_channel_number
from_channel_number_positiv: from_channel_number > 0
wipe_out

-- Remove all channels from group.

feature -- stopping

fade_out (a_duration: INTEGER)

-- Fade out a group in a_duration milliseconds.
--
-- Attention: This function is non-blocking.
-- Please check if the channels are fading before
-- you quit your application.

require
duration_valid: a_duration >= 0
stop

-- Stop playing whole group.

invariant

channels_created: channels /= Void
count_valid: count = channels.count

-- From ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end